Commit 0dade5e4 authored by 和慭琛's avatar 和慭琛

入驻信息页 确认按钮 防抖

parent fd1c002e
...@@ -7,17 +7,23 @@ ...@@ -7,17 +7,23 @@
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/settle/base",
"style": {
"navigationBarTitleText": "入驻信息"
}
},{
"path": "pages/settle/index",
"style": {
"navigationBarTitleText": "充电桩安装招募"
}
},{
"path": "pages/exam/index", "path": "pages/exam/index",
"style": { "style": {
"navigationBarTitleText": "入驻考试" "navigationBarTitleText": "入驻考试"
} }
},{
"path": "pages/settle/index",
"style": {
"navigationBarTitleText": "充电桩安装招募"
}
},{ },{
"path": "pages/exam/start", "path": "pages/exam/start",
"style": { "style": {
...@@ -59,13 +65,7 @@ ...@@ -59,13 +65,7 @@
{
"path": "pages/settle/base",
"style": {
"navigationBarTitleText": "入驻信息"
}
},
{ {
"path": "pages/settle/select", "path": "pages/settle/select",
"style": { "style": {
......
...@@ -81,7 +81,8 @@ ...@@ -81,7 +81,8 @@
</view> </view>
<view class="seat"></view> <view class="seat"></view>
<view class="btn-wrap flex-xc"> <view class="btn-wrap flex-xc">
<button class="btn-submit" :disabled="!submitStatus" @click="submitBaseInfo"> <!--view class="">submitBaseInfo</view-->
<button class="btn-submit" :disabled="!submitStatus" @click="submitBaseInfo()">
确定 确定
</button> </button>
</view> </view>
...@@ -109,7 +110,8 @@ ...@@ -109,7 +110,8 @@
areaTxts: [], areaTxts: [],
workingAgeTxt: '', workingAgeTxt: '',
protocolContent: '', protocolContent: '',
address:'' address:'',
isPosting:false
} }
}, },
onLoad(e) { onLoad(e) {
...@@ -119,6 +121,12 @@ ...@@ -119,6 +121,12 @@
} }
this.initLocation() this.initLocation()
}, },
onShow() {
if (this.isPosting) {
this.isPosting = false
}
},
computed: { computed: {
submitStatus() { submitStatus() {
const baseInfo = this.baseInfo const baseInfo = this.baseInfo
...@@ -302,15 +310,31 @@ ...@@ -302,15 +310,31 @@
}); });
return !flagArr || flagArr.length < 1; return !flagArr || flagArr.length < 1;
}, },
/*
shakeCLick: function() {
let timer = setTimeout(() => {
clearTimeout(timer)
this.submitBaseInfo()
}, 2000)
},
*/
async submitBaseInfo() { async submitBaseInfo() {
// this.newSubmitBaseInfo() // this.newSubmitBaseInfo()
// return // return
const baseInfo = this.baseInfo; const baseInfo = this.baseInfo;
if (!this.checkBaseInfo()) { if (!this.checkBaseInfo()) {
return; return;
} }
if (this.isPosting){
return
}
this.isPosting = true//尝试防抖
this.saving = true; this.saving = true;
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
...@@ -322,6 +346,9 @@ ...@@ -322,6 +346,9 @@
const res = await this.$u.api.submitSettleBaseInfo(params) const res = await this.$u.api.submitSettleBaseInfo(params)
this.saving = false; this.saving = false;
uni.hideLoading() uni.hideLoading()
//this.isPosting = false
if (res.code != 200) { if (res.code != 200) {
uni.showToast({ uni.showToast({
title: res.message, title: res.message,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment