wkyy 2 年 前
コミット
d5d49b8b70
3 ファイル変更23 行追加26 行削除
  1. 1 1
      pages/index/index.vue
  2. 20 24
      pages/news/activityDetails.vue
  3. 2 1
      pages/news/index.vue

+ 1 - 1
pages/index/index.vue

@@ -110,7 +110,7 @@
 						</view>
 					</view>
 					<view class="img">
-						<img :src="item.images ? item.images : '/static/img/default_img.png'" alt="">
+						<img :src="item.image ? item.image : '/static/img/default_img.png'" alt="">
 					</view>
 				</view>
 			</view>

+ 20 - 24
pages/news/activityDetails.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<u-navbar :title="detail.title"></u-navbar>
+		<u-navbar :title="navbarTitle"></u-navbar>
 		<!-- <view class="img">
 			<img src="../../static/img/activity.png" alt="">
 		</view> -->
@@ -55,15 +55,14 @@
 				</view>
 			</view> -->
 		</view>
-		<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>
+		
+		<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>
+		<view class="bottom" v-if="detail.isShow">
+			<u-button v-if="!detail.isJoin && !endShow" @click="signUp">立即报名</u-button>
+			<u-button v-if="detail.isJoin" style="background-color: #CCCCCC;">已报名</u-button>
+			<u-button v-if="endShow" style="background-color: #CCCCCC;">报名已结束</u-button>
 		</view>
 	</view>
 </template>
@@ -80,6 +79,7 @@
 				userId: '',
 				show: false,
 				content: '您已报名成功!',
+				endShow: false,
 			}
 		},
 		onLoad(op) {
@@ -104,6 +104,15 @@
 					
 					this.detail = response.data;
 					this.navbarTitle = this.detail.title;
+					
+					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.endShow = false;
+					} else {
+						this.endShow = true;
+					}
 				}).catch(error => {
 					uni.showToast({
 						title: error,
@@ -111,22 +120,9 @@
 					})
 				})
 			},
-			showToast() {
-				this.$refs.uToast.show({
-					title: '不在报名时段内!',
-					type: 'warning '
-				})
-			},
 			signUp() {
 				if(this.userId) {
-					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();
-					}
+					this.show = true;
 				} else {
 					uni.navigateTo({
 						url:'../../pagesA/pages/login/index'

+ 2 - 1
pages/news/index.vue

@@ -19,7 +19,8 @@
 					</h4>
 					<p>{{item.createTime}}</p>
 				</view>
-				<u-image class="newsList-img" :src="item.images?item.images:'/static/img/default_img.png'" height="150" width="200" border-radius="10"></u-image>
+				<u-image v-if="current == 3" class="newsList-img" :src="item.image?item.image:'/static/img/default_img.png'" height="150" width="200" border-radius="10"></u-image>
+				<u-image v-else class="newsList-img" :src="item.images?item.images:'/static/img/default_img.png'" height="150" width="200" border-radius="10"></u-image>
 			</view>