|
|
@ -96,6 +96,13 @@ |
|
|
{{ item.label }} |
|
|
{{ item.label }} |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<view class="target-title gender-title">匹配范围</view> |
|
|
|
|
|
<view class="target-row"> |
|
|
|
|
|
<view class="target-chip scope-chip" v-for="item in matchScopes" :key="item.key" |
|
|
|
|
|
:class="{ active: matchScope === item.key }" @tap="matchScope = item.key"> |
|
|
|
|
|
{{ item.label }} |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
<view class="target-title gender-title">想匹配的性别</view> |
|
|
<view class="target-title gender-title">想匹配的性别</view> |
|
|
<view class="target-row"> |
|
|
<view class="target-row"> |
|
|
<view class="target-chip gender-chip" v-for="item in targetGenders" :key="item.key" |
|
|
<view class="target-chip gender-chip" v-for="item in targetGenders" :key="item.key" |
|
|
@ -130,6 +137,7 @@ |
|
|
<view class="companion-orb" v-else :class="matchedPerson.mode || currentMode">{{ matchedPerson.avatar }}</view> |
|
|
<view class="companion-orb" v-else :class="matchedPerson.mode || currentMode">{{ matchedPerson.avatar }}</view> |
|
|
<view class="match-name">{{ matchedPerson.name }}</view> |
|
|
<view class="match-name">{{ matchedPerson.name }}</view> |
|
|
<view class="match-state">{{ modeText(matchedPerson.mode) }} · {{ genderText(matchedPerson.gender) }}</view> |
|
|
<view class="match-state">{{ modeText(matchedPerson.mode) }} · {{ genderText(matchedPerson.gender) }}</view> |
|
|
|
|
|
<view class="match-region" v-if="matchedPerson.regionName">{{ matchedPerson.regionName }}</view> |
|
|
<view class="match-tags" v-if="matchedPerson.tags && matchedPerson.tags.length"> |
|
|
<view class="match-tags" v-if="matchedPerson.tags && matchedPerson.tags.length"> |
|
|
<text v-for="tag in matchedPerson.tags" :key="tag">{{ tag }}</text> |
|
|
<text v-for="tag in matchedPerson.tags" :key="tag">{{ tag }}</text> |
|
|
</view> |
|
|
</view> |
|
|
@ -176,6 +184,7 @@ |
|
|
showMatch: false, |
|
|
showMatch: false, |
|
|
now: new Date(), |
|
|
now: new Date(), |
|
|
awakeCount: 127, |
|
|
awakeCount: 127, |
|
|
|
|
|
onlineCountBase: 0, |
|
|
displayAwakeCount: 0, |
|
|
displayAwakeCount: 0, |
|
|
waitingCount: 49, |
|
|
waitingCount: 49, |
|
|
liveTimer: null, |
|
|
liveTimer: null, |
|
|
@ -187,6 +196,7 @@ |
|
|
lowPowerMode: false, |
|
|
lowPowerMode: false, |
|
|
targetMode: 'any', |
|
|
targetMode: 'any', |
|
|
targetGender: 'any', |
|
|
targetGender: 'any', |
|
|
|
|
|
matchScope: 'school', |
|
|
activeDriftText: '', |
|
|
activeDriftText: '', |
|
|
displayMoodCopy: '对方没有催我讲话,沉默变得没那么尴尬', |
|
|
displayMoodCopy: '对方没有催我讲话,沉默变得没那么尴尬', |
|
|
moodTypeTimer: null, |
|
|
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":"只是给今天留一点柔软的痕迹。"}], |
|
|
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: '都可以' }], |
|
|
targetModes: [{ key: 'i', label: '匹配 i 人' }, { key: 'e', label: '匹配 e 人' }, { key: 'any', label: '都可以' }], |
|
|
targetGenders: [{ key: 'male', label: '男生' }, { key: 'female', label: '女生' }, { 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":"我可以负责开场,你负责随便接。"}]}, |
|
|
companions: {"i":[{"name":"树荫下的风","avatar":"风","state":"在校园里发呆","quote":"可以安静待 15 分钟,不用急着找话题。"},{"name":"耳机里的云","avatar":"云","state":"刚从教室出来","quote":"今天只想慢慢说两句。"}],"e":[{"name":"便利店灯光","avatar":"光","state":"想聊点不重要的","quote":"要不要交换一句今天最荒唐的小事?"},{"name":"操场散步员","avatar":"跑","state":"刚从操场回来","quote":"我可以负责开场,你负责随便接。"}]}, |
|
|
matchedPerson: {}, |
|
|
matchedPerson: {}, |
|
|
currentMatch: null, |
|
|
currentMatch: null, |
|
|
@ -317,7 +328,7 @@ |
|
|
if (!this.liveTimer) { |
|
|
if (!this.liveTimer) { |
|
|
this.liveTimer = setInterval(() => { |
|
|
this.liveTimer = setInterval(() => { |
|
|
this.now = new Date() |
|
|
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.waitingCount = 39 + Math.floor(Math.random() * 18) |
|
|
this.animateAwakeCount(this.awakeCount) |
|
|
this.animateAwakeCount(this.awakeCount) |
|
|
}, this.lowPowerMode ? 9000 : 4200) |
|
|
}, this.lowPowerMode ? 9000 : 4200) |
|
|
@ -346,6 +357,17 @@ |
|
|
this.moodTypeTimer = null |
|
|
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) { |
|
|
animateAwakeCount(target) { |
|
|
if (this.countTimer) { |
|
|
if (this.countTimer) { |
|
|
clearInterval(this.countTimer) |
|
|
clearInterval(this.countTimer) |
|
|
@ -388,7 +410,8 @@ |
|
|
} |
|
|
} |
|
|
this.profile = home.profile || {} |
|
|
this.profile = home.profile || {} |
|
|
this.profileReady = true |
|
|
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.waitingCount = home.waitingCount || this.waitingCount |
|
|
this.chancesLeft = Math.max((home.dailyQuota || 3) - (home.usedQuota || 0), 0) |
|
|
this.chancesLeft = Math.max((home.dailyQuota || 3) - (home.usedQuota || 0), 0) |
|
|
this.unreadCount = home.unreadCount || 0 |
|
|
this.unreadCount = home.unreadCount || 0 |
|
|
@ -408,26 +431,46 @@ |
|
|
}, |
|
|
}, |
|
|
syncStatus() { |
|
|
syncStatus() { |
|
|
if (!this.profileReady) return |
|
|
if (!this.profileReady) return |
|
|
|
|
|
const areaInfo = this.getAreaInfo() |
|
|
updateIeStatus({ |
|
|
updateIeStatus({ |
|
|
mode: this.currentMode, |
|
|
mode: this.currentMode, |
|
|
targetMode: this.targetMode, |
|
|
targetMode: this.targetMode, |
|
|
targetGender: this.targetGender, |
|
|
targetGender: this.targetGender, |
|
|
mood: this.currentMood, |
|
|
mood: this.currentMood, |
|
|
statusText: this.activeMood.copy, |
|
|
statusText: this.activeMood.copy, |
|
|
|
|
|
...areaInfo, |
|
|
interestTags: [this.activeMood.label] |
|
|
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() { |
|
|
async openMatch() { |
|
|
this.showTargetPanel = false |
|
|
this.showTargetPanel = false |
|
|
if (this.chancesLeft === 0) { |
|
|
if (this.chancesLeft === 0) { |
|
|
uni.showToast({ title: this.doneText, icon: 'none' }) |
|
|
uni.showToast({ title: this.doneText, icon: 'none' }) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
const areaInfo = this.getAreaInfo() |
|
|
|
|
|
if (this.matchScope === 'school' && !areaInfo.regionId) { |
|
|
|
|
|
uni.showToast({ title: '请先选择校区', icon: 'none' }) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
const match = await startIeMatch({ |
|
|
const match = await startIeMatch({ |
|
|
mode: this.currentMode, |
|
|
mode: this.currentMode, |
|
|
targetMode: this.targetMode, |
|
|
targetMode: this.targetMode, |
|
|
targetGender: this.targetGender, |
|
|
targetGender: this.targetGender, |
|
|
|
|
|
matchScope: this.matchScope, |
|
|
mood: this.currentMood, |
|
|
mood: this.currentMood, |
|
|
|
|
|
...areaInfo, |
|
|
interestTags: [this.activeMood.label] |
|
|
interestTags: [this.activeMood.label] |
|
|
}) |
|
|
}) |
|
|
if (!match || !match.roomId) { |
|
|
if (!match || !match.roomId) { |
|
|
@ -441,6 +484,7 @@ |
|
|
name: match.anonymousName || '半匿名 漂流者', |
|
|
name: match.anonymousName || '半匿名 漂流者', |
|
|
mode: match.mode || this.currentMode, |
|
|
mode: match.mode || this.currentMode, |
|
|
gender: match.gender || '', |
|
|
gender: match.gender || '', |
|
|
|
|
|
regionName: match.regionName || '', |
|
|
tags: match.interestTags || [], |
|
|
tags: match.interestTags || [], |
|
|
personaImages: match.personaImages || [], |
|
|
personaImages: match.personaImages || [], |
|
|
state: match.stateText || '也在等一句轻轻的回应', |
|
|
state: match.stateText || '也在等一句轻轻的回应', |
|
|
@ -460,6 +504,7 @@ |
|
|
name: profile.anonymousName || this.matchedPerson.name, |
|
|
name: profile.anonymousName || this.matchedPerson.name, |
|
|
mode: profile.currentMode || this.matchedPerson.mode, |
|
|
mode: profile.currentMode || this.matchedPerson.mode, |
|
|
gender: profile.gender || this.matchedPerson.gender, |
|
|
gender: profile.gender || this.matchedPerson.gender, |
|
|
|
|
|
regionName: profile.regionName || this.matchedPerson.regionName || '', |
|
|
tags: profile.interestTags || [], |
|
|
tags: profile.interestTags || [], |
|
|
personaImages: profile.personaImages || [], |
|
|
personaImages: profile.personaImages || [], |
|
|
state: this.profileStateText(profile), |
|
|
state: this.profileStateText(profile), |
|
|
@ -594,7 +639,7 @@ |
|
|
await this.openMatch() |
|
|
await this.openMatch() |
|
|
}, |
|
|
}, |
|
|
goMatchPage() { |
|
|
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' }) }, |
|
|
goRecords() { uni.navigateTo({ url: '/package1/ieBrowser/chatList' }) }, |
|
|
goArchive() { uni.navigateTo({ url: '/package1/ieBrowser/universe' }) }, |
|
|
goArchive() { uni.navigateTo({ url: '/package1/ieBrowser/universe' }) }, |
|
|
@ -1122,6 +1167,18 @@ |
|
|
font-size: 23rpx; |
|
|
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 { |
|
|
.match-tags { |
|
|
margin-top: 18rpx; |
|
|
margin-top: 18rpx; |
|
|
text-align: center; |
|
|
text-align: center; |
|
|
|