diff --git a/package1/components/planet/planet-adventure-entry.vue b/package1/components/planet/planet-adventure-entry.vue
index 512f8ba..64e88be 100644
--- a/package1/components/planet/planet-adventure-entry.vue
+++ b/package1/components/planet/planet-adventure-entry.vue
@@ -1,15 +1,33 @@
-
-
- COLLEGE ROCKET
- 学院助推赛
- 校园版羊了个羊 · 每天2分钟 · 为学院争地标
+
+
+ 开始助推
+
+ COLLEGE ROCKET
+ 学院助推赛
+ 玩一局有机会获得更多星球券,为学院争地标
+
+
+
+ 🚀
+
+
-
- 🚀
-
+
+ 开始PK
+
+ COLLEGE ROCKET
+ 星球擂台赛
+ 看看谁才是PK王
+
+
+
+ 🚀
+
+
+
diff --git a/package1/components/planet/planet-box.vue b/package1/components/planet/planet-box.vue
index 62b7060..8a4097c 100644
--- a/package1/components/planet/planet-box.vue
+++ b/package1/components/planet/planet-box.vue
@@ -81,7 +81,6 @@
height: 150rpx;
border-radius: 50%;
background: radial-gradient(circle, rgba(255,184,77,0.38), transparent 66%);
- animation: spark 2s ease-in-out infinite;
}
.pb-box {
diff --git a/package1/components/planet/planet-daily-loop.vue b/package1/components/planet/planet-daily-loop.vue
index fe160b6..4b1c1b7 100644
--- a/package1/components/planet/planet-daily-loop.vue
+++ b/package1/components/planet/planet-daily-loop.vue
@@ -3,56 +3,87 @@
2 MIN DAILY
- 今天就做这几步
- 收券、看事件、反搜、投奖池,90秒走人
+ {{progressTitle}}
+ 完成任务可获得星球券与开奖权重
+
+
+ 星球补给地图
+ 进入
- {{data.minutesToDraw || 0}}min
-
-
- 今晚现金奖池
- ¥{{poolAmount}}
+
+
+
+
+
+
+
+
+ 投入星球券
+ 参与今晚奖金池瓜分
+
+
+ {{taskDone('pool') ? '已参与' : '立即参与'}}
+ 预计提升中奖概率 +{{boostText}}%
+ →
+
+
+
+
+
+
+ {{taskDone('sign') ? '✓ 已完成' : '待签到'}}
+
+ 签到收券
+ 奖励 +1 星球券
+
+
+
+
+ {{taskDone('hunt') ? '✓ 已完成' : '去搜查 →'}}
+
+ 星球搜查令
+ 随机搜查,白嫖得券
-
+
{{data.todayCollectedTickets || 0}}
今日收券
-
+
{{data.myPoolTickets || 0}}
已投奖池
-
- {{data.poolJoinCount || 0}}
- 参与同学
+
+ {{data.myProbability || 0}}%
+ 中奖概率
-
- {{e}}
-
-
-
-
- 1
- {{collectText}}
-
-
- 2
- {{data.hasRevengeTarget ? '反搜一下' : '随机搜查'}}
-
-
- 3
- {{joinText}}
-
-
+ {{rewardFloat.text}}
+ 券
@@ -60,49 +91,155 @@
export default {
props: {
data: { type: Object, default: () => ({}) },
- poolAmount: { type: [String, Number], default: 0 }
+ myTicketCount: { type: Number, default: 0 }
+ },
+ data() {
+ return {
+ flying: false,
+ flyTimer: null,
+ rewardFloat: {
+ show: false,
+ text: '',
+ type: ''
+ },
+ rewardTimer: null
+ }
},
computed: {
events() {
return this.data.events || []
},
- collectText() {
- if (!this.data.signedToday) return '签到收券'
- if (this.data.boxAvailable) return '开补给箱'
- return '已收完'
+ doneCount() {
+ let count = 0
+ if (this.taskDone('pool')) count += 1
+ if (this.taskDone('sign')) count += 1
+ if (this.taskDone('hunt')) count += 1
+ return count
+ },
+ progressPercent() {
+ return Math.round((this.doneCount / 3) * 100)
},
- joinText() {
- const n = this.data.suggestedAddTickets || 1
- return '投' + n + '券冲奖池'
+ progressTitle() {
+ const left = 3 - this.doneCount
+ return left > 0 ? ('离瓜分奖金池还差 ' + left + ' 步') : '今日白嫖进度已完成'
+ },
+ boostText() {
+ const current = Number(this.data.myProbability || 0)
+ const suggested = Number(this.data.suggestedProbability || 0)
+ if (suggested > current) return (suggested - current).toFixed(2)
+ return '1.00'
+ }
+ },
+ beforeDestroy() {
+ if (this.flyTimer) clearTimeout(this.flyTimer)
+ if (this.rewardTimer) clearTimeout(this.rewardTimer)
+ },
+ methods: {
+ taskDone(type) {
+ if (type === 'sign') return !!this.data.signedToday && !this.data.boxAvailable
+ if (type === 'hunt') return !!this.data.searchedToday || !!this.data.huntedToday || (this.data.remainSearchCount === 0)
+ if (type === 'pool') return (this.data.myPoolTickets || 0) > 0
+ return false
+ },
+ onCollect() {
+ this.playReward('+1 星球券', 'sign')
+ this.$emit('collect')
+ },
+ onRevenge() {
+ this.playReward('随机奖励', 'hunt')
+ this.$emit('revenge')
+ },
+ playReward(text, type) {
+ if (this.rewardTimer) clearTimeout(this.rewardTimer)
+ this.rewardFloat = {
+ show: true,
+ text,
+ type
+ }
+ this.rewardTimer = setTimeout(() => {
+ this.rewardFloat.show = false
+ }, 800)
+ },
+ onJoin() {
+ if (this.flying) return
+ if (this.myTicketCount <= 0) {
+ this.$emit('join')
+ return
+ }
+ this.flying = true
+ this.playReward('+开奖权重', 'pool')
+ this.$emit('join')
+ if (this.flyTimer) clearTimeout(this.flyTimer)
+ this.flyTimer = setTimeout(() => {
+ this.flying = false
+ }, 940)
}
}
}
diff --git a/package1/components/planet/planet-header.vue b/package1/components/planet/planet-header.vue
index 5fe074f..a438568 100644
--- a/package1/components/planet/planet-header.vue
+++ b/package1/components/planet/planet-header.vue
@@ -5,8 +5,8 @@
Hello,白嫖居民
- 明细
- 开奖
+ 得券明细
+ 开奖记录
攒券、追捕、开盲盒,全校一起瓜分补给池
@@ -21,7 +21,7 @@
-
+
白嫖说明书
@@ -74,7 +74,7 @@
{{data.joinCount || 0}}
竟奖人数
-
+
{{rankText}}
财富坐标
@@ -138,6 +138,12 @@
goDraw() {
this.$emit('draw')
},
+ goGuide() {
+ this.$emit('guide')
+ },
+ goRank() {
+ this.$emit('rank')
+ },
pad(n) {
return n < 10 ? ('0' + n) : ('' + n)
},
@@ -238,7 +244,7 @@
border-radius: 999rpx;
background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.95), rgba(79,183,255,0.4));
transform: rotate(-28deg);
- animation: meteorFly 4.8s linear infinite;
+ opacity: 0.48;
z-index: 2;
}
@@ -269,7 +275,6 @@
width: 170rpx;
height: 78rpx;
z-index: 4;
- animation: stationFloat 5.6s ease-in-out infinite;
}
@keyframes stationFloat {
@@ -307,7 +312,6 @@
background: linear-gradient(145deg, #FFE6A6, #FFB7D1);
box-shadow: inset -10rpx -10rpx 20rpx rgba(150,93,48,0.12), 0 12rpx 30rpx rgba(255,184,77,0.18);
z-index: 3;
- animation: asteroidFloat 6.2s ease-in-out infinite;
}
.ph-asteroid-a {
@@ -346,7 +350,6 @@
font-size: 23rpx;
font-weight: 900;
z-index: 5;
- animation: treasureFloat 4.4s ease-in-out infinite;
}
.ph-floating-box-lid {
@@ -404,7 +407,6 @@
width: 610rpx;
height: 610rpx;
z-index: 3;
- animation: planetBreath 4.4s ease-in-out infinite;
}
.ph-planet-glow {
@@ -416,7 +418,6 @@
border-radius: 50%;
transform: translate(-50%, -50%);
background: radial-gradient(circle, rgba(53,214,166,0.26), rgba(79,183,255,0.12) 42%, rgba(255,255,255,0) 68%);
- filter: blur(8rpx);
}
.ph-planet {
@@ -447,7 +448,6 @@
.ph-planet-map {
position: absolute;
background: rgba(53,214,166,0.16);
- filter: blur(1rpx);
}
.ph-planet-map-a {
@@ -482,7 +482,6 @@
position: absolute;
border-radius: 50%;
background: rgba(255,255,255,0.72);
- filter: blur(2rpx);
}
.ph-shine-a {
@@ -522,7 +521,6 @@
border-radius: 56rpx;
background: rgba(255,255,255,0.34);
border: 1rpx solid rgba(255,255,255,0.72);
- backdrop-filter: blur(14px);
box-shadow: inset 0 0 0 1rpx rgba(255,255,255,0.36), 0 18rpx 44rpx rgba(53,214,166,0.12);
display: flex;
flex-direction: column;
@@ -647,7 +645,6 @@
display: flex;
flex-direction: column;
align-items: center;
- animation: orbitFloat 4s ease-in-out infinite;
}
.ph-satellite-left {
@@ -692,7 +689,6 @@
width: 142rpx;
height: 164rpx;
z-index: 7;
- animation: squirrelFloat 4.6s ease-in-out infinite;
}
@keyframes squirrelFloat {
diff --git a/package1/components/planet/planet-me.vue b/package1/components/planet/planet-me.vue
index eeebb32..c221f04 100644
--- a/package1/components/planet/planet-me.vue
+++ b/package1/components/planet/planet-me.vue
@@ -74,7 +74,6 @@
background: linear-gradient(145deg, rgba(255,255,255,0.86), rgba(245,255,250,0.64));
border: 2rpx solid rgba(255,255,255,0.9);
box-shadow: 0 22rpx 60rpx rgba(53,214,166,0.14);
- backdrop-filter: blur(10px);
overflow: hidden;
/* transform: rotate(-1.2deg); */
}
diff --git a/package1/components/planet/planet-rank.vue b/package1/components/planet/planet-rank.vue
index 63ded80..ae2de37 100644
--- a/package1/components/planet/planet-rank.vue
+++ b/package1/components/planet/planet-rank.vue
@@ -121,7 +121,6 @@
border-radius: 999rpx;
transform-origin: left center;
background: linear-gradient(90deg, rgba(255,122,89,0.72), rgba(255,122,89,0));
- animation: radarSpin 2.4s linear infinite;
}
@keyframes radarSpin {
diff --git a/package1/planet/adventure.vue b/package1/planet/adventure.vue
index ebff562..a1f6df0 100644
--- a/package1/planet/adventure.vue
+++ b/package1/planet/adventure.vue
@@ -1,14 +1,14 @@
-
+
‹
学院助推赛
-
+
COLLEGE ROCKET
- 今天为 {{collegeName}} 推一把
+ {{pageTitle}}
{{college ? '已选择学院' : '先选择学院'}}
{{collegeName}} ›
@@ -19,10 +19,28 @@
- 每天1关,通关贡献学院推进值。21:30结算,前三学院成员分别获得3/2/1张星球券。
+ {{heroSub}}
-
+
+
+ 今日最快通关榜
+ 学院荣耀
+
+
+
+ {{['🥇','🥈','🥉'][i] || (i + 1)}}
+
+ {{item.college || '神秘学院'}}
+ {{item.nickname || '匿名同学'}}
+
+ {{item.durationSeconds || 0}}s
+
+
+ 今天还没人通关,第一枚金牌等你来拿
+
+
+
学院推进榜
我的学院第 {{home.myRankNo || '-'}} 名
@@ -40,16 +58,17 @@
- 今日关卡
+ {{gameTitle}}
{{cleared ? '已通关' : timerText}}
+
开始助推
先点这里,再开始消除卡牌
-
+
今日已助推
明天再来为学院继续推进
@@ -102,9 +121,9 @@
- 重开本关
+ {{isDailyMode ? '重开本关' : '查看同局'}}
- {{cleared ? '今日已助推' : (playing ? '助推中' : '开始助推')}}
+ {{startButtonText}}
@@ -114,6 +133,8 @@
{{modal.title}}
{{modal.sub}}
+ 生成好友挑战卡
+
知道了
@@ -148,6 +169,7 @@
data() {
return {
statusBarHeight: 20,
+ navHeight: 64,
userId: '',
regionId: '',
nickname: '',
@@ -167,7 +189,17 @@
timeLeft: 300,
timer: null,
roundSeed: '',
+ mode: 'daily',
+ roomId: '',
+ challengeId: '',
+ fixedSeed: '',
+ pkInfo: null,
+ challengeInfo: null,
+ shareChallenge: null,
+ gloryList: [],
moveCount: 0,
+ buildingLevel: false,
+ prebuildTimer: null,
modal: { show: false, title: '', sub: '' }
}
},
@@ -175,6 +207,37 @@
collegeName() {
return this.college || '我的学院'
},
+ isDailyMode() {
+ return this.mode === 'daily'
+ },
+ isPkMode() {
+ return this.mode === 'pk'
+ },
+ isChallengeMode() {
+ return this.mode === 'challenge'
+ },
+ pageTitle() {
+ if (this.isPkMode) return '星球擂台开战'
+ if (this.isChallengeMode) return '好友挑战赛'
+ return `今天为 ${this.collegeName} 推一把`
+ },
+ heroSub() {
+ if (this.isPkMode) return '同一房间使用完全一致的卡牌布局。每人只有一次机会,退出或失败都会记录成绩。'
+ if (this.isChallengeMode) return '复刻好友通关布局,挑战同一组卡牌,结束后会显示领先或落后秒数。'
+ return '每天1关,通关贡献学院推进值。21:30结算,前三学院成员分别获得3/2/1张星球券。'
+ },
+ gameTitle() {
+ if (this.isPkMode) return '擂台关卡'
+ if (this.isChallengeMode) return '挑战关卡'
+ return '今日关卡'
+ },
+ startButtonText() {
+ if (this.playing) return '助推中'
+ if (this.cleared) return this.isDailyMode ? '今日已助推' : '成绩已提交'
+ if (this.isPkMode) return '开始擂台'
+ if (this.isChallengeMode) return '开始挑战'
+ return '开始助推'
+ },
collegeRanks() {
const list = this.home.rankList || []
let max = 1
@@ -251,9 +314,16 @@
return '先看上层再下手'
}
},
- onLoad() {
+ onLoad(options) {
const sys = uni.getSystemInfoSync()
this.statusBarHeight = sys.statusBarHeight || 20
+ this.initNavHeight()
+ options = options || {}
+ this.mode = options.mode || 'daily'
+ this.roomId = options.roomId || ''
+ this.challengeId = options.challengeId || ''
+ this.fixedSeed = options.seed ? decodeURIComponent(options.seed) : ''
+ if (!this.ensureLoginForShare()) return
this.userId = uni.getStorageSync('id') || ''
this.nickname = uni.getStorageSync('nickName') || uni.getStorageSync('nickname') || ''
this.avatar = uni.getStorageSync('avatarUrl') || uni.getStorageSync('avatar') || ''
@@ -264,13 +334,20 @@
this.college = uni.getStorageSync('planetCollege_' + this.regionId) || ''
this.loadColleges()
this.loadHome()
- this.buildLevel()
+ this.loadGlory()
+ this.prepareSharedMode()
+ this.schedulePrebuildLevel()
},
onUnload() {
this.clearTimer()
+ this.clearPrebuildTimer()
},
onHide() {
- this.clearTimer()
+ if (this.playing && this.isPkMode) {
+ this.submitLeave()
+ } else {
+ this.clearTimer()
+ }
},
onShow() {
if (!this.playing || !this.startTs) return
@@ -282,8 +359,54 @@
this.startTimer(false)
}
},
+ onShareAppMessage() {
+ if (this.shareChallenge) {
+ return {
+ title: `我用${this.shareChallenge.durationSeconds}秒通关学院助推赛,你敢挑战吗?`,
+ path: '/package1/planet/adventure?mode=challenge&challengeId=' + this.shareChallenge.id
+ }
+ }
+ if (this.isPkMode && this.roomId) {
+ const roomName = (this.pkInfo && this.pkInfo.roomName) || '星球擂台'
+ return {
+ title: `星球擂台开战:${roomName}`,
+ path: '/package1/planet/adventure?mode=pk&roomId=' + this.roomId
+ }
+ }
+ return {
+ title: '学院助推赛,来帮学院冲榜',
+ path: '/package1/planet/adventure'
+ }
+ },
methods: {
+ initNavHeight() {
+ try {
+ const menu = uni.getMenuButtonBoundingClientRect && uni.getMenuButtonBoundingClientRect()
+ if (menu && menu.top && menu.height) {
+ this.navHeight = menu.top + menu.height + 8
+ return
+ }
+ } catch (e) {}
+ this.navHeight = this.statusBarHeight + 44
+ },
+ currentSharePath() {
+ if (this.isPkMode && this.roomId) return '/package1/planet/adventure?mode=pk&roomId=' + this.roomId
+ if (this.isChallengeMode && this.challengeId) return '/package1/planet/adventure?mode=challenge&challengeId=' + this.challengeId
+ return '/package1/planet/adventure'
+ },
+ ensureLoginForShare() {
+ if (this.userId || uni.getStorageSync('id')) return true
+ if (this.isPkMode || this.isChallengeMode) {
+ uni.setStorageSync('planetPendingSharePath', this.currentSharePath())
+ uni.redirectTo({
+ url: '/package2/login/login?redirect=planetPendingSharePath'
+ })
+ return false
+ }
+ return true
+ },
loadColleges() {
+ if (!this.regionId && !this.isDailyMode) return
this.tui.request('/app/planet/college/list', 'POST', {
regionId: this.regionId
}, false, false, true).then(res => {
@@ -294,13 +417,17 @@
this.college = ''
uni.removeStorageSync('planetCollege_' + this.regionId)
}
- if (!this.college && this.colleges.length) {
+ if (!this.college && this.colleges.length && this.isDailyMode) {
this.collegeModal = true
}
}
})
},
loadHome() {
+ if (!this.isDailyMode) {
+ this.cleared = false
+ return
+ }
this.tui.request('/app/planet/adventure/home', 'POST', {
userId: this.userId,
regionId: this.regionId,
@@ -312,12 +439,86 @@
}
})
},
+ loadGlory() {
+ if (!this.regionId) return
+ this.tui.request('/app/planet/adventure/glory', 'POST', {
+ regionId: this.regionId
+ }, false, false, true).then(res => {
+ if (res.code == 200) {
+ this.gloryList = (res.result || []).map((item, index) => {
+ item._key = item.id || ('glory_' + index)
+ return item
+ })
+ }
+ })
+ },
+ prepareSharedMode() {
+ if (this.isPkMode && this.roomId && !this.fixedSeed) {
+ this.tui.request('/app/planet/adventure/pk/join', 'POST', {
+ userId: this.userId,
+ regionId: this.regionId,
+ nickname: this.nickname,
+ avatar: this.avatar,
+ college: this.college,
+ roomId: this.roomId
+ }).then(res => {
+ if (res.code != 200 || !res.result) {
+ this.tui.toast(res.message)
+ return
+ }
+ this.fixedSeed = res.result.seed
+ this.pkInfo = res.result.room
+ if (!this.regionId && this.pkInfo) this.regionId = this.pkInfo.regionId || ''
+ if (!this.college && res.result.player) this.college = res.result.player.college || ''
+ this.roundSeed = this.fixedSeed
+ this.buildLevel()
+ })
+ }
+ if (this.isChallengeMode && this.challengeId && !this.fixedSeed) {
+ this.tui.request('/app/planet/adventure/challenge/start', 'POST', {
+ userId: this.userId,
+ regionId: this.regionId,
+ challengeId: this.challengeId
+ }).then(res => {
+ if (res.code != 200 || !res.result) {
+ this.tui.toast(res.message)
+ return
+ }
+ this.fixedSeed = res.result.seed
+ this.challengeInfo = res.result.challenge
+ if (!this.regionId && this.challengeInfo) this.regionId = this.challengeInfo.regionId || ''
+ if (!this.college && this.challengeInfo) this.college = this.challengeInfo.college || ''
+ this.roundSeed = this.fixedSeed
+ this.buildLevel()
+ })
+ }
+ },
+ schedulePrebuildLevel() {
+ if (!this.isDailyMode && !this.fixedSeed) return
+ this.clearPrebuildTimer()
+ this.prebuildTimer = setTimeout(() => {
+ if (this.cards.length || this.playing || this.cleared) return
+ this.roundSeed = this.fixedSeed || this.newRoundSeed()
+ this.buildLevel()
+ if (!this.cards.length) this.buildLevel()
+ }, 200)
+ },
+ clearPrebuildTimer() {
+ if (!this.prebuildTimer) return
+ clearTimeout(this.prebuildTimer)
+ this.prebuildTimer = null
+ },
startLevel() {
if (this.cleared || this.playing) return
- if (!this.college) {
+ this.clearPrebuildTimer()
+ if (!this.college && this.isDailyMode) {
this.openCollegePicker()
return
}
+ if (!this.isDailyMode) {
+ this.startFixedMode()
+ return
+ }
this.tui.request('/app/planet/adventure/start', 'POST', {
userId: this.userId,
regionId: this.regionId,
@@ -332,40 +533,98 @@
this.session = res.result
this.playing = true
this.startTs = Date.now()
- this.roundSeed = this.newRoundSeed()
- this.buildLevel()
- if (!this.cards.length) this.buildLevel()
+ if (!this.cards.length) {
+ this.roundSeed = this.newRoundSeed()
+ this.buildLevel()
+ if (!this.cards.length) this.buildLevel()
+ }
this.startTimer()
})
},
+ startFixedMode() {
+ if (!this.fixedSeed && this.isPkMode) {
+ this.tui.request('/app/planet/adventure/pk/join', 'POST', {
+ userId: this.userId,
+ regionId: this.regionId,
+ nickname: this.nickname,
+ avatar: this.avatar,
+ college: this.college,
+ roomId: this.roomId
+ }).then(res => {
+ if (res.code != 200 || !res.result) {
+ this.tui.toast(res.message)
+ return
+ }
+ this.fixedSeed = res.result.seed
+ this.pkInfo = res.result.room
+ this.roomId = res.result.roomId || this.roomId
+ if (!this.regionId && this.pkInfo) this.regionId = this.pkInfo.regionId || ''
+ if (!this.college && res.result.player) this.college = res.result.player.college || ''
+ this.startFixedMode()
+ })
+ return
+ }
+ if (this.isChallengeMode && !this.fixedSeed) {
+ this.tui.request('/app/planet/adventure/challenge/start', 'POST', {
+ userId: this.userId,
+ regionId: this.regionId,
+ challengeId: this.challengeId
+ }).then(res => {
+ if (res.code != 200 || !res.result) {
+ this.tui.toast(res.message)
+ return
+ }
+ this.fixedSeed = res.result.seed
+ this.challengeInfo = res.result.challenge
+ this.challengeId = res.result.challengeId || this.challengeId
+ if (!this.regionId && this.challengeInfo) this.regionId = this.challengeInfo.regionId || ''
+ if (!this.college && this.challengeInfo) this.college = this.challengeInfo.college || ''
+ this.startFixedMode()
+ })
+ return
+ }
+ this.playing = true
+ this.startTs = Date.now()
+ this.roundSeed = this.fixedSeed
+ if (!this.cards.length) {
+ this.buildLevel()
+ if (!this.cards.length) this.buildLevel()
+ }
+ this.startTimer()
+ },
buildLevel() {
const icons = ['🍔', '🥤', '🥟', '🏀', '🎧', '🚲', '🍜', '🔥', '☕', '🍢']
const garbageIcons = ['🚀', '🍱', '🍗']
if (!this.roundSeed) this.roundSeed = this.newRoundSeed()
let cards = []
- for (let attempt = 0; attempt < 100; attempt++) {
- const seed = this.roundSeed + '_try_' + attempt
- const positions = this.buildCardPositions(seed)
- cards = this.assignTrapLayoutIcons(positions, icons, garbageIcons, seed)
- if (cards.length && this.checkDifficultyMetrics(cards)) break
- cards = []
- }
- if (!cards.length) {
- cards = this.assignTrapLayoutIcons(this.buildCardPositions(this.roundSeed + '_fallback'), icons, garbageIcons, this.roundSeed + '_fallback', true)
- }
- if (!cards.length) {
- cards = this.assignEmergencyIcons(this.buildCardPositions(this.roundSeed + '_emergency'), icons, garbageIcons)
- }
- if (this.shouldBuildTrapLayout()) {
- this.applyTrapLayout(cards)
- }
- if (!this.validateTileCounts(cards)) {
- this.repairTileCounts(cards, icons, garbageIcons)
+ this.buildingLevel = true
+ try {
+ for (let attempt = 0; attempt < 100; attempt++) {
+ const seed = this.roundSeed + '_try_' + attempt
+ const positions = this.buildCardPositions(seed)
+ cards = this.assignTrapLayoutIcons(positions, icons, garbageIcons, seed)
+ if (cards.length && this.checkDifficultyMetrics(cards)) break
+ cards = []
+ }
+ if (!cards.length) {
+ cards = this.assignTrapLayoutIcons(this.buildCardPositions(this.roundSeed + '_fallback'), icons, garbageIcons, this.roundSeed + '_fallback', true)
+ }
+ if (!cards.length) {
+ cards = this.assignEmergencyIcons(this.buildCardPositions(this.roundSeed + '_emergency'), icons, garbageIcons)
+ }
+ if (this.shouldBuildTrapLayout()) {
+ this.applyTrapLayout(cards)
+ }
+ if (!this.validateTileCounts(cards)) {
+ this.repairTileCounts(cards, icons, garbageIcons)
+ }
+ this.cards = cards
+ this.slots = []
+ this.moveCount = 0
+ this.normalizeCards(icons)
+ } finally {
+ this.buildingLevel = false
}
- this.cards = cards
- this.slots = []
- this.moveCount = 0
- this.normalizeCards(icons)
this.refreshCardState()
},
newRoundSeed() {
@@ -661,7 +920,7 @@
tightenOpeningPressure(cards, rand) {
let buryIndex = 0
for (let round = 0; round < 3; round++) {
- this.refreshCardState()
+ this.forceRefreshCardState()
const visibleMap = {}
cards.forEach(card => {
if (card.removed || card.selected || card.coverDepth > 0 || this.isGarbageIcon(card.icon)) return
@@ -683,7 +942,7 @@
})
if (!changed) break
}
- this.refreshCardState()
+ this.forceRefreshCardState()
const visible = cards.filter(card => !card.removed && !card.selected && card.coverDepth === 0 && !this.isGarbageIcon(card.icon) && !card.openingSafe)
visible
.sort((a, b) => {
@@ -694,7 +953,7 @@
.forEach(card => {
this.buryOpeningCard(card, cards, buryIndex++, rand)
})
- this.refreshCardState()
+ this.forceRefreshCardState()
},
buryOpeningCard(card, cards, index, rand) {
card.layer = 0
@@ -722,7 +981,7 @@
cover.y = card.y + (i === 0 ? 0 : (i === 1 ? 10 : -10)) + Math.floor(rand() * 4)
cover.style = `left:${cover.x}rpx;top:${cover.y}rpx;z-index:${this.cardZIndex(cover)};`
}
- this.refreshCardState()
+ this.forceRefreshCardState()
},
repositionKeyCovers(cards, seed) {
const rand = this.seededRandom(seed + '_cover')
@@ -840,6 +1099,10 @@
return icon
},
refreshCardState() {
+ if (this.buildingLevel) return
+ this.forceRefreshCardState()
+ },
+ forceRefreshCardState() {
this.cards.forEach(card => {
const depth = this.coverDepth(card)
card.locked = !card.removed && !card.selected && depth > 0
@@ -950,6 +1213,10 @@
const progress = Math.max(100, 260 - duration + Math.max(0, 80 - this.moveCount))
this.playing = false
this.clearTimer()
+ if (!this.isDailyMode) {
+ this.submitCompetitive(true, duration, 0)
+ return
+ }
this.tui.request('/app/planet/adventure/submit', 'POST', {
userId: this.userId,
regionId: this.regionId,
@@ -966,8 +1233,9 @@
}).then(res => {
if (res.code == 200) {
this.cleared = true
- this.modal = { show: true, title: '助推成功', sub: `${this.collegeName} 获得 ${progress} 点推进值,晚上21:30争夺学院荣誉。` }
+ this.modal = { show: true, title: '助推成功', sub: `${this.collegeName} 获得 ${progress} 点推进值,晚上21:30争夺学院荣誉。`, challenge: true, duration }
this.loadHome()
+ this.loadGlory()
} else {
this.tui.toast(res.message)
}
@@ -976,24 +1244,102 @@
failLevel(title, sub) {
this.playing = false
this.clearTimer()
+ if (!this.isDailyMode) {
+ this.submitCompetitive(false, Math.floor((Date.now() - this.startTs) / 1000), this.remainingCount)
+ return
+ }
this.modal = {
show: true,
title: title || '槽位满了',
sub: sub || '本关失败,不消耗次数。换个顺序再推一次。'
}
},
+ submitCompetitive(cleared, duration, remainingCards) {
+ const url = this.isPkMode ? '/app/planet/adventure/pk/submit' : '/app/planet/adventure/challenge/submit'
+ const data = {
+ userId: this.userId,
+ regionId: this.regionId,
+ nickname: this.nickname,
+ avatar: this.avatar,
+ college: this.college,
+ roomId: this.roomId,
+ challengeId: this.challengeId,
+ cleared: cleared ? 1 : 0,
+ durationSeconds: Math.max(0, duration || 0),
+ remainingSeconds: this.timeLeft,
+ remainingCards: remainingCards || this.remainingCount
+ }
+ this.tui.request(url, 'POST', data).then(res => {
+ if (res.code != 200) {
+ this.tui.toast(res.message)
+ return
+ }
+ if (this.isPkMode) {
+ this.cleared = true
+ this.modal = {
+ show: true,
+ title: cleared ? '擂台成绩已提交' : '擂台挑战失败',
+ sub: cleared ? `用时 ${duration} 秒,等待房间结算。` : '本房间只有一次机会,成绩已记录,等待最终排名。'
+ }
+ } else {
+ this.cleared = true
+ const result = res.result || {}
+ this.modal = {
+ show: true,
+ title: cleared ? '挑战完成' : '挑战失败',
+ sub: result.resultText || (cleared ? `用时 ${duration} 秒` : '这次没追上,换个顺序还有机会。')
+ }
+ }
+ })
+ },
+ submitLeave() {
+ this.playing = false
+ this.clearTimer()
+ this.tui.request('/app/planet/adventure/pk/leave', 'POST', {
+ userId: this.userId,
+ regionId: this.regionId,
+ roomId: this.roomId,
+ remainingCards: this.remainingCount
+ }, false, false, true)
+ },
resetLevel() {
if (this.cleared) return
+ if (!this.isDailyMode && this.playing) {
+ this.tui.toast('擂台/挑战只有一次机会,不能重开')
+ return
+ }
this.playing = false
this.clearTimer()
this.timeLeft = this.timeLimit
- this.roundSeed = this.newRoundSeed()
+ this.roundSeed = this.fixedSeed || this.newRoundSeed()
this.buildLevel()
if (!this.cards.length) this.buildLevel()
},
closeModal() {
this.modal.show = false
},
+ createChallenge() {
+ const duration = this.modal.duration || Math.max(1, Math.floor((Date.now() - this.startTs) / 1000))
+ this.tui.request('/app/planet/adventure/challenge/create', 'POST', {
+ userId: this.userId,
+ regionId: this.regionId,
+ nickname: this.nickname,
+ avatar: this.avatar,
+ college: this.college,
+ durationSeconds: duration
+ }).then(res => {
+ if (res.code != 200 || !res.result) {
+ this.tui.toast(res.message)
+ return
+ }
+ this.shareChallenge = {
+ id: res.result.id,
+ durationSeconds: duration
+ }
+ this.modal.sub = `我用 ${duration} 秒通关学院助推赛,你敢挑战吗?点击下方按钮分享给好友。`
+ this.modal.challenge = false
+ })
+ },
openCollegePicker() {
this.collegeModal = true
},
@@ -1071,7 +1417,12 @@
return cards
},
goBack() {
- uni.navigateBack()
+ const pages = getCurrentPages ? getCurrentPages() : []
+ if (pages.length > 1) {
+ uni.navigateBack({ delta: 1 })
+ return
+ }
+ uni.redirectTo({ url: '/package1/planet/index' })
}
}
}
@@ -1079,11 +1430,12 @@
diff --git a/package1/planet/more.vue b/package1/planet/more.vue
new file mode 100644
index 0000000..c977af0
--- /dev/null
+++ b/package1/planet/more.vue
@@ -0,0 +1,298 @@
+
+
+
+ ‹
+ 星球补给地图
+
+
+
+ 正在加载星球补给...
+
+
+
+ PLANET SUPPLY
+ 把长期玩法都放在这里
+ 券树、仓库、防御塔、地标、任务和能量站,想深入经营时再进来。
+
+
+ {{home.myTicketCount || 0}}
+ 星球券
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/package1/planet/pkHall.vue b/package1/planet/pkHall.vue
new file mode 100644
index 0000000..34e3883
--- /dev/null
+++ b/package1/planet/pkHall.vue
@@ -0,0 +1,306 @@
+
+
+
+ ‹
+ 星球擂台
+
+
+
+
+ CAMPUS ARENA
+ 同一关卡,拼手速和决策
+ 独立于每日助推赛,房间内所有人使用同一个 seed。每人一次机会,第一名通吃奖池。
+ 创建房间
+
+
+
+
+ 我的房间
+
+ {{room.roomName || '星球擂台'}}
+ {{roomStatus(room.status)}}
+
+
+ 暂无房间
+
+
+ 我的战绩
+
+ {{record.cleared ? (record.durationSeconds + '秒通关') : '挑战失败'}}
+ {{record.rankNo ? ('第' + record.rankNo) : '待结算'}}
+
+ 暂无战绩
+
+
+
+
+
+ 热门房间
+ 刷新
+
+
+
+ {{room.roomName || '星球擂台'}}
+ {{room.playerCount || 0}}/{{room.maxPlayers || 2}} 人 · 入场 {{room.entryTickets || 1}} 券
+
+
+ {{room.poolTickets || 0}}
+ 奖池
+
+
+
+ 还没有公开擂台,先开一间等同学来挑战
+ {{hotLoadText}}
+
+
+
+
+
+ 创建星球擂台
+
+
+
+
+
+ 取消
+ 创建
+
+
+
+
+
+
+
+
+
diff --git a/package1/planet/rank.vue b/package1/planet/rank.vue
new file mode 100644
index 0000000..1c63338
--- /dev/null
+++ b/package1/planet/rank.vue
@@ -0,0 +1,317 @@
+
+
+
+ ‹
+ 星球排行榜
+
+
+
+ 正在扫描财富坐标...
+
+
+
+
+
+
+
+
+
+ SCHOOL RICH LIST
+ 全校首富雷达
+ 从榜单里选定目标,发起星际追查,抢回今日补给权。
+
+
+ {{home.remainHunt || 0}}
+ 次追查
+
+
+
+
+
+ WEALTH COORDINATES
+ 财富坐标榜
+
+ 已加载 {{pageNum}} / {{totalPages}} 页
+
+
+
+
+ #{{item._displayRankNo}}
+
+
+
+ {{item.stealth ? '隐身侠' : (item.nickname || '神秘同学')}}
+ 隐身
+ ME
+
+
+ {{item.ticketCount || 0}} 张星球券
+ 霸榜 {{item.rankKeepDays}} 天
+
+
+
+ {{huntText(item)}}
+
+
+
+ 暂无上榜居民,攒券登顶成为今日主角
+
+ {{loadMoreText}}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/package1/planet/ticketLog.vue b/package1/planet/ticketLog.vue
index 1d27320..8396712 100644
--- a/package1/planet/ticketLog.vue
+++ b/package1/planet/ticketLog.vue
@@ -1,12 +1,12 @@
-
+
‹
星球券明细
-
@@ -64,6 +64,7 @@
data() {
return {
statusBarHeight: 20,
+ navHeight: 64,
userId: '',
regionId: '',
balance: 0,
@@ -78,6 +79,7 @@
onLoad() {
const sys = uni.getSystemInfoSync()
this.statusBarHeight = sys.statusBarHeight || 20
+ this.initNavHeight()
this.userId = uni.getStorageSync('id') || ''
try {
const area = uni.getStorageSync('area')
@@ -86,6 +88,16 @@
this.loadPage(true)
},
methods: {
+ initNavHeight() {
+ try {
+ const menu = uni.getMenuButtonBoundingClientRect && uni.getMenuButtonBoundingClientRect()
+ if (menu && menu.top && menu.height) {
+ this.navHeight = menu.top + menu.height + 8
+ return
+ }
+ } catch (e) {}
+ this.navHeight = this.statusBarHeight + 44
+ },
loadPage(reset) {
if (this.loading) return
if (!this.userId) {
@@ -142,7 +154,12 @@
return map[type] || '星球券变动'
},
goBack() {
- uni.navigateBack({ delta: 1 })
+ const pages = getCurrentPages ? getCurrentPages() : []
+ if (pages.length > 1) {
+ uni.navigateBack({ delta: 1 })
+ return
+ }
+ uni.redirectTo({ url: '/package1/planet/index' })
}
}
}
@@ -167,33 +184,36 @@
.nav {
position: fixed;
top: 0; left: 0; right: 0;
- height: 44px;
z-index: 20;
+ box-sizing: border-box;
display: flex;
- align-items: flex-end;
+ align-items: center;
justify-content: center;
- background: linear-gradient(180deg, rgba(243,255,244,0.9), rgba(243,255,244,0));
+ background: rgba(243,255,244,0.9);
}
.nav-back {
position: absolute;
- left: 20rpx;
- bottom: 0;
- height: 44px;
- width: 60rpx;
+ left: 24rpx;
+ bottom: 12rpx;
+ width: 56rpx;
+ height: 56rpx;
+ border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
+ background: rgba(255,255,255,.72);
+ box-shadow: 0 8rpx 20rpx rgba(18,52,47,.08);
}
- .nav-back-icon { color: #12342F; font-size: 48rpx; font-weight: 300; }
+ .nav-back-icon { color: #12342F; font-size: 42rpx; font-weight: 300; line-height: 1; transform: translateY(-2rpx); }
.nav-title {
color: #12342F;
- font-size: 34rpx;
- font-weight: 800;
+ font-size: 32rpx;
+ font-weight: 900;
letter-spacing: 1rpx;
- padding-bottom: 6rpx;
+ padding-bottom: 14rpx;
}
.tl-scroll {