feige996 11 месяцев назад
Родитель
Сommit
d237a19090
6 измененных файлов с 8303 добавлено и 3024 удалено
  1. 24 23
      package.json
  2. 1 0
      pages.config.ts
  3. 8264 2989
      pnpm-lock.yaml
  4. 4 0
      src/pages/about/about.vue
  5. 1 3
      src/pages/index/index.vue
  6. 9 9
      src/utils/index.ts

+ 24 - 23
package.json

@@ -1,7 +1,7 @@
 {
 {
   "name": "unibest",
   "name": "unibest",
   "type": "commonjs",
   "type": "commonjs",
-  "version": "2.6.4",
+  "version": "2.7.0",
   "description": "unibest - 最好的 uniapp 开发模板",
   "description": "unibest - 最好的 uniapp 开发模板",
   "author": {
   "author": {
     "name": "feige996",
     "name": "feige996",
@@ -91,21 +91,22 @@
     "bin-wrapper": "npm:bin-wrapper-china"
     "bin-wrapper": "npm:bin-wrapper-china"
   },
   },
   "dependencies": {
   "dependencies": {
-    "@dcloudio/uni-app": "3.0.0-4020920240930001",
-    "@dcloudio/uni-app-harmony": "3.0.0-4020920240930001",
-    "@dcloudio/uni-app-plus": "3.0.0-4020920240930001",
-    "@dcloudio/uni-components": "3.0.0-4020920240930001",
-    "@dcloudio/uni-h5": "3.0.0-4020920240930001",
-    "@dcloudio/uni-mp-alipay": "3.0.0-4020920240930001",
-    "@dcloudio/uni-mp-baidu": "3.0.0-4020920240930001",
-    "@dcloudio/uni-mp-jd": "3.0.0-4020920240930001",
-    "@dcloudio/uni-mp-kuaishou": "3.0.0-4020920240930001",
-    "@dcloudio/uni-mp-lark": "3.0.0-4020920240930001",
-    "@dcloudio/uni-mp-qq": "3.0.0-4020920240930001",
-    "@dcloudio/uni-mp-toutiao": "3.0.0-4020920240930001",
-    "@dcloudio/uni-mp-weixin": "3.0.0-4020920240930001",
-    "@dcloudio/uni-mp-xhs": "3.0.0-4020920240930001",
-    "@dcloudio/uni-quickapp-webview": "3.0.0-4020920240930001",
+    "@dcloudio/uni-app": "3.0.0-4060520250512001",
+    "@dcloudio/uni-app-harmony": "3.0.0-4060520250512001",
+    "@dcloudio/uni-app-plus": "3.0.0-4060520250512001",
+    "@dcloudio/uni-components": "3.0.0-4060520250512001",
+    "@dcloudio/uni-h5": "3.0.0-4060520250512001",
+    "@dcloudio/uni-mp-alipay": "3.0.0-4060520250512001",
+    "@dcloudio/uni-mp-baidu": "3.0.0-4060520250512001",
+    "@dcloudio/uni-mp-harmony": "3.0.0-4060520250512001",
+    "@dcloudio/uni-mp-jd": "3.0.0-4060520250512001",
+    "@dcloudio/uni-mp-kuaishou": "3.0.0-4060520250512001",
+    "@dcloudio/uni-mp-lark": "3.0.0-4060520250512001",
+    "@dcloudio/uni-mp-qq": "3.0.0-4060520250512001",
+    "@dcloudio/uni-mp-toutiao": "3.0.0-4060520250512001",
+    "@dcloudio/uni-mp-weixin": "3.0.0-4060520250512001",
+    "@dcloudio/uni-mp-xhs": "3.0.0-4060520250512001",
+    "@dcloudio/uni-quickapp-webview": "3.0.0-4060520250512001",
     "@tanstack/vue-query": "^5.62.16",
     "@tanstack/vue-query": "^5.62.16",
     "abortcontroller-polyfill": "^1.7.8",
     "abortcontroller-polyfill": "^1.7.8",
     "dayjs": "1.11.10",
     "dayjs": "1.11.10",
@@ -122,10 +123,10 @@
     "@commitlint/cli": "^18.6.1",
     "@commitlint/cli": "^18.6.1",
     "@commitlint/config-conventional": "^18.6.3",
     "@commitlint/config-conventional": "^18.6.3",
     "@dcloudio/types": "^3.4.14",
     "@dcloudio/types": "^3.4.14",
-    "@dcloudio/uni-automator": "3.0.0-4020920240930001",
-    "@dcloudio/uni-cli-shared": "3.0.0-4020920240930001",
-    "@dcloudio/uni-stacktracey": "3.0.0-4020920240930001",
-    "@dcloudio/vite-plugin-uni": "3.0.0-4020920240930001",
+    "@dcloudio/uni-automator": "3.0.0-4060520250512001",
+    "@dcloudio/uni-cli-shared": "3.0.0-4060520250512001",
+    "@dcloudio/uni-stacktracey": "3.0.0-4060520250512001",
+    "@dcloudio/vite-plugin-uni": "3.0.0-4060520250512001",
     "@esbuild/darwin-arm64": "0.20.2",
     "@esbuild/darwin-arm64": "0.20.2",
     "@esbuild/darwin-x64": "0.20.2",
     "@esbuild/darwin-x64": "0.20.2",
     "@iconify-json/carbon": "^1.2.4",
     "@iconify-json/carbon": "^1.2.4",
@@ -135,7 +136,7 @@
     "@typescript-eslint/parser": "^6.21.0",
     "@typescript-eslint/parser": "^6.21.0",
     "@uni-helper/uni-types": "1.0.0-alpha.3",
     "@uni-helper/uni-types": "1.0.0-alpha.3",
     "@uni-helper/vite-plugin-uni-layouts": "^0.1.10",
     "@uni-helper/vite-plugin-uni-layouts": "^0.1.10",
-    "@uni-helper/vite-plugin-uni-manifest": "^0.2.7",
+    "@uni-helper/vite-plugin-uni-manifest": "^0.2.8",
     "@uni-helper/vite-plugin-uni-pages": "0.2.20",
     "@uni-helper/vite-plugin-uni-pages": "0.2.20",
     "@uni-helper/vite-plugin-uni-platform": "^0.0.4",
     "@uni-helper/vite-plugin-uni-platform": "^0.0.4",
     "@unocss/preset-legacy-compat": "^0.59.4",
     "@unocss/preset-legacy-compat": "^0.59.4",
@@ -169,7 +170,7 @@
     "stylelint-prettier": "^5.0.2",
     "stylelint-prettier": "^5.0.2",
     "terser": "^5.36.0",
     "terser": "^5.36.0",
     "typescript": "^5.7.2",
     "typescript": "^5.7.2",
-    "unocss": "^0.58.9",
+    "unocss": "0.58.9",
     "unocss-applet": "^0.7.8",
     "unocss-applet": "^0.7.8",
     "unplugin-auto-import": "^0.17.8",
     "unplugin-auto-import": "^0.17.8",
     "vite": "5.2.8",
     "vite": "5.2.8",
@@ -177,4 +178,4 @@
     "vitepress": "^1.5.0",
     "vitepress": "^1.5.0",
     "vue-tsc": "^1.8.27"
     "vue-tsc": "^1.8.27"
   }
   }
-}
+}

+ 1 - 0
pages.config.ts

@@ -16,6 +16,7 @@ export default defineUniPages({
         'z-paging/components/z-paging$1/z-paging$1.vue',
         'z-paging/components/z-paging$1/z-paging$1.vue',
     },
     },
   },
   },
+  // 如果不需要tabBar,可以注释掉这个配置,或者直接删除
   tabBar: {
   tabBar: {
     color: '#999999',
     color: '#999999',
     selectedColor: '#018d71',
     selectedColor: '#018d71',

Разница между файлами не показана из-за своего большого размера
+ 8264 - 2989
pnpm-lock.yaml


+ 4 - 0
src/pages/about/about.vue

@@ -15,6 +15,7 @@
       鸽友们好,我是
       鸽友们好,我是
       <text class="text-red-500">菲鸽</text>
       <text class="text-red-500">菲鸽</text>
     </view>
     </view>
+    <view class="test-css">测试 scss 样式</view>
     <RequestComp />
     <RequestComp />
     <UploadComp />
     <UploadComp />
   </view>
   </view>
@@ -30,7 +31,10 @@ const { safeAreaInsets } = uni.getSystemInfoSync()
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
 .test-css {
 .test-css {
+  // 16rpx=>0.5rem
+  padding-bottom: 16rpx;
   // mt-4=>1rem=>16px;
   // mt-4=>1rem=>16px;
   margin-top: 16px;
   margin-top: 16px;
+  text-align: center;
 }
 }
 </style>
 </style>

+ 1 - 3
src/pages/index/index.vue

@@ -31,7 +31,6 @@
 </template>
 </template>
 
 
 <script lang="ts" setup>
 <script lang="ts" setup>
-import { TestEnum } from '@/typings'
 import PLATFORM from '@/utils/platform'
 import PLATFORM from '@/utils/platform'
 
 
 defineOptions({
 defineOptions({
@@ -46,8 +45,7 @@ const description = ref(
 )
 )
 // 测试 uni API 自动引入
 // 测试 uni API 自动引入
 onLoad(() => {
 onLoad(() => {
-  console.log(author)
-  console.log(TestEnum.A)
+  console.log('项目作者:', author.value)
 })
 })
 </script>
 </script>
 
 

+ 9 - 9
src/utils/index.ts

@@ -1,6 +1,8 @@
-import { pages, subPackages, tabBar } from '@/pages.json'
+import pagesConfig from '@/pages.json'
 import { isMpWeixin } from './platform'
 import { isMpWeixin } from './platform'
 
 
+const { pages, subPackages, tabBar = { list: [] } } = { ...pagesConfig }
+
 export const getLastPage = () => {
 export const getLastPage = () => {
   // getCurrentPages() 至少有1个元素,所以不再额外判断
   // getCurrentPages() 至少有1个元素,所以不再额外判断
   // const lastPage = getCurrentPages().at(-1)
   // const lastPage = getCurrentPages().at(-1)
@@ -11,16 +13,14 @@ export const getLastPage = () => {
 
 
 /** 判断当前页面是否是 tabbar 页  */
 /** 判断当前页面是否是 tabbar 页  */
 export const getIsTabbar = () => {
 export const getIsTabbar = () => {
-  if (!tabBar) {
-    return false
-  }
-  if (!tabBar.list.length) {
-    // 通常有 tabBar 的话,list 不能有空,且至少有2个元素,这里其实不用处理
+  try {
+    const lastPage = getLastPage()
+    const currPath = lastPage?.route
+
+    return Boolean(tabBar?.list?.some((item) => item.pagePath === currPath))
+  } catch {
     return false
     return false
   }
   }
-  const lastPage = getLastPage()
-  const currPath = lastPage.route
-  return !!tabBar.list.find((e) => e.pagePath === currPath)
 }
 }
 
 
 /**
 /**