diff --git a/package1/components/planet/planet-daily-loop.vue b/package1/components/planet/planet-daily-loop.vue index c751a9e..61b2a9f 100644 --- a/package1/components/planet/planet-daily-loop.vue +++ b/package1/components/planet/planet-daily-loop.vue @@ -4,7 +4,7 @@ JOIN DAILY {{progressTitle}} - 完成任务可获得星球券与开奖权重 + 完成任务可获得星球券 @@ -124,7 +124,7 @@ return } this.flying = true - this.playReward('+开奖权重', 'pool') + this.playReward('+得奖概率', 'pool') this.$emit('join') if (this.flyTimer) clearTimeout(this.flyTimer) this.flyTimer = setTimeout(() => { @@ -158,7 +158,7 @@ .main-icon { position: relative; width: 54rpx; height: 54rpx; margin-right: 16rpx; flex-shrink: 0;font-size: 50rpx; margin-top: 16rpx;} .main-title { color: #5C3310; font-size: 34rpx; font-weight: 900; white-space: nowrap; } .main-desc { margin-top: 8rpx; color: #9B7043; font-size: 22rpx; font-weight: 800; white-space: nowrap; } - .main-status { position: absolute; right: 76rpx; top: 26rpx; z-index: 1; height: 46rpx; line-height: 46rpx; padding: 0 18rpx; border-radius: 999rpx; background: rgba(255,255,255,0.66); color: #F08322; font-size: 21rpx; font-weight: 900; } + .main-status { position: absolute; right: 36rpx; top: 50%; z-index: 1; width: 92rpx; height: 92rpx; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; border-radius: 24rpx; background: rgba(255,255,255,0.78); color: #F08322; font-size: 22rpx; font-weight: 900; box-shadow: 0 12rpx 26rpx rgba(240,131,34,0.14), inset 0 1rpx 0 rgba(255,255,255,0.92); } .main-boost { position: absolute; left: 92rpx; bottom: 20rpx; z-index: 1; color: #C27724; font-size: 21rpx; font-weight: 900; } .main-hand { position: absolute; right: 76rpx; top: 80rpx; z-index: 1; width: 82rpx; height: 46rpx; line-height: 46rpx; border-radius: 999rpx; text-align: center;font-size: 44rpx; font-weight: 900; box-shadow: 0 10rpx 22rpx rgba(240,131,34,0.16); } .sub-task-list { position: relative; z-index: 1; margin-top: 16rpx; display: flex; gap: 14rpx; } diff --git a/package1/ieBrowser/index.vue b/package1/ieBrowser/index.vue index cc190ef..105b2a7 100644 --- a/package1/ieBrowser/index.vue +++ b/package1/ieBrowser/index.vue @@ -96,6 +96,13 @@ {{ item.label }} + 匹配范围 + + + {{ item.label }} + + 想匹配的性别 {{ matchedPerson.avatar }} {{ matchedPerson.name }} {{ modeText(matchedPerson.mode) }} · {{ genderText(matchedPerson.gender) }} + {{ matchedPerson.regionName }} {{ tag }} @@ -176,6 +184,7 @@ showMatch: false, now: new Date(), awakeCount: 127, + onlineCountBase: 0, displayAwakeCount: 0, waitingCount: 49, liveTimer: null, @@ -187,6 +196,7 @@ lowPowerMode: false, targetMode: 'any', targetGender: 'any', + matchScope: 'school', activeDriftText: '', displayMoodCopy: '对方没有催我讲话,沉默变得没那么尴尬', moodTypeTimer: null, @@ -212,6 +222,7 @@ moods: [{"key":"quiet","label":"想安静","icon":"◐","copy":"对方没有催我讲话,沉默变得没那么尴尬。"},{"key":"talk","label":"想说话","icon":"◒","copy":"聊了一个很小的日常话题,心情被拉亮了一点。"},{"key":"listen","label":"听着呢","icon":"◌","copy":"像有人坐在旁边,不需要解释为什么低落。"},{"key":"drift","label":"轻了一点","icon":"✦","copy":"只是给今天留一点柔软的痕迹。"}], targetModes: [{ key: 'i', label: '匹配 i 人' }, { key: 'e', label: '匹配 e 人' }, { key: 'any', label: '都可以' }], targetGenders: [{ key: 'male', label: '男生' }, { key: 'female', label: '女生' }, { key: 'any', label: '不限' }], + matchScopes: [{ key: 'school', label: '本校区' }, { key: 'world', label: '世界用户' }], companions: {"i":[{"name":"树荫下的风","avatar":"风","state":"在校园里发呆","quote":"可以安静待 15 分钟,不用急着找话题。"},{"name":"耳机里的云","avatar":"云","state":"刚从教室出来","quote":"今天只想慢慢说两句。"}],"e":[{"name":"便利店灯光","avatar":"光","state":"想聊点不重要的","quote":"要不要交换一句今天最荒唐的小事?"},{"name":"操场散步员","avatar":"跑","state":"刚从操场回来","quote":"我可以负责开场,你负责随便接。"}]}, matchedPerson: {}, currentMatch: null, @@ -317,7 +328,7 @@ if (!this.liveTimer) { this.liveTimer = setInterval(() => { this.now = new Date() - this.awakeCount = 118 + Math.floor(Math.random() * 28) + this.awakeCount = this.randomAwakeCount(this.onlineCountBase) this.waitingCount = 39 + Math.floor(Math.random() * 18) this.animateAwakeCount(this.awakeCount) }, this.lowPowerMode ? 9000 : 4200) @@ -346,6 +357,17 @@ this.moodTypeTimer = null } }, + randomBetween(min, max) { + return min + Math.floor(Math.random() * (max - min + 1)) + }, + randomAwakeCount(onlineCount) { + const count = Number(onlineCount) || 0 + if (count > 1000) { + const min = Math.floor(count / 1000) * 1000 + return this.randomBetween(min, min + 999) + } + return this.randomBetween(1000, 2000) + }, animateAwakeCount(target) { if (this.countTimer) { clearInterval(this.countTimer) @@ -388,7 +410,8 @@ } this.profile = home.profile || {} this.profileReady = true - this.awakeCount = home.onlineCount || this.awakeCount + this.onlineCountBase = Number(home.onlineCount) || 0 + this.awakeCount = this.randomAwakeCount(this.onlineCountBase) this.waitingCount = home.waitingCount || this.waitingCount this.chancesLeft = Math.max((home.dailyQuota || 3) - (home.usedQuota || 0), 0) this.unreadCount = home.unreadCount || 0 @@ -408,26 +431,46 @@ }, syncStatus() { if (!this.profileReady) return + const areaInfo = this.getAreaInfo() updateIeStatus({ mode: this.currentMode, targetMode: this.targetMode, targetGender: this.targetGender, mood: this.currentMood, statusText: this.activeMood.copy, + ...areaInfo, interestTags: [this.activeMood.label] }) }, + getAreaInfo() { + try { + const area = JSON.parse(uni.getStorageSync('area') || '{}') + return { + regionId: area.id || '', + regionName: area.title || '' + } + } catch (e) { + return { regionId: '', regionName: '' } + } + }, async openMatch() { this.showTargetPanel = false if (this.chancesLeft === 0) { uni.showToast({ title: this.doneText, icon: 'none' }) return } + const areaInfo = this.getAreaInfo() + if (this.matchScope === 'school' && !areaInfo.regionId) { + uni.showToast({ title: '请先选择校区', icon: 'none' }) + return + } const match = await startIeMatch({ mode: this.currentMode, targetMode: this.targetMode, targetGender: this.targetGender, + matchScope: this.matchScope, mood: this.currentMood, + ...areaInfo, interestTags: [this.activeMood.label] }) if (!match || !match.roomId) { @@ -441,6 +484,7 @@ name: match.anonymousName || '半匿名 漂流者', mode: match.mode || this.currentMode, gender: match.gender || '', + regionName: match.regionName || '', tags: match.interestTags || [], personaImages: match.personaImages || [], state: match.stateText || '也在等一句轻轻的回应', @@ -460,6 +504,7 @@ name: profile.anonymousName || this.matchedPerson.name, mode: profile.currentMode || this.matchedPerson.mode, gender: profile.gender || this.matchedPerson.gender, + regionName: profile.regionName || this.matchedPerson.regionName || '', tags: profile.interestTags || [], personaImages: profile.personaImages || [], state: this.profileStateText(profile), @@ -594,7 +639,7 @@ await this.openMatch() }, goMatchPage() { - uni.navigateTo({ url: '/package1/ieBrowser/match?mode=' + this.currentMode + '&mood=' + this.currentMood + '&targetMode=' + this.targetMode + '&targetGender=' + this.targetGender }) + uni.navigateTo({ url: '/package1/ieBrowser/match?mode=' + this.currentMode + '&mood=' + this.currentMood + '&targetMode=' + this.targetMode + '&targetGender=' + this.targetGender + '&matchScope=' + this.matchScope }) }, goRecords() { uni.navigateTo({ url: '/package1/ieBrowser/chatList' }) }, goArchive() { uni.navigateTo({ url: '/package1/ieBrowser/universe' }) }, @@ -1122,6 +1167,18 @@ font-size: 23rpx; } + .match-region { + width: fit-content; + max-width: 520rpx; + margin: 14rpx auto 0; + padding: 8rpx 20rpx; + border-radius: 999rpx; + color: #6c69d8; + background: rgba(139, 124, 255, .1); + font-size: 22rpx; + font-weight: 700; + } + .match-tags { margin-top: 18rpx; text-align: center; diff --git a/package1/ieBrowser/match.vue b/package1/ieBrowser/match.vue index b3807a4..f188a76 100644 --- a/package1/ieBrowser/match.vue +++ b/package1/ieBrowser/match.vue @@ -43,6 +43,7 @@ mood: 'quiet', targetMode: 'any', targetGender: 'any', + matchScope: 'school', dailyQuota: 3, chancesLeft: 3, menuButtonInfo: { top: 44 } @@ -61,9 +62,21 @@ this.mood = options.mood || 'quiet' this.targetMode = options.targetMode || 'any' this.targetGender = options.targetGender || 'any' + this.matchScope = options.matchScope || 'school' this.loadQuota() }, methods: { + getAreaInfo() { + try { + const area = JSON.parse(uni.getStorageSync('area') || '{}') + return { + regionId: area.id || '', + regionName: area.title || '' + } + } catch (e) { + return { regionId: '', regionName: '' } + } + }, async loadQuota() { const home = await ieHome() if (!home) return @@ -75,7 +88,12 @@ uni.showToast({ title: '今天先到这里', icon: 'none' }) return } - const match = await startIeMatch({ mode: this.mode, mood: this.mood, targetMode: this.targetMode, targetGender: this.targetGender }) + const areaInfo = this.getAreaInfo() + if (this.matchScope === 'school' && !areaInfo.regionId) { + uni.showToast({ title: '请先选择校区', icon: 'none' }) + return + } + const match = await startIeMatch({ mode: this.mode, mood: this.mood, targetMode: this.targetMode, targetGender: this.targetGender, matchScope: this.matchScope, ...areaInfo }) if (!match || !match.roomId) { uni.showToast({ title: (match && match.failReason) || '暂时没有同频的人', icon: 'none' }) return diff --git a/package1/ieBrowser/profileSetup.vue b/package1/ieBrowser/profileSetup.vue index 10eee39..9d40fdc 100644 --- a/package1/ieBrowser/profileSetup.vue +++ b/package1/ieBrowser/profileSetup.vue @@ -279,6 +279,17 @@ previewPersona(index) { uni.previewImage({ urls: this.form.personaImages, current: this.form.personaImages[index] }) }, + getAreaInfo() { + try { + const area = JSON.parse(uni.getStorageSync('area') || '{}') + return { + regionId: area.id || '', + regionName: area.title || '' + } + } catch (e) { + return { regionId: '', regionName: '' } + } + }, validateStep() { if (this.step === 2 && !this.form.anonymousName.trim()) { uni.showToast({ title: '先起一个昵称吧', icon: 'none' }) @@ -301,8 +312,14 @@ this.submitting = true uni.showLoading({ title: '正在进入 i/e', mask: true }) try { + const areaInfo = this.getAreaInfo() + if (!areaInfo.regionId) { + uni.showToast({ title: '请先选择校区', icon: 'none' }) + return + } const profile = await saveIeProfile({ ...this.form, + ...areaInfo, avatarText: this.avatarPreview }) if (!profile) return diff --git a/package1/ieBrowser/universe.vue b/package1/ieBrowser/universe.vue index d2a7668..d8ec6fb 100644 --- a/package1/ieBrowser/universe.vue +++ b/package1/ieBrowser/universe.vue @@ -15,7 +15,6 @@ {{ profile.dailyQuota || 3 }}今日机会 - 长期聊天保留 {{ profile.currentMode || 'i' }}当前状态 diff --git a/package1/planet/more.vue b/package1/planet/more.vue index 1031ae0..5455ede 100644 --- a/package1/planet/more.vue +++ b/package1/planet/more.vue @@ -8,7 +8,7 @@ - 星球排行榜 + 星球补给地图