From ee473854f9f7dd4b7ec906bfa097ebc7bcfa467d Mon Sep 17 00:00:00 2001 From: appleyou Date: Wed, 16 Apr 2025 18:00:45 +0800 Subject: [PATCH] feat(global): fix error when build with app-plus --- App.vue | 6 +- components/cartBall.vue | 9 +- config/auth.js | 23 +- config/request.js | 16 +- index.html | 8 +- main.js | 16 +- mixins/deviceSafeArea.js | 19 + package-lock.json | 11 +- package.json | 5 +- pages.json | 10 +- pages/index/index.vue | 121 +-- pages/login/index.vue | 12 +- pages/pay/index.vue | 736 ++++++++---------- pages/shoppingCar/index.vue | 2 +- pages/specialArea/list.vue | 4 +- static/cdn/echarts.min.js | 127 --- static/styles/index.css | 6 + store/modules/user.js | 1 + .../uview-ui/components/u-parse/u-parse.vue | 2 +- 19 files changed, 449 insertions(+), 685 deletions(-) create mode 100644 mixins/deviceSafeArea.js delete mode 100644 static/cdn/echarts.min.js create mode 100644 static/styles/index.css diff --git a/App.vue b/App.vue index 28f6b40..683836b 100644 --- a/App.vue +++ b/App.vue @@ -7,9 +7,7 @@ --> --> - +
- + diff --git a/main.js b/main.js index 5eabe91..f7193fe 100644 --- a/main.js +++ b/main.js @@ -17,12 +17,12 @@ import Vue from 'vue' import uview from '@/uni_modules/uview-ui' import store from '@/store/index.js' import Vue2OrgTree from 'vue-tree-color' -import * as echarts from 'echarts'; +import * as echarts from 'echarts'; Vue.prototype.$echarts = echarts; +import 'static/styles/index.css' Vue.use(Vue2OrgTree) -import axios from 'axios'; -import { saveAs } from 'file-saver'; -window.wx = {} +// import { saveAs } from 'file-saver'; +// window.wx = {} /*底部数据*/ @@ -37,7 +37,7 @@ const app = new Vue({ Vue.config.ignoredElements = [...Vue.config.ignoredElements, 'wx-open-launch-weapp'] -// 复制 +// // 复制 import VueClipboard from 'vue-clipboard2' Vue.use(VueClipboard) @@ -50,14 +50,14 @@ Vue.filter('numberToCurrency', numberToCurrencyNo) Vue.filter('toThousandthAndKeepDecimal', toThousandthAndKeepDecimal) // 配置全局过滤器,实现数字千分位格式 Vue.filter('isLocal', isLocal) -import i18n from '@/util/i18n/index' -Vue.prototype._i18n = i18n +// import i18n from '@/util/i18n/index' +// Vue.prototype._i18n = i18n // #ifdef VUE3 import { createSSRApp } from 'vue' export function createApp() { const app = createSSRApp(App) - app.use(i18n) + // app.use(i18n) return { app, store diff --git a/mixins/deviceSafeArea.js b/mixins/deviceSafeArea.js new file mode 100644 index 0000000..1e781a7 --- /dev/null +++ b/mixins/deviceSafeArea.js @@ -0,0 +1,19 @@ +export default { + data() { + return { + safeAreaTop: 0, + safeAreaBottom: 0, + safeAreaLeft: 0, + safeAreaRight: 0 + } + }, + onLoad() { + // #ifdef APP-PLUS + const {top, bottom, left, right} = uni.getSystemInfoSync().safeAreaInsets + this.safeAreaTop = top + this.safeAreaBottom = bottom + this.safeAreaLeft = left + this.safeAreaRight = right + // #endif + } +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index d368753..67b19b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,8 +15,9 @@ "glob": "^11.0.1", "html2canvas": "^1.4.1", "js-cookie": "^3.0.5", - "qrcodejs2": "0.0.2", + "qrcodejs2": "^0.0.2", "swiper": "^3.4.2", + "uqrcodejs": "^4.0.7", "vue-clipboard2": "^0.3.3", "vue-i18n": "^9.2.2", "vue-tree-color": "^2.3.2", @@ -3915,7 +3916,7 @@ }, "node_modules/qrcodejs2": { "version": "0.0.2", - "resolved": "https://registry.npmmirror.com/qrcodejs2/-/qrcodejs2-0.0.2.tgz", + "resolved": "https://registry.npmjs.org/qrcodejs2/-/qrcodejs2-0.0.2.tgz", "integrity": "sha512-+Y4HA+cb6qUzdgvI3KML8GYpMFwB24dFwzMkS/yXq6hwtUGNUnZQdUnksrV1XGMc2mid5ROw5SAuY9XhI3ValA==", "license": "MIT" }, @@ -5101,6 +5102,12 @@ "yarn": "*" } }, + "node_modules/uqrcodejs": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/uqrcodejs/-/uqrcodejs-4.0.7.tgz", + "integrity": "sha512-84+aZmD2godCVI+93lxE3YUAPNY8zAJvNA7xRS7R7U+q57KzMDepBSfNCwoRUhWOfR6eHFoAOcHRPwsP6ka1cA==", + "license": "Apache-2.0" + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://mirrors.cloud.tencent.com/npm/uri-js/-/uri-js-4.4.1.tgz", diff --git a/package.json b/package.json index 2783b95..d4286ef 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,9 @@ "glob": "^11.0.1", "html2canvas": "^1.4.1", "js-cookie": "^3.0.5", - "qrcodejs2": "0.0.2", + "qrcodejs2": "^0.0.2", "swiper": "^3.4.2", + "uqrcodejs": "^4.0.7", "vue-clipboard2": "^0.3.3", "vue-i18n": "^9.2.2", "vue-tree-color": "^2.3.2", @@ -56,4 +57,4 @@ } } } -} \ No newline at end of file +} diff --git a/pages.json b/pages.json index f807721..11687b2 100644 --- a/pages.json +++ b/pages.json @@ -5,7 +5,6 @@ "style": { "navigationBarTitleText": "首页", "navigationBarBackgroundColor": "#fff", - // "enablePullDownRefresh": true, "navigationBarHidden": true, "navigationStyle": "custom" } @@ -174,13 +173,6 @@ "navigationBarBackgroundColor": "#fff" } }, - { - "path": "pages/email/index", - "style": { - "navigationBarTitleText": "公告列表", - "navigationBarBackgroundColor": "#fff" - } - }, { "path": "pages/shoppingCar/index", "style": { @@ -228,7 +220,7 @@ "style": { "navigationBarTitleText": "会员专区", "app-plus": { - "titleNView": false + "titleNView": true } } }, diff --git a/pages/index/index.vue b/pages/index/index.vue index 3b31ead..3025d94 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -5,40 +5,33 @@ * @Date: 2022-11-21 15:11:22 -->