From 1176a62a1f8a39af3b9ffa369ee17e9d9873141a Mon Sep 17 00:00:00 2001 From: kenyanghui Date: Sun, 15 Nov 2026 06:51:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(audit):=20=E5=85=B1=E6=8B=86=E5=88=86?= =?UTF-8?q?=E6=9E=90=E9=A1=B5=E6=B8=B8=E5=AE=A2=E6=94=B9=E9=9D=99=E6=80=81?= =?UTF-8?q?=E5=BC=95=E5=AF=BC=E8=A7=86=E5=9B=BE=EF=BC=8C=E5=85=88=E6=B5=8F?= =?UTF-8?q?=E8=A7=88=E5=8A=9F=E8=83=BD=E4=BB=8B=E7=BB=8D=E5=86=8D=E8=87=AA?= =?UTF-8?q?=E4=B8=BB=E7=99=BB=E5=BD=95=EF=BC=88=E5=AE=A1=E6=A0=B8=E6=8B=92?= =?UTF-8?q?=E5=9B=A01=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/collaboration-analysis/index.js | 63 +++++++++---------- .../pages/collaboration-analysis/index.wxml | 35 +++++++++-- .../pages/collaboration-analysis/index.wxss | 39 ++++++++++++ 3 files changed, 99 insertions(+), 38 deletions(-) diff --git a/wechat-miniprogram/pages/collaboration-analysis/index.js b/wechat-miniprogram/pages/collaboration-analysis/index.js index 2a8de44..da5d055 100644 --- a/wechat-miniprogram/pages/collaboration-analysis/index.js +++ b/wechat-miniprogram/pages/collaboration-analysis/index.js @@ -9,6 +9,7 @@ Page({ loading: true, error: '', analysis: null, + isLoggedIn: true, showDimensions: false, // 量化分析默认折叠 }, @@ -19,17 +20,23 @@ Page({ return; } this.setData({ targetUserId, activityId: activityId || '' }); + if (!wx.getStorageSync('userId')) { + this.setData({ isLoggedIn: false, loading: false }); + return; + } this.loadAnalysis(); }, + onShow() { + if (!this.data.isLoggedIn && wx.getStorageSync('userId')) { + this.setData({ isLoggedIn: true }); + this.loadAnalysis(); + } + }, + async loadAnalysis() { this.setData({ loading: true, error: '' }); const { targetUserId, activityId } = this.data; - // 游客引导登录后再查看共拆分析 - if (!wx.getStorageSync('userId')) { - this.promptLogin(); - return; - } try { const res = await new Promise((resolve, reject) => { wx.request({ @@ -52,7 +59,22 @@ Page({ const analysis = this.prepareAnalysis(res.data); this.setData({ analysis, loading: false }); } else if (res.code === 'LOGIN_REQUIRED') { - this.promptLogin(res.message); + // 登录态失效:转为游客引导视图,由用户自主选择登录 + this.setData({ isLoggedIn: false, loading: false, error: '' }); + } else if (res.code === 'EMAIL_REQUIRED') { + // 已登录未绑邮箱:引导绑定(本页原生请求不走全局拦截器) + this.setData({ loading: false, error: res.message || '请先绑定邮箱后查看共拆分析' }); + wx.showModal({ + title: '请先绑定邮箱', + content: '邮箱是身份认定凭证,绑定后即可查看共拆分析', + confirmText: '去绑定', + cancelText: '暂不', + success: (r) => { + if (r.confirm) { + wx.navigateTo({ url: '/pages/edit-profile/index?focus=email' }); + } + }, + }); } else { this.setData({ loading: false, error: res.message || '分析失败' }); } @@ -62,27 +84,9 @@ Page({ } }, - // 游客引导:弹窗去登录,取消则返回上一页 - promptLogin(message) { - this.setData({ loading: false, error: '' }); - wx.showModal({ - title: '登录后查看', - content: message || '登录后即可查看与 TA 的共拆潜力分析,还能报名活动、结识书友', - confirmText: '去登录', - cancelText: '暂不', - success: (r) => { - if (r.confirm) { - wx.navigateTo({ url: '/pages/login/index' }); - } else { - const pages = getCurrentPages(); - if (pages.length > 1) { - wx.navigateBack({ delta: 1 }); - } else { - wx.switchTab({ url: '/pages/home/index' }); - } - } - }, - }); + // 游客自主点击「去登录」 + goToLogin() { + wx.navigateTo({ url: '/pages/login/index' }); }, prepareAnalysis(data) { @@ -147,9 +151,4 @@ Page({ success: () => wx.showToast({ title: '已复制', icon: 'success', duration: 1500 }), }); }, - - // 发起私聊(暂未实现) - startChat() { - wx.showToast({ title: '功能开发中', icon: 'none' }); - }, }); diff --git a/wechat-miniprogram/pages/collaboration-analysis/index.wxml b/wechat-miniprogram/pages/collaboration-analysis/index.wxml index 6574d3d..66b1c0c 100644 --- a/wechat-miniprogram/pages/collaboration-analysis/index.wxml +++ b/wechat-miniprogram/pages/collaboration-analysis/index.wxml @@ -12,8 +12,36 @@ {{error}} + + + + 🤝 + 共拆潜力分析 + 登录后,AI 将基于你们双方的资料,生成专属共拆分析: + + + 💎 + 价值标签 — 快速了解 TA 能带来的资源与视角 + + + 💡 + 利益交集 — 找到你们共同关注的机会点 + + + 🎯 + 破冰策略 — 切入角度、首次话题与开场话术 + + + ✅ + 行动清单 — 下一步共拆行动建议 + + + + + + - + @@ -147,10 +175,5 @@ - - - - - diff --git a/wechat-miniprogram/pages/collaboration-analysis/index.wxss b/wechat-miniprogram/pages/collaboration-analysis/index.wxss index fee563f..424b697 100644 --- a/wechat-miniprogram/pages/collaboration-analysis/index.wxss +++ b/wechat-miniprogram/pages/collaboration-analysis/index.wxss @@ -209,6 +209,45 @@ .action-title { display: block; font-size: 28rpx; font-weight: 600; color: #333; margin-bottom: 6rpx; } .action-desc { display: block; font-size: 26rpx; color: #666; line-height: 1.6; } +/* ========== 游客引导 ========== */ +.guest-wrapper { + display: flex; + justify-content: center; + padding: 60rpx 32rpx; +} +.guest-card { + width: 100%; + background: #fff; + border-radius: 24rpx; + padding: 48rpx 36rpx 40rpx; + box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.04); + display: flex; + flex-direction: column; + align-items: center; +} +.guest-icon { font-size: 80rpx; } +.guest-title { + font-size: 36rpx; font-weight: 700; color: #333; + margin-top: 20rpx; +} +.guest-desc { + font-size: 26rpx; color: #666; line-height: 1.6; + margin-top: 16rpx; text-align: center; +} +.guest-feature-list { + width: 100%; + display: flex; flex-direction: column; gap: 20rpx; + margin-top: 32rpx; +} +.guest-feature { + display: flex; align-items: flex-start; + background: #f8f9fc; border-radius: 16rpx; + padding: 20rpx 24rpx; +} +.guest-feature-icon { font-size: 30rpx; margin-right: 16rpx; flex-shrink: 0; } +.guest-feature-text { font-size: 26rpx; color: #444; line-height: 1.6; } +.guest-card .chat-btn { margin-top: 40rpx; } + /* ========== 底部按钮 ========== */ .bottom-action { padding: 40rpx 24rpx; } .chat-btn {