|
|
|
@ -276,6 +276,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { ieHome, getIeUnreadCount, updateIeStatus, startIeMatch, matchIeProfile, getIeDailyQuestion, saveIeProfile } from '@/common/ieApi.js' |
|
|
|
import { ensureIeVerifiedBeforeAction } from '@/common/ieRealNameAuth.js' |
|
|
|
import IeBottomTab from '@/components/ie-bottom-tab/ie-bottom-tab.vue' |
|
|
|
|
|
|
|
export default { |
|
|
|
@ -303,6 +304,7 @@ |
|
|
|
showTargetPanel: false, |
|
|
|
showCompanionEditor: false, |
|
|
|
matching: false, |
|
|
|
realNameVerifying: false, |
|
|
|
savingCompanionIntent: false, |
|
|
|
keyboardHeight: 0, |
|
|
|
profileReady: false, |
|
|
|
@ -579,7 +581,16 @@ |
|
|
|
if (res) this.dailyQuestion = res |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
goDailyQuestion() { |
|
|
|
async goDailyQuestion() { |
|
|
|
const verified = await ensureIeVerifiedBeforeAction({ |
|
|
|
profile: this.profile, |
|
|
|
actionText: '参与每日同频一题', |
|
|
|
cancelText: '暂不回答', |
|
|
|
reload: async () => { |
|
|
|
await this.loadHome() |
|
|
|
} |
|
|
|
}) |
|
|
|
if (!verified) return |
|
|
|
uni.navigateTo({ url: '/package1/ieBrowser/dailyQuestion' }) |
|
|
|
}, |
|
|
|
toggleIntent(key) { |
|
|
|
@ -608,14 +619,10 @@ |
|
|
|
return |
|
|
|
} |
|
|
|
if (!home) return |
|
|
|
if (home.profileCompleted !== 1) { |
|
|
|
uni.redirectTo({ url: '/package1/ieBrowser/profileSetup' }) |
|
|
|
return |
|
|
|
} |
|
|
|
this.profile = home.profile || {} |
|
|
|
this.customCompanionIntent = this.profile.companionIntent || this.customCompanionIntent |
|
|
|
this.editCompanionIntent = this.customCompanionIntent |
|
|
|
this.profileReady = true |
|
|
|
this.profileReady = !!(this.profile && this.profile.exists && this.profile.profileCompleted === 1) |
|
|
|
this.onlineCountBase = Number(home.onlineCount) || 0 |
|
|
|
this.awakeCount = this.randomAwakeCount(this.onlineCountBase) |
|
|
|
this.waitingCount = home.waitingCount || this.waitingCount |
|
|
|
@ -706,6 +713,8 @@ |
|
|
|
uni.showToast({ title: '请先选择校区', icon: 'none' }) |
|
|
|
return |
|
|
|
} |
|
|
|
const verified = await this.ensureRealNameBeforeMatch() |
|
|
|
if (!verified) return |
|
|
|
this.matching = true |
|
|
|
try { |
|
|
|
const matchAnimation = this.wait(2000) |
|
|
|
@ -801,6 +810,8 @@ |
|
|
|
}, |
|
|
|
async matchDriftUser(item) { |
|
|
|
if (this.matching) return |
|
|
|
const verified = await this.ensureRealNameBeforeMatch() |
|
|
|
if (!verified) return |
|
|
|
this.matching = true |
|
|
|
try { |
|
|
|
const match = await matchIeProfile(item.userId) |
|
|
|
@ -814,6 +825,22 @@ |
|
|
|
this.matching = false |
|
|
|
} |
|
|
|
}, |
|
|
|
async ensureRealNameBeforeMatch() { |
|
|
|
if (this.realNameVerifying) return false |
|
|
|
this.realNameVerifying = true |
|
|
|
try { |
|
|
|
return await ensureIeVerifiedBeforeAction({ |
|
|
|
profile: this.profile, |
|
|
|
actionText: '开始匹配', |
|
|
|
cancelText: '暂不匹配', |
|
|
|
reload: async () => { |
|
|
|
await this.loadHome() |
|
|
|
} |
|
|
|
}) |
|
|
|
} finally { |
|
|
|
this.realNameVerifying = false |
|
|
|
} |
|
|
|
}, |
|
|
|
playMoodCopy(text) { |
|
|
|
if (this.moodTypeTimer) { |
|
|
|
clearInterval(this.moodTypeTimer) |
|
|
|
|