王家程 před 11 měsíci
rodič
revize
4fa01eadbd
22 změnil soubory, kde provedl 1832 přidání a 296 odebrání
  1. 11 0
      .env.development
  2. 4 3
      .eslintrc.js
  3. 21 80
      .stylelintrc.js
  4. 0 24
      App.vue
  5. 9 2
      README.md
  6. 16 5
      index.html
  7. 46 9
      package.json
  8. 1258 33
      pnpm-lock.yaml
  9. 24 0
      src/App.vue
  10. 4 4
      src/main.ts
  11. 0 0
      src/manifest.json
  12. 8 1
      src/pages.json
  13. 56 55
      src/pages/index/index.vue
  14. 8 0
      src/static/icons/anl.svg
  15. 0 0
      src/static/logo.png
  16. 77 77
      src/uni.scss
  17. 19 0
      src/utils/icons.ts
  18. 1 1
      tsconfig.json
  19. 107 0
      types/auto-import.d.ts
  20. 8 0
      types/global.d.ts
  21. 99 0
      uno.config.ts
  22. 56 2
      vite.config.ts

+ 11 - 0
.env.development

@@ -0,0 +1,11 @@
+###
+ # @Author: wjc
+ # @Date: 2023-05-30 10:50:23
+ # @LastEditors: wjc
+ # @LastEditTime: 2024-05-08 14:40:26
+ # @Description: 
+### 
+VITE_ENV = 'development'
+
+# base api
+VITE_APP_BASE_API = 'https://s.mooeen.com'

+ 4 - 3
.eslintrc.js

@@ -2,8 +2,8 @@
  * @Author: wjc
  * @Date: 2024-05-27 11:53:23
  * @LastEditors: wjc
- * @LastEditTime: 2024-05-28 15:14:01
- * @Description: 
+ * @LastEditTime: 2024-05-31 09:24:37
+ * @Description:
  */
 module.exports = {
   env: {
@@ -12,7 +12,7 @@ module.exports = {
   },
   extends: [
     'eslint:recommended',
-    'plugin:vue/vue3-recommended',
+    'plugin:vue/vue3-essential',
     'plugin:@typescript-eslint/recommended',
     'plugin:import/recommended',
     'standard',
@@ -39,6 +39,7 @@ module.exports = {
         shallowOnly: true, // 启用更改props值但保持引用不变的功能
       },
     ],
+    'import/no-unresolved': 'off',
     'vue/valid-template-root': [0],
     'vue/no-reserved-component-names': 'off',
     'vue/multi-word-component-names': [1],

+ 21 - 80
.stylelintrc.js

@@ -1,11 +1,19 @@
+/*
+ * @Author: wjc
+ * @Date: 2024-05-29 17:32:17
+ * @LastEditors: wjc
+ * @LastEditTime: 2024-05-29 17:58:47
+ * @Description:
+ */
 module.exports = {
+  root: true,
   extends: [
-    'stylelint-config-standard',
-    'stylelint-config-prettier',
-    'stylelint-config-standard`-scss',
-    'stylelint-config-standard-vue',
+    'stylelint-config-recommended',
+    'stylelint-config-recommended-scss',
+    'stylelint-config-recommended-vue/scss',
+    'stylelint-config-recess-order',
   ],
-  plugins: ['stylelint-order'],
+  plugins: ['stylelint-order', 'stylelint-prettier'],
   // 不同格式的文件指定自定义语法
   overrides: [
     {
@@ -19,6 +27,13 @@ module.exports = {
   ],
   ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts', '**/*.json', '**/*.md', '**/*.yaml'],
   rules: {
+    'prettier/prettier': true,
+    'unit-no-unknown': [
+      true,
+      {
+        ignoreUnits: ['rpx'],
+      },
+    ],
     'color-function-notation': ['legacy', { ignore: ['with-var-inside'] }],
     // 这里使用正则表达式允许选择器中出现短横线和下划线。
     'selector-class-pattern': '^[a-z][a-zA-Z0-9_-]+$',
@@ -26,7 +41,7 @@ module.exports = {
     'selector-pseudo-element-no-unknown': [
       true,
       {
-        ignorePseudoElements: ['v-deep'],
+        ignorePseudoElements: ['v-deep', 'deep', 'global'],
       },
     ],
     'scss/at-extend-no-missing-placeholder': null,
@@ -42,79 +57,5 @@ module.exports = {
         ignorePseudoClasses: ['deep', 'slotted'],
       },
     ],
-    // 指定样式的排序
-    'order/properties-order': [
-      'position',
-      'top',
-      'right',
-      'bottom',
-      'left',
-      'z-index',
-      'display',
-      'justify-content',
-      'align-items',
-      'float',
-      'clear',
-      'overflow',
-      'overflow-x',
-      'overflow-y',
-      'padding',
-      'padding-top',
-      'padding-right',
-      'padding-bottom',
-      'padding-left',
-      'margin',
-      'margin-top',
-      'margin-right',
-      'margin-bottom',
-      'margin-left',
-      'width',
-      'min-width',
-      'max-width',
-      'height',
-      'min-height',
-      'max-height',
-      'font-size',
-      'font-family',
-      'text-align',
-      'text-justify',
-      'text-indent',
-      'text-overflow',
-      'text-decoration',
-      'white-space',
-      'color',
-      'background',
-      'background-position',
-      'background-repeat',
-      'background-size',
-      'background-color',
-      'background-clip',
-      'border',
-      'border-style',
-      'border-width',
-      'border-color',
-      'border-top-style',
-      'border-top-width',
-      'border-top-color',
-      'border-right-style',
-      'border-right-width',
-      'border-right-color',
-      'border-bottom-style',
-      'border-bottom-width',
-      'border-bottom-color',
-      'border-left-style',
-      'border-left-width',
-      'border-left-color',
-      'border-radius',
-      'opacity',
-      'filter',
-      'list-style',
-      'outline',
-      'visibility',
-      'box-shadow',
-      'text-shadow',
-      'resize',
-      'transition',
-    ],
   },
 }

+ 0 - 24
App.vue

@@ -1,24 +0,0 @@
-<!--
- * @Author: wjc
- * @Date: 2024-05-27 11:50:13
- * @LastEditors: wjc
- * @LastEditTime: 2024-05-28 10:05:19
- * @Description: 
--->
-<script>
-  export default {
-    onLaunch: function () {
-      console.log('App Launch')
-    },
-    onShow: function () {
-      console.log('App Show')
-    },
-    onHide: function () {
-      console.log('App Hide')
-    },
-  }
-</script>
-
-<style lang="scss">
-  @import 'uview-ui/index.scss';
-</style>

+ 9 - 2
README.md

@@ -2,13 +2,20 @@
  * @Author: wjc
  * @Date: 2024-05-27 17:21:43
  * @LastEditors: wjc
- * @LastEditTime: 2024-05-28 16:26:15
+ * @LastEditTime: 2024-05-28 17:59:29
  * @Description:
 -->
 
 ## huiguanjia-app
 
-hbuilderx 创建模板工程 + 第三方依赖支持
+hbuilderx 创建模板工程 + 第三方依赖支持。
+
+使用 vscode 编辑,提交代码,hbuilderx 运行和构建。
+
+### 名词解释
+
+- node_modules: 第三方依赖库
+- uni_modules:uni-app 插件市场依赖
 
 ### husky 配置
 

+ 16 - 5
index.html

@@ -1,13 +1,24 @@
-<!DOCTYPE html>
+<!--
+ * @Author: wjc
+ * @Date: 2022-01-08 17:58:22
+ * @LastEditors: wjc
+ * @LastEditTime: 2024-05-29 16:12:34
+ * @Description: 
+-->
+<!doctype html>
 <html lang="en">
   <head>
     <meta charset="UTF-8" />
     <script>
-      var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
-        CSS.supports('top: constant(a)'))
+      var coverSupport =
+        'CSS' in window &&
+        typeof CSS.supports === 'function' &&
+        (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
       document.write(
         '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
-        (coverSupport ? ', viewport-fit=cover' : '') + '" />')
+          (coverSupport ? ', viewport-fit=cover' : '') +
+          '" />'
+      )
     </script>
     <title></title>
     <!--preload-links-->
@@ -15,6 +26,6 @@
   </head>
   <body>
     <div id="app"><!--app-html--></div>
-    <script type="module" src="/main.js"></script>
+    <script type="module" src="/src/main.ts"></script>
   </body>
 </html>

+ 46 - 9
package.json

@@ -4,6 +4,14 @@
   "description": "",
   "main": "index.js",
   "scripts": {
+    "dev:app": "uni -p app",
+    "dev:app-android": "uni -p app-android",
+    "dev:app-ios": "uni -p app-ios",
+    "dev:h5": "uni",
+    "build:app": "uni build -p app",
+    "build:app-android": "uni build -p app-android",
+    "build:app-ios": "uni build -p app-ios",
+    "build:h5": "uni build",
     "test": "echo \"Error: no test specified\" && exit 1",
     "lint": "eslint --fix",
     "format": "prettier --write",
@@ -14,11 +22,35 @@
   "keywords": [],
   "author": "",
   "license": "ISC",
+  "dependencies": {
+    "@dcloudio/uni-app": "3.0.0-4010420240430001",
+    "@dcloudio/uni-app-plus": "3.0.0-4010420240430001",
+    "@dcloudio/uni-components": "3.0.0-4010420240430001",
+    "@dcloudio/uni-h5": "3.0.0-4010420240430001",
+    "@dcloudio/uni-ui": "^1.5.5",
+    "@iconify-json/ep": "^1.1.15",
+    "@unocss/reset": "^0.60.3",
+    "dayjs": "^1.11.11",
+    "pinia": "^2.1.7",
+    "unocss": "^0.58.3",
+    "uview-plus": "^3.2.22",
+    "vue": "^3.4.27",
+    "vue-i18n": "^9.13.1"
+  },
   "devDependencies": {
     "@commitlint/cli": "^19.3.0",
     "@commitlint/config-conventional": "^19.2.2",
+    "@dcloudio/types": "^3.4.8",
+    "@dcloudio/uni-automator": "3.0.0-4010420240430001",
+    "@dcloudio/uni-cli-shared": "3.0.0-4010420240430001",
+    "@dcloudio/uni-stacktracey": "3.0.0-4010420240430001",
+    "@dcloudio/vite-plugin-uni": "3.0.0-4010420240430001",
+    "@iconify/utils": "^2.1.23",
+    "@types/node": "^20.12.12",
     "@typescript-eslint/eslint-plugin": "^7.10.0",
     "@typescript-eslint/parser": "^7.10.0",
+    "@vue/runtime-core": "^3.4.27",
+    "@vue/tsconfig": "^0.5.1",
     "commitlint": "^19.3.0",
     "eslint": "^8.57.0",
     "eslint-config-prettier": "^9.1.0",
@@ -35,19 +67,24 @@
     "postcss-html": "^1.7.0",
     "postcss-scss": "^4.0.9",
     "prettier": "^3.2.5",
-    "stylelint": "^16.6.0",
+    "sass": "^1.77.2",
+    "sass-loader": "^14.2.1",
+    "stylelint": "16.0.2",
     "stylelint-config-prettier": "^9.0.5",
-    "stylelint-config-standard-scss": "^13.1.0",
-    "stylelint-config-standard-vue": "^1.0.0",
+    "stylelint-config-recess-order": "^5.0.1",
+    "stylelint-config-recommended": "^14.0.0",
+    "stylelint-config-recommended-scss": "^14.0.0",
+    "stylelint-config-recommended-vue": "^1.0.0",
     "stylelint-order": "^6.0.4",
-    "stylelint-scss": "^6.3.0",
+    "stylelint-prettier": "^5.0.0",
     "typescript": "^5.4.5",
     "typescript-eslint": "^7.11.0",
-    "vue-eslint-parser": "^9.4.2"
-  },
-  "dependencies": {
-    "uview-ui": "^2.0.37",
-    "vue": "^3.4.27"
+    "unplugin-auto-import": "^0.17.6",
+    "vite": "^5.2.12",
+    "vite-plugin-purge-icons": "^0.10.0",
+    "vite-plugin-svg-icons": "^2.0.1",
+    "vue-eslint-parser": "^9.4.2",
+    "vue-tsc": "^2.0.19"
   },
   "lint-staged": {
     "*.{vue,js,ts,jsx,tsx}": [

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1258 - 33
pnpm-lock.yaml


+ 24 - 0
src/App.vue

@@ -0,0 +1,24 @@
+<!--
+ * @Author: wjc
+ * @Date: 2024-05-27 11:50:13
+ * @LastEditors: wjc
+ * @LastEditTime: 2024-05-29 17:15:46
+ * @Description: 
+-->
+<script setup lang="ts">
+  import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
+
+  onLaunch(() => {
+    console.log('App Launch')
+  })
+  onShow(() => {
+    console.log('App Show')
+  })
+  onHide(() => {
+    console.log('App Hide')
+  })
+</script>
+
+<style lang="scss">
+  @import url('uview-plus/index');
+</style>

+ 4 - 4
main.ts → src/main.ts

@@ -2,18 +2,18 @@
  * @Author: wjc
  * @Date: 2024-05-27 11:49:45
  * @LastEditors: wjc
- * @LastEditTime: 2024-05-28 16:11:28
+ * @LastEditTime: 2024-05-29 17:03:27
  * @Description:
  */
 import { createSSRApp } from 'vue'
-import uView from 'uview-ui'
+import uviewPlus from 'uview-plus'
+import 'virtual:uno.css'
 
 import App from './App.vue'
 
 export function createApp() {
   const app = createSSRApp(App)
-
-  app.use(uView)
+  app.use(uviewPlus)
 
   return {
     app,

+ 0 - 0
manifest.json → src/manifest.json


+ 8 - 1
pages.json → src/pages.json

@@ -1,4 +1,11 @@
 {
+	"easycom": {
+		"autoscan" : true,
+		"custom": {
+			"^u-(.*)": "uview-plus/components/u-$1/u-$1.vue",
+			"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
+		}
+	},
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
 			"path": "pages/index/index",
@@ -14,4 +21,4 @@
 		"backgroundColor": "#F8F8F8"
 	},
 	"uniIdRouter": {}
-}
+}

+ 56 - 55
pages/index/index.vue → src/pages/index/index.vue

@@ -1,55 +1,56 @@
-<!--
- * @Author: wjc
- * @Date: 2019-08-22 19:41:20
- * @LastEditors: wjc
- * @LastEditTime: 2024-05-28 11:26:08
- * @Description: 
--->
-<template>
-  <view class="content">
-    <image class="logo" src="/static/logo.png"></image>
-    <view class="text-area">
-      <text class="title">{{ title }}</text>
-    </view>
-  </view>
-</template>
-
-<script>
-  export default {
-    data() {
-      return {
-        title: 'Hello',
-      }
-    },
-    onLoad() {},
-    methods: {},
-  }
-</script>
-
-<style>
-  .content {
-    display: flex;
-    flex-direction: column;
-    align-items: center;
-    justify-content: center;
-  }
-
-  .logo {
-    height: 200rpx;
-    width: 200rpx;
-    margin-top: 200rpx;
-    margin-left: auto;
-    margin-right: auto;
-    margin-bottom: 50rpx;
-  }
-
-  .text-area {
-    display: flex;
-    justify-content: center;
-  }
-
-  .title {
-    font-size: 36rpx;
-    color: #8f8f94;
-  }
-</style>
+<!--
+ * @Author: wjc
+ * @Date: 2019-08-22 19:41:20
+ * @LastEditors: wjc
+ * @LastEditTime: 2024-05-29 18:01:04
+ * @Description: 
+-->
+<template>
+  <view class="content">
+    <image class="logo" src="/static/logo.png"></image>
+    <view class="text-area">
+      <text class="title">{{ title }}</text>
+      <u-button type="primary" text="确定"></u-button>
+    </view>
+  </view>
+</template>
+
+<script>
+  export default {
+    data() {
+      return {
+        title: 'Hello',
+      }
+    },
+    onLoad() {},
+    methods: {},
+  }
+</script>
+
+<style lang="scss">
+  .content {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+  }
+
+  .logo {
+    width: 200rpx;
+    height: 200rpx;
+    margin-top: 200rpx;
+    margin-right: auto;
+    margin-bottom: 50rpx;
+    margin-left: auto;
+  }
+
+  .text-area {
+    display: flex;
+    justify-content: center;
+  }
+
+  .title {
+    font-size: 36rpx;
+    color: #8f8f94;
+  }
+</style>

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 8 - 0
src/static/icons/anl.svg


+ 0 - 0
static/logo.png → src/static/logo.png


+ 77 - 77
uni.scss → src/uni.scss

@@ -1,77 +1,77 @@
-/**
- * 这里是uni-app内置的常用样式变量
- *
- * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
- * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
- *
- */
-
-/**
- * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
- *
- * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
- */
- @import 'uview-ui/theme.scss';
-
-/* 颜色变量 */
-
-/* 行为相关颜色 */
-$uni-color-primary: #007aff;
-$uni-color-success: #4cd964;
-$uni-color-warning: #f0ad4e;
-$uni-color-error: #dd524d;
-
-/* 文字基本颜色 */
-$uni-text-color:#333;//基本色
-$uni-text-color-inverse:#fff;//反色
-$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
-$uni-text-color-placeholder: #808080;
-$uni-text-color-disable:#c0c0c0;
-
-/* 背景颜色 */
-$uni-bg-color:#ffffff;
-$uni-bg-color-grey:#f8f8f8;
-$uni-bg-color-hover:#f1f1f1;//点击状态颜色
-$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
-
-/* 边框颜色 */
-$uni-border-color:#c8c7cc;
-
-/* 尺寸变量 */
-
-/* 文字尺寸 */
-$uni-font-size-sm:12px;
-$uni-font-size-base:14px;
-$uni-font-size-lg:16px;
-
-/* 图片尺寸 */
-$uni-img-size-sm:20px;
-$uni-img-size-base:26px;
-$uni-img-size-lg:40px;
-
-/* Border Radius */
-$uni-border-radius-sm: 2px;
-$uni-border-radius-base: 3px;
-$uni-border-radius-lg: 6px;
-$uni-border-radius-circle: 50%;
-
-/* 水平间距 */
-$uni-spacing-row-sm: 5px;
-$uni-spacing-row-base: 10px;
-$uni-spacing-row-lg: 15px;
-
-/* 垂直间距 */
-$uni-spacing-col-sm: 4px;
-$uni-spacing-col-base: 8px;
-$uni-spacing-col-lg: 12px;
-
-/* 透明度 */
-$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
-
-/* 文章场景相关 */
-$uni-color-title: #2C405A; // 文章标题颜色
-$uni-font-size-title:20px;
-$uni-color-subtitle: #555555; // 二级标题颜色
-$uni-font-size-subtitle:26px;
-$uni-color-paragraph: #3F536E; // 文章段落颜色
-$uni-font-size-paragraph:15px;
+/**
+ * 这里是uni-app内置的常用样式变量
+ *
+ * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
+ * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
+ *
+ */
+
+/**
+ * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
+ *
+ * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
+ */
+@import 'uview-plus/theme';
+
+/* 颜色变量 */
+
+/* 行为相关颜色 */
+$uni-color-primary: #007aff;
+$uni-color-success: #4cd964;
+$uni-color-warning: #f0ad4e;
+$uni-color-error: #dd524d;
+
+/* 文字基本颜色 */
+$uni-text-color: #333; //基本色
+$uni-text-color-inverse: #fff; //反色
+$uni-text-color-grey: #999; //辅助灰色,如加载更多的提示信息
+$uni-text-color-placeholder: #808080;
+$uni-text-color-disable: #c0c0c0;
+
+/* 背景颜色 */
+$uni-bg-color: #fff;
+$uni-bg-color-grey: #f8f8f8;
+$uni-bg-color-hover: #f1f1f1; //点击状态颜色
+$uni-bg-color-mask: rgba(0, 0, 0, 40%); //遮罩颜色
+
+/* 边框颜色 */
+$uni-border-color: #c8c7cc;
+
+/* 尺寸变量 */
+
+/* 文字尺寸 */
+$uni-font-size-sm: 12px;
+$uni-font-size-base: 14px;
+$uni-font-size-lg: 16px;
+
+/* 图片尺寸 */
+$uni-img-size-sm: 20px;
+$uni-img-size-base: 26px;
+$uni-img-size-lg: 40px;
+
+/* Border Radius */
+$uni-border-radius-sm: 2px;
+$uni-border-radius-base: 3px;
+$uni-border-radius-lg: 6px;
+$uni-border-radius-circle: 50%;
+
+/* 水平间距 */
+$uni-spacing-row-sm: 5px;
+$uni-spacing-row-base: 10px;
+$uni-spacing-row-lg: 15px;
+
+/* 垂直间距 */
+$uni-spacing-col-sm: 4px;
+$uni-spacing-col-base: 8px;
+$uni-spacing-col-lg: 12px;
+
+/* 透明度 */
+$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
+
+/* 文章场景相关 */
+$uni-color-title: #2c405a; // 文章标题颜色
+$uni-font-size-title: 20px;
+$uni-color-subtitle: #555; // 二级标题颜色
+$uni-font-size-subtitle: 26px;
+$uni-color-paragraph: #3f536e; // 文章段落颜色
+$uni-font-size-paragraph: 15px;

+ 19 - 0
src/utils/icons.ts

@@ -0,0 +1,19 @@
+/*
+ * @Author: wjc
+ * @Date: 2024-05-29 09:55:14
+ * @LastEditors: wjc
+ * @LastEditTime: 2024-05-29 15:59:22
+ * @Description:
+ */
+import fs from 'fs'
+import ep from '@iconify-json/ep/icons.json'
+
+const epList = Object.keys(ep.icons).map((i) => `i-ep-${i}`)
+let custom: string[] = []
+
+const files = fs.readdirSync('./src/static/icons/')
+custom = files.map((item: string) => `i-custom-${item.replace('.svg', '')}`)
+
+const iconList = [...epList, ...custom]
+
+export default iconList

+ 1 - 1
tsconfig.json

@@ -20,7 +20,7 @@
     "moduleResolution": "bundler",
     "allowSyntheticDefaultImports": true,
     "baseUrl": ".",
-    "types": [],
+    "types": ["@dcloudio/types"],
     "paths": {
       "@/*": ["/*"],
       "#/*": ["types/*"],

+ 107 - 0
types/auto-import.d.ts

@@ -0,0 +1,107 @@
+/* eslint-disable */
+/* prettier-ignore */
+// @ts-nocheck
+// noinspection JSUnusedGlobalSymbols
+// Generated by unplugin-auto-import
+export {}
+declare global {
+  const EffectScope: (typeof import('vue'))['EffectScope']
+  const computed: (typeof import('vue'))['computed']
+  const createApp: (typeof import('../src/main'))['createApp']
+  const customRef: (typeof import('vue'))['customRef']
+  const defineAsyncComponent: (typeof import('vue'))['defineAsyncComponent']
+  const defineComponent: (typeof import('vue'))['defineComponent']
+  const effectScope: (typeof import('vue'))['effectScope']
+  const getCurrentInstance: (typeof import('vue'))['getCurrentInstance']
+  const getCurrentScope: (typeof import('vue'))['getCurrentScope']
+  const h: (typeof import('vue'))['h']
+  const inject: (typeof import('vue'))['inject']
+  const isProxy: (typeof import('vue'))['isProxy']
+  const isReactive: (typeof import('vue'))['isReactive']
+  const isReadonly: (typeof import('vue'))['isReadonly']
+  const isRef: (typeof import('vue'))['isRef']
+  const markRaw: (typeof import('vue'))['markRaw']
+  const nextTick: (typeof import('vue'))['nextTick']
+  const onActivated: (typeof import('vue'))['onActivated']
+  const onAddToFavorites: (typeof import('@dcloudio/uni-app'))['onAddToFavorites']
+  const onBackPress: (typeof import('@dcloudio/uni-app'))['onBackPress']
+  const onBeforeMount: (typeof import('vue'))['onBeforeMount']
+  const onBeforeRouteLeave: (typeof import('vue-router'))['onBeforeRouteLeave']
+  const onBeforeRouteUpdate: (typeof import('vue-router'))['onBeforeRouteUpdate']
+  const onBeforeUnmount: (typeof import('vue'))['onBeforeUnmount']
+  const onBeforeUpdate: (typeof import('vue'))['onBeforeUpdate']
+  const onDeactivated: (typeof import('vue'))['onDeactivated']
+  const onError: (typeof import('@dcloudio/uni-app'))['onError']
+  const onErrorCaptured: (typeof import('vue'))['onErrorCaptured']
+  const onHide: (typeof import('@dcloudio/uni-app'))['onHide']
+  const onLaunch: (typeof import('@dcloudio/uni-app'))['onLaunch']
+  const onLoad: (typeof import('@dcloudio/uni-app'))['onLoad']
+  const onMounted: (typeof import('vue'))['onMounted']
+  const onNavigationBarButtonTap: (typeof import('@dcloudio/uni-app'))['onNavigationBarButtonTap']
+  const onNavigationBarSearchInputChanged: (typeof import('@dcloudio/uni-app'))['onNavigationBarSearchInputChanged']
+  const onNavigationBarSearchInputClicked: (typeof import('@dcloudio/uni-app'))['onNavigationBarSearchInputClicked']
+  const onNavigationBarSearchInputConfirmed: (typeof import('@dcloudio/uni-app'))['onNavigationBarSearchInputConfirmed']
+  const onNavigationBarSearchInputFocusChanged: (typeof import('@dcloudio/uni-app'))['onNavigationBarSearchInputFocusChanged']
+  const onPageNotFound: (typeof import('@dcloudio/uni-app'))['onPageNotFound']
+  const onPageScroll: (typeof import('@dcloudio/uni-app'))['onPageScroll']
+  const onPullDownRefresh: (typeof import('@dcloudio/uni-app'))['onPullDownRefresh']
+  const onReachBottom: (typeof import('@dcloudio/uni-app'))['onReachBottom']
+  const onReady: (typeof import('@dcloudio/uni-app'))['onReady']
+  const onRenderTracked: (typeof import('vue'))['onRenderTracked']
+  const onRenderTriggered: (typeof import('vue'))['onRenderTriggered']
+  const onResize: (typeof import('@dcloudio/uni-app'))['onResize']
+  const onScopeDispose: (typeof import('vue'))['onScopeDispose']
+  const onServerPrefetch: (typeof import('vue'))['onServerPrefetch']
+  const onShareAppMessage: (typeof import('@dcloudio/uni-app'))['onShareAppMessage']
+  const onShareTimeline: (typeof import('@dcloudio/uni-app'))['onShareTimeline']
+  const onShow: (typeof import('@dcloudio/uni-app'))['onShow']
+  const onTabItemTap: (typeof import('@dcloudio/uni-app'))['onTabItemTap']
+  const onThemeChange: (typeof import('@dcloudio/uni-app'))['onThemeChange']
+  const onUnhandledRejection: (typeof import('@dcloudio/uni-app'))['onUnhandledRejection']
+  const onUnload: (typeof import('@dcloudio/uni-app'))['onUnload']
+  const onUnmounted: (typeof import('vue'))['onUnmounted']
+  const onUpdated: (typeof import('vue'))['onUpdated']
+  const provide: (typeof import('vue'))['provide']
+  const reactive: (typeof import('vue'))['reactive']
+  const readonly: (typeof import('vue'))['readonly']
+  const ref: (typeof import('vue'))['ref']
+  const resolveComponent: (typeof import('vue'))['resolveComponent']
+  const shallowReactive: (typeof import('vue'))['shallowReactive']
+  const shallowReadonly: (typeof import('vue'))['shallowReadonly']
+  const shallowRef: (typeof import('vue'))['shallowRef']
+  const toRaw: (typeof import('vue'))['toRaw']
+  const toRef: (typeof import('vue'))['toRef']
+  const toRefs: (typeof import('vue'))['toRefs']
+  const toValue: (typeof import('vue'))['toValue']
+  const triggerRef: (typeof import('vue'))['triggerRef']
+  const unref: (typeof import('vue'))['unref']
+  const useAttrs: (typeof import('vue'))['useAttrs']
+  const useCssModule: (typeof import('vue'))['useCssModule']
+  const useCssVars: (typeof import('vue'))['useCssVars']
+  const useLink: (typeof import('vue-router'))['useLink']
+  const useRoute: (typeof import('vue-router'))['useRoute']
+  const useRouter: (typeof import('vue-router'))['useRouter']
+  const useSlots: (typeof import('vue'))['useSlots']
+  const watch: (typeof import('vue'))['watch']
+  const watchEffect: (typeof import('vue'))['watchEffect']
+  const watchPostEffect: (typeof import('vue'))['watchPostEffect']
+  const watchSyncEffect: (typeof import('vue'))['watchSyncEffect']
+}
+// for type re-export
+declare global {
+  // @ts-ignore
+  export type {
+    Component,
+    ComponentPublicInstance,
+    ComputedRef,
+    ExtractDefaultPropTypes,
+    ExtractPropTypes,
+    ExtractPublicPropTypes,
+    InjectionKey,
+    PropType,
+    Ref,
+    VNode,
+    WritableComputedRef,
+  } from 'vue'
+  import('vue')
+}

+ 8 - 0
types/global.d.ts

@@ -0,0 +1,8 @@
+/// <reference types="vite/client" />
+
+declare module '*.vue' {
+  import type { DefineComponent } from 'vue'
+  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
+  const component: DefineComponent<{}, {}, any>
+  export default component
+}

+ 99 - 0
uno.config.ts

@@ -0,0 +1,99 @@
+/*
+ * @Author: wjc
+ * @Date: 2023-05-07 20:59:28
+ * @LastEditors: wjc
+ * @LastEditTime: 2024-05-29 11:11:07
+ * @Description:
+ */
+import {
+  defineConfig,
+  presetUno,
+  presetIcons,
+  transformerDirectives,
+  transformerVariantGroup,
+} from 'unocss'
+import { FileSystemIconLoader } from '@iconify/utils/lib/loader/node-loaders'
+// import iconList from './utils/icons'
+
+export default defineConfig({
+  presets: [
+    presetUno(),
+    presetIcons({
+      scale: 1.2,
+      extraProperties: {
+        display: 'inline-block',
+      },
+      // cdn: 'https://esm.sh/'
+      collections: {
+        custom: FileSystemIconLoader('./src/static/icons/'),
+        ep: () => import('@iconify-json/ep/icons.json').then((i) => i.default),
+      },
+    }),
+  ],
+  transformers: [transformerDirectives(), transformerVariantGroup()],
+  rules: [
+    [/^m-h-(.+)$/, ([, d]) => ({ 'margin-left': `${d}`, 'margin-right': `${d}` })],
+    [/^m-v-(.+)$/, ([, d]) => ({ 'margin-top': `${d}`, 'margin-bottom': `${d}` })],
+    [/^p-h-(.+)$/, ([, d]) => ({ 'padding-left': `${d}`, 'padding-right': `${d}` })],
+    [/^p-v-(.+)$/, ([, d]) => ({ 'padding-top': `${d}`, 'padding-bottom': `${d}` })],
+    [/^max-w-(\s+)$/, ([, d]) => ({ 'max-width': `${d}` })],
+    [/^min-w-(\s+)$/, ([, d]) => ({ 'min-width': `${d}` })],
+    [/^max-h-[(\s+)]$/, ([, d]) => ({ 'max-height': `${d}` })],
+    [/^min-h-[(\s+)]$/, ([, d]) => ({ 'min-height': `${d}` })],
+    [/^font-s-(\d+(\.\d+)?\w+)$/, ([, d]) => ({ 'font-size': `${d}` })],
+    [/^wh-(.+)$/, ([, d]) => ({ width: `${d}`, height: `${d}` })],
+    [/^bg-color-(\d+)$/, ([, d]) => ({ 'background-color': `${d}` })],
+  ],
+  // safelist: iconList,
+  shortcuts: {
+    'wh-full': 'w-full h-full',
+    'mp-0': 'm-0 p-0',
+    'ma-x': 'mt-0 mb-0 ml-auto mr-auto',
+    'inline-flex-center': 'inline-flex justify-center items-center',
+    'flex-center': 'flex justify-center items-center',
+    'flex-x-center': 'flex justify-center',
+    'flex-y-center': 'flex items-center',
+    // 文本溢出显示省略号
+    'text-overflow': 'overflow-hidden whitespace-nowrap text-ellipsis',
+    // 文本溢出换行
+    'text-break': 'whitespace-normal break-all break-words',
+  },
+  theme: {
+    breakpoints: {
+      xs: '480px',
+      sm: '768px',
+      md: '992px',
+      lg: '1200px',
+      xl: '1920px',
+    },
+    colors: {
+      primary: 'var(--primary-color)',
+      success: 'var(--success-color)',
+      warning: 'var(--warning-color)',
+      danger: 'var(--danger-color)',
+      error: 'var(--error-color)',
+      info: 'var(--info-color)',
+      color: {
+        '1': 'var(--text-color-1)',
+        '2': 'var(--text-color-2)',
+        '3': 'var(--text-color-3)',
+        4: 'var(--bg-color-4)',
+        place: 'var(--text-color-place)',
+        disabled: 'var(--text-color-disabled)',
+        whiter: 'var(--text-color-whiter)',
+      },
+      bg: {
+        color: 'var(--bg-color)',
+        1: 'var(--bg-color-1)',
+        2: 'var(--bg-color-2)',
+        3: 'var(--bg-color-3)',
+        4: 'var(--bg-color-4)',
+        page: 'var(--bg-page)',
+        place: 'var(--text-color-place)',
+        divider: 'var(--bg-divider)',
+        overlay: 'var(--bg-overlay)',
+        primary: 'var(--primary-color)',
+      },
+    },
+  },
+})

+ 56 - 2
vite.config.ts

@@ -2,6 +2,60 @@
  * @Author: wjc
  * @Date: 2024-05-27 10:17:11
  * @LastEditors: wjc
- * @LastEditTime: 2024-05-27 11:50:00
- * @Description: 
+ * @LastEditTime: 2024-05-29 15:56:51
+ * @Description:
  */
+import path from 'path'
+import { defineConfig, loadEnv } from 'vite'
+import UnoCSS from 'unocss/vite'
+import uni from '@dcloudio/vite-plugin-uni'
+import PurgeIcons from 'vite-plugin-purge-icons'
+import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
+import AutoImport from 'unplugin-auto-import/vite'
+
+const root = process.cwd()
+
+function pathResolve(dir: string) {
+  return path.resolve(root, '.', dir)
+}
+
+// https://vitejs.dev/config/
+export default defineConfig(({ mode }) => {
+  const env = loadEnv(mode, process.cwd(), '')
+
+  return {
+    resolve: {
+      alias: {
+        '@': path.resolve(__dirname, 'src'),
+      },
+    },
+    server: {
+      proxy: {
+        '/api': {
+          target: env.VITE_APP_BASE_API, // 对应自己的接口
+          changeOrigin: true,
+        },
+      },
+    },
+    plugins: [
+      uni(),
+      UnoCSS(),
+      createSvgIconsPlugin({
+        iconDirs: [pathResolve('src/static/icons')],
+        symbolId: 'icon-[dir]-[name]',
+        svgoOptions: true,
+      }),
+      AutoImport({
+        include: [
+          /\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
+          /\.vue$/,
+          /\.vue\?vue/, // .vue
+        ],
+        dirs: ['./src'],
+        imports: ['vue', 'uni-app'], // 限定范围为 vue, vue-router
+        dts: 'types/auto-import.d.ts', // 自动生成 'auto-import.d.ts'全局声明
+      }),
+      PurgeIcons(),
+    ],
+  }
+})

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů