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

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

View File

@@ -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() };
});
},
//删除地址

View File

@@ -103,7 +103,7 @@ export default {
});
this.addressList = res.data.result.records;
uni.hideLoading();
if (this.$store.state.isShowToast){ uni.hideLoading() };
});
},
//删除地址

View File

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

View File

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

View File

@@ -78,7 +78,7 @@ export default {
if (res.data.result) {
this.distributionData = res.data.result;
}
uni.hideLoading();
if (this.$store.state.isShowToast){ uni.hideLoading() };
});
},
},

View File

@@ -75,7 +75,7 @@ export default {
if (res.data.result) {
this.distributionData = res.data.result;
}
uni.hideLoading();
if (this.$store.state.isShowToast){ uni.hideLoading() };
});
},
},

View File

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

View File

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

View File

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

View File

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

View File

@@ -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) => {

View File

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

View File

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