|
|
|
@ -117,19 +117,32 @@ |
|
|
|
|
|
|
|
<view class="match-mask" v-if="showMatch" @tap="closeMatch"> |
|
|
|
<view class="match-panel" @tap.stop> |
|
|
|
<scroll-view scroll-y class="match-scroll"> |
|
|
|
<view class="match-top"> |
|
|
|
<view class="match-label">半匿名漂流者</view> |
|
|
|
<view class="close" @tap="closeMatch">×</view> |
|
|
|
</view> |
|
|
|
<image class="companion-orb-img" v-if="matchedPerson.avatarUrl" :src="matchedPerson.avatarUrl" mode="aspectFill"></image> |
|
|
|
<view class="companion-orb" v-else :class="currentMode">{{ matchedPerson.avatar }}</view> |
|
|
|
<image class="companion-orb-img" v-if="matchedPerson.avatarUrl" :src="matchedPerson.avatarUrl" mode="aspectFill" @tap="previewMatchedPersona(0)"></image> |
|
|
|
<view class="companion-orb" v-else :class="matchedPerson.mode || currentMode">{{ matchedPerson.avatar }}</view> |
|
|
|
<view class="match-name">{{ matchedPerson.name }}</view> |
|
|
|
<view class="match-state">{{ activeMood.label }} · {{ matchedPerson.state }}</view> |
|
|
|
<view class="match-state">{{ modeText(matchedPerson.mode) }} · {{ genderText(matchedPerson.gender) }}</view> |
|
|
|
<view class="match-tags" v-if="matchedPerson.tags && matchedPerson.tags.length"> |
|
|
|
<text v-for="tag in matchedPerson.tags" :key="tag">{{ tag }}</text> |
|
|
|
</view> |
|
|
|
<view class="match-state-text">{{ matchedPerson.state }}</view> |
|
|
|
<view class="match-quote">{{ matchedPerson.quote }}</view> |
|
|
|
<view class="match-persona" v-if="matchedPerson.personaImages && matchedPerson.personaImages.length"> |
|
|
|
<view class="match-section-title">人格卡片</view> |
|
|
|
<scroll-view scroll-x class="match-persona-scroll"> |
|
|
|
<image class="match-persona-image" v-for="(img,index) in matchedPerson.personaImages" :key="img" |
|
|
|
:src="img" mode="aspectFill" @tap="previewMatchedPersona(index)"></image> |
|
|
|
</scroll-view> |
|
|
|
</view> |
|
|
|
<view class="match-actions"> |
|
|
|
<view class="ghost-btn" @tap="skipMatch">轻轻划过</view> |
|
|
|
<view class="solid-btn" @tap="goChat">进入聊天</view> |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
@ -145,7 +158,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { ieHome, updateIeStatus, startIeMatch } from '@/common/ieApi.js' |
|
|
|
import { ieHome, updateIeStatus, startIeMatch, getIeUserProfile } from '@/common/ieApi.js' |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
@ -416,11 +429,51 @@ |
|
|
|
avatar: match.avatarText || '◌', |
|
|
|
avatarUrl: match.avatarUrl || '', |
|
|
|
name: match.anonymousName || '半匿名 漂流者', |
|
|
|
mode: match.mode || this.currentMode, |
|
|
|
gender: match.gender || '', |
|
|
|
tags: match.interestTags || [], |
|
|
|
personaImages: match.personaImages || [], |
|
|
|
state: match.stateText || '也在等一句轻轻的回应', |
|
|
|
quote: match.quoteText || '可以先安静待一会,不用急着找话题。' |
|
|
|
} |
|
|
|
await this.loadMatchedProfile(match.targetUserId) |
|
|
|
this.showMatch = true |
|
|
|
}, |
|
|
|
async loadMatchedProfile(targetUserId) { |
|
|
|
if (!targetUserId) return |
|
|
|
const profile = await getIeUserProfile(targetUserId) |
|
|
|
if (!profile || profile.exists === false) return |
|
|
|
this.matchedPerson = { |
|
|
|
...this.matchedPerson, |
|
|
|
avatar: profile.avatarText || this.matchedPerson.avatar, |
|
|
|
avatarUrl: profile.avatarUrl || this.matchedPerson.avatarUrl || '', |
|
|
|
name: profile.anonymousName || this.matchedPerson.name, |
|
|
|
mode: profile.currentMode || this.matchedPerson.mode, |
|
|
|
gender: profile.gender || this.matchedPerson.gender, |
|
|
|
tags: profile.interestTags || [], |
|
|
|
personaImages: profile.personaImages || [], |
|
|
|
state: this.profileStateText(profile), |
|
|
|
quote: profile.intro || this.matchedPerson.quote |
|
|
|
} |
|
|
|
}, |
|
|
|
profileStateText(profile) { |
|
|
|
const mode = profile.currentMode === 'e' ? '轻轻热闹' : '安静靠近' |
|
|
|
const tags = profile.interestTags && profile.interestTags.length ? profile.interestTags.slice(0, 2).join(' · ') : '此刻在线' |
|
|
|
return `${mode} · ${tags}` |
|
|
|
}, |
|
|
|
modeText(mode) { |
|
|
|
return mode === 'e' ? 'e 人' : 'i 人' |
|
|
|
}, |
|
|
|
genderText(gender) { |
|
|
|
if (gender === 'male') return '男生' |
|
|
|
if (gender === 'female') return '女生' |
|
|
|
return '性别未设置' |
|
|
|
}, |
|
|
|
previewMatchedPersona(index) { |
|
|
|
const images = this.matchedPerson.personaImages || [] |
|
|
|
if (!images.length) return |
|
|
|
uni.previewImage({ urls: images, current: images[index] }) |
|
|
|
}, |
|
|
|
closeMatch() { this.showMatch = false }, |
|
|
|
toggleMode() { |
|
|
|
this.currentMode = this.currentMode === 'i' ? 'e' : 'i' |
|
|
|
@ -961,12 +1014,20 @@ |
|
|
|
|
|
|
|
.match-panel { |
|
|
|
width: 100%; |
|
|
|
padding: 34rpx; |
|
|
|
max-height: 78vh; |
|
|
|
padding: 0; |
|
|
|
border: 1rpx solid rgba(255, 255, 255, .76); |
|
|
|
border-radius: 46rpx; |
|
|
|
background: rgba(255, 255, 255, .76); |
|
|
|
box-sizing: border-box; |
|
|
|
box-shadow: 0 30rpx 90rpx rgba(96, 112, 160, .18); |
|
|
|
overflow: hidden; |
|
|
|
} |
|
|
|
|
|
|
|
.match-scroll { |
|
|
|
max-height: 78vh; |
|
|
|
padding: 34rpx; |
|
|
|
box-sizing: border-box; |
|
|
|
} |
|
|
|
|
|
|
|
.match-top { |
|
|
|
@ -1019,6 +1080,31 @@ |
|
|
|
font-size: 23rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.match-tags { |
|
|
|
margin-top: 18rpx; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
|
|
|
|
.match-tags text { |
|
|
|
display: inline-block; |
|
|
|
height: 44rpx; |
|
|
|
line-height: 44rpx; |
|
|
|
padding: 0 16rpx; |
|
|
|
margin: 0 8rpx 10rpx; |
|
|
|
border-radius: 999rpx; |
|
|
|
color: #6c69d8; |
|
|
|
background: rgba(139,124,255,.1); |
|
|
|
font-size: 21rpx; |
|
|
|
font-weight: 700; |
|
|
|
} |
|
|
|
|
|
|
|
.match-state-text { |
|
|
|
margin-top: 8rpx; |
|
|
|
text-align: center; |
|
|
|
color: rgba(22,27,46,.54); |
|
|
|
font-size: 23rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.match-quote { |
|
|
|
margin-top: 30rpx; |
|
|
|
padding: 26rpx; |
|
|
|
@ -1029,6 +1115,31 @@ |
|
|
|
line-height: 42rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.match-persona { |
|
|
|
margin-top: 22rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.match-section-title { |
|
|
|
margin-bottom: 14rpx; |
|
|
|
color: rgba(22,27,46,.62); |
|
|
|
font-size: 24rpx; |
|
|
|
font-weight: 800; |
|
|
|
} |
|
|
|
|
|
|
|
.match-persona-scroll { |
|
|
|
white-space: nowrap; |
|
|
|
} |
|
|
|
|
|
|
|
.match-persona-image { |
|
|
|
display: inline-block; |
|
|
|
width: 168rpx; |
|
|
|
height: 208rpx; |
|
|
|
margin-right: 16rpx; |
|
|
|
border-radius: 26rpx; |
|
|
|
background: rgba(22,27,46,.06); |
|
|
|
box-shadow: 0 14rpx 34rpx rgba(96,112,160,.12); |
|
|
|
} |
|
|
|
|
|
|
|
.match-actions { |
|
|
|
display: flex; |
|
|
|
gap: 18rpx; |
|
|
|
|