|
|
|
@ -2,15 +2,15 @@ |
|
|
|
<view class="boost"> |
|
|
|
<view class="nav" :style="{height: navHeight + 'px', paddingTop: statusBarHeight + 'px'}"> |
|
|
|
<view class="nav-back" @tap="goBack"><text>‹</text></view> |
|
|
|
<view class="nav-title">{{isDailyMode ? '学院排位赛' : 'PK局'}}</view> |
|
|
|
<view class="nav-title">{{isDailyMode ? rankEventName : 'PK局'}}</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<scroll-view scroll-y class="page" :style="{paddingTop: (navHeight + 10) + 'px'}"> |
|
|
|
<view class="hero" v-if="isDailyMode"> |
|
|
|
<view class="hero-kicker">COLLEGE ROCKET</view> |
|
|
|
<view class="hero-kicker">{{isSocialArea ? 'FRIEND ROCKET' : 'COLLEGE ROCKET'}}</view> |
|
|
|
<view class="hero-title">{{pageTitle}}</view> |
|
|
|
<view class="college-picker" @tap="openCollegePicker"> |
|
|
|
<text>{{college ? '已选择学院' : '先选择学院'}}</text> |
|
|
|
<text>{{college ? ('已选择' + teamLabel) : ('先选择' + teamLabel)}}</text> |
|
|
|
<text>{{collegeName}} ›</text> |
|
|
|
</view> |
|
|
|
<view class="rocket"> |
|
|
|
@ -42,8 +42,8 @@ |
|
|
|
<view class="glory-mini-item" v-for="(item,i) in compactGloryList" :key="item._key" :class="'rank-' + i"> |
|
|
|
<view class="mini-medal">{{gloryMedals[i] || (i + 1)}}</view> |
|
|
|
<view class="mini-main"> |
|
|
|
<text>{{item.nickname || '匿名同学'}}</text> |
|
|
|
<text>{{item.college || '神秘学院'}}</text> |
|
|
|
<text>{{item.nickname || anonymousUserLabel}}</text> |
|
|
|
<text>{{item.college || mysteryTeamLabel}}</text> |
|
|
|
</view> |
|
|
|
<view class="mini-score">{{item.durationSeconds || 0}}s</view> |
|
|
|
</view> |
|
|
|
@ -52,14 +52,14 @@ |
|
|
|
</view> |
|
|
|
<view class="rank-mini-panel"> |
|
|
|
<view class="rank-mini-title"> |
|
|
|
<text>学院排位榜</text> |
|
|
|
<text>{{teamLabel}}排位榜</text> |
|
|
|
<text>推进值</text> |
|
|
|
</view> |
|
|
|
<view class="college-mini-list" v-if="compactCollegeRanks.length"> |
|
|
|
<view class="college-mini-item" v-for="(item,i) in compactCollegeRanks" :key="i"> |
|
|
|
<view class="mini-medal">{{i + 1}}</view> |
|
|
|
<view class="mini-main"> |
|
|
|
<text>{{item.college || item.nickname || '未知学院'}}</text> |
|
|
|
<text>{{item.college || item.nickname || unknownTeamLabel}}</text> |
|
|
|
<view class="mini-bar"><view :style="{width: (item.percent || 8) + '%'}"></view></view> |
|
|
|
</view> |
|
|
|
<view class="mini-score college-score">{{item.score || 0}}</view> |
|
|
|
@ -77,14 +77,14 @@ |
|
|
|
<text>{{cleared ? clearedPillText : timerText}}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<button class="arena-share" v-if="isPkMode" open-type="share">邀请同学来擂台</button> |
|
|
|
<button class="arena-share" v-if="isPkMode" open-type="share">邀请好友来擂台</button> |
|
|
|
<view class="start-strip" :class="{disabled: actionLocked && isDailyMode}" v-if="!playing && !cleared" @tap="startLevel"> |
|
|
|
<text>{{isDailyMode ? '开始游戏' : '开始PK'}}</text> |
|
|
|
<text>先点这里,再开始消除卡牌</text> |
|
|
|
</view> |
|
|
|
<view class="start-strip done" v-if="cleared && isDailyMode"> |
|
|
|
<text>今日已通关</text> |
|
|
|
<text>{{dailyResultText || '明天再来为学院继续推进'}}</text> |
|
|
|
<text>{{dailyResultText || ('明天再来为' + teamLabel + '继续推进')}}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="tips"> |
|
|
|
@ -154,15 +154,15 @@ |
|
|
|
<view class="modal-card"> |
|
|
|
<view class="modal-title">{{modal.title}}</view> |
|
|
|
<view class="modal-sub">{{modal.sub}}</view> |
|
|
|
<button class="invite-share" v-if="modal.invite" open-type="share">邀请好友为学院助力</button> |
|
|
|
<button class="invite-share" v-if="modal.invite" open-type="share">邀请好友为{{teamLabel}}助力</button> |
|
|
|
<view class="main-btn" @tap="closeModal">知道了</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view v-if="collegeModal" class="modal"> |
|
|
|
<view class="modal-card college-modal"> |
|
|
|
<view class="modal-title">选择你的学院</view> |
|
|
|
<view class="modal-sub">学院来自当前校区后台配置,可随时修改。当天通关后会为所选学院贡献推进值。</view> |
|
|
|
<view class="modal-title">选择你的{{teamLabel}}</view> |
|
|
|
<view class="modal-sub">{{teamLabel}}来自当前{{regionLabel}}后台配置,可随时修改。当天通关后会为所选{{teamLabel}}贡献推进值。</view> |
|
|
|
<scroll-view scroll-y class="college-list"> |
|
|
|
<view |
|
|
|
class="college-option" |
|
|
|
@ -173,11 +173,11 @@ |
|
|
|
<text>{{item.icon || '🎓'}}</text> |
|
|
|
<view> |
|
|
|
<text>{{item.collegeName}}</text> |
|
|
|
<text>{{item.shortName || '学院战队'}}</text> |
|
|
|
<text>{{item.shortName || defaultTeamShortName}}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
<view class="empty" v-if="!colleges.length">当前校区还没有配置学院,请联系后台先维护学院配置</view> |
|
|
|
<view class="empty" v-if="!colleges.length">当前{{regionLabel}}还没有配置{{teamLabel}},请联系后台先维护{{teamLabel}}配置</view> |
|
|
|
<view class="main-btn" @tap="closeCollegePicker">确定</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -185,7 +185,7 @@ |
|
|
|
<view v-if="rewardModal.show" class="modal"> |
|
|
|
<view class="modal-card reward-modal"> |
|
|
|
<view class="modal-title">昨日奖励记录</view> |
|
|
|
<view class="modal-sub">个人前五显示通关秒数,学院前三显示学院分数。</view> |
|
|
|
<view class="modal-sub">个人前五显示通关秒数,{{teamLabel}}前三显示{{teamLabel}}分数。</view> |
|
|
|
<view class="reward-modal-grid"> |
|
|
|
<view class="reward-modal-panel"> |
|
|
|
<view class="reward-modal-head"> |
|
|
|
@ -196,7 +196,7 @@ |
|
|
|
<view class="reward-record-row" v-for="(item,i) in personalRewardList" :key="item._key"> |
|
|
|
<view class="mini-medal">{{gloryMedals[i] || item.rankNo || (i + 1)}}</view> |
|
|
|
<view class="mini-main"> |
|
|
|
<text>{{item.nickname || '匿名同学'}}</text> |
|
|
|
<text>{{item.nickname || anonymousUserLabel}}</text> |
|
|
|
<text class="reward-content personal">{{item.rewardContent || '现金奖励待发放'}}</text> |
|
|
|
</view> |
|
|
|
<view class="mini-score">{{item.durationSeconds || 0}}s</view> |
|
|
|
@ -206,20 +206,20 @@ |
|
|
|
</view> |
|
|
|
<view class="reward-modal-panel"> |
|
|
|
<view class="reward-modal-head"> |
|
|
|
<text>学院前三</text> |
|
|
|
<text>{{teamLabel}}前三</text> |
|
|
|
<text>分数</text> |
|
|
|
</view> |
|
|
|
<view v-if="collegeRewardList.length" class="reward-record-list"> |
|
|
|
<view class="reward-record-row" v-for="(item,i) in collegeRewardList" :key="item._key"> |
|
|
|
<view class="mini-medal">{{item.rankNo || (i + 1)}}</view> |
|
|
|
<view class="mini-main"> |
|
|
|
<text>{{item.college || item.nickname || '未知学院'}}</text> |
|
|
|
<text class="reward-content college">{{item.rewardContent || '学院奖励待发放'}}</text> |
|
|
|
<text>{{item.college || item.nickname || unknownTeamLabel}}</text> |
|
|
|
<text class="reward-content college">{{item.rewardContent || (teamLabel + '奖励待发放')}}</text> |
|
|
|
</view> |
|
|
|
<view class="mini-score college-score">{{item.score || 0}}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="empty mini-empty" v-else>昨日暂无学院奖励</view> |
|
|
|
<view class="empty mini-empty" v-else>昨日暂无{{teamLabel}}奖励</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="main-btn" @tap="closeRewardModal">知道了</view> |
|
|
|
@ -276,12 +276,37 @@ |
|
|
|
loading: false, |
|
|
|
personalRewardList: [], |
|
|
|
collegeRewardList: [] |
|
|
|
} |
|
|
|
}, |
|
|
|
areaKind: 1 |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
isSocialArea() { |
|
|
|
return Number(this.areaKind) === 2 |
|
|
|
}, |
|
|
|
rankEventName() { |
|
|
|
return this.isSocialArea ? '同城排位赛' : '学院排位赛' |
|
|
|
}, |
|
|
|
teamLabel() { |
|
|
|
return this.isSocialArea ? '战队' : '学院' |
|
|
|
}, |
|
|
|
regionLabel() { |
|
|
|
return this.isSocialArea ? '区域' : '校区' |
|
|
|
}, |
|
|
|
anonymousUserLabel() { |
|
|
|
return this.isSocialArea ? '匿名好友' : '匿名同学' |
|
|
|
}, |
|
|
|
mysteryTeamLabel() { |
|
|
|
return this.isSocialArea ? '神秘战队' : '神秘学院' |
|
|
|
}, |
|
|
|
unknownTeamLabel() { |
|
|
|
return this.isSocialArea ? '未知战队' : '未知学院' |
|
|
|
}, |
|
|
|
defaultTeamShortName() { |
|
|
|
return this.isSocialArea ? '好友战队' : '学院战队' |
|
|
|
}, |
|
|
|
collegeName() { |
|
|
|
return this.college || '我的学院' |
|
|
|
return this.college || ('我的' + this.teamLabel) |
|
|
|
}, |
|
|
|
isDailyMode() { |
|
|
|
return this.mode === 'daily' |
|
|
|
@ -300,7 +325,9 @@ |
|
|
|
heroSub() { |
|
|
|
if (this.isPkMode) return '同一房间使用完全一致的卡牌布局。每人只有一次机会,退出或失败都会记录成绩。' |
|
|
|
if (this.isChallengeMode) return '复刻好友通关布局,挑战同一组卡牌,结束后会显示领先或落后秒数。' |
|
|
|
return '21:30结算学院榜券奖励,前三名学院参与者每人得3/2/1张星球券;个人最快通关前五名可获得现金奖励5/4/3/2/1元。' |
|
|
|
return this.isSocialArea |
|
|
|
? '21:30结算战队榜券奖励,前三名战队参与者每人得3/2/1张星球券;个人最快通关前五名可获得现金奖励5/4/3/2/1元。' |
|
|
|
: '21:30结算学院榜券奖励,前三名学院参与者每人得3/2/1张星球券;个人最快通关前五名可获得现金奖励5/4/3/2/1元。' |
|
|
|
}, |
|
|
|
gameTitle() { |
|
|
|
if (this.isPkMode) return '擂台关卡' |
|
|
|
@ -455,6 +482,7 @@ |
|
|
|
this.userId = uni.getStorageSync('id') || '' |
|
|
|
this.nickname = uni.getStorageSync('nickName') || uni.getStorageSync('nickname') || '' |
|
|
|
this.avatar = uni.getStorageSync('avatarUrl') || uni.getStorageSync('avatar') || '' |
|
|
|
this.syncAreaKind() |
|
|
|
try { |
|
|
|
const area = uni.getStorageSync('area') |
|
|
|
if (area) this.regionId = JSON.parse(area).id || '' |
|
|
|
@ -480,6 +508,7 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
this.syncAreaKind() |
|
|
|
if (!this.playing || !this.startTs) return |
|
|
|
const elapsed = Math.floor((Date.now() - this.startTs) / 1000) |
|
|
|
this.timeLeft = Math.max(0, this.timeLimit - elapsed) |
|
|
|
@ -499,11 +528,26 @@ |
|
|
|
} |
|
|
|
const collegeParam = this.college ? ('?college=' + encodeURIComponent(this.college)) : '' |
|
|
|
return { |
|
|
|
title: this.college ? `来为${this.college}助力,冲学院排位榜!` : '学院排位赛,来帮学院冲榜', |
|
|
|
title: this.college |
|
|
|
? `来为${this.college}助力,冲${this.teamLabel}排位榜!` |
|
|
|
: `${this.rankEventName},来帮${this.teamLabel}冲榜`, |
|
|
|
path: buildHomeSharePath('/package5/planet/adventure' + collegeParam) |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
syncAreaKind(areaObj) { |
|
|
|
let area = areaObj |
|
|
|
if (!area) { |
|
|
|
try { |
|
|
|
const cached = uni.getStorageSync('area') |
|
|
|
area = cached ? (typeof cached === 'string' ? JSON.parse(cached) : cached) : null |
|
|
|
} catch (e) { |
|
|
|
area = null |
|
|
|
} |
|
|
|
} |
|
|
|
const kind = area ? Number(area.areaKind) : 1 |
|
|
|
this.areaKind = kind === 2 ? 2 : 1 |
|
|
|
}, |
|
|
|
initNavHeight() { |
|
|
|
try { |
|
|
|
const menu = uni.getMenuButtonBoundingClientRect && uni.getMenuButtonBoundingClientRect() |
|
|
|
@ -1440,7 +1484,7 @@ |
|
|
|
this.modal = { |
|
|
|
show: true, |
|
|
|
title: '排位成功', |
|
|
|
sub: `${this.collegeName} 获得 ${progress} 点推进值。分享给好友继续为学院助力,每个人都会随机生成自己的关卡。`, |
|
|
|
sub: `${this.collegeName} 获得 ${progress} 点推进值。分享给好友继续为${this.teamLabel}助力,每个人都会随机生成自己的关卡。`, |
|
|
|
invite: true, |
|
|
|
duration |
|
|
|
} |
|
|
|
@ -1580,7 +1624,7 @@ |
|
|
|
}, |
|
|
|
closeCollegePicker() { |
|
|
|
if (!this.college) { |
|
|
|
this.tui.toast('请先选择学院') |
|
|
|
this.tui.toast('请先选择' + this.teamLabel) |
|
|
|
return |
|
|
|
} |
|
|
|
this.collegeModal = false |
|
|
|
|