选择地址功能添加loading方法

This commit is contained in:
Yer11214
2024-10-18 15:25:37 +08:00
parent d166d5943c
commit de94f212c3

View File

@@ -185,7 +185,13 @@ export default {
this.tabbars.splice(index + 1, this.tabbars.length - index - 1); this.tabbars.splice(index + 1, this.tabbars.length - index - 1);
} }
if (this.tabbars.length < this.pickersize) { if (this.tabbars.length < this.pickersize) {
uni.showLoading({
title: "加载中",
mask:true
});
try {
let data = await getRegionsById(item.id); let data = await getRegionsById(item.id);
uni.hideLoading();
// 当前选项级为最后一级时回调,将选中的数据返回 // 当前选项级为最后一级时回调,将选中的数据返回
if (data.data.result.length == 0) { if (data.data.result.length == 0) {
this.$emit("funcValue", this.tabbars); this.$emit("funcValue", this.tabbars);
@@ -204,6 +210,10 @@ export default {
// 当前距离重新为最上面 // 当前距离重新为最上面
this.$set(this,'scrollTop',0) this.$set(this,'scrollTop',0)
} }
} catch (error) {
uni.hideLoading();
}
} else { } else {
this.$emit("funcValue", this.tabbars); this.$emit("funcValue", this.tabbars);
this.hide(); this.hide();