|
@@ -1,10 +1,6 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
- <u-navbar title="">
|
|
|
- <view class="slot-wrap">
|
|
|
- <view class="slot-title">{{detail.title}}</view>
|
|
|
- </view>
|
|
|
- </u-navbar>
|
|
|
+ <u-navbar :title="detail.title"></u-navbar>
|
|
|
<!-- <view class="img">
|
|
|
<img src="../../static/img/activity.png" alt="">
|
|
|
</view> -->
|
|
@@ -59,10 +55,13 @@
|
|
|
</view>
|
|
|
</view> -->
|
|
|
</view>
|
|
|
- <u-modal v-model="show" :show-title="false" :content="content"
|
|
|
- :content-style="{color: '#101010',fontSize: '16px'}"
|
|
|
- @confirm="confirm" confirm-color="#FF7C70" ref="uModal" :async-close="true"></u-modal>
|
|
|
+ <view>
|
|
|
+ <u-toast ref="uToast" />
|
|
|
+ </view>
|
|
|
<view class="bottom">
|
|
|
+ <u-modal v-model="show" :show-title="false" :content="content"
|
|
|
+ :content-style="{color: '#101010',fontSize: '16px'}" @confirm="confirm" confirm-color="#FF7C70"
|
|
|
+ :show-cancel-button="true" @cancel="cancel" ref="uModal" :async-close="true"></u-modal>
|
|
|
<u-button v-if="detail.isShow && !detail.isJoin" @click="signUp">立即报名</u-button>
|
|
|
<u-button v-if="detail.isShow && detail.isJoin" style="background-color: #CCCCCC;">已报名</u-button>
|
|
|
</view>
|
|
@@ -112,15 +111,31 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ showToast() {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ title: '不在报名时段内!',
|
|
|
+ type: 'warning '
|
|
|
+ })
|
|
|
+ },
|
|
|
signUp() {
|
|
|
if(this.userId) {
|
|
|
- this.show = true;
|
|
|
+ var date = new Date();
|
|
|
+ var oDate1 = new Date(this.detail.startTime);
|
|
|
+ var oDate2 = new Date(this.detail.endTime);
|
|
|
+ if(date.getTime() > oDate1.getTime() && date.getTime() < oDate2.getTime()){
|
|
|
+ this.show = true;
|
|
|
+ } else {
|
|
|
+ this.showToast();
|
|
|
+ }
|
|
|
} else {
|
|
|
uni.navigateTo({
|
|
|
url:'../../pagesA/pages/login/index'
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ cancel() {
|
|
|
+ this.show = false;
|
|
|
+ },
|
|
|
confirm() {
|
|
|
uni.showLoading({
|
|
|
title: "加载中",
|