ZaiZai 9 mesiacov pred
rodič
commit
db9dd86aec
7 zmenil súbory, kde vykonal 52 pridanie a 88 odobranie
  1. 12 12
      js_sdk/uni.promisify.adaptor.js
  2. 16 7
      package.json
  3. 11 15
      pages.json
  4. 4 47
      pages/index/index.vue
  5. BIN
      static/logo.png
  6. 5 5
      uno.config.js
  7. 4 2
      vite.config.js

+ 12 - 12
js_sdk/uni.promisify.adaptor.js

@@ -1,13 +1,13 @@
 uni.addInterceptor({
-  returnValue (res) {
-    if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) {
-      return res;
-    }
-    return new Promise((resolve, reject) => {
-      res.then((res) => {
-        if (!res) return resolve(res) 
-        return res[0] ? reject(res[0]) : resolve(res[1])
-      });
-    });
-  },
-});
+    returnValue(res) {
+        if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) {
+            return res;
+        }
+        return new Promise((resolve, reject) => {
+            res.then((res) => {
+                if (!res) return resolve(res)
+                return res[0] ? reject(res[0]) : resolve(res[1])
+            });
+        });
+    },
+});

+ 16 - 7
package.json

@@ -1,17 +1,26 @@
 {
     "dependencies": {
         "dayjs": "^1.11.10",
-        "js-fast-way": "^0.3.8",
+        "js-base64": "^3.7.6",
+        "js-fast-way": "^0.4.0",
+        "js-md5": "^0.8.3",
         "pinia": "^2.1.7",
         "uni-ajax": "^2.5.1",
-        "vue": "^3.3.11"
+        "vue": "^3.4.15"
     },
     "devDependencies": {
-        "@iconify-json/ri": "^1.1.12",
-        "@iconify-json/solar": "^1.1.2",
-        "unocss": "^0.58.0",
-        "unocss-preset-extra": "^0.5.2",
-        "unocss-preset-weapp": "^0.58.0"
+        "@iconify-json/fluent": "^1.1.46",
+        "@iconify-json/ic": "^1.1.17",
+        "@iconify-json/icon-park-outline": "^1.1.15",
+        "@iconify-json/iconoir": "^1.1.39",
+        "@iconify-json/material-symbols": "^1.1.70",
+        "@iconify-json/mdi": "^1.1.64",
+        "@iconify-json/ooui": "^1.1.33",
+        "@iconify-json/ri": "^1.1.19",
+        "@iconify-json/solar": "^1.1.9",
+        "unocss": "^0.58.3",
+        "unocss-preset-extra": "^0.5.3",
+        "unocss-preset-weapp": "^0.58.1"
     },
     "license": "MIT"
 }

+ 11 - 15
pages.json

@@ -1,17 +1,13 @@
 {
-	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
-		{
-			"path": "pages/index/index",
-			"style": {
-				"navigationBarTitleText": "uni-app"
-			}
-		}
-	],
-	"globalStyle": {
-		"navigationBarTextStyle": "black",
-		"navigationBarTitleText": "uni-app",
-		"navigationBarBackgroundColor": "#F8F8F8",
-		"backgroundColor": "#F8F8F8"
-	},
-	"uniIdRouter": {}
+    "pages": [
+        { "path": "pages/index/index" }
+    ],
+    "globalStyle": {
+        "navigationStyle": "custom",
+        "navigationBarTextStyle": "black",
+        "navigationBarTitleText": "芯片扫描",
+        "navigationBarBackgroundColor": "#FFFFFF",
+        "backgroundColor": "#EFEFF4"
+    },
+    "uniIdRouter": {}
 }

+ 4 - 47
pages/index/index.vue

@@ -1,52 +1,9 @@
 <template>
-	<view class="content">
-		<image class="logo" src="/static/logo.png"></image>
-		<view class="text-area">
-			<text class="title">{{title}}</text>
-		</view>
-	</view>
+    <view class="content">
+        111
+    </view>
 </template>
 
-<script>
-	export default {
-		data() {
-			return {
-				title: 'Hello'
-			}
-		},
-		onLoad() {
+<script setup>
 
-		},
-		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>

BIN
static/logo.png


+ 5 - 5
uno.config.js

@@ -5,11 +5,11 @@ import {transformerAttributify, transformerClass} from 'unocss-preset-weapp/tran
 
 export default defineConfig({
     shortcuts: {
-        'zu-flex': 'relative flex items-center',
-        'zu-flex-center': 'zu-flex justify-center',
-        'zu-flex-end': 'zu-flex justify-end',
-        'zu-p': 'px-3 py-2',
-        'zu-tr': 'absolute top-0 right-0',
+        'hc-flex': 'relative flex items-center',
+        'hc-flex-center': 'hc-flex justify-center',
+        'hc-flex-end': 'hc-flex justify-end',
+        'hc-p': 'px-3 py-2',
+        'hc-tr': 'absolute top-0 right-0',
     },
     presets: [
         presetUno(),

+ 4 - 2
vite.config.js

@@ -20,9 +20,11 @@ export default defineConfig({
             '/api': {
                 ws: true,
                 changeOrigin: true,
-                target: website.api,
+                target: () => {
+                    return process.env.NODE_ENV === 'development' ? website.testApi : website.baseApi
+                },
                 rewrite: (path) => path.replace(new RegExp('^/api'), '/'),
             }
         }
     },
-})
+})