feat(master): 完善师傅档案证件展示与导航地址解析

- 后端 Master::info 接口补充完整身份证原图与水印图 URL 转换(支持 cdnurl 处理)
- 师傅端小程序入驻档案页增加身份证人像面/国徽面缩略图展示及点击大图预览功能
- 师傅端订单详情页优化地图导航地址名称解析,自动截取详细短地址提升导航体验
这个提交包含在:
2026-11-24 16:06:15 +08:00
父节点 62150d261a
当前提交 191b90d90d
共有 3 个文件被更改,包括 64 次插入 和 8 次删除

查看文件

@@ -265,6 +265,11 @@ class Master extends MasterBase
? (substr($rawIdcard, 0, 6) . str_repeat('*', max(4, strlen($rawIdcard) - 10)) . substr($rawIdcard, -4))
: $rawIdcard;
$rawIdcardFront = trim((string)($master['idcard_front'] ?? ''));
$rawIdcardBack = trim((string)($master['idcard_back'] ?? ''));
$fullIdcardFront = $rawIdcardFront !== '' ? (strpos($rawIdcardFront, 'http') === 0 ? $rawIdcardFront : cdnurl($rawIdcardFront, true)) : '';
$fullIdcardBack = $rawIdcardBack !== '' ? (strpos($rawIdcardBack, 'http') === 0 ? $rawIdcardBack : cdnurl($rawIdcardBack, true)) : '';
$this->success('', [
'applied' => true,
'master' => [
@@ -273,10 +278,10 @@ class Master extends MasterBase
'mobile' => $master['mobile'],
'idcard_no' => $maskedIdcard,
'idcard' => $maskedIdcard,
'idcard_front' => TencentVerifyService::getWatermarkUrl((string)($master['idcard_front'] ?? '')),
'idcard_back' => TencentVerifyService::getWatermarkUrl((string)($master['idcard_back'] ?? '')),
'idcard_front_raw' => (string)($master['idcard_front'] ?? ''),
'idcard_back_raw' => (string)($master['idcard_back'] ?? ''),
'idcard_front' => TencentVerifyService::getWatermarkUrl($fullIdcardFront),
'idcard_back' => TencentVerifyService::getWatermarkUrl($fullIdcardBack),
'idcard_front_raw' => $fullIdcardFront,
'idcard_back_raw' => $fullIdcardBack,
'cert_images' => (string)($master['cert_images'] ?? ''),
'avatar' => \app\common\library\MasterAvatar::url($master['avatar']),
'city' => $master['city'],

查看文件

@@ -187,6 +187,27 @@
<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>
<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>
</view>
</view>
<view class="profile-save clickable-hover" :class="{ disabled: profileSaving || profileUploading }" @tap="saveProfile">
<text>{{ profileSaving ? '保存中...' : '保存资料' }}</text>
@@ -359,6 +380,17 @@
} catch (e) {} finally { profileSaving.value = false; }
}
function previewIdCard(current) {
const m = info.value && info.value.master;
if (!m) return;
const urls = [m.idcard_front, m.idcard_back].filter(Boolean);
if (!urls.length) return;
uni.previewImage({
current: current || urls[0],
urls
});
}
function goWorkbench() {
uni.reLaunch({ url: '/pages/master/hall?tab=3' });
}
@@ -638,6 +670,11 @@
.identity-row { display: flex; justify-content: space-between; align-items: center; gap: 20rpx; min-height: 84rpx; border-top: 1rpx solid $yjyf-border-color; }
.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-cert-section { padding: 24rpx 0 28rpx; border-top: 1rpx solid $yjyf-border-color; }
.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; }
.profile-save.disabled { opacity: 0.6; }
.page {

查看文件

@@ -893,23 +893,37 @@
}
}
function getNavLocationName(o) {
const full = String(o.full_address || '').trim();
if (!full) return '客户服务地址';
let shortAddr = full;
[o.province, o.city, o.district].forEach((part) => {
const p = String(part || '').trim();
if (p && shortAddr.startsWith(p)) {
shortAddr = shortAddr.slice(p.length).trim();
}
});
return shortAddr || full;
}
function openMapNav() {
if (!order.value) return;
const lat = Number(order.value.lat);
const lng = Number(order.value.lng);
const fullAddress = String(order.value.full_address || '').trim();
if (lat && lng) {
uni.openLocation({
latitude: lat,
longitude: lng,
name: order.value.service_name || '客户服务地址',
address: order.value.full_address || '',
name: getNavLocationName(order.value),
address: fullAddress,
fail: () => {
uni.setClipboardData({ data: order.value.full_address || '' });
uni.setClipboardData({ data: fullAddress });
}
});
} else {
uni.setClipboardData({
data: order.value.full_address || '',
data: fullAddress,
success: () => {
uni.showToast({ title: '已复制详细地址,可粘贴至导航软件', icon: 'none' });
}