Commit 03926975 by fengzhaoyu

fix: 创建加限制

parent 3b2f5084
...@@ -20,4 +20,8 @@ view { ...@@ -20,4 +20,8 @@ view {
text-align: center; text-align: center;
color: #fff; color: #fff;
background: rgba(234, 12, 40, 1); background: rgba(234, 12, 40, 1);
}
.gray {
background: rgba(10, 10, 10, 0.2)!important;
} }
\ No newline at end of file
...@@ -106,8 +106,8 @@ ...@@ -106,8 +106,8 @@
</view> </view>
</view> </view>
<!-- 保存 --> <!-- 保存 -->
<view class="save" onTap="addSchedule"> <view class="save" onTap="addSchedule1">
<view class="button"> <view class="button {{limitClick ? 'gray' : ''}}">
立即创建 立即创建
</view> </view>
<view class="tabBarBottom" a:if="{{isIPX}}"> <view class="tabBarBottom" a:if="{{isIPX}}">
......
...@@ -46,9 +46,10 @@ create.Page({ ...@@ -46,9 +46,10 @@ create.Page({
isAcrossDay: false, isAcrossDay: false,
conflictPeople: [], conflictPeople: [],
placeholder: '', placeholder: '',
isIPX: false isIPX: false,
limitClick: false,
}, },
limitClick: false,
showPop(event) { showPop(event) {
this.setData({ this.setData({
show: true show: true
...@@ -336,11 +337,15 @@ create.Page({ ...@@ -336,11 +337,15 @@ create.Page({
} }
}, },
addSchedule: throttle(async function () { addSchedule1: throttle(async function () {
if (this.limitClick) { if (this.data.limitClick) {
return false return
} }
this.limitClick = true console.log('我重复点击还是走到这了')
this.setData({ limitClick: true });
dd.showLoading({
content: '正在创建...',
});
let data = { let data = {
title: this.data.title || `${getApp().globalData.name}创建的会议`, title: this.data.title || `${getApp().globalData.name}创建的会议`,
location: { location: {
...@@ -360,10 +365,10 @@ create.Page({ ...@@ -360,10 +365,10 @@ create.Page({
meetingWayModel: this.data.meetingWayModel meetingWayModel: this.data.meetingWayModel
} }
const res = await addSchedule(data).catch(err => { const res = await addSchedule(data).catch(err => {
this.limitClick = false this.setData({ limitClick: false });
dd.hideLoading();
}); });
if (res.data.code === 0) { if (res.data.code === 0) {
this.limitClick = false
this.$store.data.tabBarIndex = '1' this.$store.data.tabBarIndex = '1'
if (this.data.repeatable === 0) { if (this.data.repeatable === 0) {
if (this.$store.addOnceMeeting) { if (this.$store.addOnceMeeting) {
...@@ -380,6 +385,8 @@ create.Page({ ...@@ -380,6 +385,8 @@ create.Page({
await this.$store.modifyErpeatMeeting() await this.$store.modifyErpeatMeeting()
} }
} }
this.setData({ limitClick: false });
dd.hideLoading();
dd.navigateBack() dd.navigateBack()
} }
......
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