update(master): 优化师傅认证页面UI与接口提示逻辑

- 修改请求响应判断逻辑,避免非登录失效场景重复提示
- 重构已认证师傅页面布局,优化信息展示结构
- 新增实名认证状态徽章和统计信息展示区域
- 调整样式细节,提升页面视觉效果和用户体验
这个提交包含在:
2026-11-24 16:42:12 +08:00
父节点 191b90d90d
当前提交 55a8d6e921
共有 2 个文件被更改,包括 108 次插入 和 60 次删除

查看文件

@@ -158,59 +158,93 @@
<!-- 已认证师傅:可编辑资料与实名档案分别展示 -->
<template v-else-if="info && info.master && info.master.verify_status === 'pass'">
<view class="card profile-card">
<view class="profile-heading">
<text class="profile-title">基本资料</text>
<text class="profile-subtitle">设置头像与接单联系电话</text>
</view>
<view class="profile-avatar-row clickable-hover" @tap="chooseProfileAvatar" role="button" aria-label="更换师傅头像">
<text class="profile-label">头像</text>
<view class="profile-avatar-action">
<image class="profile-avatar-image" :src="info.master.avatar || '/static/icons/avatar-master.svg'" mode="aspectFill" />
<text class="profile-action-text">{{ profileUploading ? '上传中...' : '更换' }}</text>
<image class="profile-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
<view class="profile-wrap">
<view class="card profile-card">
<view class="profile-heading">
<text class="profile-title">基本资料</text>
<text class="profile-subtitle">设置头像与接单电话</text>
</view>
<view class="profile-avatar-row clickable-hover" @tap="chooseProfileAvatar" role="button" aria-label="更换师傅头像">
<text class="profile-label">头像</text>
<view class="profile-avatar-action">
<image class="profile-avatar-image" :src="info.master.avatar || '/static/icons/avatar-master.svg'" mode="aspectFill" />
<text class="profile-action-text">{{ profileUploading ? '上传中...' : '更换' }}</text>
<image class="profile-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
</view>
<view class="profile-phone-row">
<text class="profile-label">接单电话</text>
<input class="profile-input" v-model="profileMobile" type="number" maxlength="11" placeholder="请输入接单手机号" />
</view>
</view>
<view class="profile-phone-row">
<text class="profile-label">接单电话</text>
<input class="profile-input" v-model="profileMobile" type="number" maxlength="11" placeholder="请输入接单手机号" />
</view>
</view>
<view class="card profile-card identity-card">
<view class="profile-heading">
<text class="profile-title">实名档案</text>
<text class="identity-status">已认证</text>
</view>
<view class="identity-row"><text class="identity-label">真实姓名</text><text class="identity-value">{{ info.master.realname }}</text></view>
<view class="identity-row"><text class="identity-label">身份证号</text><text class="identity-value">{{ info.master.idcard_no }}</text></view>
<view class="identity-row"><text class="identity-label">服务城市</text><text class="identity-value">{{ info.master.city || '-' }}</text></view>
<view class="identity-row"><text class="identity-label">综合评分</text><text class="identity-value">{{ info.master.score }} 分</text></view>
<view class="identity-row identity-row-last"><text class="identity-label">累计完单</text><text class="identity-value">{{ info.master.order_count }} 单</text></view>
<view class="identity-cert-section" v-if="info.master.idcard_front || info.master.idcard_back">
<text class="identity-label">身份证件</text>
<view class="identity-cert-grid">
<view
v-if="info.master.idcard_front"
class="identity-cert-item clickable-hover"
@tap="previewIdCard(info.master.idcard_front)"
>
<image class="identity-cert-img" :src="info.master.idcard_front" mode="aspectFit" />
<text class="identity-cert-caption">人像面</text>
<view class="card profile-card identity-card">
<view class="profile-heading">
<text class="profile-title">实名档案</text>
<view class="identity-badge">
<image class="identity-badge-ico" src="/static/icons/shield-green.svg" mode="aspectFit" />
<text class="identity-status">已认证</text>
</view>
<view
v-if="info.master.idcard_back"
class="identity-cert-item clickable-hover"
@tap="previewIdCard(info.master.idcard_back)"
>
<image class="identity-cert-img" :src="info.master.idcard_back" mode="aspectFit" />
<text class="identity-cert-caption">国徽面</text>
</view>
<view class="identity-stats">
<view class="identity-stat-item">
<text class="identity-stat-val">{{ info.master.score }}<text class="identity-stat-unit"> 分</text></text>
<text class="identity-stat-label">综合评分</text>
</view>
<view class="identity-stat-divider"></view>
<view class="identity-stat-item">
<text class="identity-stat-val">{{ info.master.order_count }}<text class="identity-stat-unit"> 单</text></text>
<text class="identity-stat-label">累计完单</text>
</view>
</view>
<view class="identity-row identity-row-first">
<text class="identity-label">真实姓名</text>
<text class="identity-value">{{ info.master.realname }}</text>
</view>
<view class="identity-row">
<text class="identity-label">身份证号</text>
<text class="identity-value identity-mono">{{ info.master.idcard_no }}</text>
</view>
<view class="identity-row" :class="{ 'identity-row-last': !info.master.idcard_front && !info.master.idcard_back }">
<text class="identity-label">服务城市</text>
<text class="identity-value">{{ info.master.city || '-' }}</text>
</view>
<view class="identity-cert-section" v-if="info.master.idcard_front || info.master.idcard_back">
<view class="identity-cert-head">
<text class="identity-label">身份证件</text>
<text class="identity-cert-tip">点击查看大图</text>
</view>
<view class="identity-cert-grid">
<view
v-if="info.master.idcard_front"
class="identity-cert-card clickable-hover"
@tap="previewIdCard(info.master.idcard_front)"
>
<image class="identity-cert-img" :src="info.master.idcard_front" mode="aspectFill" />
<view class="identity-cert-mask">
<text class="identity-cert-caption">人像面</text>
</view>
</view>
<view
v-if="info.master.idcard_back"
class="identity-cert-card clickable-hover"
@tap="previewIdCard(info.master.idcard_back)"
>
<image class="identity-cert-img" :src="info.master.idcard_back" mode="aspectFill" />
<view class="identity-cert-mask">
<text class="identity-cert-caption">国徽面</text>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="profile-save clickable-hover" :class="{ disabled: profileSaving || profileUploading }" @tap="saveProfile">
<text>{{ profileSaving ? '保存中...' : '保存资料' }}</text>
<view class="profile-save clickable-hover" :class="{ disabled: profileSaving || profileUploading }" @tap="saveProfile">
<text>{{ profileSaving ? '保存中...' : '保存资料' }}</text>
</view>
</view>
</template>
@@ -654,28 +688,42 @@
<style lang="scss" scoped>
@import '@/uni.scss';
.profile-wrap { padding-top: 4rpx; }
.profile-card { padding: 0 32rpx; }
.profile-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16rpx; padding: 30rpx 0 20rpx; }
.profile-heading { display: flex; align-items: center; justify-content: space-between; gap: 16rpx; padding: 28rpx 0 20rpx; }
.profile-title { font-size: $yjyf-font-title; color: $yjyf-text-main; font-weight: 700; flex-shrink: 0; }
.profile-subtitle { font-size: $yjyf-font-sub; color: $yjyf-text-secondary; text-align: right; }
.profile-avatar-row, .profile-phone-row { min-height: 108rpx; display: flex; align-items: center; justify-content: space-between; border-top: 1rpx solid $yjyf-border-color; }
.profile-avatar-row { min-height: 136rpx; }
.profile-avatar-row { min-height: 132rpx; }
.profile-label { font-size: $yjyf-font-body; color: $yjyf-text-regular; flex-shrink: 0; }
.profile-avatar-action { display: flex; align-items: center; gap: 16rpx; }
.profile-avatar-image { width: 88rpx; height: 88rpx; border-radius: 50%; background: $yjyf-primary-bg; }
.profile-action-text { font-size: $yjyf-font-body; color: $yjyf-text-secondary; }
.profile-avatar-action { display: flex; align-items: center; gap: 14rpx; }
.profile-avatar-image { width: 88rpx; height: 88rpx; border-radius: 50%; background: $yjyf-primary-bg; border: 2rpx solid $yjyf-primary-border; }
.profile-action-text { font-size: $yjyf-font-sub; color: $yjyf-text-secondary; }
.profile-arrow { width: 24rpx; height: 24rpx; }
.profile-input { text-align: right; flex: 1; min-width: 0; height: 100rpx; font-size: $yjyf-font-body; color: $yjyf-text-main; }
.identity-status { font-size: $yjyf-font-sub; color: $yjyf-success; }
.identity-row { display: flex; justify-content: space-between; align-items: center; gap: 20rpx; min-height: 84rpx; border-top: 1rpx solid $yjyf-border-color; }
.profile-input { text-align: right; flex: 1; min-width: 0; height: 100rpx; font-size: $yjyf-font-body; color: $yjyf-text-main; font-weight: 500; }
.identity-badge { display: inline-flex; align-items: center; gap: 6rpx; padding: 6rpx 16rpx; border-radius: $yjyf-radius-pill; background: rgba(47, 168, 79, 0.1); }
.identity-badge-ico { width: 24rpx; height: 24rpx; flex-shrink: 0; }
.identity-status { font-size: $yjyf-font-micro; color: $yjyf-success; font-weight: 600; line-height: 1; }
.identity-stats { display: flex; align-items: center; padding: 22rpx 0; margin-bottom: 8rpx; background: $yjyf-bg-page; border-radius: $yjyf-radius-sm; }
.identity-stat-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6rpx; }
.identity-stat-val { font-size: $yjyf-font-lg; color: $yjyf-primary; font-weight: 700; line-height: 1.2; }
.identity-stat-unit { font-size: $yjyf-font-micro; color: $yjyf-text-secondary; font-weight: 500; }
.identity-stat-label { font-size: $yjyf-font-micro; color: $yjyf-text-secondary; }
.identity-stat-divider { width: 1rpx; height: 52rpx; background: $yjyf-border-color; }
.identity-row { display: flex; justify-content: space-between; align-items: center; gap: 20rpx; min-height: 86rpx; border-top: 1rpx solid $yjyf-border-color; }
.identity-row-first { border-top: none; }
.identity-label { font-size: $yjyf-font-body; color: $yjyf-text-secondary; flex-shrink: 0; }
.identity-value { font-size: $yjyf-font-body; color: $yjyf-text-main; text-align: right; word-break: break-all; }
.identity-value { font-size: $yjyf-font-body; color: $yjyf-text-main; font-weight: 500; text-align: right; word-break: break-all; }
.identity-mono { font-variant-numeric: tabular-nums; }
.identity-cert-section { padding: 24rpx 0 28rpx; border-top: 1rpx solid $yjyf-border-color; }
.identity-cert-head { display: flex; align-items: center; justify-content: space-between; }
.identity-cert-tip { font-size: $yjyf-font-micro; color: $yjyf-text-muted; }
.identity-cert-grid { display: flex; gap: 20rpx; margin-top: 18rpx; }
.identity-cert-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10rpx; }
.identity-cert-img { width: 100%; height: 188rpx; border-radius: $yjyf-radius-sm; background: $yjyf-bg-page; border: 1rpx solid $yjyf-border-color; }
.identity-cert-caption { font-size: $yjyf-font-micro; color: $yjyf-text-secondary; }
.profile-save { height: 88rpx; margin: 40rpx $yjyf-space-md 0; border-radius: $yjyf-radius-pill; background: $yjyf-gradient-primary; color: $yjyf-text-inverse; display: flex; align-items: center; justify-content: center; font-size: $yjyf-font-body; font-weight: 700; }
.identity-cert-card { position: relative; flex: 1; height: 200rpx; border-radius: $yjyf-radius-sm; overflow: hidden; background: $yjyf-bg-page; border: 1rpx solid $yjyf-border-color; }
.identity-cert-img { width: 100%; height: 100%; display: block; }
.identity-cert-mask { position: absolute; left: 0; right: 0; bottom: 0; padding: 20rpx 16rpx 10rpx; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.56) 100%); display: flex; align-items: center; justify-content: center; }
.identity-cert-caption { font-size: $yjyf-font-micro; color: $yjyf-text-inverse; font-weight: 500; }
.profile-save { height: 88rpx; margin: 36rpx $yjyf-space-md 0; border-radius: $yjyf-radius-pill; background: $yjyf-gradient-primary; box-shadow: $yjyf-shadow-button; color: $yjyf-text-inverse; display: flex; align-items: center; justify-content: center; font-size: $yjyf-font-body; font-weight: 700; }
.profile-save.disabled { opacity: 0.6; }
.page {
min-height: 100vh;

查看文件

@@ -143,7 +143,7 @@ export function request(path, options) {
uni.showToast({ title: '登录已失效,请重新登录', icon: 'none' });
setTimeout(() => toLogin(), 800);
}
} else if (!silent) {
} else if (!silent && body.code !== 2001) {
uni.showToast({ title: msg, icon: 'none' });
}
reject(Object.assign(new Error(msg), { code: body.code, data: body.data }));