Browse Source

限制多次点击

dev
jyt 2 years ago
parent
commit
4aa5e14a66
2 changed files with 24 additions and 19 deletions
  1. +22
    -18
      pages/index/customer.vue
  2. +2
    -1
      pages/mine/reception/addreception.vue

+ 22
- 18
pages/index/customer.vue View File

@@ -74,6 +74,7 @@
export default {
data() {
return {
noClick:true,
tabbarList:tabbarList,
current: 0,
buildingID: '',
@@ -213,24 +214,27 @@
content: "确定更改当前客户接待状态为结束?",
cancelColor: "#999999",
success: res => {
if (res.confirm) {
let that = this
clearTimeout(this.fdFlag)
this.fdFlag = setTimeout(() => {
this.$u.post("/customer/endReception", {
id: id,
houseId: this.buildingID
}).then(res => {
uni.showToast({
icon: "none",
title: "操作成功"
})
this.init();
});
that.fdFlag = null;
}, 500)
if (this.noClick) {
this.noClick= false;
if (res.confirm) {
if (res.confirm) {
this.$u.post("/customer/endReception", {
id: id,
houseId: this.buildingID
}).then(res => {
uni.showToast({
icon: "none",
title: "操作成功"
})
this.init();
});
}
}
setTimeout(()=> {
this.noClick= true;
}, 2000)
} else {
// 这里是重复点击的判断
}
}
})


+ 2
- 1
pages/mine/reception/addreception.vue View File

@@ -70,7 +70,7 @@
</view>
</view>
<view class="clive" @click.stop="btnSave" :style="{background:(isBand==false?'#2671E2':'#949494')}">确定</view>
<view class="clive" @click.stop="$noMultipleClicks(save)" :style="{background:(isBand==false?'#2671E2':'#949494')}">确定</view>
<!-- <view v-if="Showhiddenunits"> -->
<!-- <u-select v-model="show" :list="list"></u-select> -->
@@ -92,6 +92,7 @@
export default {
data() {
return {
noClick: true,
Showhiddenunits: false,
list: [
// {label: '自然到访',value:'自然到访'},


Loading…
Cancel
Save