From 6a556c2470b487c2dc77deae6ae39926ff7d4c5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E8=8B=A5?= Date: Thu, 29 Jan 2026 12:10:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=88=91=E7=9A=84=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=B8=83=E5=B1=80=20+=20=E6=89=BE=E4=BC=99=E4=BC=B4?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 我的页面 1. 头像使用wx.chooseMedia替代button的chooseAvatar 2. 头像/名字/ID布局对齐 3. 去掉多余的创业伙伴图标 ## 找伙伴页面 1. 导师顾问改为"立即咨询" 2. 团队招募改为"团队招募"(去掉"加入项目") 3. 弹窗标题去掉"加入"字样 --- miniprogram/pages/match/match.js | 4 +- miniprogram/pages/match/match.wxml | 2 +- miniprogram/pages/my/my.js | 64 +++++++++++++++++------------- miniprogram/pages/my/my.wxml | 13 +++--- miniprogram/pages/my/my.wxss | 41 ++++++++++--------- 5 files changed, 67 insertions(+), 57 deletions(-) diff --git a/miniprogram/pages/match/match.js b/miniprogram/pages/match/match.js index 741eba7..5adca0c 100644 --- a/miniprogram/pages/match/match.js +++ b/miniprogram/pages/match/match.js @@ -10,8 +10,8 @@ const app = getApp() let MATCH_TYPES = [ { id: 'partner', label: '创业合伙', matchLabel: '创业伙伴', icon: '⭐', matchFromDB: true, showJoinAfterMatch: false }, { id: 'investor', label: '资源对接', matchLabel: '资源对接', icon: '👥', matchFromDB: false, showJoinAfterMatch: true }, - { id: 'mentor', label: '导师顾问', matchLabel: '商业顾问', icon: '❤️', matchFromDB: false, showJoinAfterMatch: true }, - { id: 'team', label: '团队招募', matchLabel: '加入项目', icon: '🎮', matchFromDB: false, showJoinAfterMatch: true } + { id: 'mentor', label: '导师顾问', matchLabel: '立即咨询', icon: '❤️', matchFromDB: false, showJoinAfterMatch: true }, + { id: 'team', label: '团队招募', matchLabel: '团队招募', icon: '🎮', matchFromDB: false, showJoinAfterMatch: true } ] let FREE_MATCH_LIMIT = 3 // 每日免费匹配次数 diff --git a/miniprogram/pages/match/match.wxml b/miniprogram/pages/match/match.wxml index 711ee0b..0ccc79c 100644 --- a/miniprogram/pages/match/match.wxml +++ b/miniprogram/pages/match/match.wxml @@ -181,7 +181,7 @@ {{joinType === 'investor' ? '👥' : joinType === 'mentor' ? '❤️' : '🎮'}} - 加入{{joinTypeLabel}} + {{joinTypeLabel}} 请先绑定联系方式 填写联系方式,专人对接 diff --git a/miniprogram/pages/my/my.js b/miniprogram/pages/my/my.js index a78eeaf..f50143e 100644 --- a/miniprogram/pages/my/my.js +++ b/miniprogram/pages/my/my.js @@ -102,33 +102,43 @@ Page({ } }, - // 微信头像选择回调(button open-type="chooseAvatar") - async onChooseAvatar(e) { - const avatarUrl = e.detail.avatarUrl - if (!avatarUrl) return - - wx.showLoading({ title: '更新中...', mask: true }) - - try { - // 更新本地显示 - const userInfo = this.data.userInfo - userInfo.avatar = avatarUrl - this.setData({ userInfo }) - app.globalData.userInfo = userInfo - wx.setStorageSync('userInfo', userInfo) - - // 同步到服务器 - await app.request('/api/user/update', { - method: 'POST', - data: { userId: userInfo.id, avatar: avatarUrl } - }) - - wx.hideLoading() - wx.showToast({ title: '头像已更新', icon: 'success' }) - } catch (e) { - wx.hideLoading() - wx.showToast({ title: '更新失败', icon: 'none' }) - } + // 点击头像 - 从相册选择 + chooseAvatar() { + wx.chooseMedia({ + count: 1, + mediaType: ['image'], + sourceType: ['album', 'camera'], + success: async (res) => { + const tempFilePath = res.tempFiles[0].tempFilePath + + wx.showLoading({ title: '更新中...', mask: true }) + + try { + // 更新本地显示 + const userInfo = this.data.userInfo + userInfo.avatar = tempFilePath + this.setData({ userInfo }) + app.globalData.userInfo = userInfo + wx.setStorageSync('userInfo', userInfo) + + // 同步到服务器 + try { + await app.request('/api/user/update', { + method: 'POST', + data: { userId: userInfo.id, avatar: tempFilePath } + }) + } catch (e) { + console.log('同步头像失败', e) + } + + wx.hideLoading() + wx.showToast({ title: '头像已更新', icon: 'success' }) + } catch (e) { + wx.hideLoading() + wx.showToast({ title: '更新失败', icon: 'none' }) + } + } + }) }, // 点击昵称修改 diff --git a/miniprogram/pages/my/my.wxml b/miniprogram/pages/my/my.wxml index 38452bd..6e2dce7 100644 --- a/miniprogram/pages/my/my.wxml +++ b/miniprogram/pages/my/my.wxml @@ -27,8 +27,8 @@ - - + - + diff --git a/miniprogram/pages/my/my.wxss b/miniprogram/pages/my/my.wxss index bee8c07..5601700 100644 --- a/miniprogram/pages/my/my.wxss +++ b/miniprogram/pages/my/my.wxss @@ -65,27 +65,16 @@ .user-header-row { display: flex; align-items: center; - gap: 28rpx; - margin-bottom: 36rpx; -} - -/* 头像按钮样式 */ -.avatar-btn { - position: relative; - flex-shrink: 0; - padding: 0; - margin: 0; - background: transparent; - border: none; - line-height: normal; -} -.avatar-btn::after { - border: none; + gap: 24rpx; + margin-bottom: 32rpx; } +/* 头像容器 */ .avatar-wrapper { position: relative; flex-shrink: 0; + width: 120rpx; + height: 120rpx; } .avatar { @@ -98,6 +87,7 @@ justify-content: center; background: linear-gradient(135deg, rgba(0, 206, 209, 0.2) 0%, transparent 100%); overflow: hidden; + box-sizing: border-box; } .avatar-img { @@ -144,32 +134,41 @@ flex: 1; display: flex; flex-direction: column; + justify-content: center; gap: 8rpx; + min-width: 0; } .user-name-row { display: flex; align-items: center; - gap: 16rpx; - flex-wrap: wrap; + gap: 8rpx; } .user-name { - font-size: 34rpx; + font-size: 36rpx; font-weight: 600; color: #ffffff; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + max-width: 280rpx; } .edit-name-icon { font-size: 24rpx; color: rgba(255,255,255,0.4); - margin-left: 8rpx; + flex-shrink: 0; +} + +.user-id-row { + display: flex; + align-items: center; } .user-wechat { font-size: 24rpx; color: #00CED1; - margin-top: 4rpx; } .user-badge-small {