Merge branch 'base' into i18n
This commit is contained in:
commit
9f972136cc
4
.gitignore
vendored
4
.gitignore
vendored
@ -32,8 +32,8 @@ components.d.ts
|
|||||||
uni-pages.d.ts
|
uni-pages.d.ts
|
||||||
|
|
||||||
# 插件生成的文件
|
# 插件生成的文件
|
||||||
src/pages.json
|
# src/pages.json
|
||||||
src/manifest.json
|
# src/manifest.json
|
||||||
|
|
||||||
# lock 文件还是不要了,我主要的版本写死就好了
|
# lock 文件还是不要了,我主要的版本写死就好了
|
||||||
# github actions 需要这些文件,所以留着
|
# github actions 需要这些文件,所以留着
|
||||||
|
30
README.md
30
README.md
@ -33,6 +33,36 @@
|
|||||||
<a href="https://codercup.github.io/unibest-docs/" target="_blank">📖 阅读文档</a>
|
<a href="https://codercup.github.io/unibest-docs/" target="_blank">📖 阅读文档</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://cn.vuejs.org/" target="_blank">
|
||||||
|
<img src="https://img.shields.io/badge/-Vue3-34495e?logo=vue.js" />
|
||||||
|
</a>
|
||||||
|
<a href="https://cn.vitejs.dev/" target="_blank">
|
||||||
|
<img src="https://img.shields.io/badge/-Vite4-646cff?logo=vite&logoColor=white" />
|
||||||
|
</a>
|
||||||
|
<a href="https://www.typescriptlang.org/zh/" target="_blank">
|
||||||
|
<img src="https://img.shields.io/badge/-TypeScript5-blue?logo=typescript&logoColor=white" />
|
||||||
|
</a>
|
||||||
|
<a href="https://eslint.org/" target="_blank">
|
||||||
|
<img src="https://img.shields.io/badge/-ESLint8-4b32c3?logo=eslint&logoColor=white" />
|
||||||
|
</a>
|
||||||
|
<a href="https://stylelint.io/" target="_blank">
|
||||||
|
<img src="https://img.shields.io/badge/-StyleLint16-4b32c3?logo=stylelint&logoColor=white" />
|
||||||
|
</a>
|
||||||
|
<a href="https://pnpm.io/" target="_blank">
|
||||||
|
<img src="https://img.shields.io/badge/-pnpm8-F69220?logo=pnpm&logoColor=white" />
|
||||||
|
</a>
|
||||||
|
<a href="https://unocss.dev/" target="_blank">
|
||||||
|
<img src="https://img.shields.io/badge/-UnoCSS-4d4d4d?logo=unocss" />
|
||||||
|
</a>
|
||||||
|
<a href="https://icones.js.org/" target="_blank">
|
||||||
|
<img src="https://img.shields.io/badge/-icones-1769aa?logo=Iconify" />
|
||||||
|
</a>
|
||||||
|
<a href="https://ext.dcloud.net.cn/plugin?id=8559" target="_blank">
|
||||||
|
<img src="https://svg.hamm.cn/badge.svg?key=Platform&value=uni-app"/>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
## ⚙️ 环境
|
## ⚙️ 环境
|
||||||
|
|
||||||
- node>=18
|
- node>=18
|
||||||
|
2
env/.env.development
vendored
2
env/.env.development
vendored
@ -3,4 +3,4 @@ NODE_ENV = 'development'
|
|||||||
# 是否去除console 和 debugger
|
# 是否去除console 和 debugger
|
||||||
VITE_DELETE_CONSOLE = false
|
VITE_DELETE_CONSOLE = false
|
||||||
|
|
||||||
VITE_SERVER_BASEURL = 'https://ukw0y1.laf.run'
|
# VITE_SERVER_BASEURL = 'https://ukw0y1.laf.run'
|
||||||
|
2
env/.env.production
vendored
2
env/.env.production
vendored
@ -3,4 +3,4 @@ NODE_ENV = 'development'
|
|||||||
# 是否去除console 和 debugger
|
# 是否去除console 和 debugger
|
||||||
VITE_DELETE_CONSOLE = true
|
VITE_DELETE_CONSOLE = true
|
||||||
|
|
||||||
VITE_SERVER_BASEURL = 'https://xxx.com'
|
# VITE_SERVER_BASEURL = 'https://xxx.com'
|
||||||
|
2
env/.env.test
vendored
2
env/.env.test
vendored
@ -3,4 +3,4 @@ NODE_ENV = 'development'
|
|||||||
# 是否去除console 和 debugger
|
# 是否去除console 和 debugger
|
||||||
VITE_DELETE_CONSOLE = false
|
VITE_DELETE_CONSOLE = false
|
||||||
|
|
||||||
VITE_SERVER_BASEURL = 'https://xxx.com'
|
# VITE_SERVER_BASEURL = 'https://xxx.com'
|
||||||
|
14
global.d.ts
vendored
Normal file
14
global.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
declare const __UNI_PLATFORM__:
|
||||||
|
| 'h5'
|
||||||
|
| 'app'
|
||||||
|
| 'mp-alipay'
|
||||||
|
| 'mp-baidu'
|
||||||
|
| 'mp-jd'
|
||||||
|
| 'mp-kuaishou'
|
||||||
|
| 'mp-lark'
|
||||||
|
| 'mp-qq'
|
||||||
|
| 'mp-toutiao'
|
||||||
|
| 'mp-weixin'
|
||||||
|
| 'quickapp-webview'
|
||||||
|
| 'quickapp-webview-huawei'
|
||||||
|
| 'quickapp-webview-union'
|
46
package.json
46
package.json
@ -78,36 +78,35 @@
|
|||||||
"bin-wrapper": "npm:bin-wrapper-china"
|
"bin-wrapper": "npm:bin-wrapper-china"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dcloudio/uni-app": "3.0.0-4000620240325001",
|
"@dcloudio/uni-app": "3.0.0-4000720240327002",
|
||||||
"@dcloudio/uni-app-plus": "3.0.0-4000620240325001",
|
"@dcloudio/uni-app-plus": "3.0.0-4000720240327002",
|
||||||
"@dcloudio/uni-components": "3.0.0-4000620240325001",
|
"@dcloudio/uni-components": "3.0.0-4000720240327002",
|
||||||
"@dcloudio/uni-h5": "3.0.0-4000620240325001",
|
"@dcloudio/uni-h5": "3.0.0-4000720240327002",
|
||||||
"@dcloudio/uni-mp-alipay": "3.0.0-4000620240325001",
|
"@dcloudio/uni-mp-alipay": "3.0.0-4000720240327002",
|
||||||
"@dcloudio/uni-mp-baidu": "3.0.0-4000620240325001",
|
"@dcloudio/uni-mp-baidu": "3.0.0-4000720240327002",
|
||||||
"@dcloudio/uni-mp-jd": "3.0.0-4000620240325001",
|
"@dcloudio/uni-mp-jd": "3.0.0-4000720240327002",
|
||||||
"@dcloudio/uni-mp-kuaishou": "3.0.0-4000620240325001",
|
"@dcloudio/uni-mp-kuaishou": "3.0.0-4000720240327002",
|
||||||
"@dcloudio/uni-mp-lark": "3.0.0-4000620240325001",
|
"@dcloudio/uni-mp-lark": "3.0.0-4000720240327002",
|
||||||
"@dcloudio/uni-mp-qq": "3.0.0-4000620240325001",
|
"@dcloudio/uni-mp-qq": "3.0.0-4000720240327002",
|
||||||
"@dcloudio/uni-mp-toutiao": "3.0.0-4000620240325001",
|
"@dcloudio/uni-mp-toutiao": "3.0.0-4000720240327002",
|
||||||
"@dcloudio/uni-mp-weixin": "3.0.0-4000620240325001",
|
"@dcloudio/uni-mp-weixin": "3.0.0-4000720240327002",
|
||||||
"@dcloudio/uni-mp-xhs": "3.0.0-4000620240325001",
|
"@dcloudio/uni-mp-xhs": "3.0.0-4000720240327002",
|
||||||
"@dcloudio/uni-quickapp-webview": "3.0.0-4000620240325001",
|
"@dcloudio/uni-quickapp-webview": "3.0.0-4000720240327002",
|
||||||
"dayjs": "1.11.10",
|
"dayjs": "1.11.10",
|
||||||
"pinia": "2.0.36",
|
"pinia": "2.0.36",
|
||||||
"pinia-plugin-persistedstate": "3.2.1",
|
"pinia-plugin-persistedstate": "3.2.1",
|
||||||
"qs": "^6.11.2",
|
"qs": "^6.11.2",
|
||||||
"vue": "3.4.19",
|
"vue": "^3.4.19",
|
||||||
"vue-i18n": "9.9.0",
|
|
||||||
"wot-design-uni": "^1.2.5"
|
"wot-design-uni": "^1.2.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^18.4.3",
|
"@commitlint/cli": "^18.4.3",
|
||||||
"@commitlint/config-conventional": "^18.4.3",
|
"@commitlint/config-conventional": "^18.4.3",
|
||||||
"@dcloudio/types": "^3.4.3",
|
"@dcloudio/types": "^3.4.8",
|
||||||
"@dcloudio/uni-automator": "3.0.0-4000620240325001",
|
"@dcloudio/uni-automator": "3.0.0-4000720240327002",
|
||||||
"@dcloudio/uni-cli-shared": "3.0.0-4000620240325001",
|
"@dcloudio/uni-cli-shared": "3.0.0-4000720240327002",
|
||||||
"@dcloudio/uni-stacktracey": "3.0.0-4000620240325001",
|
"@dcloudio/uni-stacktracey": "3.0.0-4000720240327002",
|
||||||
"@dcloudio/vite-plugin-uni": "3.0.0-4000620240325001",
|
"@dcloudio/vite-plugin-uni": "3.0.0-4000720240327002",
|
||||||
"@iconify-json/carbon": "^1.1.27",
|
"@iconify-json/carbon": "^1.1.27",
|
||||||
"@types/node": "^20.11.5",
|
"@types/node": "^20.11.5",
|
||||||
"@types/wechat-miniprogram": "^3.4.7",
|
"@types/wechat-miniprogram": "^3.4.7",
|
||||||
@ -144,7 +143,7 @@
|
|||||||
"stylelint-config-standard": "^35.0.0",
|
"stylelint-config-standard": "^35.0.0",
|
||||||
"stylelint-config-standard-scss": "^12.0.0",
|
"stylelint-config-standard-scss": "^12.0.0",
|
||||||
"terser": "^5.26.0",
|
"terser": "^5.26.0",
|
||||||
"typescript": "^4.9.4",
|
"typescript": "^4.9.5",
|
||||||
"unocss": "^0.58.0",
|
"unocss": "^0.58.0",
|
||||||
"unocss-applet": "^0.7.8",
|
"unocss-applet": "^0.7.8",
|
||||||
"unplugin-auto-import": "^0.17.2",
|
"unplugin-auto-import": "^0.17.2",
|
||||||
@ -155,6 +154,7 @@
|
|||||||
"vite-plugin-vue-setup-extend": "^0.4.0",
|
"vite-plugin-vue-setup-extend": "^0.4.0",
|
||||||
"vite-svg-loader": "^5.1.0",
|
"vite-svg-loader": "^5.1.0",
|
||||||
"vue-global-api": "^0.4.1",
|
"vue-global-api": "^0.4.1",
|
||||||
"vue-tsc": "^1.0.24"
|
"vue-i18n": "^9.10.2",
|
||||||
|
"vue-tsc": "^1.8.25"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,8 +33,8 @@ export default defineUniPages({
|
|||||||
{
|
{
|
||||||
iconPath: 'static/tabbar/example.png',
|
iconPath: 'static/tabbar/example.png',
|
||||||
selectedIconPath: 'static/tabbar/exampleHL.png',
|
selectedIconPath: 'static/tabbar/exampleHL.png',
|
||||||
pagePath: 'pages/index/i18n',
|
pagePath: 'pages/index/about',
|
||||||
text: '多语言',
|
text: '关于',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
1737
pnpm-lock.yaml
generated
1737
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -5,18 +5,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page {
|
|
||||||
height: 100%;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
height: 100%;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.default-layout {
|
.default-layout {
|
||||||
height: 100%;
|
height: 100vh;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
77
src/manifest.json
Normal file
77
src/manifest.json
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
{
|
||||||
|
"name": "unibest",
|
||||||
|
"appid": "H5871D791",
|
||||||
|
"description": "",
|
||||||
|
"versionName": "1.0.0",
|
||||||
|
"versionCode": "100",
|
||||||
|
"transformPx": false,
|
||||||
|
"app-plus": {
|
||||||
|
"usingComponents": true,
|
||||||
|
"nvueStyleCompiler": "uni-app",
|
||||||
|
"compilerVersion": 3,
|
||||||
|
"splashscreen": {
|
||||||
|
"alwaysShowBeforeRender": true,
|
||||||
|
"waiting": true,
|
||||||
|
"autoclose": true,
|
||||||
|
"delay": 0
|
||||||
|
},
|
||||||
|
"modules": {},
|
||||||
|
"distribute": {
|
||||||
|
"android": {
|
||||||
|
"permissions": [
|
||||||
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||||
|
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||||
|
],
|
||||||
|
"minSdkVersion": 30,
|
||||||
|
"targetSdkVersion": 30,
|
||||||
|
"abiFilters": ["armeabi-v7a", "arm64-v8a"]
|
||||||
|
},
|
||||||
|
"ios": {},
|
||||||
|
"sdkConfigs": {},
|
||||||
|
"icons": {
|
||||||
|
"android": {},
|
||||||
|
"ios": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"quickapp": {},
|
||||||
|
"mp-weixin": {
|
||||||
|
"appid": "wxa2abb91f64032a2b",
|
||||||
|
"setting": {
|
||||||
|
"urlCheck": false
|
||||||
|
},
|
||||||
|
"usingComponents": true
|
||||||
|
},
|
||||||
|
"mp-alipay": {
|
||||||
|
"usingComponents": true
|
||||||
|
},
|
||||||
|
"mp-baidu": {
|
||||||
|
"usingComponents": true
|
||||||
|
},
|
||||||
|
"mp-toutiao": {
|
||||||
|
"usingComponents": true
|
||||||
|
},
|
||||||
|
"uniStatistics": {
|
||||||
|
"enable": false
|
||||||
|
},
|
||||||
|
"vueVersion": "3",
|
||||||
|
"locale": "zh-Hans",
|
||||||
|
"h5": {
|
||||||
|
"router": {
|
||||||
|
"base": "/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="text-center">
|
<view class="text-center">
|
||||||
<view class="m-8"> http://localhost:9000/#/pages-sub/demo/index </view>
|
<view class="m-8">http://localhost:9000/#/pages-sub/demo/index</view>
|
||||||
<view class="text-green-500"> 分包页面demo </view>
|
<view class="text-green-500">分包页面demo</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
70
src/pages.json
Normal file
70
src/pages.json
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
{
|
||||||
|
"globalStyle": {
|
||||||
|
"navigationStyle": "default",
|
||||||
|
"navigationBarTitleText": "unibest",
|
||||||
|
"navigationBarBackgroundColor": "#f8f8f8",
|
||||||
|
"navigationBarTextStyle": "black",
|
||||||
|
"backgroundColor": "#FFFFFF"
|
||||||
|
},
|
||||||
|
"easycom": {
|
||||||
|
"autoscan": true,
|
||||||
|
"custom": {
|
||||||
|
"^wd-(.*)": "wot-design-uni/components/wd-$1/wd-$1.vue"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tabBar": {
|
||||||
|
"color": "#999999",
|
||||||
|
"selectedColor": "#018d71",
|
||||||
|
"backgroundColor": "#F8F8F8",
|
||||||
|
"borderStyle": "black",
|
||||||
|
"height": "50px",
|
||||||
|
"fontSize": "10px",
|
||||||
|
"iconWidth": "24px",
|
||||||
|
"spacing": "3px",
|
||||||
|
"list": [
|
||||||
|
{
|
||||||
|
"iconPath": "static/tabbar/home.png",
|
||||||
|
"selectedIconPath": "static/tabbar/homeHL.png",
|
||||||
|
"pagePath": "pages/index/index",
|
||||||
|
"text": "首页"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"iconPath": "static/tabbar/example.png",
|
||||||
|
"selectedIconPath": "static/tabbar/exampleHL.png",
|
||||||
|
"pagePath": "pages/index/about",
|
||||||
|
"text": "关于"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"path": "pages/index/index",
|
||||||
|
"type": "home",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"navigationBarTitleText": "首页"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/index/about",
|
||||||
|
"type": "page",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "关于"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"subPackages": [
|
||||||
|
{
|
||||||
|
"root": "pages-sub",
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"path": "demo/index",
|
||||||
|
"type": "page",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "分包页面 标题"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
45
src/pages/index/about.vue
Normal file
45
src/pages/index/about.vue
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<route lang="json5">
|
||||||
|
{
|
||||||
|
style: {
|
||||||
|
navigationBarTitleText: '关于',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</route>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<view
|
||||||
|
class="bg-white overflow-hidden pt-2 px-4"
|
||||||
|
:style="{ marginTop: safeAreaInsets?.top + 'px' }"
|
||||||
|
>
|
||||||
|
<view class="text-center text-3xl mt-4">关于页面</view>
|
||||||
|
<view class="text-center text-3xl mt-8">
|
||||||
|
鸽友们好,我是
|
||||||
|
<text class="text-red-500">菲鸽</text>
|
||||||
|
</view>
|
||||||
|
<view class="text-center mt-8">
|
||||||
|
<wd-button type="primary">wot 组件库测试</wd-button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="text-center py-4">
|
||||||
|
当前平台是:
|
||||||
|
<text class="text-red-500">{{ PLATFORM.platform }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="text-center desc mt-10">设计稿样式编写:</view>
|
||||||
|
<view class="text-center desc">设计稿是750px,css里面全部写rpx 即可</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import PLATFORM from '@/utils/platform'
|
||||||
|
|
||||||
|
// 获取屏幕边界到安全区域距离
|
||||||
|
const { safeAreaInsets } = uni.getSystemInfoSync()
|
||||||
|
|
||||||
|
console.log(PLATFORM)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.desc {
|
||||||
|
height: 80rpx;
|
||||||
|
}
|
||||||
|
</style>
|
@ -17,7 +17,7 @@
|
|||||||
<view class="m-4">{{ $t('app.name') }}</view>
|
<view class="m-4">{{ $t('app.name') }}</view>
|
||||||
<view class="m-4">{{ $t('weight', { heavy: 100 }) }}</view>
|
<view class="m-4">{{ $t('weight', { heavy: 100 }) }}</view>
|
||||||
|
|
||||||
<view class="text-green-500 mt-12">切换语言 </view>
|
<view class="text-green-500 mt-12">切换语言</view>
|
||||||
<view class="uni-list">
|
<view class="uni-list">
|
||||||
<radio-group @change="radioChange" class="radio-group">
|
<radio-group @change="radioChange" class="radio-group">
|
||||||
<label class="uni-list-cell uni-list-cell-pd" v-for="item in languages" :key="item.value">
|
<label class="uni-list-cell uni-list-cell-pd" v-for="item in languages" :key="item.value">
|
||||||
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import i18n from '@/locale/index'
|
import i18n from '@/locale/index'
|
||||||
import { testI18n } from '@/utils/index'
|
import { testI18n } from '@/utils/i18n'
|
||||||
|
|
||||||
const current = ref(uni.getLocale())
|
const current = ref(uni.getLocale())
|
||||||
const languages = [
|
const languages = [
|
||||||
|
@ -17,14 +17,17 @@
|
|||||||
</defs>
|
</defs>
|
||||||
<g id="_图层_1-2" data-name="图层 1">
|
<g id="_图层_1-2" data-name="图层 1">
|
||||||
<g>
|
<g>
|
||||||
<rect class="cls-1" width="113.39" height="113.39"/>
|
<rect class="cls-1" width="113.39" height="113.39" />
|
||||||
<g>
|
<g>
|
||||||
<path class="cls-3" d="M86.31,11.34H25.08c-8.14,0-14.74,6.6-14.74,14.74v61.23c0,8.14,6.6,14.74,14.74,14.74h61.23c.12,0,.24-.02,.37-.02-9.76-.2-17.64-8.18-17.64-17.99,0-.56,.03-1.12,.08-1.67H34.1c-1.57,0-2.83-1.27-2.83-2.83V32.43c0-.78,.63-1.42,1.42-1.42h9.17c.78,0,1.42,.63,1.42,1.42v36.52c0,.78,.63,1.42,1.42,1.42h22.02c.78,0,1.42-.63,1.42-1.42V32.43c0-.78,.63-1.42,1.42-1.42h9.17c.78,0,1.42,.63,1.42,1.42v34.99c2.13-.89,4.47-1.39,6.92-1.39,5.66,0,10.7,2.63,14.01,6.72V26.08c0-8.14-6.6-14.74-14.74-14.74Z"/>
|
<path class="cls-3"
|
||||||
|
d="M86.31,11.34H25.08c-8.14,0-14.74,6.6-14.74,14.74v61.23c0,8.14,6.6,14.74,14.74,14.74h61.23c.12,0,.24-.02,.37-.02-9.76-.2-17.64-8.18-17.64-17.99,0-.56,.03-1.12,.08-1.67H34.1c-1.57,0-2.83-1.27-2.83-2.83V32.43c0-.78,.63-1.42,1.42-1.42h9.17c.78,0,1.42,.63,1.42,1.42v36.52c0,.78,.63,1.42,1.42,1.42h22.02c.78,0,1.42-.63,1.42-1.42V32.43c0-.78,.63-1.42,1.42-1.42h9.17c.78,0,1.42,.63,1.42,1.42v34.99c2.13-.89,4.47-1.39,6.92-1.39,5.66,0,10.7,2.63,14.01,6.72V26.08c0-8.14-6.6-14.74-14.74-14.74Z" />
|
||||||
<g>
|
<g>
|
||||||
<path class="cls-2" d="M87.04,68.03c-8.83,0-16.01,7.18-16.01,16.01s7.18,16.01,16.01,16.01,16.01-7.18,16.01-16.01-7.18-16.01-16.01-16.01Zm-.27,24.84h-7.2v-3h1.18v-10.48h4.58v2.81h1.42c.84,0,1.46-.16,1.88-.48s.62-.87,.62-1.64c0-.69-.25-1.17-.74-1.45s-1.19-.42-2.09-.42h-6.84v-3h7.2c2.38,0,4.15,.38,5.31,1.15,1.16,.77,1.74,1.93,1.74,3.48,0,1.71-.83,2.93-2.5,3.64,1.07,.4,1.87,.95,2.39,1.65s.79,1.56,.79,2.58c0,3.44-2.58,5.16-7.73,5.16Z"/>
|
<path class="cls-2"
|
||||||
<path class="cls-2" d="M86.49,85.17h-1.16v4.7h1.8c.81,0,1.46-.18,1.94-.55s.72-.95,.72-1.73c0-.86-.25-1.48-.74-1.85s-1.35-.56-2.56-.56Z"/>
|
d="M87.04,68.03c-8.83,0-16.01,7.18-16.01,16.01s7.18,16.01,16.01,16.01,16.01-7.18,16.01-16.01-7.18-16.01-16.01-16.01Zm-.27,24.84h-7.2v-3h1.18v-10.48h4.58v2.81h1.42c.84,0,1.46-.16,1.88-.48s.62-.87,.62-1.64c0-.69-.25-1.17-.74-1.45s-1.19-.42-2.09-.42h-6.84v-3h7.2c2.38,0,4.15,.38,5.31,1.15,1.16,.77,1.74,1.93,1.74,3.48,0,1.71-.83,2.93-2.5,3.64,1.07,.4,1.87,.95,2.39,1.65s.79,1.56,.79,2.58c0,3.44-2.58,5.16-7.73,5.16Z" />
|
||||||
|
<path class="cls-2"
|
||||||
|
d="M86.49,85.17h-1.16v4.7h1.8c.81,0,1.46-.18,1.94-.55s.72-.95,.72-1.73c0-.86-.25-1.48-.74-1.85s-1.35-.56-2.56-.56Z" />
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
@ -5,13 +5,3 @@
|
|||||||
padding-top: 4px;
|
padding-top: 4px;
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 全局字体引用 DEMO
|
|
||||||
// @font-face {
|
|
||||||
// font-family: TiTi;
|
|
||||||
// src: url('./fonts/PangMenZhengDaoBiaoTiTi-1.ttf');
|
|
||||||
// }
|
|
||||||
|
|
||||||
// .titi {
|
|
||||||
// font-family: TiTi, Arial, sans-serif;
|
|
||||||
// }
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 120 KiB |
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
// 全局要用的类型放到这里
|
// 全局要用的类型放到这里
|
||||||
|
|
11
src/utils/i18n.ts
Normal file
11
src/utils/i18n.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { translate as t } from '@/locale/index'
|
||||||
|
|
||||||
|
/** 非vue 文件使用 i18n */
|
||||||
|
export const testI18n = () => {
|
||||||
|
console.log(t('app.name'))
|
||||||
|
// 下面同样生效
|
||||||
|
uni.showModal({
|
||||||
|
title: 'i18n 测试',
|
||||||
|
content: t('app.name'),
|
||||||
|
})
|
||||||
|
}
|
@ -1,4 +1,3 @@
|
|||||||
import { translate as t } from '@/locale/index'
|
|
||||||
import pagesJson from '@/pages.json'
|
import pagesJson from '@/pages.json'
|
||||||
|
|
||||||
console.log(pagesJson)
|
console.log(pagesJson)
|
||||||
@ -15,17 +14,6 @@ export const getIsTabbar = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test i18n in not .vue file
|
|
||||||
*/
|
|
||||||
export const testI18n = () => {
|
|
||||||
console.log(t('app.name'))
|
|
||||||
// 下面同样生效
|
|
||||||
uni.showModal({
|
|
||||||
title: 'i18n 测试',
|
|
||||||
content: t('app.name'),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* 获取当前页面路由的 path 路劲和 redirectPath 路径
|
* 获取当前页面路由的 path 路劲和 redirectPath 路径
|
||||||
* path 如 ‘/pages/login/index’
|
* path 如 ‘/pages/login/index’
|
||||||
* redirectPath 如 ‘/pages/demo/base/route-interceptor’
|
* redirectPath 如 ‘/pages/demo/base/route-interceptor’
|
||||||
|
17
src/utils/platform.ts
Normal file
17
src/utils/platform.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* @Author: 菲鸽
|
||||||
|
* @Date: 2024-03-28 19:13:55
|
||||||
|
* @Last Modified by: 菲鸽
|
||||||
|
* @Last Modified time: 2024-03-28 19:24:55
|
||||||
|
*/
|
||||||
|
export const platform = __UNI_PLATFORM__
|
||||||
|
export const isH5 = __UNI_PLATFORM__ === 'h5'
|
||||||
|
export const isApp = __UNI_PLATFORM__ === 'app'
|
||||||
|
export const isMp = __UNI_PLATFORM__.startsWith('mp-')
|
||||||
|
const PLATFORM = {
|
||||||
|
platform,
|
||||||
|
isH5,
|
||||||
|
isApp,
|
||||||
|
isMp,
|
||||||
|
}
|
||||||
|
export default PLATFORM
|
@ -13,10 +13,12 @@
|
|||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"lib": ["esnext", "dom"],
|
"lib": ["esnext", "dom"],
|
||||||
"types": [
|
"types": [
|
||||||
|
"./vite-env.d.ts",
|
||||||
"@dcloudio/types",
|
"@dcloudio/types",
|
||||||
"@types/wechat-miniprogram",
|
"@types/wechat-miniprogram",
|
||||||
"@uni-helper/uni-app-types",
|
"@uni-helper/uni-app-types",
|
||||||
"wot-design-uni/global.d.ts"
|
"wot-design-uni/global.d.ts",
|
||||||
|
"./global.d.ts"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"vueCompilerOptions": {
|
"vueCompilerOptions": {
|
||||||
|
15
vite-env.d.ts
vendored
Normal file
15
vite-env.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
// 全局自定义参数
|
||||||
|
declare const __UNI_PLATFORM__:
|
||||||
|
| 'h5'
|
||||||
|
| 'app'
|
||||||
|
| 'mp-alipay'
|
||||||
|
| 'mp-baidu'
|
||||||
|
| 'mp-jd'
|
||||||
|
| 'mp-kuaishou'
|
||||||
|
| 'mp-lark'
|
||||||
|
| 'mp-qq'
|
||||||
|
| 'mp-toutiao'
|
||||||
|
| 'mp-weixin'
|
||||||
|
| 'quickapp-webview'
|
||||||
|
| 'quickapp-webview-huawei'
|
||||||
|
| 'quickapp-webview-union'
|
@ -35,7 +35,7 @@ export default ({ command, mode }) => {
|
|||||||
// console.log(mode === process.env.NODE_ENV) // true
|
// console.log(mode === process.env.NODE_ENV) // true
|
||||||
|
|
||||||
// mode: 区分生产环境还是开发环境
|
// mode: 区分生产环境还是开发环境
|
||||||
console.log(command, mode)
|
console.log('command, mode -> ', command, mode)
|
||||||
// pnpm dev:h5 时得到 => serve development
|
// pnpm dev:h5 时得到 => serve development
|
||||||
// pnpm build:h5 时得到 => build production
|
// pnpm build:h5 时得到 => build production
|
||||||
// pnpm dev:mp-weixin 时得到 => build development (注意区别,command为build)
|
// pnpm dev:mp-weixin 时得到 => build development (注意区别,command为build)
|
||||||
@ -44,11 +44,13 @@ export default ({ command, mode }) => {
|
|||||||
// process.cwd(): 获取当前文件的目录跟地址
|
// process.cwd(): 获取当前文件的目录跟地址
|
||||||
// loadEnv(): 返回当前环境env文件中额外定义的变量
|
// loadEnv(): 返回当前环境env文件中额外定义的变量
|
||||||
const env = loadEnv(mode, path.resolve(process.cwd(), 'env'))
|
const env = loadEnv(mode, path.resolve(process.cwd(), 'env'))
|
||||||
console.log(env)
|
console.log('env -> ', env)
|
||||||
console.log(process.env.UNI_PLATFORM) // 得到 mp-weixin, h5 等
|
console.log('process.env.UNI_PLATFORM: ', process.env.UNI_PLATFORM) // 得到 mp-weixin, h5, app 等
|
||||||
|
console.log('isH5: ', process.env.UNI_PLATFORM === 'h5') // 得到 mp-weixin, h5, app 等
|
||||||
|
|
||||||
return defineConfig({
|
return defineConfig({
|
||||||
envDir: './env', // 自定义env目录
|
envDir: './env', // 自定义env目录
|
||||||
|
|
||||||
plugins: [
|
plugins: [
|
||||||
UniPages({
|
UniPages({
|
||||||
exclude: ['**/components/**/**.*'],
|
exclude: ['**/components/**/**.*'],
|
||||||
@ -106,7 +108,9 @@ export default ({ command, mode }) => {
|
|||||||
// TODO: 缓存每次压缩过的图片,已经压缩过的不再压缩
|
// TODO: 缓存每次压缩过的图片,已经压缩过的不再压缩
|
||||||
imagemin(mode === 'production'),
|
imagemin(mode === 'production'),
|
||||||
],
|
],
|
||||||
|
define: {
|
||||||
|
__UNI_PLATFORM__: JSON.stringify(process.env.UNI_PLATFORM),
|
||||||
|
},
|
||||||
css: {
|
css: {
|
||||||
postcss: {
|
postcss: {
|
||||||
plugins: [
|
plugins: [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user