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

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

View File

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

View File

@@ -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: "提交成功",

View File

@@ -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" ||

View File

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

View File

@@ -95,7 +95,7 @@ export default {
icon: "none",
});
}
uni.hideLoading();
if (this.$store.state.isShowToast){ uni.hideLoading() };
});
},
},

View File

@@ -140,7 +140,7 @@ export default {
} else {
this.empty = true;
}
uni.hideLoading();
if (this.$store.state.isShowToast){ uni.hideLoading() };
});
},
},

View File

@@ -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";

View File

@@ -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: "发布评价成功",

View File

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

View File

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

View File

@@ -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;