From 4a97ec60fa4a5654cc81d193230a7c9699d40712 Mon Sep 17 00:00:00 2001 From: Wayne Date: Mon, 16 Oct 2023 09:50:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=82=BAvite=E5=BB=BA?= =?UTF-8?q?=E6=A7=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 13 + .env.production | 12 +- .env.stage | 12 +- .env.u168 | 12 +- .gitignore | 25 +- .vscode/extensions.json | 3 + README.md | 20 +- bun.lockb | Bin 0 -> 178446 bytes index.html | 39 + package.json | 54 +- src/App.vue | 47 +- src/api/ajax.js | 2 +- src/components/Footer.vue | 26 +- src/main.js | 4 +- src/plugins/vant.js | 2 +- src/registerServiceWorker.js | 4 +- src/router/index.js | 26 +- src/utils/card/card0.js | 2 +- src/utils/card1.js | 2 +- src/utils/liff.js | 2 +- src/views/Auth/Auth.vue | 10 +- src/views/Auth/Edit.vue | 32 +- src/views/Card/Edit.vue | 34 +- src/views/Card/Notice.vue | 2 +- src/views/Home/index.vue | 37 +- src/views/Login/index.vue | 8 +- src/views/Member/index.vue | 20 +- src/views/Register/index.vue | 23 +- src/views/Send/index.vue | 10 +- src/views/Shop/index.vue | 6 +- vite.config.js | 29 + yarn.lock | 11093 ++++++--------------------------- 32 files changed, 2037 insertions(+), 9574 deletions(-) create mode 100644 .env.development create mode 100644 .vscode/extensions.json create mode 100755 bun.lockb create mode 100644 index.html create mode 100644 vite.config.js diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..7144117 --- /dev/null +++ b/.env.development @@ -0,0 +1,13 @@ +NODE_ENV = development + +VITE_ENV = development + +VITE_APP_BASE_URL = https://utel.zltest.com.tw + +VITE_APP_LINE_LIFF_ID = 1656907652-p38ddKzQ + +VITE_APP_SEND_URL = https://liff.line.me/1656907652-VJq33Pdg + +VITE_APP_API_URL = https://utel.zltest.com.tw/appapi/v1 + +VITE_APP_IMAGE_URL = https://utel.vip/storage \ No newline at end of file diff --git a/.env.production b/.env.production index e4b0f4e..7eebcf7 100644 --- a/.env.production +++ b/.env.production @@ -1,13 +1,13 @@ NODE_ENV = production -VUE_ENV = production +VITE_ENV = production -VUE_APP_BASE_URL = https://utel.vip +VITE_APP_BASE_URL = https://utel.vip -VUE_APP_LINE_LIFF_ID = 1656969446-nQYlz77R +VITE_APP_LINE_LIFF_ID = 1656969446-nQYlz77R -VUE_APP_SEND_URL = https://liff.line.me/1656969446-mg36Maav +VITE_APP_SEND_URL = https://liff.line.me/1656969446-mg36Maav -VUE_APP_API_URL = https://utel.vip/appapi/v1 +VITE_APP_API_URL = https://utel.vip/appapi/v1 -VUE_APP_IMAGE_URL = https://utel.vip/storage \ No newline at end of file +VITE_APP_IMAGE_URL = https://utel.vip/storage \ No newline at end of file diff --git a/.env.stage b/.env.stage index 1b6c14b..97ff37b 100644 --- a/.env.stage +++ b/.env.stage @@ -1,13 +1,13 @@ NODE_ENV = production -VUE_ENV = stage +VITE_ENV = stage -VUE_APP_BASE_URL = https://utel.zltest.com.tw +VITE_APP_BASE_URL = https://utel.zltest.com.tw -VUE_APP_LINE_LIFF_ID = 1656948609-xMp7dWAz +VITE_APP_LINE_LIFF_ID = 1656948609-xMp7dWAz -VUE_APP_SEND_URL = https://liff.line.me/1656948609-BYr8Nynp +VITE_APP_SEND_URL = https://liff.line.me/1656948609-BYr8Nynp -VUE_APP_API_URL = https://utel.zltest.com.tw/appapi/v1 +VITE_APP_API_URL = https://utel.zltest.com.tw/appapi/v1 -VUE_APP_IMAGE_URL = https://utel.zltest.com.tw/storage \ No newline at end of file +VITE_APP_IMAGE_URL = https://utel.zltest.com.tw/storage \ No newline at end of file diff --git a/.env.u168 b/.env.u168 index db9490f..b8cc5c2 100644 --- a/.env.u168 +++ b/.env.u168 @@ -1,11 +1,11 @@ -NODE_ENV = production +NODEproduction_ENV = production -VUE_ENV = production +VITE_ENV = production -VUE_APP_LINE_LIFF_ID = 1657184427-8bq9debn +VITE_APP_LINE_LIFF_ID = 1657184427-8bq9debn -VUE_APP_SEND_URL = https://liff.line.me/1657184427-9GayRMQl +VITE_APP_SEND_URL = https://liff.line.me/1657184427-9GayRMQl -VUE_APP_API_URL = https://card.u168.vip/appapi/v1 +VITE_APP_API_URL = https://card.u168.vip/appapi/v1 -VUE_APP_IMAGE_URL = https://card.u168.vip/storage \ No newline at end of file +VITE_APP_IMAGE_URL = https://card.u168.vip/storage \ No newline at end of file diff --git a/.gitignore b/.gitignore index 6c17418..a547bf3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,25 +1,24 @@ -.DS_Store -node_modules -/dist - - -# local env files -.env.local -.env.*.local - -# Log files +# Logs +logs +*.log npm-debug.log* yarn-debug.log* yarn-error.log* pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local # Editor directories and files +.vscode/* +!.vscode/extensions.json .idea -.vscode +.DS_Store *.suo *.ntvs* *.njsproj *.sln *.sw? - -.env.development diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..c0a6e5a --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"] +} diff --git a/README.md b/README.md index 48e47fc..e62e093 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,7 @@ -# ecard2 +# Vue 3 + Vite -## Project setup -``` -npm install -``` +This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 ` + + + + + diff --git a/package.json b/package.json index 72fbbf9..66d72d5 100644 --- a/package.json +++ b/package.json @@ -1,48 +1,40 @@ { - "name": "utel", - "version": "0.1.0", + "name": "utel_h5_vite", "private": true, + "version": "0.0.0", + "type": "module", "scripts": { - "serve": "vue-cli-service serve", - "build": "vue-cli-service build", - "build:u168": "vue-cli-service build --mode u168", - "build:dev": "vue-cli-service build --mode development", - "build:slash": "vue-cli-service build --mode slash", - "build:sta": "vue-cli-service build --mode stage", - "build:h888": "vue-cli-service build --mode h888" + "dev": "vite", + "build": "vite build", + "preview": "vite preview" }, "dependencies": { "@line/liff": "^2.22.4", "@soerenmartius/vue3-clipboard": "^0.1.2", - "axios": "^1.3.3", - "colorthief": "^2.3.2", - "core-js": "^3.6.5", + "axios": "^1.5.1", + "colorthief": "^2.4.0", "ismobilejs": "^1.1.1", - "js-cookie": "^3.0.1", + "js-cookie": "^3.0.5", "lodash": "^4.17.21", - "moment": "^2.29.1", + "moment": "^2.29.4", "nprogress": "^0.2.0", "pwacompat": "^2.0.17", - "qrcode.vue": "^3.3.3", - "register-service-worker": "^1.7.1", + "qrcode.vue": "^3.4.1", + "register-service-worker": "^1.7.2", "secure-ls": "^1.2.6", - "vant": "^3.4.5", - "vue": "3.2.41", - "vue-advanced-cropper": "^2.8.1", - "vue-cropper": "^1.0.3", - "vue-router": "^4.0.0-0", - "vuex": "^4.0.0-0", + "vant": "^4.7.1", + "vue": "^3.3.4", + "vue-advanced-cropper": "^2.8.8", + "vue-cropper": "^0.6.4", + "vue-router": "^4.2.5", + "vuex": "^4.1.0", "vuex-persistedstate": "^4.1.0" }, "devDependencies": { - "@vue/cli-plugin-babel": "~4.5.15", - "@vue/cli-plugin-pwa": "~4.5.15", - "@vue/cli-plugin-router": "~4.5.15", - "@vue/cli-plugin-vuex": "~4.5.15", - "@vue/cli-service": "~4.5.15", - "@vue/compiler-sfc": "3.2.41", - "babel-plugin-import": "^1.13.3", - "less": "^3.0.4", - "less-loader": "^5.0.0" + "@vant/auto-import-resolver": "^1.0.1", + "@vitejs/plugin-vue": "^4.2.3", + "less": "^4.2.0", + "unplugin-vue-components": "^0.25.2", + "vite": "^4.4.5" } } diff --git a/src/App.vue b/src/App.vue index 120e842..4748753 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,25 +1,26 @@ - - - + + + + \ No newline at end of file diff --git a/src/api/ajax.js b/src/api/ajax.js index 738664f..9cb16c2 100644 --- a/src/api/ajax.js +++ b/src/api/ajax.js @@ -2,7 +2,7 @@ import axios from 'axios' import store from '../store' const instance = axios.create({ - baseURL: process.env.VUE_APP_API_URL, + baseURL: import.meta.env.VITE_APP_API_URL, timeout: 5000, withCredentials: true }) diff --git a/src/components/Footer.vue b/src/components/Footer.vue index 082d098..8933f3a 100644 --- a/src/components/Footer.vue +++ b/src/components/Footer.vue @@ -37,7 +37,7 @@