feat(addMember): 选择已有成员补服务端校验;表单加scroll-view;上限10人限制

- onSelectMember 选中后调用 fetchUserInfoByIdCard 走服务端校验
- 表单区域包裹 scroll-view,适配小屏滚动
- equipmentMember 添加按钮超10人弹 toast 提示

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
17792275749
2026-05-28 16:52:59 +08:00
co-authored by Claude Opus 4.7
parent dc5010350c
commit 77e768f6c7
4 changed files with 156 additions and 141 deletions
@@ -41,8 +41,12 @@
width: 100%;
flex: 1;
overflow: hidden;
.scrollViewContent {
width: 100%;
padding: 0 30rpx;
box-sizing: border-box;
}
/* 表单卡片 */
.form-card {
+3
View File
@@ -299,6 +299,9 @@ Page({
'form.height': String(member.height),
'form.weight': String(member.weight),
})
if (member.name.trim() && this.isIdCardValid(member.idCard)) {
this.fetchUserInfoByIdCard(member.name.trim(), member.idCard)
}
},
/** 确认弹框 - 确认 */
+8 -4
View File
@@ -7,6 +7,8 @@
</view>
<view class="form">
<scroll-view class="scrollView">
<view class="scrollViewContent">
<!-- 白色圆角表单卡片 -->
<view class="form-card">
@@ -24,7 +26,7 @@
placeholder-class="form-placeholder"
value="{{ form.name }}"
disabled="{{ readonly }}"
bind:input="onNameInput" />
bind:input="onNameInput"/>
</view>
</view>
@@ -42,7 +44,7 @@
placeholder-class="form-placeholder"
value="{{ form.idCard }}"
disabled="{{ readonly }}"
bind:input="onIdCardInput" />
bind:input="onIdCardInput"/>
</view>
</view>
@@ -96,7 +98,7 @@
placeholder-class="form-placeholder"
value="{{ form.height }}"
disabled="{{ readonly }}"
bind:input="onHeightInput" />
bind:input="onHeightInput"/>
<text class="form-suffix form-suffix-inside">cm</text>
</view>
</view>
@@ -117,7 +119,7 @@
placeholder-class="form-placeholder"
value="{{ form.weight }}"
disabled="{{ readonly }}"
bind:input="onWeightInput" />
bind:input="onWeightInput"/>
<text class="form-suffix form-suffix-inside">kg</text>
</view>
</view>
@@ -129,6 +131,8 @@
<view class="ghost-btn" bind:tap="onTapSelectExisting">从已有成员中选择</view>
</block>
</view>
</scroll-view>
</view>
<!-- 底部双按钮:取消 / 保存成员信息 -->
<view class="actions">
@@ -292,6 +292,10 @@ Page({
/** 添加成员:未连接态禁用 */
onTapAddMember() {
if (!this.data.connected) return
if (this.data.memberList.length >= 10) {
wx.showToast({ title: '超过最大用户限制', icon: 'none' })
return
}
wx.navigateTo({ url: '/pages/addMember/addMember' })
},
})