Fix:新增地址保存防抖处理
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="dialog-footer">
|
||||
<u-button type="primary" color="#C52733" shape="circle" @click="handleSave">立即保存</u-button>
|
||||
<u-button type="primary" :disabled="loading" :loading="loading" color="#C52733" shape="circle" @click="handleSave">立即保存</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
@@ -80,6 +80,7 @@ export default {
|
||||
detail: '',
|
||||
isDefault: 0
|
||||
},
|
||||
loading: false,
|
||||
address: {},
|
||||
isWechat: isWeixin(),
|
||||
addressText: "",
|
||||
@@ -212,6 +213,8 @@ export default {
|
||||
is_default: isDefault ? true : false,
|
||||
post_code: ""
|
||||
};
|
||||
uni.showLoading();
|
||||
this.loading = true
|
||||
postAddress(data).then((res) => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
@@ -219,6 +222,8 @@ export default {
|
||||
duration: 2000
|
||||
});
|
||||
this.$emit('save', res.data.id)
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
});
|
||||
} catch (err) {
|
||||
uni.showToast({
|
||||
@@ -226,6 +231,7 @@ export default {
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
//获取当前定位地址
|
||||
|
||||
Reference in New Issue
Block a user