解决登录显示、首页显示bug
This commit is contained in:
@@ -10,9 +10,13 @@
|
||||
<view class="table-header">
|
||||
<view class="th" style="flex: 1;">序号</view>
|
||||
<view class="th" style="flex: 1.5;">头像</view>
|
||||
<view class="th" style="flex: 2;">名称</view>
|
||||
<view class="th" style="flex: 2.5;">手机号码</view>
|
||||
<view class="th" style="flex: 1.5;">状态</view>
|
||||
<view class="th" style="flex: 1.8;">名称</view>
|
||||
<view class="th" style="flex: 1.8;">编号</view>
|
||||
<view class="th" style="flex: 2.5;">机构</view>
|
||||
<view class="th" style="flex: 2.3;">手机号码</view>
|
||||
<view class="th" style="flex: 1.5;">在线</view>
|
||||
<view class="th" style="flex: 1.7;">资质</view>
|
||||
<view class="th" style="flex: 1.3;">状态</view>
|
||||
<view class="th" style="flex: 3;">添加时间</view>
|
||||
<view class="th" style="flex: 2;">操作</view>
|
||||
</view>
|
||||
@@ -29,9 +33,13 @@
|
||||
<image v-if="item.avatar" class="avatar" :src="item.avatar" mode="aspectFill" />
|
||||
<view v-else class="avatar-placeholder"><text>👤</text></view>
|
||||
</view>
|
||||
<view class="td" style="flex: 2;"><text class="td-txt">{{ item.nickname }}</text></view>
|
||||
<view class="td" style="flex: 2.5;"><text class="td-txt">{{ item.phone }}</text></view>
|
||||
<view class="td" style="flex: 1.5;">
|
||||
<view class="td" style="flex: 1.8;"><text class="td-txt">{{ item.nickname }}</text></view>
|
||||
<view class="td" style="flex: 1.8;"><text class="td-txt">{{ item.staff_no || '-' }}</text></view>
|
||||
<view class="td" style="flex: 2.5;"><text class="td-txt">{{ item.station_name || item.station_id || '-' }}</text></view>
|
||||
<view class="td" style="flex: 2.3;"><text class="td-txt">{{ item.phone }}</text></view>
|
||||
<view class="td" style="flex: 1.5;"><text class="td-txt">{{ item.online_status || '-' }}</text></view>
|
||||
<view class="td" style="flex: 1.7;"><text class="td-txt">{{ item.certificate_status || '-' }}</text></view>
|
||||
<view class="td" style="flex: 1.3;">
|
||||
<switch :checked="item.status === 1" color="#1890ff" scale="0.7" @change="onToggleStatus(item)" />
|
||||
</view>
|
||||
<view class="td" style="flex: 3;"><text class="td-txt-small">{{ formatTime(item.created_at) }}</text></view>
|
||||
@@ -71,6 +79,34 @@
|
||||
<text class="f-label">手机号:</text>
|
||||
<input class="f-input" v-model="form.phone" type="number" placeholder="请输入手机号" />
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="f-label">编号:</text>
|
||||
<input class="f-input" v-model="form.staff_no" placeholder="请输入服务人员编号" />
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="f-label">机构ID:</text>
|
||||
<input class="f-input" v-model="form.station_id" placeholder="请输入服务机构/站点 ID" />
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="f-label">服务区域:</text>
|
||||
<input class="f-input" v-model="form.service_area" placeholder="请输入服务区域" />
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="f-label">在线状态:</text>
|
||||
<input class="f-input" v-model="form.online_status" placeholder="online / resting / busy" />
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="f-label">资质状态:</text>
|
||||
<input class="f-input" v-model="form.certificate_status" placeholder="valid / expired / pending" />
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="f-label">资质到期:</text>
|
||||
<input class="f-input" v-model="form.certificate_expire_at" placeholder="YYYY-MM-DD" />
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="f-label">技能标签:</text>
|
||||
<input class="f-input" v-model="form.skillsText" placeholder="多个标签请用英文逗号分隔" />
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="f-label">头像:</text>
|
||||
<view class="upload-placeholder" @click="handleUpload">
|
||||
@@ -103,10 +139,18 @@ const showModal = ref(false)
|
||||
const isEdit = ref(false)
|
||||
const form = reactive({
|
||||
id: '' as string | null,
|
||||
uid: '' as string | null,
|
||||
station_id: '' as string | null,
|
||||
staff_no: '',
|
||||
nickname: '',
|
||||
phone: '',
|
||||
avatar: '',
|
||||
status: 1
|
||||
status: 1,
|
||||
online_status: 'resting',
|
||||
certificate_status: 'pending',
|
||||
certificate_expire_at: '',
|
||||
service_area: '',
|
||||
skillsText: ''
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
@@ -129,20 +173,36 @@ async function loadData() {
|
||||
function onAdd() {
|
||||
isEdit.value = false
|
||||
form.id = null
|
||||
form.uid = null
|
||||
form.station_id = ''
|
||||
form.staff_no = ''
|
||||
form.nickname = ''
|
||||
form.phone = ''
|
||||
form.avatar = ''
|
||||
form.status = 1
|
||||
form.online_status = 'resting'
|
||||
form.certificate_status = 'pending'
|
||||
form.certificate_expire_at = ''
|
||||
form.service_area = ''
|
||||
form.skillsText = ''
|
||||
showModal.value = true
|
||||
}
|
||||
|
||||
function onEdit(item : DeliveryStaff) {
|
||||
isEdit.value = true
|
||||
form.id = item.id
|
||||
form.uid = item.uid
|
||||
form.station_id = item.station_id || ''
|
||||
form.staff_no = item.staff_no || ''
|
||||
form.nickname = item.nickname
|
||||
form.phone = item.phone
|
||||
form.avatar = item.avatar || ''
|
||||
form.status = item.status
|
||||
form.online_status = item.online_status || 'resting'
|
||||
form.certificate_status = item.certificate_status || 'pending'
|
||||
form.certificate_expire_at = item.certificate_expire_at || ''
|
||||
form.service_area = item.service_area || ''
|
||||
form.skillsText = item.skills && item.skills.length > 0 ? item.skills.join(',') : ''
|
||||
showModal.value = true
|
||||
}
|
||||
|
||||
@@ -155,6 +215,14 @@ async function handleSave() {
|
||||
uni.showToast({ title: '请填写姓名和手机号', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (form.online_status != 'online' && form.online_status != 'resting' && form.online_status != 'busy') {
|
||||
uni.showToast({ title: '在线状态不合法', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (form.certificate_status != 'valid' && form.certificate_status != 'expired' && form.certificate_status != 'pending') {
|
||||
uni.showToast({ title: '资质状态不合法', icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
loading.value = true
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user