From 191b90d90d9aeee6ca76e0686786677bfc804982 Mon Sep 17 00:00:00 2001 From: MiAn Date: Tue, 24 Nov 2026 16:06:15 +0800 Subject: [PATCH] =?UTF-8?q?feat(master):=20=E5=AE=8C=E5=96=84=E5=B8=88?= =?UTF-8?q?=E5=82=85=E6=A1=A3=E6=A1=88=E8=AF=81=E4=BB=B6=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E4=B8=8E=E5=AF=BC=E8=88=AA=E5=9C=B0=E5=9D=80=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 后端 Master::info 接口补充完整身份证原图与水印图 URL 转换(支持 cdnurl 处理) - 师傅端小程序入驻档案页增加身份证人像面/国徽面缩略图展示及点击大图预览功能 - 师傅端订单详情页优化地图导航地址名称解析,自动截取详细短地址提升导航体验 --- server/application/api/controller/Master.php | 13 ++++--- yjyf-master-app/pages/master/apply.vue | 37 ++++++++++++++++++++ yjyf-master-app/pages/master/detail.vue | 22 +++++++++--- 3 files changed, 64 insertions(+), 8 deletions(-) diff --git a/server/application/api/controller/Master.php b/server/application/api/controller/Master.php index bc789c1..614990f 100644 --- a/server/application/api/controller/Master.php +++ b/server/application/api/controller/Master.php @@ -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'], diff --git a/yjyf-master-app/pages/master/apply.vue b/yjyf-master-app/pages/master/apply.vue index ae03fce..3352cf2 100644 --- a/yjyf-master-app/pages/master/apply.vue +++ b/yjyf-master-app/pages/master/apply.vue @@ -187,6 +187,27 @@ 服务城市{{ info.master.city || '-' }} 综合评分{{ info.master.score }} 分 累计完单{{ info.master.order_count }} 单 + + 身份证件 + + + + 人像面 + + + + 国徽面 + + + {{ profileSaving ? '保存中...' : '保存资料' }} @@ -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 { diff --git a/yjyf-master-app/pages/master/detail.vue b/yjyf-master-app/pages/master/detail.vue index faae3fa..c3e2278 100644 --- a/yjyf-master-app/pages/master/detail.vue +++ b/yjyf-master-app/pages/master/detail.vue @@ -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' }); }