lxs 4 anni fa
parent
commit
ee70059410

+ 6 - 3
pages/challenge-detail/challenge-detail.vue

@@ -61,7 +61,7 @@
 					<view class="left" :style="{ width: ((item.challenge_num + item.accept_num) ? Math.floor(item.challenge_num / (item.challenge_num + item.accept_num) * 100) : 50) + '%' }"></view>
 					<view class="right" :style="{ width: ((item.challenge_num + item.accept_num) ? Math.floor(item.accept_num / (item.challenge_num + item.accept_num) * 100) : 50) + '%' }"></view>
 				</view>
-				<view v-if="!self" class="actionss">
+				<view v-if="!self && n" class="actionss">
 					<view v-if="!item.guessing || (item.support_id && item.support_id == item.challenge_id)" class="actions-btn" style="color: #FFA231; border-color: #FFA231;" @click="action(item.challenge_nickname, item.challenge_id, 0)"><text v-if="item.support_id == item.challenge_id">已</text>预测他/她赢</view>
 					<view v-if="!item.guessing || (item.support_id && item.support_id == item.accept_id)" class="actions-btn float-right" style="color: #C55AAE; border-color: #C55AAE;" @click="action(item.accept_nickname, item.accept_id, 1)"><text v-if="item.support_id == item.accept_id">已</text>预测他/她赢</view>
 				</view>
@@ -104,7 +104,11 @@
 					if (item.guessing) {
 						return '已围观'
 					} else {
-						return '围观竞猜'
+						if(Date.now() > item.guessing_endtime) {
+							return '竞猜结束'
+						} else {
+							return '围观竞猜'
+						}
 					}
 				}
 				return ''
@@ -124,7 +128,6 @@
 		},
 		onLoad({ from }) {
 			this.item = uni.temp1
-			console.log(this.item)
 			if (Date.now() <= this.item.guessing_endtime) {
 				this.n = Date.now()
 				this.timer = setInterval(() => {

+ 7 - 3
pages/challengeList/challengeList.vue

@@ -41,7 +41,7 @@
 									<view class="long-item">{{ item.day | getLong(1) }}</view>
 								</view>
 								<view class="time">{{ item.time }}</view>
-								<view class="action" :class="{ end: item.status == 3 || item.guessing }" @click="toDetail(item)">{{ item | getAction(nowActive) }}</view>
+								<view class="action" :class="{ end: item.status == 3 || item.guessing || Date.now() > item.guessing_endtime }" @click="toDetail(item)">{{ item | getAction(nowActive) }}</view>
 							</view>
 							<view class="detail-r">
 								<image v-if="item.status == 2 && item.accept_id == item.successId" class="success" src="../../static/icon/pk-success.png" mode=""></image>
@@ -100,7 +100,11 @@
 					if (item.guessing) {
 						return '已预测'
 					} else {
-						return '围观竞猜'
+						if(Date.now() > item.guessing_endtime) {
+							return '竞猜结束'
+						} else {
+							return '围观竞猜'
+						}
 					}
 				}
 				return ''
@@ -170,7 +174,7 @@
 					uni.navigateTo({ url: '../challenge/challenge?type=1' })
 				} else if (type == '应战') {
 					uni.navigateTo({ url: '../challenge/challenge?type=2' })
-				} else if (type == '挑战详情' || type == '围观竞猜' || type == '已竞猜') {
+				} else if (type == '挑战详情' || type == '围观竞猜' || type == '已竞猜' || type == '竞猜结束') {
 					uni.temp1 = item
 					uni.navigateTo({ url: '../challenge-detail/challenge-detail' + (type == '挑战详情' ? '?from=1' : '') })
 				}