feat: 优化在微信小程序中接口返回的错误信息 会被uni.hideLoading取消展示错误信息问题

This commit is contained in:
学习很差啦
2023-04-11 18:41:34 +08:00
parent c070ed01f7
commit 2bdb8682e1
38 changed files with 70 additions and 58 deletions

View File

@@ -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() };
});
},
/**

View File

@@ -217,7 +217,7 @@ export default {
this.navList[index].dataList.push(...data);
}
}
uni.hideLoading();
if (this.$store.state.isShowToast){ uni.hideLoading() };
});
},

View File

@@ -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({

View File

@@ -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;
// 判断是否拼团活动 如果有则显示拼团活动信息