fix: 头像昵称页与规则引擎;用户页与 user/user_rule API;更新 admin dist

Made-with: Cursor
This commit is contained in:
卡若
2026-03-24 12:54:39 +08:00
parent f069b71374
commit e6b8443b0c
9 changed files with 354 additions and 185 deletions

View File

@@ -12,11 +12,29 @@ Page({
saving: false,
showPrivacyModal: false,
nicknameInputFocus: false,
/** 规则引擎传入avatar | nickname用于高亮对应区块 */
uiFocus: '',
},
onLoad() {
onLoad(options) {
this.setData({ statusBarHeight: app.globalData.statusBarHeight || 44 })
const focus = String(options.focus || '').toLowerCase()
if (focus === 'avatar' || focus === 'nickname') {
this.setData({ uiFocus: focus })
}
this.loadFromUser()
if (focus === 'nickname') {
setTimeout(() => {
if (typeof wx.requirePrivacyAuthorize === 'function') {
wx.requirePrivacyAuthorize({
success: () => this.setData({ nicknameInputFocus: true }),
fail: () => {},
})
} else {
this.setData({ nicknameInputFocus: true })
}
}, 400)
}
},
loadFromUser() {

View File

@@ -11,11 +11,13 @@
<view class="guide-card">
<icon name="handshake" size="64" color="#00CED1" customClass="guide-icon"></icon>
<text class="guide-title">设置对外展示信息</text>
<text class="guide-desc">头像与昵称会出现在名片与匹配卡片上,方便伙伴认出你。</text>
<text class="guide-desc" wx:if="{{uiFocus === 'avatar'}}">请先换一张清晰头像,伙伴更容易认出你。</text>
<text class="guide-desc" wx:elif="{{uiFocus === 'nickname'}}">请改一个真实好记的昵称,方便伙伴称呼你。</text>
<text class="guide-desc" wx:else>头像与昵称会出现在名片与匹配卡片上,方便伙伴认出你。</text>
</view>
<!-- 头像:点击直接弹出微信原生选择器;头像与文字水平对齐 -->
<view class="avatar-section">
<view class="avatar-section {{uiFocus === 'avatar' ? 'section-focus' : ''}}">
<button class="avatar-wrap-btn" open-type="chooseAvatar" bindchooseavatar="onChooseAvatar">
<view class="avatar-wrap">
<view class="avatar-inner">
@@ -28,7 +30,7 @@
</view>
<!-- 昵称:点击前先请求隐私授权,解决 errno:104 昵称选择器无法弹出 -->
<view class="form-section">
<view class="form-section {{uiFocus === 'nickname' ? 'section-focus' : ''}}">
<text class="form-label">昵称</text>
<view class="form-input-wrap" catchtouchstart="onNicknameAreaTouch">
<input

View File

@@ -78,6 +78,13 @@
gap: 32rpx;
margin-bottom: 48rpx;
}
.avatar-section.section-focus .avatar-wrap {
box-shadow: 0 0 0 6rpx rgba(94, 234, 212, 0.45), 0 0 36rpx rgba(94, 234, 212, 0.45);
}
.form-section.section-focus .form-input-wrap {
border-color: rgba(94, 234, 212, 0.55);
box-shadow: 0 0 0 2rpx rgba(94, 234, 212, 0.25);
}
/* 头像按钮:透明无边框,点击直接弹出微信原生选择器 */
.avatar-wrap-btn {
display: flex; align-items: center; justify-content: center;