|
@@ -3,9 +3,20 @@
|
|
|
<!-- 顶部状态栏 -->
|
|
<!-- 顶部状态栏 -->
|
|
|
<view class="top-bar">
|
|
<view class="top-bar">
|
|
|
<view class="logo">婚恋</view>
|
|
<view class="logo">婚恋</view>
|
|
|
- <view class="msg-icon" @click="goToMessages">
|
|
|
|
|
- <text class="icon">🔔</text>
|
|
|
|
|
- <view v-if="unreadCount > 0" class="badge">{{ unreadCount }}</view>
|
|
|
|
|
|
|
+ <view class="top-right-icons">
|
|
|
|
|
+ <!-- 红娘工作台切换按钮 -->
|
|
|
|
|
+ <view v-if="userInfo.isMatchmaker && parseInt(userInfo.isMatchmaker) === 1"
|
|
|
|
|
+ class="matchmaker-btn" @click="openMatchmakerPopup">
|
|
|
|
|
+ <view class="arrow-container">
|
|
|
|
|
+ <view class="arrow arrow-top"></view>
|
|
|
|
|
+ <view class="arrow arrow-bottom"></view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <!-- 消息通知图标 -->
|
|
|
|
|
+ <view class="msg-icon" @click="goToMessages">
|
|
|
|
|
+ <text class="icon">🔔</text>
|
|
|
|
|
+ <view v-if="unreadCount > 0" class="badge">{{ unreadCount }}</view>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -238,10 +249,11 @@
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
// 用户信息
|
|
// 用户信息
|
|
|
- userInfo: {
|
|
|
|
|
- nickname: '小张',
|
|
|
|
|
- userId: null
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ userInfo: {
|
|
|
|
|
+ nickname: '小张',
|
|
|
|
|
+ userId: null,
|
|
|
|
|
+ isMatchmaker: '1' // 测试用,实际从后端获取
|
|
|
|
|
+ },
|
|
|
matchCount: 3,
|
|
matchCount: 3,
|
|
|
|
|
|
|
|
|
|
|
|
@@ -336,48 +348,12 @@
|
|
|
this.checkMatchmakerStatus()
|
|
this.checkMatchmakerStatus()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- // 检查红娘状态
|
|
|
|
|
|
|
+ // 删除自动弹出功能,只保留手动点击切换
|
|
|
checkMatchmakerStatus() {
|
|
checkMatchmakerStatus() {
|
|
|
// 从本地存储获取用户信息
|
|
// 从本地存储获取用户信息
|
|
|
const userInfo = uni.getStorageSync('userInfo')
|
|
const userInfo = uni.getStorageSync('userInfo')
|
|
|
console.log('🔍 检查红娘状态,用户信息:', userInfo)
|
|
console.log('🔍 检查红娘状态,用户信息:', userInfo)
|
|
|
-
|
|
|
|
|
- // 严格判断:只有明确为红娘(值为1)的用户才显示弹框
|
|
|
|
|
- // 使用 parseInt 确保类型一致,避免字符串和数字比较问题
|
|
|
|
|
- if (userInfo && userInfo.isMatchmaker && parseInt(userInfo.isMatchmaker) === 1) {
|
|
|
|
|
- const storageKey = 'matchmakerPopupHandled_' + userInfo.userId
|
|
|
|
|
- console.log('📝 存储键:', storageKey)
|
|
|
|
|
-
|
|
|
|
|
- // 检查用户是否已经处理过红娘工作台提示
|
|
|
|
|
- const matchmakerPopupHandled = uni.getStorageSync(storageKey)
|
|
|
|
|
- console.log('✅ 已处理标记:', matchmakerPopupHandled)
|
|
|
|
|
-
|
|
|
|
|
- if (matchmakerPopupHandled) {
|
|
|
|
|
- console.log('❌ 用户已处理过红娘工作台提示,不再显示弹框')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 避免在同一次会话中重复显示弹框
|
|
|
|
|
- if (this.hasShownMatchmakerPopup) {
|
|
|
|
|
- console.log('❌ 本次会话已显示过弹框,不再重复显示')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- console.log('✨ 用户是红娘且未处理过提示,准备显示弹框')
|
|
|
|
|
- // 标记已显示(仅在当前会话中有效)
|
|
|
|
|
- this.hasShownMatchmakerPopup = true
|
|
|
|
|
- // 延迟显示弹框,确保页面已完全加载
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- if (this.$refs.matchmakerPopup) {
|
|
|
|
|
- this.$refs.matchmakerPopup.open()
|
|
|
|
|
- console.log('🎉 弹框已打开')
|
|
|
|
|
- } else {
|
|
|
|
|
- console.error('❌ 弹框组件引用不存在')
|
|
|
|
|
- }
|
|
|
|
|
- }, 500)
|
|
|
|
|
- } else {
|
|
|
|
|
- console.log('ℹ️ 用户不是红娘,isMatchmaker值:', userInfo?.isMatchmaker)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 此处不再自动弹出弹框,只在用户点击切换按钮时显示
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 前往红娘工作台
|
|
// 前往红娘工作台
|
|
@@ -385,19 +361,6 @@
|
|
|
console.log('🚀 前往红娘工作台')
|
|
console.log('🚀 前往红娘工作台')
|
|
|
this.$refs.matchmakerPopup.close()
|
|
this.$refs.matchmakerPopup.close()
|
|
|
|
|
|
|
|
- // 标记用户已处理过弹框(选择了前往)
|
|
|
|
|
- const userInfo = uni.getStorageSync('userInfo')
|
|
|
|
|
- if (userInfo && userInfo.userId) {
|
|
|
|
|
- const storageKey = 'matchmakerPopupHandled_' + userInfo.userId
|
|
|
|
|
- uni.setStorageSync(storageKey, true)
|
|
|
|
|
- console.log('💾 已保存处理标记(前往):', storageKey, '=', true)
|
|
|
|
|
- // 验证保存
|
|
|
|
|
- const saved = uni.getStorageSync(storageKey)
|
|
|
|
|
- console.log('🔍 验证保存结果:', saved)
|
|
|
|
|
- } else {
|
|
|
|
|
- console.error('❌ 无法保存标记,用户信息不完整:', userInfo)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
// 跳转到红娘工作台
|
|
// 跳转到红娘工作台
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
url: '/pages/matchmaker-workbench/index'
|
|
url: '/pages/matchmaker-workbench/index'
|
|
@@ -408,19 +371,6 @@
|
|
|
closeMatchmakerPopup() {
|
|
closeMatchmakerPopup() {
|
|
|
console.log('🚫 用户选择不前往红娘工作台')
|
|
console.log('🚫 用户选择不前往红娘工作台')
|
|
|
this.$refs.matchmakerPopup.close()
|
|
this.$refs.matchmakerPopup.close()
|
|
|
-
|
|
|
|
|
- // 标记用户已处理过弹框(选择了取消)
|
|
|
|
|
- const userInfo = uni.getStorageSync('userInfo')
|
|
|
|
|
- if (userInfo && userInfo.userId) {
|
|
|
|
|
- const storageKey = 'matchmakerPopupHandled_' + userInfo.userId
|
|
|
|
|
- uni.setStorageSync(storageKey, true)
|
|
|
|
|
- console.log('💾 已保存处理标记(取消):', storageKey, '=', true)
|
|
|
|
|
- // 验证保存
|
|
|
|
|
- const saved = uni.getStorageSync(storageKey)
|
|
|
|
|
- console.log('🔍 验证保存结果:', saved)
|
|
|
|
|
- } else {
|
|
|
|
|
- console.error('❌ 无法保存标记,用户信息不完整:', userInfo)
|
|
|
|
|
- }
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 加载用户信息
|
|
// 加载用户信息
|
|
@@ -945,6 +895,14 @@
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ // 打开红娘工作台弹框
|
|
|
|
|
+ openMatchmakerPopup() {
|
|
|
|
|
+ // 删除检查处理标记的逻辑,每次点击都显示弹框
|
|
|
|
|
+ if (this.$refs.matchmakerPopup) {
|
|
|
|
|
+ this.$refs.matchmakerPopup.open()
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
|
|
|
|
|
// 切换Tab
|
|
// 切换Tab
|
|
@@ -990,6 +948,88 @@
|
|
|
color: #E91E63;
|
|
color: #E91E63;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ .top-right-icons {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 20rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .matchmaker-btn {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ width: 68rpx;
|
|
|
|
|
+ height: 68rpx;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ background: transparent;
|
|
|
|
|
+ border-radius: 4rpx;
|
|
|
|
|
+ transition: all 0.2s ease;
|
|
|
|
|
+
|
|
|
|
|
+ &:active {
|
|
|
|
|
+ opacity: 0.6;
|
|
|
|
|
+ transform: scale(0.95);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .arrow-container {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 4rpx;
|
|
|
|
|
+ width: 64rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .arrow {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ width: 64rpx;
|
|
|
|
|
+ height: 22rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .arrow::before,
|
|
|
|
|
+ .arrow::after {
|
|
|
|
|
+ content: '';
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ transition: all 0.2s ease;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 上方箭头 - 向右 */
|
|
|
|
|
+ .arrow-top::before {
|
|
|
|
|
+ top: 8rpx;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ width: 40rpx;
|
|
|
|
|
+ height: 6rpx;
|
|
|
|
|
+ background: #333;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .arrow-top::after {
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+ width: 0;
|
|
|
|
|
+ height: 0;
|
|
|
|
|
+ border-top: 11rpx solid transparent;
|
|
|
|
|
+ border-bottom: 11rpx solid transparent;
|
|
|
|
|
+ border-left: 24rpx solid #333;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* 下方箭头 - 向左 */
|
|
|
|
|
+ .arrow-bottom::before {
|
|
|
|
|
+ top: 8rpx;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+ width: 40rpx;
|
|
|
|
|
+ height: 6rpx;
|
|
|
|
|
+ background: #333;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .arrow-bottom::after {
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ width: 0;
|
|
|
|
|
+ height: 0;
|
|
|
|
|
+ border-top: 11rpx solid transparent;
|
|
|
|
|
+ border-bottom: 11rpx solid transparent;
|
|
|
|
|
+ border-right: 24rpx solid #333;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
.msg-icon {
|
|
.msg-icon {
|
|
|
position: relative;
|
|
position: relative;
|
|
|
width: 68rpx;
|
|
width: 68rpx;
|
|
@@ -1003,6 +1043,7 @@
|
|
|
|
|
|
|
|
&:active {
|
|
&:active {
|
|
|
opacity: 0.8;
|
|
opacity: 0.8;
|
|
|
|
|
+ transform: scale(0.95);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.icon {
|
|
.icon {
|