feat(apply): 入驻只收基本信息并新增启动页、材料后补与改服务城市

入驻表单移除身份证与证件材料(服务城市单选下拉,默认北京),只填姓名/手机/性别/城市/简介即可提交;新增 pages/launch 启动页先解析身份再跳转,无身份直接进申请页不再闪现首页;新增 pages/materials 证件材料补传页;个人资料页支持在职陪诊师修改服务城市;appId 更名为 wxapp_companion。
This commit is contained in:
lik
2026-11-10 16:34:00 +08:00
parent 5848d181a6
commit ff1b1664fa
20 changed files with 738 additions and 176 deletions
+66 -1
View File
@@ -1,5 +1,7 @@
// pages/me/index.js
const API = require('../../utils/api.js')
const role = require('../../utils/role.js')
const { CITY_OPTIONS, CITY_LABELS, cityIndex, cityLabel } = require('../../utils/city.js')
// 性别映射
const SEX_MAP = {
@@ -10,7 +12,11 @@ const SEX_MAP = {
Page({
data: {
user: {},
identityText: ''
identityText: '',
isAttendant: false,
serviceAreaLabels: CITY_LABELS,
serviceAreaIndex: 0,
serviceAreaText: ''
},
onShow() {
@@ -26,13 +32,72 @@ Page({
.ensureRoleSafe()
.then((detail) => {
const attendant = detail.attendant || null
const isAttendant = detail.role === 'attendant'
this.setData({
isAttendant,
identityText: detail.role === 'admin' ? '管理员' : (attendant ? attendant.text : '')
})
if (isAttendant) this.loadServiceArea()
})
.catch(() => {})
},
/**
* 服务城市:以员工档案 attendantInfo.serviceAreas 为准
*/
loadServiceArea() {
API.employee
.getMe()
.then((res) => {
if (res.code !== 0 || !res.data || !res.data.employee) return
const areas = res.data.employee.attendantInfo
? res.data.employee.attendantInfo.serviceAreas || []
: []
this.applyServiceArea(areas[0])
})
.catch(() => {})
},
applyServiceArea(value) {
this.setData({
serviceAreaIndex: cityIndex(value),
serviceAreaText: value ? cityLabel(value) : '未设置'
})
},
/**
* 修改服务城市:只影响订单池可见范围
*/
onServiceAreaChange(e) {
const index = Number(e.detail.value) || 0
const option = CITY_OPTIONS[index]
if (!option) return
wx.showLoading({ title: '保存中...' })
API.employee
.setServiceArea(option.value)
.then((res) => {
wx.hideLoading()
if (res.code === 0) {
this.applyServiceArea(option.value)
wx.showToast({ title: '服务城市已更新', icon: 'success' })
return
}
wx.showToast({ title: res.msg || '保存失败', icon: 'none' })
})
.catch((err) => {
wx.hideLoading()
wx.showToast({ title: (err && err.message) || '网络错误,请重试', icon: 'none' })
})
},
/**
* 证件材料后补入口
*/
onMaterialsTap() {
wx.navigateTo({ url: '/pages/materials/index' })
},
/**
* 加载当前登录用户信息
*/
+13
View File
@@ -104,3 +104,16 @@ page {
text-overflow: ellipsis;
white-space: nowrap;
}
.picker-value {
display: flex;
align-items: center;
justify-content: flex-end;
color: #C26A2E;
}
.arrow {
margin-left: 8rpx;
font-size: 32rpx;
color: #C9BFB5;
}
+27
View File
@@ -56,6 +56,33 @@
</view>
<text class="info-value">{{user.locationText || '未填写'}}</text>
</view>
<view class="info-item" wx:if="{{isAttendant}}">
<view class="info-left">
<t-icon name="location" size="36rpx" color="#C26A2E" />
<text class="info-label">服务城市</text>
</view>
<picker
mode="selector"
range="{{serviceAreaLabels}}"
value="{{serviceAreaIndex}}"
bindchange="onServiceAreaChange"
>
<view class="info-value picker-value">
{{serviceAreaText || '未设置'}}
<text class="arrow">›</text>
</view>
</picker>
</view>
<view class="info-item" bindtap="onMaterialsTap">
<view class="info-left">
<t-icon name="file" size="36rpx" color="#C26A2E" />
<text class="info-label">证件材料</text>
</view>
<view class="info-value picker-value">
查看 / 补传
<text class="arrow">›</text>
</view>
</view>
<view class="info-item">
<view class="info-left">
<t-icon name="time" size="36rpx" color="#C26A2E" />