新增更新上级节流操作,避免用户连续点击添加多次
This commit is contained in:
parent
3b862ecdd3
commit
a193cef232
@ -24,7 +24,7 @@
|
|||||||
<view v-if="uniMP" style="height: 44px;">
|
<view v-if="uniMP" style="height: 44px;">
|
||||||
<u-icon name="arrow-left" color="#fff" size="20" @click="leftClick"></u-icon>
|
<u-icon name="arrow-left" color="#fff" size="20" @click="leftClick"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view style="height: 30rpx"></view> -->
|
<view v-else style="height: 30rpx"></view>
|
||||||
<!-- <view v-if="uniMP" style="height: 44px;"></view> -->
|
<!-- <view v-if="uniMP" style="height: 44px;"></view> -->
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<view class="my_info">
|
<view class="my_info">
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<view v-if="uniMP" style="height: 44px;">
|
<view v-if="uniMP" style="height: 44px;">
|
||||||
<u-icon name="arrow-left" color="#fff" size="20" @click="leftClick"></u-icon>
|
<u-icon name="arrow-left" color="#fff" size="20" @click="leftClick"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view style="height: 30rpx"></view> -->
|
<view v-else style="height: 30rpx"></view>
|
||||||
<!-- <view style="height: 100rpx"></view> -->
|
<!-- <view style="height: 100rpx"></view> -->
|
||||||
<!-- <view v-if="uniMP" style="height: 44px"></view> -->
|
<!-- <view v-if="uniMP" style="height: 44px"></view> -->
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
@ -56,6 +56,8 @@
|
|||||||
</u--form>
|
</u--form>
|
||||||
<!-- <button @click="addArchives" class="btn">完成更新</button> -->
|
<!-- <button @click="addArchives" class="btn">完成更新</button> -->
|
||||||
<mybtn text="完成更新" @click="addArchives"></mybtn>
|
<mybtn text="完成更新" @click="addArchives"></mybtn>
|
||||||
|
<u-modal :show="modelShow" title="警告" content='确定要删除该信息吗' closeOnClickOverlay showCancelButton
|
||||||
|
@close="modelShow=false" @cancel="modelShow=false" @confirm="deleteDemand(deleteIndex)"></u-modal>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -111,6 +113,8 @@
|
|||||||
showDemandList: [], //更多需求展示列表
|
showDemandList: [], //更多需求展示列表
|
||||||
updateFlag: true,
|
updateFlag: true,
|
||||||
task_id: 0,
|
task_id: 0,
|
||||||
|
modelShow: false, // 是否显示删除提示框
|
||||||
|
deleteIndex: -1, // 删除标记
|
||||||
formData: {
|
formData: {
|
||||||
id_card: '',
|
id_card: '',
|
||||||
sex: '',
|
sex: '',
|
||||||
@ -210,22 +214,32 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 确认添加需求
|
// 确认添加需求
|
||||||
changeDemand: throttle(function(e) {
|
changeDemand(e){
|
||||||
|
this.$u.throttle(()=>this.addDemand(e), 2000)
|
||||||
|
},
|
||||||
|
addDemand(e){
|
||||||
|
uni.showLoading({
|
||||||
|
title: '添加中',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
this.demandShow = false;
|
this.demandShow = false;
|
||||||
if (e.value[1]) {
|
if (e.value[1]) {
|
||||||
this.showDemandList.push(e.value[1]);
|
this.showDemandList.push(e.value[1]);
|
||||||
} else {
|
} else {
|
||||||
this.showDemandList.push(e.value[0]);
|
this.showDemandList.push(e.value[0]);
|
||||||
}
|
}
|
||||||
}, 3000),
|
this.$nextTick(()=>{
|
||||||
|
uni.hideLoading();
|
||||||
|
})
|
||||||
|
},
|
||||||
// 删除需求
|
// 删除需求
|
||||||
removeShowDemand(index) {
|
removeShowDemand(index) {
|
||||||
uni.showModal({
|
this.modelShow = true;
|
||||||
title: '确定删除这一部分内容吗',
|
this.deleteIndex = index;
|
||||||
success: (res) => {
|
},
|
||||||
if (res.confirm) this.showDemandList.splice(index, 1);
|
deleteDemand(index){
|
||||||
}
|
this.showDemandList.splice(index, 1);
|
||||||
})
|
this.modelShow = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user