diff --git a/App.vue b/App.vue
index db4ace3..eb008ae 100644
--- a/App.vue
+++ b/App.vue
@@ -6,8 +6,11 @@ export default {
onLaunch: function () {
console.log("App Launch");
- const res = uni.getSystemInfoSync();
- uni.setStorageSync("platform", res.platform);
+ uni.getSystemInfo({
+ success: (res) => {
+ uni.setStorageSync("platform", res.platform);
+ }
+ });
// #ifdef APP-PLUS
plus.navigator.closeSplashscreen(); // 立即关闭原生闪屏
diff --git a/api/kefu.js b/api/kefu.js
new file mode 100644
index 0000000..8ca3b93
--- /dev/null
+++ b/api/kefu.js
@@ -0,0 +1,27 @@
+import { KEFU_BASE_URL, Authorization } from '@/utils/config.js'
+import { getStorageFun, TOKEN_NAME } from '@/utils/auth.js'
+
+export function getUnreadCount(userId) {
+ const token = getStorageFun(TOKEN_NAME)
+ return new Promise((resolve, reject) => {
+ uni.request({
+ url: `${KEFU_BASE_URL}/kefu/user/unread-count`,
+ method: 'GET',
+ data: { userId },
+ header: {
+ Authorization,
+ 'HSM-AUTH': token || '',
+ 'content-type': 'application/json'
+ },
+ success: response => {
+ const body = response.data || {}
+ if (response.statusCode >= 200 && response.statusCode < 300 && body.bizcode === 100) {
+ resolve(Number(body.data || 0))
+ return
+ }
+ resolve(0)
+ },
+ fail: () => resolve(0)
+ })
+ })
+}
diff --git a/components/LuckyWheel.vue b/components/LuckyWheel.vue
deleted file mode 100644
index aaf1197..0000000
--- a/components/LuckyWheel.vue
+++ /dev/null
@@ -1,176 +0,0 @@
-
-
-
-
-
- {{ item.name }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/components/address.vue b/components/address.vue
index bbaccdb..4058999 100644
--- a/components/address.vue
+++ b/components/address.vue
@@ -15,7 +15,7 @@
-
暂时地址,快去地址管理添加吧~
diff --git a/components/choiceness/choiceness.vue b/components/choiceness/choiceness.vue
index 10ce871..9017ed7 100644
--- a/components/choiceness/choiceness.vue
+++ b/components/choiceness/choiceness.vue
@@ -8,7 +8,7 @@
-
+
{{ item.title }}
diff --git a/components/common/product-seckill-card.vue b/components/common/product-seckill-card.vue
index 462c047..12aa108 100644
--- a/components/common/product-seckill-card.vue
+++ b/components/common/product-seckill-card.vue
@@ -2,7 +2,7 @@
-
{{ countdownText }}
diff --git a/pages/rwa_package/component/qrcode-preview.vue b/components/qrcode-preview.vue
similarity index 100%
rename from pages/rwa_package/component/qrcode-preview.vue
rename to components/qrcode-preview.vue
diff --git a/components/shop/ping-item.vue b/components/shop/parity-product-item.vue
similarity index 91%
rename from components/shop/ping-item.vue
rename to components/shop/parity-product-item.vue
index 68465ac..25be627 100644
--- a/components/shop/ping-item.vue
+++ b/components/shop/parity-product-item.vue
@@ -1,5 +1,5 @@
-
+
@@ -24,7 +24,7 @@
diff --git a/pages/mine_package/mine_order/after-sales/refund-popu.vue b/pages/mine_package/mine_order/after-sales/refund-popup.vue
similarity index 100%
rename from pages/mine_package/mine_order/after-sales/refund-popu.vue
rename to pages/mine_package/mine_order/after-sales/refund-popup.vue
diff --git a/pages/mine_package/mine_order/mine_order.vue b/pages/mine_package/mine_order/mine_order.vue
index d2b47ca..41543c4 100644
--- a/pages/mine_package/mine_order/mine_order.vue
+++ b/pages/mine_package/mine_order/mine_order.vue
@@ -214,7 +214,7 @@
如遇退/换货等问题,请联系客服处理
-
+
在线客服
@@ -229,7 +229,7 @@
-
订单编号:
{{
@@ -154,7 +154,7 @@
`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${orderInfo.antChainHash}`
}}
-
import { ORDER_TYPE, ORDER_STATUS, getValue } from "@/utils/enumUtils.js";
-import QrcodePreview from "@/pages/rwa_package/component/qrcode-preview.vue";
+import QrcodePreview from "@/components/qrcode-preview.vue";
import {
copyData,
assembleAddress,
diff --git a/pages/mine_package/mine_purse/mine_purse.vue b/pages/mine_package/mine_purse/mine_purse.vue
index 1e06b1d..44f9f02 100644
--- a/pages/mine_package/mine_purse/mine_purse.vue
+++ b/pages/mine_package/mine_purse/mine_purse.vue
@@ -38,7 +38,7 @@
{{ item.lockAmount || 0 }}
{{ item.categoty === "raffle" ? "不可用次数" : "不可用余额" }}
-
@@ -79,7 +79,7 @@
-
@@ -196,7 +196,7 @@ export default {
// url: "/pages/mine_package/mine_purse_exchange/mine_purse_exchange?amount=" + row.curAmount + "&category=" + row.categoty,
// })
uni.navigateTo({
- url: "/pages/rwa_package/shop/fen-shop",
+ url: "/pages/rwa_package/shop/points-shop",
});
} else if (type === "transfer") {
console.log("transfer转出...");
@@ -209,7 +209,7 @@ export default {
}else if (type === "deduction") {
// 兑换
uni.navigateTo({
- url: "/pages/rwa_package/shop/fen-shop",
+ url: "/pages/rwa_package/shop/points-shop",
});
}
},
diff --git a/pages/mine_package/mine_purse_bonus_withdraw/mine_purse_bonus_withdraw.vue b/pages/mine_package/mine_purse_bonus_withdraw/mine_purse_bonus_withdraw.vue
index 93c505d..e9ccd78 100644
--- a/pages/mine_package/mine_purse_bonus_withdraw/mine_purse_bonus_withdraw.vue
+++ b/pages/mine_package/mine_purse_bonus_withdraw/mine_purse_bonus_withdraw.vue
@@ -66,7 +66,7 @@
-
-
diff --git a/pages/rwa_package/rwa/rwa.vue b/pages/rwa_package/rwa/rwa.vue
index 28fd259..69f2ff9 100644
--- a/pages/rwa_package/rwa/rwa.vue
+++ b/pages/rwa_package/rwa/rwa.vue
@@ -16,7 +16,7 @@
-
-
-
-
-
- {{ categotyObj.name || 'USDT' }}
- {{ categotyObj.curAmount || 0 }}
-
-
- 行权金额
-
- 当前可行权余额 {{ categotyObj.curAmount || 0 }} {{ categotyObj.name || 'USDT' }}
-
-
-
- 行权账户
-
- {{ accountName }}
- 请选择行权账户
-
-
-
-
- 交易密码《共享计划终止协议》
-
-
-
- 备注
-
-
-
-
- 提交
-
-
-
-
-
-
-
-
-
-
-
diff --git a/pages/rwa_package/rwa_withdrawal_log/rwa_withdrawal_log.vue b/pages/rwa_package/rwa_withdrawal_log/rwa_withdrawal_log.vue
index fc6b67d..67b91f9 100644
--- a/pages/rwa_package/rwa_withdrawal_log/rwa_withdrawal_log.vue
+++ b/pages/rwa_package/rwa_withdrawal_log/rwa_withdrawal_log.vue
@@ -13,7 +13,7 @@
-
+
{{ item.name }}-{{ item.account }}
{{
@@ -40,7 +40,7 @@
`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${item.antChainHash}`
}}
-
-
@@ -274,10 +273,10 @@ export default {
url = '/pages/rwa_package/accountSafe/accountSafe'
break;
case 1:
- url = '/pages/rwa_package/dongjian/index'
+ url = '/pages/rwa_package/insights/index'
break;
case 2:
- url = '/pages/rwa_package/zhaopian/zhaopian'
+ url = '/pages/rwa_package/store-photo/store-photo'
break;
case 3:
url = '/pages/mine_package/mine_user_agreement/mine_user_agreement'
diff --git a/pages/rwa_package/shop/fen-shop.vue b/pages/rwa_package/shop/points-shop.vue
similarity index 89%
rename from pages/rwa_package/shop/fen-shop.vue
rename to pages/rwa_package/shop/points-shop.vue
index 7a9e16d..d4ed15f 100644
--- a/pages/rwa_package/shop/fen-shop.vue
+++ b/pages/rwa_package/shop/points-shop.vue
@@ -26,12 +26,12 @@
-
+
-
+
@@ -50,11 +50,11 @@ import { getAcctBalance } from "@/api/finance.js";
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue";
-import PingItem from "@/components/shop/ping-item.vue";
+import ParityProductItem from "@/components/shop/parity-product-item.vue";
export default {
mixins: [MescrollMixin],
- components: { Header, TopSafe, MyBtn, PingItem, MescrollUni, },
+ components: { Header, TopSafe, MyBtn, ParityProductItem, MescrollUni, },
data() {
return {
dataList: [],
diff --git a/pages/rwa_package/shop/you-shop.vue b/pages/rwa_package/shop/preferred-shop.vue
similarity index 93%
rename from pages/rwa_package/shop/you-shop.vue
rename to pages/rwa_package/shop/preferred-shop.vue
index ff86af3..fb5705e 100644
--- a/pages/rwa_package/shop/you-shop.vue
+++ b/pages/rwa_package/shop/preferred-shop.vue
@@ -78,13 +78,13 @@
-
+ >
@@ -94,12 +94,12 @@
import shopHeader from "@/components/common/shopHeader.vue";
import TopSafe from "@/components/common/top-safe.nvue";
import MyBtn from "@/components/common/my-btn.vue";
-import YouItem from "@/components/shop/you-item.vue";
+import PreferredProductItem from "@/components/shop/preferred-product-item.vue";
import { searchList } from "@/api/product.js";
import { getCarouselImage } from "@/api/common.js";
export default {
- components: { shopHeader, TopSafe, MyBtn, YouItem },
+ components: { shopHeader, TopSafe, MyBtn, PreferredProductItem },
data() {
return {
dataList: [],
@@ -132,7 +132,7 @@ export default {
},
jumpSearch() {
uni.navigateTo({
- url: "/pages/rwa_package/dongjian/search",
+ url: "/pages/rwa_package/insights/search",
});
},
// 跳转到商品详情
diff --git a/pages/rwa_package/shop/sort-shop.vue b/pages/rwa_package/shop/sort-shop.vue
index ba2755a..f8f344c 100644
--- a/pages/rwa_package/shop/sort-shop.vue
+++ b/pages/rwa_package/shop/sort-shop.vue
@@ -10,7 +10,7 @@
-
+
暂无数据
@@ -27,9 +27,9 @@ import MyBtn from '@/components/common/my-btn.vue'
import { searchList } from '@/api/product.js';
import { getCascadeCategory } from '@/api/common.js';
-import PingItem from "@/components/shop/ping-item.vue";
+import ParityProductItem from "@/components/shop/parity-product-item.vue";
export default {
- components: { Header, TopSafe,MyBtn,PingItem },
+ components: { Header, TopSafe,MyBtn,ParityProductItem },
data() {
return {
dataList:[
diff --git a/static/common/kf_dh.png b/pages/rwa_package/static/kf_dh.png
similarity index 100%
rename from static/common/kf_dh.png
rename to pages/rwa_package/static/kf_dh.png
diff --git a/static/common/kf_wx.png b/pages/rwa_package/static/kf_wx.png
similarity index 100%
rename from static/common/kf_wx.png
rename to pages/rwa_package/static/kf_wx.png
diff --git a/static/rwa/account.png b/pages/rwa_package/static/rwa/account.png
similarity index 100%
rename from static/rwa/account.png
rename to pages/rwa_package/static/rwa/account.png
diff --git a/static/rwa/add.png b/pages/rwa_package/static/rwa/add.png
similarity index 100%
rename from static/rwa/add.png
rename to pages/rwa_package/static/rwa/add.png
diff --git a/static/rwa/copy.png b/pages/rwa_package/static/rwa/copy.png
similarity index 100%
rename from static/rwa/copy.png
rename to pages/rwa_package/static/rwa/copy.png
diff --git a/static/rwa/jl.png b/pages/rwa_package/static/rwa/jl.png
similarity index 100%
rename from static/rwa/jl.png
rename to pages/rwa_package/static/rwa/jl.png
diff --git a/static/rwa/tx.png b/pages/rwa_package/static/rwa/tx.png
similarity index 100%
rename from static/rwa/tx.png
rename to pages/rwa_package/static/rwa/tx.png
diff --git a/static/common/setting.png b/pages/rwa_package/static/setting.png
similarity index 100%
rename from static/common/setting.png
rename to pages/rwa_package/static/setting.png
diff --git a/static/common/tips.png b/pages/rwa_package/static/tips.png
similarity index 100%
rename from static/common/tips.png
rename to pages/rwa_package/static/tips.png
diff --git a/static/common/waybill.png b/pages/rwa_package/static/waybill.png
similarity index 100%
rename from static/common/waybill.png
rename to pages/rwa_package/static/waybill.png
diff --git a/pages/rwa_package/zhaopian/zhaopian.vue b/pages/rwa_package/store-photo/store-photo.vue
similarity index 96%
rename from pages/rwa_package/zhaopian/zhaopian.vue
rename to pages/rwa_package/store-photo/store-photo.vue
index 9fae62d..e3fbe38 100644
--- a/pages/rwa_package/zhaopian/zhaopian.vue
+++ b/pages/rwa_package/store-photo/store-photo.vue
@@ -48,7 +48,7 @@ export default {
},
onJump(index){
uni.navigateTo({
- url:`/pages/rwa_package/zhao/zhao?type=${index}`
+ url:`/pages/rwa_package/business-license/business-license?type=${index}`
})
}
}
diff --git a/pages/shopping_cart/shopping_cart.vue b/pages/shopping_cart/shopping_cart.vue
index fb348cc..8ec6a16 100644
--- a/pages/shopping_cart/shopping_cart.vue
+++ b/pages/shopping_cart/shopping_cart.vue
@@ -37,7 +37,7 @@
@change="(event) => productChange(event, index, pIndex)">
-
{{ pItem.name }}
diff --git a/pages/sort/sort.vue b/pages/sort/sort.vue
index 43cff95..870b1f5 100644
--- a/pages/sort/sort.vue
+++ b/pages/sort/sort.vue
@@ -45,9 +45,9 @@
{{ item.name }}
-
+
@@ -154,7 +154,7 @@ export default {
},
jumpSearch(item) {
uni.navigateTo({
- url: "/pages/rwa_package/dongjian/search",
+ url: "/pages/rwa_package/insights/search",
});
},
jumpInfo(item) {
diff --git a/pages/supply_chain/supply_chain.vue b/pages/supply_chain/supply_chain.vue
index fdb3f12..d42123c 100644
--- a/pages/supply_chain/supply_chain.vue
+++ b/pages/supply_chain/supply_chain.vue
@@ -26,11 +26,11 @@
-
-
@@ -48,7 +48,7 @@
import Header from "@/components/common/header.vue";
import TopSafe from "@/components/common/top-safe.nvue";
import MyBtn from "@/components/common/my-btn.vue";
-import PingItem from "@/components/shop/ping-item.vue";
+import ParityProductItem from "@/components/shop/parity-product-item.vue";
import { searchList, getGoodsTags } from "@/api/product.js";
import CustomTabBar from "@/components/custom-tab-bar.vue";
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
@@ -56,7 +56,7 @@ import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue";
export default {
mixins: [MescrollMixin],
- components: { Header, TopSafe, MyBtn, PingItem, CustomTabBar, MescrollUni },
+ components: { Header, TopSafe, MyBtn, ParityProductItem, CustomTabBar, MescrollUni },
computed: {
isApp() {
// #ifdef APP-PLUS
@@ -258,7 +258,7 @@ export default {
onJumpSearch() {
uni.navigateTo({
- url: "/pages/rwa_package/dongjian/search",
+ url: "/pages/rwa_package/insights/search",
});
},
onJumpShop(id) {
@@ -397,7 +397,7 @@ export default {
.fall-col {
width: 332rpx;
- /* 与 PingItem 宽度一致 */
+ /* 与 ParityProductItem 宽度一致 */
height: 100%;
}
}
diff --git a/static/common/address3.png b/static/common/address3.png
deleted file mode 100644
index e34a03a..0000000
Binary files a/static/common/address3.png and /dev/null differ
diff --git a/static/common/buttom.png b/static/common/buttom.png
deleted file mode 100644
index 8efbb4f..0000000
Binary files a/static/common/buttom.png and /dev/null differ
diff --git a/static/common/buttom_x.png b/static/common/buttom_x.png
deleted file mode 100644
index 7cb6750..0000000
Binary files a/static/common/buttom_x.png and /dev/null differ
diff --git a/static/common/down.png b/static/common/down.png
deleted file mode 100644
index f4334e2..0000000
Binary files a/static/common/down.png and /dev/null differ
diff --git a/static/common/note.png b/static/common/note.png
deleted file mode 100644
index 169630b..0000000
Binary files a/static/common/note.png and /dev/null differ
diff --git a/static/common/right_b.png b/static/common/right_b.png
deleted file mode 100644
index 7db666d..0000000
Binary files a/static/common/right_b.png and /dev/null differ
diff --git a/static/common/right_l.png b/static/common/right_l.png
deleted file mode 100644
index fa9cf5f..0000000
Binary files a/static/common/right_l.png and /dev/null differ
diff --git a/static/common/right_y_st2.png b/static/common/right_y_st2.png
deleted file mode 100644
index e131e34..0000000
Binary files a/static/common/right_y_st2.png and /dev/null differ
diff --git a/static/common/right_y_st3.png b/static/common/right_y_st3.png
deleted file mode 100644
index 690dc0c..0000000
Binary files a/static/common/right_y_st3.png and /dev/null differ
diff --git a/static/common/right_y_st4.png b/static/common/right_y_st4.png
deleted file mode 100644
index 856f070..0000000
Binary files a/static/common/right_y_st4.png and /dev/null differ
diff --git a/static/common/tips_b.png b/static/common/tips_b.png
deleted file mode 100644
index 6bfeb8e..0000000
Binary files a/static/common/tips_b.png and /dev/null differ
diff --git a/static/invite/save.png b/static/invite/save.png
deleted file mode 100644
index 65af894..0000000
Binary files a/static/invite/save.png and /dev/null differ
diff --git a/static/shopping/tp.png b/static/shopping/tp.png
deleted file mode 100644
index aafea78..0000000
Binary files a/static/shopping/tp.png and /dev/null differ
diff --git a/uni_modules/no-data/changelog.md b/uni_modules/no-data/changelog.md
deleted file mode 100644
index e69de29..0000000
diff --git a/uni_modules/no-data/components/no-data/i18n/en.json b/uni_modules/no-data/components/no-data/i18n/en.json
deleted file mode 100644
index 88b1f68..0000000
--- a/uni_modules/no-data/components/no-data/i18n/en.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "no-data.title": "No Data"
-}
diff --git a/uni_modules/no-data/components/no-data/i18n/index.js b/uni_modules/no-data/components/no-data/i18n/index.js
deleted file mode 100644
index 7836c90..0000000
--- a/uni_modules/no-data/components/no-data/i18n/index.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import en from './en.json'
-import zhHans from './zh-Hans.json'
-import zhHant from './zh-Hant.json'
-import ja from './ja.json'
-export default {
- en,
- 'zh-Hans': zhHans,
- 'zh-Hant': zhHant,
- ja
-}
diff --git a/uni_modules/no-data/components/no-data/i18n/ja.json b/uni_modules/no-data/components/no-data/i18n/ja.json
deleted file mode 100644
index 6d5c876..0000000
--- a/uni_modules/no-data/components/no-data/i18n/ja.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "no-data.title": "データなし"
-}
diff --git a/uni_modules/no-data/components/no-data/i18n/zh-Hans.json b/uni_modules/no-data/components/no-data/i18n/zh-Hans.json
deleted file mode 100644
index cd6011c..0000000
--- a/uni_modules/no-data/components/no-data/i18n/zh-Hans.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "no-data.title": "无数据"
-}
diff --git a/uni_modules/no-data/components/no-data/i18n/zh-Hant.json b/uni_modules/no-data/components/no-data/i18n/zh-Hant.json
deleted file mode 100644
index e50f3ff..0000000
--- a/uni_modules/no-data/components/no-data/i18n/zh-Hant.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "no-data.title": "無數據"
-}
diff --git a/uni_modules/no-data/components/no-data/no-data.vue b/uni_modules/no-data/components/no-data/no-data.vue
deleted file mode 100644
index c1c943a..0000000
--- a/uni_modules/no-data/components/no-data/no-data.vue
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
- {{title}}
-
-
-
-
-
diff --git a/uni_modules/no-data/package.json b/uni_modules/no-data/package.json
deleted file mode 100644
index 2237b9b..0000000
--- a/uni_modules/no-data/package.json
+++ /dev/null
@@ -1,97 +0,0 @@
-{
- "id": "no-data",
- "displayName": "no-data",
- "version": "1.0.0",
- "description": "no-data",
- "keywords": [
- "no-data"
- ],
- "repository": "",
- "engines": {
- "HBuilderX": "^3.1.0",
- "uni-app": "^3.1.0",
- "uni-app-x": "^3.1.0"
- },
- "dcloudext": {
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "",
- "data": "",
- "permissions": ""
- },
- "npmurl": "",
- "type": "component-vue",
- "darkmode": "-",
- "i18n": "-",
- "widescreen": "-"
- },
- "uni_modules": {
- "dependencies": [],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "-",
- "aliyun": "-"
- },
- "client": {
- "uni-app": {
- "vue": {
- "vue2": "-",
- "vue3": "-"
- },
- "web": {
- "safari": "-",
- "chrome": "-"
- },
- "app": {
- "vue": "-",
- "nvue": "-",
- "android": "-",
- "ios": "-",
- "harmony": "-"
- },
- "mp": {
- "weixin": "-",
- "alipay": "-",
- "toutiao": "-",
- "baidu": "-",
- "kuaishou": "-",
- "jd": "-",
- "harmony": "-",
- "qq": "-",
- "lark": "-",
- "xhs": "-"
- },
- "quickapp": {
- "huawei": "-",
- "union": "-"
- }
- },
- "uni-app-x": {
- "web": {
- "safari": "-",
- "chrome": "-"
- },
- "app": {
- "android": "-",
- "ios": "-",
- "harmony": "-"
- },
- "mp": {
- "weixin": "-"
- }
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/uni_modules/no-data/readme.md b/uni_modules/no-data/readme.md
deleted file mode 100644
index f6364f2..0000000
--- a/uni_modules/no-data/readme.md
+++ /dev/null
@@ -1 +0,0 @@
-# no-data
\ No newline at end of file
diff --git a/utils/enumUtils.js b/utils/enumUtils.js
index 4b7513a..e0041b2 100644
--- a/utils/enumUtils.js
+++ b/utils/enumUtils.js
@@ -167,13 +167,13 @@ export const WAY_LIST = [
disabled: false,
id: PAYMENT_WAY.WECHAT,
name: "微信支付",
- path: "/static/product/way_wx.png",
+ path: "/pages/other_package/static/product/way_wx.png",
},
{
disabled: false,
id: PAYMENT_WAY.ALIPAY,
name: "支付宝支付",
- path: "/static/product/way_zfb.png",
+ path: "/pages/other_package/static/product/way_zfb.png",
},
]
diff --git a/utils/request.js b/utils/request.js
index 7af91df..22c812d 100644
--- a/utils/request.js
+++ b/utils/request.js
@@ -4,6 +4,27 @@ import { BASE_URL, Authorization } from "@/utils/config.js";
// utils/http.js (修改后的版本)
// const baseUrl = 'http://192.168.0.108:8087';
+let requestCount = 0;
+
+function showLoading() {
+ if (requestCount === 0) {
+ uni.showLoading({
+ title: "加载中...",
+ mask: false
+ });
+ }
+ requestCount++;
+}
+
+function hideLoading() {
+ if (requestCount > 0) {
+ requestCount--;
+ }
+ if (requestCount === 0) {
+ uni.hideLoading();
+ }
+}
+
function request(options) {
const {
url,
@@ -13,11 +34,10 @@ function request(options) {
isShowLoading = true,
} = options;
- // const token = uni.getStorageSync(tokenKey); // 获取token, 根据实际情况调整获取方式
- const token = getStorageFun(TOKEN_NAME); // 获取token, 根据实际情况调整获取方式
+ const token = getStorageFun(TOKEN_NAME);
let defaultHeaders = {
Authorization: Authorization,
- "HSM-AUTH": token ? token : "", // 如果存在token, 则添加到请求头中
+ "HSM-AUTH": token ? token : "",
"content-type": ["post", "POST"].includes(method)
? "application/x-www-form-urlencoded"
: "application/json",
@@ -30,13 +50,7 @@ function request(options) {
}
return new Promise((resolve, reject) => {
if (isShowLoading) {
- // 请求之前做一些事
- uni.showToast({
- title: "加载中...",
- image: "https://static.tbmall.xin/static/loading.gif",
- // image: "/static/common/loading.gif", // 本地图片路径
- position: "middle", // 可选:top/middle/bottom
- });
+ showLoading();
}
uni.request({
url: BASE_URL + url,
@@ -44,12 +58,11 @@ function request(options) {
data,
header: {
...defaultHeaders,
- ...headers, // 使用展开运算符合并默认头和自定义头
+ ...headers,
},
success: (res) => {
if (isShowLoading) {
- // 请求之前做一些事
- uni.hideToast();
+ hideLoading();
}
let data = res.data;
@@ -114,8 +127,7 @@ function request(options) {
fail: (error) => {
console.log("错误-2", url);
if (isShowLoading) {
- // 请求之前做一些事
- uni.hideToast();
+ hideLoading();
}
uni.showToast({
title: "服务器异常,稍后再试",
diff --git a/vite.config.js b/vite.config.js
index 881c9fa..f7f604a 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -3,6 +3,17 @@ import uni from '@dcloudio/vite-plugin-uni';
export default defineConfig({
plugins: [uni()],
+ build: {
+ minify: 'terser',
+ terserOptions: {
+ compress: {
+ drop_console: process.env.NODE_ENV === 'production',
+ drop_debugger: process.env.NODE_ENV === 'production',
+ },
+ },
+ assetsInlineLimit: 4096,
+ cssCodeSplit: true,
+ },
server: {
port: 5173,
proxy: {