Browse Source

Merge branch '电子门牌' into dev

feature
mk 1 year ago
parent
commit
92a9ce20bc
  1. 10
      src/views/activity/index.vue
  2. 9
      src/views/home/index.vue

10
src/views/activity/index.vue

@ -15,7 +15,7 @@
}}</span>/<span class="font-size14">{{ item.participants }}</span>
</div>
<van-button type="info" size="small" round @click="handelClickJump('activityDetail', item)"
:disabled="new Date(item.cutOffTime.replace(/-/g, '/')).getTime() < Date.now() || item.currentParticipants >= item.participants">{{ recordFlag(item) ? '已报名' : '报名' }}</van-button>
:disabled="disabledRecord(item)">{{ recordFlag(item) ? '已报名' : '报名' }}</van-button>
</div>
</div>
</div>
@ -85,6 +85,14 @@ export default {
return item.recordList.findIndex(itemC => itemC.mobile === this.$store.state.app.userInfo.mobile) != -1
}
},
disabledRecord() {
return (item) => {
if (!item.cutOffTime) return false
let flag = new Date(item.cutOffTime.replace(/-/g, '/')).getTime() < Date.now() || item.currentParticipants >= item.participants;
return flag || false
}
},
},
watch: {},
}

9
src/views/home/index.vue

@ -68,7 +68,7 @@
class="font-size14">{{ item.participants }}</span>
</div>
<van-button type="info" size="small" round @click="handelClickJump(`activityDetail`,item)"
:disabled="new Date(item.cutOffTime.replace(/-/g, '/')).getTime()<Date.now() || item.currentParticipants >= item.participants">{{recordFlag(item)?'已报名':'报名'}}</van-button>
:disabled="disabledRecord(item)">{{recordFlag(item)?'已报名':'报名'}}</van-button>
</div>
</div>
</div>
@ -347,6 +347,13 @@ export default {
return item.recordList.findIndex(itemC=>itemC.mobile === this.$store.state.app.userInfo.mobile) != -1
}
},
disabledRecord() {
return (item) => {
if (!item.cutOffTime) return false
let flag = new Date(item.cutOffTime.replace(/-/g, '/')).getTime() < Date.now() || item.currentParticipants >= item.participants;
return flag || false
}
},
},
watch: {},
}

Loading…
Cancel
Save