From 2bdb8682e1dff5b47e3ad96254086a9f56129996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=E4=B9=A0=E5=BE=88=E5=B7=AE=E5=95=A6?= <17633066053@163.com> Date: Tue, 11 Apr 2023 18:41:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20:sparkles:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=9C=A8=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=B8=AD?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E7=9A=84=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=20=E4=BC=9A=E8=A2=ABuni.hideLoading=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E5=B1=95=E7=A4=BA=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/cart/coupon/couponCenter.vue | 4 ++-- pages/cart/coupon/myCoupon.vue | 2 +- pages/cart/payment/payOrder.vue | 6 +++--- pages/cart/payment/shareOrderGoods.vue | 2 +- pages/mine/address/add.vue | 6 +++--- pages/mine/address/address.vue | 2 +- pages/mine/address/addressManage.vue | 2 +- pages/mine/address/storeAddress.vue | 2 +- pages/mine/distribution/history.vue | 4 ++-- pages/mine/distribution/home.vue | 2 +- pages/mine/distribution/withdrawal.vue | 2 +- pages/mine/im/list.vue | 2 +- pages/mine/msgTips/packageMsg/index.vue | 2 +- pages/mine/msgTips/sysMsg/index.vue | 2 +- pages/mine/myCollect.vue | 4 ++-- pages/mine/myTracks.vue | 2 +- pages/mine/point/myPoint.vue | 2 +- pages/mine/set/securityCenter/editPassword.vue | 2 +- pages/navigation/search/searchPage.vue | 2 +- pages/order/afterSales/afterSales.vue | 4 ++-- pages/order/afterSales/afterSalesDetail.vue | 4 ++-- pages/order/afterSales/afterSalesDetailExpress.vue | 2 +- pages/order/afterSales/applyDetail.vue | 2 +- pages/order/complain/complain.vue | 2 +- pages/order/complain/complainInfo.vue | 2 +- pages/order/complain/complainList.vue | 2 +- pages/order/evaluate/myEvaluate.vue | 4 ++-- pages/order/evaluate/releaseEvaluate.vue | 2 +- pages/order/fillorder.vue | 2 +- pages/order/myOrder.vue | 6 +++--- pages/order/orderDetail.vue | 6 +++--- pages/passport/login.vue | 4 ++-- pages/product/askList.vue | 6 +++--- pages/tabbar/cart/cartList.vue | 10 ++++++---- pages/tabbar/user/similarGoods.vue | 2 +- store/index.js | 1 + utils/request.js | 13 +++++++++++-- uview-ui/components/u-upload/u-upload.vue | 2 +- 38 files changed, 70 insertions(+), 58 deletions(-) diff --git a/pages/cart/coupon/couponCenter.vue b/pages/cart/coupon/couponCenter.vue index 04d99eb..627e389 100644 --- a/pages/cart/coupon/couponCenter.vue +++ b/pages/cart/coupon/couponCenter.vue @@ -98,7 +98,7 @@ }) : "", getAllCoupons(submitData) .then((res) => { - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; uni.stopPullDownRefresh(); if (res.data.code == 200) { // 如果请求成功,展示数据并进行展示 @@ -113,7 +113,7 @@ } }) .catch((err) => { - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }); }, /** diff --git a/pages/cart/coupon/myCoupon.vue b/pages/cart/coupon/myCoupon.vue index 687d73f..e299d86 100644 --- a/pages/cart/coupon/myCoupon.vue +++ b/pages/cart/coupon/myCoupon.vue @@ -217,7 +217,7 @@ export default { this.navList[index].dataList.push(...data); } } - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }); }, diff --git a/pages/cart/payment/payOrder.vue b/pages/cart/payment/payOrder.vue index 8d1bdce..1e2f199 100644 --- a/pages/cart/payment/payOrder.vue +++ b/pages/cart/payment/payOrder.vue @@ -244,7 +244,7 @@ // 初始化支付签名 await API_Trade.initiatePay(paymentMethod, paymentClient, params).then( (signXml) => { - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; //如果支付异常 if (!signXml.data.success) { uni.showToast({ @@ -334,7 +334,7 @@ } } ); - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; } else { window.location.href = JSON.parse(response.result).h5_url; const searchParams = { @@ -352,7 +352,7 @@ }) },3000) - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; } } else if (paymentMethod === "WALLET") { uni.showToast({ diff --git a/pages/cart/payment/shareOrderGoods.vue b/pages/cart/payment/shareOrderGoods.vue index f7f21f2..5902746 100644 --- a/pages/cart/payment/shareOrderGoods.vue +++ b/pages/cart/payment/shareOrderGoods.vue @@ -204,7 +204,7 @@ export default { this.goodsDetail = response.data.result.data; this.selectedGoods = response.data.result.data; this.goodsSpec = response.data.result.specs; - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; this.PromotionList = response.data.result.promotionMap; // 判断是否拼团活动 如果有则显示拼团活动信息 diff --git a/pages/mine/address/add.vue b/pages/mine/address/add.vue index a491dc4..dce017e 100644 --- a/pages/mine/address/add.vue +++ b/pages/mine/address/add.vue @@ -133,7 +133,7 @@ export default { this.form.consigneeAddressPath = val.data.result.name; //地址名称, ','分割 this.form.lat = val.latitude; //纬度 this.form.lon = val.longitude; //经度 - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; } this.mapFlag = !this.mapFlag; //关闭地图 @@ -276,10 +276,10 @@ export default { params.___path = params.consigneeAddressPath; this.$set(this, "form", params); - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }); } - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }, // 初始化rules必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕 onReady() { diff --git a/pages/mine/address/address.vue b/pages/mine/address/address.vue index e025746..7faa4e7 100644 --- a/pages/mine/address/address.vue +++ b/pages/mine/address/address.vue @@ -101,7 +101,7 @@ export default { this.addressList = res.data.result.records; console.log(this.addressList); - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }); }, //删除地址 diff --git a/pages/mine/address/addressManage.vue b/pages/mine/address/addressManage.vue index 129be8c..beb041d 100644 --- a/pages/mine/address/addressManage.vue +++ b/pages/mine/address/addressManage.vue @@ -103,7 +103,7 @@ export default { }); this.addressList = res.data.result.records; - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }); }, //删除地址 diff --git a/pages/mine/address/storeAddress.vue b/pages/mine/address/storeAddress.vue index 035a692..988a583 100644 --- a/pages/mine/address/storeAddress.vue +++ b/pages/mine/address/storeAddress.vue @@ -76,7 +76,7 @@ export default { this.storeAddressList = res.data.result.records; console.log(this.storeAddressList); - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }); }, }, diff --git a/pages/mine/distribution/history.vue b/pages/mine/distribution/history.vue index af5f926..53fbc71 100644 --- a/pages/mine/distribution/history.vue +++ b/pages/mine/distribution/history.vue @@ -96,7 +96,7 @@ export default { this.status = "nomore"; this.empty = true; } - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }); }, // 初始化提现历史 @@ -111,7 +111,7 @@ export default { this.status = "nomore"; this.empty = true; } - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }); }, }, diff --git a/pages/mine/distribution/home.vue b/pages/mine/distribution/home.vue index eac2051..9ef5952 100644 --- a/pages/mine/distribution/home.vue +++ b/pages/mine/distribution/home.vue @@ -78,7 +78,7 @@ export default { if (res.data.result) { this.distributionData = res.data.result; } - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }); }, }, diff --git a/pages/mine/distribution/withdrawal.vue b/pages/mine/distribution/withdrawal.vue index 865957e..a9614fc 100644 --- a/pages/mine/distribution/withdrawal.vue +++ b/pages/mine/distribution/withdrawal.vue @@ -75,7 +75,7 @@ export default { if (res.data.result) { this.distributionData = res.data.result; } - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }); }, }, diff --git a/pages/mine/im/list.vue b/pages/mine/im/list.vue index 1f99bb6..0914012 100644 --- a/pages/mine/im/list.vue +++ b/pages/mine/im/list.vue @@ -110,7 +110,7 @@ export default { title: "加载中", }); getTalkList(params).then((res) => { - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; if (res.data.success) { this.talkList = res.data.result; console.log(this.talkList, 'this.talkListthis.talkList'); diff --git a/pages/mine/msgTips/packageMsg/index.vue b/pages/mine/msgTips/packageMsg/index.vue index 619cf4e..da9ae42 100644 --- a/pages/mine/msgTips/packageMsg/index.vue +++ b/pages/mine/msgTips/packageMsg/index.vue @@ -58,7 +58,7 @@ export default { title:"加载中" }) API_Message.getLogisticsMessages(this.params).then(async response => { - uni.hideLoading() + if (this.$store.state.isShowToast){ uni.hideLoading() } const { data } = response if (!data || !data.length) { this.messageList.push(...data.data) diff --git a/pages/mine/msgTips/sysMsg/index.vue b/pages/mine/msgTips/sysMsg/index.vue index 4799470..1db1c56 100644 --- a/pages/mine/msgTips/sysMsg/index.vue +++ b/pages/mine/msgTips/sysMsg/index.vue @@ -59,7 +59,7 @@ export default { title: "加载中" }); API_Message.getMessages(this.params).then(async response => { - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; const { data } = response; if (!data || !data.length) { this.messageList.push(...data.data); diff --git a/pages/mine/myCollect.vue b/pages/mine/myCollect.vue index 18ee619..7191f68 100644 --- a/pages/mine/myCollect.vue +++ b/pages/mine/myCollect.vue @@ -197,7 +197,7 @@ title: "加载中", }); getGoodsCollection(this.navList[0].params, "GOODS").then((res) => { - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; uni.stopPullDownRefresh(); if (res.data.success) { let data = res.data.result; @@ -225,7 +225,7 @@ title: "加载中", }); getGoodsCollection(this.navList[1].params, "store").then((res) => { - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; uni.stopPullDownRefresh(); if (res.data.success) { let data = res.data.result; diff --git a/pages/mine/myTracks.vue b/pages/mine/myTracks.vue index 00a130f..89af420 100644 --- a/pages/mine/myTracks.vue +++ b/pages/mine/myTracks.vue @@ -114,7 +114,7 @@ }); myTrackList(this.params).then((res) => { uni.stopPullDownRefresh(); - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; if (res.statusCode == 200) { res.data.result.records.length && res.data.result.records.forEach((item) => { diff --git a/pages/mine/point/myPoint.vue b/pages/mine/point/myPoint.vue index 4c13a3a..c3530b3 100644 --- a/pages/mine/point/myPoint.vue +++ b/pages/mine/point/myPoint.vue @@ -72,7 +72,7 @@ export default { title: "加载中", }); getPointsData(params).then((res) => { - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; if (res.data.success) { let data = res.data.result.records; if (data.length < 10) { diff --git a/pages/mine/set/securityCenter/editPassword.vue b/pages/mine/set/securityCenter/editPassword.vue index dcd9d2f..aa890ea 100644 --- a/pages/mine/set/securityCenter/editPassword.vue +++ b/pages/mine/set/securityCenter/editPassword.vue @@ -115,7 +115,7 @@ title: "正在获取验证码", }); sendMobile(this.codeForm.mobile, "FIND_USER").then((res) => { - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; // 这里此提示会被this.start()方法中的提示覆盖 if (res.data.success) { this.$refs.uCode.start(); diff --git a/pages/navigation/search/searchPage.vue b/pages/navigation/search/searchPage.vue index 52b1edc..cbd6081 100644 --- a/pages/navigation/search/searchPage.vue +++ b/pages/navigation/search/searchPage.vue @@ -636,7 +636,7 @@ export default { this.goodsList.push(...goodsList.data.result.records); this.initSortGoods(); - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }, //高亮关键字 diff --git a/pages/order/afterSales/afterSales.vue b/pages/order/afterSales/afterSales.vue index 263d8d3..f229e4b 100644 --- a/pages/order/afterSales/afterSales.vue +++ b/pages/order/afterSales/afterSales.vue @@ -309,7 +309,7 @@ export default { mask: true, }); getOrderList(this.params).then((res) => { - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; const orderList = res.data.result.records; if (orderList.length > 0) { this.orderList = this.orderList.concat(orderList); @@ -345,7 +345,7 @@ export default { this.orderList = []; this.searchOrderList(this.current); - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }, /** diff --git a/pages/order/afterSales/afterSalesDetail.vue b/pages/order/afterSales/afterSalesDetail.vue index 50f8b4d..606482e 100644 --- a/pages/order/afterSales/afterSalesDetail.vue +++ b/pages/order/afterSales/afterSalesDetail.vue @@ -224,7 +224,7 @@ export default { this.reasonList = action; } }); - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }, //打开地区选择器 showCitySelect() { @@ -288,7 +288,7 @@ export default { this.form.applyRefundPrice = this.applyInfo.applyRefundPrice; applyReturn(this.sn, this.form).then((resp) => { - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; if (resp.data.success) { this.$refs.uToast.show({ title: "提交成功", type: "success" }); uni.redirectTo({ diff --git a/pages/order/afterSales/afterSalesDetailExpress.vue b/pages/order/afterSales/afterSalesDetailExpress.vue index 9f755f7..edc2636 100644 --- a/pages/order/afterSales/afterSalesDetailExpress.vue +++ b/pages/order/afterSales/afterSalesDetailExpress.vue @@ -128,7 +128,7 @@ export default { }); delete this.form.courierCompany; fillShipInfo(this.serviceDetail.sn, this.form).then((res) => { - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; if (res.statusCode === 200) { this.$refs.uToast.show({ title: "提交成功", diff --git a/pages/order/afterSales/applyDetail.vue b/pages/order/afterSales/applyDetail.vue index c8564d9..7926dc0 100644 --- a/pages/order/afterSales/applyDetail.vue +++ b/pages/order/afterSales/applyDetail.vue @@ -352,7 +352,7 @@ export default { title: "加载中", }); getServiceDetail(this.sn).then((res) => { - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; this.serviceDetail = res.data.result; if ( this.serviceDetail.serviceType == "RETURN_GOODS" || diff --git a/pages/order/complain/complain.vue b/pages/order/complain/complain.vue index 548b0df..4f6c48b 100644 --- a/pages/order/complain/complain.vue +++ b/pages/order/complain/complain.vue @@ -178,7 +178,7 @@ export default { this.order = order.order; this.orderGoodsList = order.orderItems; this.orderDetail = res.data.result; - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }); }, diff --git a/pages/order/complain/complainInfo.vue b/pages/order/complain/complainInfo.vue index 45d55e3..6eb2e66 100644 --- a/pages/order/complain/complainInfo.vue +++ b/pages/order/complain/complainInfo.vue @@ -95,7 +95,7 @@ export default { icon: "none", }); } - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }); }, }, diff --git a/pages/order/complain/complainList.vue b/pages/order/complain/complainList.vue index b09b75c..cbf2788 100644 --- a/pages/order/complain/complainList.vue +++ b/pages/order/complain/complainList.vue @@ -140,7 +140,7 @@ export default { } else { this.empty = true; } - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }); }, }, diff --git a/pages/order/evaluate/myEvaluate.vue b/pages/order/evaluate/myEvaluate.vue index 35dc244..db83649 100644 --- a/pages/order/evaluate/myEvaluate.vue +++ b/pages/order/evaluate/myEvaluate.vue @@ -202,7 +202,7 @@ export default { title: "加载中", }); getOrderList(this.params).then((res) => { - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; const orderList = res.data.result.records; if (orderList.length < 10) { this.params.loadStatus = "noMore"; @@ -234,7 +234,7 @@ export default { title: "加载中", }); getComments(this.params).then((res) => { - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; let orderList = res.data.result.records; if (orderList.length < 10) { this.params.loadStatus = "noMore"; diff --git a/pages/order/evaluate/releaseEvaluate.vue b/pages/order/evaluate/releaseEvaluate.vue index 72bb81a..c607830 100644 --- a/pages/order/evaluate/releaseEvaluate.vue +++ b/pages/order/evaluate/releaseEvaluate.vue @@ -137,7 +137,7 @@ export default { title: "加载中", }); commentsMemberOrder(this.form).then((res) => { - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; if (res.data.success) { uni.showToast({ title: "发布评价成功", diff --git a/pages/order/fillorder.vue b/pages/order/fillorder.vue index 7d56f1d..1a99144 100644 --- a/pages/order/fillorder.vue +++ b/pages/order/fillorder.vue @@ -373,7 +373,7 @@ export default { }); await this.getOrderList(); await this.getDistribution(); - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; if (this.routerVal.way == "PINTUAN") { this.isAssemble = true; this.routerVal.parentOrder = JSON.parse( diff --git a/pages/order/myOrder.vue b/pages/order/myOrder.vue index 5f6c2fc..53a5bd2 100644 --- a/pages/order/myOrder.vue +++ b/pages/order/myOrder.vue @@ -392,7 +392,7 @@ export default { if (res.data.result.length >= 1) { this.cancelList = res.data.result; } - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }); }, @@ -473,7 +473,7 @@ export default { }); setTimeout(() => { this.navList[this.tabCurrentIndex].orderList.splice(index, 1); - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }, 600); }, //取消订单 @@ -493,7 +493,7 @@ export default { let list = this.navList[1].orderList; let index = list.findIndex((val) => val.id === item.id); index !== -1 && list.splice(index, 1); - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }, 600); }, diff --git a/pages/order/orderDetail.vue b/pages/order/orderDetail.vue index 93a3d77..cd99a3e 100644 --- a/pages/order/orderDetail.vue +++ b/pages/order/orderDetail.vue @@ -361,7 +361,7 @@ export default { if (this.order.deliveryMethod === 'LOGISTICS') { this.loadLogistics(sn) } - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }); }, @@ -413,7 +413,7 @@ export default { }); setTimeout(() => { this.navList[this.tabCurrentIndex].orderList.splice(index, 1); - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }, 600); }, //取消订单 @@ -427,7 +427,7 @@ export default { if (res.data.result.length >= 1) { this.cancelList = res.data.result; } - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }); this.cancelShow = true; diff --git a/pages/passport/login.vue b/pages/passport/login.vue index 859be67..7b9eaa8 100644 --- a/pages/passport/login.vue +++ b/pages/passport/login.vue @@ -321,7 +321,7 @@ // 向后端请求验证码 uni.showLoading({}); let res = await sendMobile(this.mobile); - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; // 这里此提示会被this.start()方法中的提示覆盖 if (res.data.success) { this.current = 1; @@ -708,7 +708,7 @@ clearInterval(timer); }, 100); } - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; } if (!this.flage) { this.$refs.verification.error(); //发送 diff --git a/pages/product/askList.vue b/pages/product/askList.vue index 35cbf79..19fbeac 100644 --- a/pages/product/askList.vue +++ b/pages/product/askList.vue @@ -70,7 +70,7 @@ export default { title: "请填写内容!", icon: "none", }); - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; return false; } API_MEM.consultating( @@ -86,11 +86,11 @@ export default { }); this.askValue = ""; } - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }) .catch((err) => { - uni.hideLoading(); + if (this.$store.state.isShowToast){ uni.hideLoading() }; }); }, radioGroupChange(e) { diff --git a/pages/tabbar/cart/cartList.vue b/pages/tabbar/cart/cartList.vue index c631e78..d2aae87 100644 --- a/pages/tabbar/cart/cartList.vue +++ b/pages/tabbar/cart/cartList.vue @@ -1,7 +1,7 @@