优化:微信资料改为双按钮

This commit is contained in:
2026-10-10 18:04:00 +08:00
parent 89f51440a0
commit ef5f638e7e
4 changed files with 21 additions and 28 deletions
@@ -40,7 +40,6 @@ Page({
roleText: '管理端',
shopName: BRAND_CONFIG.defaultShopName,
phoneDisplay: '未绑定',
wechatProfileExpanded: false,
form: { nickname: '', avatar: '', wechatId: '', signature: '' }
},
@@ -97,10 +96,6 @@ Page({
this.setData(nextData)
},
toggleWechatProfile() {
this.setData({ wechatProfileExpanded: !this.data.wechatProfileExpanded })
},
onWechatNicknameInput(event) {
const nickname = event.detail.value
this.setData({
+9 -13
View File
@@ -13,19 +13,15 @@
</view>
</view>
<view class="card wechat-profile-card">
<view class="wechat-profile-entry" bindtap="toggleWechatProfile">
<view class="wechat-profile-mark">微</view>
<text>使用微信资料</text>
<text class="expand-arrow {{wechatProfileExpanded ? 'expanded' : ''}}">›</text>
</view>
<view wx:if="{{wechatProfileExpanded}}" class="wechat-profile-panel">
<button class="wechat-avatar-picker" open-type="chooseAvatar" loading="{{avatarUploading}}" disabled="{{loading || saving}}" bindchooseavatar="chooseWechatAvatar">
<image wx:if="{{form.avatar}}" src="{{form.avatar}}" mode="aspectFill"></image>
<text wx:else>{{avatarText}}</text>
<view class="wechat-avatar-tip">选择微信头像</view>
</button>
<input class="wechat-nickname-input" type="nickname" value="{{form.nickname}}" bindinput="onWechatNicknameInput" placeholder="填写微信昵称" />
<view class="wechat-data-actions">
<button class="wechat-data-action" open-type="chooseAvatar" disabled="{{loading || saving || avatarUploading}}" bindchooseavatar="chooseWechatAvatar">
<view class="wechat-action-mark">像</view>
<text>{{avatarUploading ? '头像上传中' : '使用微信头像'}}</text>
</button>
<view class="wechat-data-action nickname-action {{loading || saving || avatarUploading ? 'disabled' : ''}}">
<view class="wechat-action-mark">昵</view>
<text>使用微信昵称</text>
<input class="wechat-nickname-trigger" type="nickname" value="{{form.nickname}}" disabled="{{loading || saving || avatarUploading}}" bindinput="onWechatNicknameInput" />
</view>
</view>
+6 -10
View File
@@ -8,16 +8,12 @@
.avatar-copy { display:flex; min-width:0; flex:1; flex-direction:column; margin-left:20rpx; }
.avatar-title { color:#30483c; font-size:30rpx; font-weight:800; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.avatar-signature { margin-top:10rpx; color:#8a9a91; font-size:22rpx; line-height:1.5; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wechat-profile-card { margin-top:20rpx; overflow:hidden; }
.wechat-profile-entry { display:flex; min-height:92rpx; align-items:center; padding:0 24rpx; color:#30483c; font-size:26rpx; font-weight:800; }
.wechat-profile-mark { display:flex; width:48rpx; height:48rpx; align-items:center; justify-content:center; margin-right:16rpx; border-radius:14rpx; background:#dcebe1; color:#35634d; font-size:21rpx; }
.expand-arrow { margin-left:auto; color:#8a9a91; font-size:38rpx; transition:transform 180ms ease; }
.expand-arrow.expanded { transform:rotate(90deg); }
.wechat-profile-panel { display:flex; align-items:center; gap:20rpx; padding:22rpx 24rpx 26rpx; border-top:1rpx solid #eee8df; background:#faf8f3; }
.wechat-avatar-picker { position:relative; display:flex; width:112rpx; min-width:112rpx; max-width:112rpx; height:112rpx; min-height:112rpx; align-items:center; justify-content:center; overflow:hidden; border-radius:28rpx; background:#6f8f83; color:#fff; font-size:36rpx; font-weight:900; }
.wechat-avatar-picker image { width:100%; height:100%; }
.wechat-avatar-tip { position:absolute; right:0; bottom:0; left:0; height:34rpx; background:rgba(35,42,39,.62); color:#fff; font-size:15rpx; font-weight:500; line-height:34rpx; text-align:center; }
.wechat-nickname-input { height:78rpx; min-width:0; flex:1; padding:0 20rpx; border:1rpx solid #dde8e0; border-radius:12rpx; background:#fff; color:#27231f; font-size:27rpx; }
.wechat-data-actions { display:flex; gap:16rpx; margin-top:20rpx; }
.wechat-data-action { position:relative; display:flex; width:auto; min-width:0; height:84rpx; flex:1; align-items:center; justify-content:center; padding:0 18rpx; overflow:hidden; border:1rpx solid rgba(53,99,77,.08); border-radius:18rpx; background:#fffdf8; color:#30483c; font-size:24rpx; font-weight:800; box-shadow:0 8rpx 22rpx rgba(58,48,34,.05); }
.wechat-data-action.disabled { opacity:.55; }
.wechat-action-mark { display:flex; width:40rpx; height:40rpx; flex:none; align-items:center; justify-content:center; margin-right:12rpx; border-radius:12rpx; background:#dcebe1; color:#35634d; font-size:18rpx; }
.nickname-action { box-sizing:border-box; }
.wechat-nickname-trigger { position:absolute; z-index:2; top:0; right:0; bottom:0; left:0; width:100%; height:100%; opacity:0; }
.section-title { margin:30rpx 4rpx 14rpx; }
.form-card { padding:0 24rpx; }
.field-label { width:170rpx; }
+6
View File
@@ -1,5 +1,11 @@
# 项目变更记录
## 2026-10-10 Salon 微信资料双按钮
- 将个人信息页“使用微信资料”折叠入口改为左右两个等宽按钮:左侧使用微信头像,右侧使用微信昵称。
- 微信昵称按钮以透明 `nickname` 输入覆盖实现,保留微信原生昵称建议能力,同时固定显示操作文案。
- 删除旧展开状态、箭头和二级头像昵称面板,减少操作层级。
## 2026-10-10 Salon 微信头像选择即时预览修复
- 修复微信头像选择器返回页面时 `onShow` 重新加载旧资料、覆盖新头像的问题。