feat: 新增平台客服配置及弹窗组件

- 新增客服电话、服务时间、企业微信客服配置项
- 新增客服弹窗组件支持微信在线客服和电话拨打
- 调整核销码为6位数字,修复相关提示文本
- 优化订单服务项目展示逻辑
- 完善抢单大厅加载动画和列表样式
这个提交包含在:
2026-11-18 18:08:22 +08:00
父节点 45a16c8bef
当前提交 31addddd5f
共有 35 个文件被更改,包括 1975 次插入 和 794 次删除

文件差异因一行或多行过长而隐藏

查看文件

@@ -0,0 +1,16 @@
-- ============================================================================
-- Phase 32: 平台客服配置项(后台系统配置 -> 基础配置)
-- ============================================================================
SET NAMES utf8mb4;
INSERT INTO `fa_config` (`name`, `group`, `title`, `tip`, `type`, `visible`, `value`, `content`, `rule`, `extend`, `setting`)
VALUES
('service_phone', 'basic', '平台客服电话', '用户在小程序客服弹窗点击拨打的客服电话(如 400-xxx-xxxx 或手机号)', 'string', '', '', '', '', '', NULL),
('service_work_time', 'basic', '客服服务时间', '可选,展示在客服弹窗中的服务时间说明(如:每天 09:00 - 21:00)', 'string', '', '', '', '', '', NULL),
('service_corp_id', 'basic', '企业微信客服CorpID', '可选,接入企业微信“微信客服”时填写企业ID;留空则默认使用微信小程序原生客服会话', 'string', '', '', '', '', '', NULL),
('service_kf_url', 'basic', '微信客服链接', '可选,企业微信后台获取的客服链接(https://work.weixin.qq.com/kfid/...),须与CorpID配套使用', 'string', '', '', '', '', '', NULL)
ON DUPLICATE KEY UPDATE
`group` = VALUES(`group`),
`title` = VALUES(`title`),
`tip` = VALUES(`tip`),
`type` = VALUES(`type`);

查看文件

@@ -0,0 +1,8 @@
import pymysql
conn = pymysql.connect(host='127.0.0.1', user='yjyf', password='4bRz2NYz6pDhsCk4', database='yjyf', port=3306, charset='utf8mb4')
with conn.cursor() as cur:
cur.execute("SELECT name, value FROM fa_config WHERE name IN ('service_phone', 'service_work_time', 'service_corp_id', 'service_kf_url')")
rows = cur.fetchall()
print('Local fa_config rows:', rows)
conn.close()

查看文件

@@ -15,7 +15,7 @@ LOCAL_SQL_PATH = r'd:\Projects\phpstudy_pro\WWW\yjyf\db\local_yjyf_deploy.sql'
LOCAL_TAR_PATH = r'd:\Projects\phpstudy_pro\WWW\yjyf\server_deploy.tar.gz'
print("==================================================")
print("=== 开始自动化重新部署到测试服务器 ===")
print("=== 开始自动化重新部署最新代码与数据库到测试服务器 ===")
print("==================================================")
# 1. 本地数据库导出
@@ -174,6 +174,7 @@ run_ssh(f"chmod -R 755 {REMOTE_SITE_DIR}")
print(" 重载 PHP-FPM 服务...")
out_fpm, _, _ = run_ssh("/etc/init.d/php-fpm-85 reload")
print(f" PHP-FPM 重载状态: {out_fpm.strip()}")
time.sleep(1)
# 7. 部署后验证与质检
print("\n[步骤 7/7] 执行部署后全链路验证...")
@@ -183,6 +184,10 @@ out_tb, _, _ = run_ssh("mysql -uyjyf -pyjyf yjyf -e 'SHOW TABLES;'")
remote_tables = [l.strip() for l in out_tb.strip().splitlines() if l.strip() and l.strip() != 'Tables_in_yjyf']
print(f" 远程 yjyf 数据库表数量: {len(remote_tables)}")
# 验证 pricing_config 字段是否存在
out_col, _, _ = run_ssh("mysql -uyjyf -pyjyf yjyf -e \"SHOW COLUMNS FROM fa_service LIKE 'pricing_config';\"")
print(f" fa_service.pricing_config 字段验证:\n{out_col.strip()}")
check_sql = (
"SELECT 'fa_user' AS tb, COUNT(*) AS cnt FROM fa_user UNION ALL "
"SELECT 'fa_master', COUNT(*) FROM fa_master UNION ALL "
@@ -200,18 +205,21 @@ print("\n 测试 HTTP 访问响应:")
out_http1, _, _ = run_ssh("curl -k -s -o /dev/null -w '%{http_code}' https://yjyf.gzyakj.com.cn/")
print(f" - 首页 (https://yjyf.gzyakj.com.cn/): HTTP {out_http1.strip()}")
out_http2, _, _ = run_ssh("curl -k -s -o /dev/null -w '%{http_code}' https://yjyf.gzyakj.com.cn/s.php")
print(f" - 后台管理入口 (https://yjyf.gzyakj.com.cn/s.php): HTTP {out_http2.strip()}")
out_http2, _, _ = run_ssh("curl -k -s -o /dev/null -w '%{http_code}' https://yjyf.gzyakj.com.cn/s.php/index/login")
print(f" - 后台登录页面 (https://yjyf.gzyakj.com.cn/s.php/index/login): HTTP {out_http2.strip()}")
out_api, _, _ = run_ssh("curl -k -s https://yjyf.gzyakj.com.cn/api/common/init")
print(f" - 公共初始化接口 (/api/common/init): {out_api[:120]}...")
out_cats, _, _ = run_ssh("curl -k -s https://yjyf.gzyakj.com.cn/api/home/cats")
print(f" - 分类接口 (/api/home/cats): {out_cats[:120]}...")
out_config, _, _ = run_ssh("curl -k -s https://yjyf.gzyakj.com.cn/api/index/index")
print(f" - 首页数据接口 (/api/index/index): {out_config[:120]}...")
out_home, _, _ = run_ssh("curl -k -s https://yjyf.gzyakj.com.cn/api/home/index")
print(f" - 首页接口 (/api/home/index): {out_home[:120]}...")
out_dicts, _, _ = run_ssh("curl -k -s https://yjyf.gzyakj.com.cn/api/common/dicts")
print(f" - 字典接口 (/api/common/dicts): {out_dicts[:120]}...")
# 7.3 验证其他站点未受影响
print("\n 验证其他站点未受影响:")
other_sites = ['fenleixinxi.gzyakj.com.cn', 'huaqiapp.gzyakj.com.cn']
other_sites = ['fenleixinxi.gzyakj.com.cn', 'huaqiapp.gzyakj.com.cn', 'renqing', 'rqzb.gyscwl.com']
for s in other_sites:
out_s, _, _ = run_ssh(f"test -d /www/wwwroot/{s} && echo 'EXISTS' || echo 'NOT_FOUND'")
print(f" - 目录 /www/wwwroot/{s}: {out_s.strip()}")

查看文件

@@ -673,7 +673,7 @@ foreach ($orderBlueprints as $idx => $bp) {
Db::name('order_log')->insert([
'order_id' => $orderId,
'status' => 5,
'remark' => '师傅施工完毕,请业主核验现场并提供4位服务完工核销码',
'remark' => '师傅施工完毕,请业主核验现场并提供6位服务完工核销码',
'operator_type' => 'master',
'operator_id' => 40,
'createtime' => $finishTime

查看文件

@@ -302,7 +302,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">完工验收核验码:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-verify_code" class="form-control" name="row[verify_code]" type="text" value="" placeholder="4位或6位核销码">
<input id="c-verify_code" class="form-control" name="row[verify_code]" type="text" maxlength="6" value="" placeholder="请输入6位数字核销码">
</div>
</div>
</div>

查看文件

@@ -1,4 +1,13 @@
<div class="panel panel-default panel-intro">
<style>
.order-list .fixed-table-body { overflow-x: auto; }
.order-list #table { width: 100%; }
.order-list #table > thead > tr > th { background: #f7f8fa; color: #536176; font-weight: 600; border-bottom: 1px solid #e5eaf0; }
.order-list #table > tbody > tr > td { padding: 12px 8px; vertical-align: middle; color: #344256; }
.order-list #table .order-number { font-family: monospace; font-weight: 600; color: #26364b; }
.order-list #table .order-amount { color: #d65a12; font-weight: 600; font-variant-numeric: tabular-nums; }
</style>
<script>require.config.site.version += "-order-list-20261118c";</script>
<div class="panel panel-default panel-intro order-list">
<div class="panel-heading">
{:build_heading(null,FALSE)}
<ul class="nav nav-tabs" data-field="status">

查看文件

@@ -10,7 +10,7 @@ use app\common\library\ProductPricing;
*/
class Home extends Base
{
protected $noNeedLogin = ['index', 'feed', 'cats', 'services', 'detail', 'calc', 'specs', 'masterCount', 'orderCase', 'agreement', 'agreementRead', 'systemGallery'];
protected $noNeedLogin = ['index', 'feed', 'cats', 'services', 'detail', 'calc', 'specs', 'masterCount', 'orderCase', 'agreement', 'agreementRead', 'systemGallery', 'serviceConfig'];
/**
* 首页聚合:类目 + 热门服务 + 我的角标
@@ -217,6 +217,9 @@ class Home extends Base
'assures' => $this->configList('home_assure'),
'tutorial' => $this->tutorial(),
'service_phone' => (string)(\think\Config::get('site.service_phone') ?: ''),
'service_work_time' => (string)(\think\Config::get('site.service_work_time') ?: ''),
'service_corp_id' => (string)(\think\Config::get('site.service_corp_id') ?: ''),
'service_kf_url' => (string)(\think\Config::get('site.service_kf_url') ?: ''),
'badge' => ['coupon' => 0, 'unread' => 0],
];
@@ -1826,4 +1829,17 @@ class Home extends Base
'services' => $services,
]);
}
/**
* 获取平台客服配置(客服电话、服务时间、企业微信客服参数)
*/
public function serviceConfig()
{
$this->success('', [
'service_phone' => trim((string)(\think\Config::get('site.service_phone') ?: '')),
'service_work_time' => trim((string)(\think\Config::get('site.service_work_time') ?: '')),
'service_corp_id' => trim((string)(\think\Config::get('site.service_corp_id') ?: '')),
'service_kf_url' => trim((string)(\think\Config::get('site.service_kf_url') ?: '')),
]);
}
}

查看文件

@@ -997,7 +997,7 @@ class Master extends Base
* 我的订单(师傅视角)
*/
/**
* 师傅端:输入客户 4 位验收核销码完成工单验收结算
* 师傅端:输入客户 6 位验收核销码完成工单验收结算
* @ApiMethod (POST)
*/
public function verifyCode()
@@ -1006,7 +1006,7 @@ class Master extends Base
$code = trim((string)$this->request->post('verify_code', ''));
if ($orderId <= 0 || $code === '') {
$this->error('请输入 4 位核销验证码');
$this->error('请输入 6 位核销验证码');
}
$master = $this->requireMaster();
@@ -1045,7 +1045,7 @@ class Master extends Base
$commission = $settleCalc['commission'];
$settleAmount = $settleCalc['settle_amount'];
$this->transit($lockedOrder, OrderStatus::COMPLETED, '师傅已录入客户 4 位验收核销码,核销完工', [
$this->transit($lockedOrder, OrderStatus::COMPLETED, '师傅已录入客户 6 位验收核销码,核销完工', [
'verify_time' => time(),
'settle_status' => 1,
'settle_amount' => $settleAmount,

查看文件

@@ -2,14 +2,12 @@
namespace app\api\controller;
use app\common\library\CommissionService;
use app\common\library\FinanceConfigService;
use app\common\library\InvoiceService;
use app\common\library\OrderStatus;
use think\Db;
/**
* 商家端(企业账号):入驻 / 资料 / 账单 / 开票 / 批量下单归属
* 商家端(企业账号):入驻 / 资料 / 账单 / 开票 / 团队成员 / 订单归属
*/
class Merchant extends Base
{
@@ -554,323 +552,6 @@ class Merchant extends Base
/**
* 当前用户商家档案:主账号直接匹配,关联账号通过绑定关系匹配
*/
/**
* 商户端:Excel 或结构化数据一键批量解析下单
* @ApiMethod (POST)
*/
public function importBatch()
{
$merchant = $this->requireMerchant();
$rawOrders = $this->request->post('orders', null, null);
if ($rawOrders === null || $rawOrders === '' || $rawOrders === []) {
$rawOrders = $this->request->post('items', [], null);
}
$items = [];
if (is_string($rawOrders)) {
$decoded = json_decode(htmlspecialchars_decode(trim($rawOrders)), true);
if (is_array($decoded)) {
$items = $decoded;
}
} elseif (is_array($rawOrders)) {
if (count($rawOrders) === 1 && isset($rawOrders[0]) && is_string($rawOrders[0])) {
$decoded = json_decode(htmlspecialchars_decode(trim($rawOrders[0])), true);
$items = is_array($decoded) ? $decoded : $rawOrders;
} else {
$items = $rawOrders;
}
}
if (empty($items) || !is_array($items)) {
$this->error('导入数据不能为空');
}
if (count($items) > 100) {
$this->error('单次批量导入最多支持 100 条订单');
}
$globalServiceId = (int)$this->request->post('service_id', 0);
$serviceCache = [];
$preparedRows = [];
foreach ($items as $idx => $item) {
if (is_string($item)) {
$decItem = json_decode(htmlspecialchars_decode(trim($item)), true);
if (is_array($decItem)) {
$item = $decItem;
}
}
if (!is_array($item)) {
continue;
}
$contact = trim((string)(isset($item['contact']) ? $item['contact'] : '买家'));
$mobile = preg_replace('/[^\d]/', '', trim((string)(isset($item['mobile']) ? $item['mobile'] : '')));
$address = trim((string)(isset($item['address']) ? $item['address'] : ''));
if ($mobile === '' && $address === '') {
continue;
}
$rowNo = $idx + 1;
if (!preg_match('/^1\d{10}$/', $mobile)) {
$this->error("第 {$rowNo} 条订单联系电话格式不正确");
}
if ($address === '') {
$this->error("第 {$rowNo} 条订单缺少详细服务地址");
}
$itemServiceId = !empty($item['service_id']) ? (int)$item['service_id'] : $globalServiceId;
if ($itemServiceId <= 0) {
$this->error("第 {$rowNo} 条订单未指定有效的服务项目");
}
if (!array_key_exists($itemServiceId, $serviceCache)) {
$serviceCache[$itemServiceId] = Db::name('service')
->where('id', $itemServiceId)
->where('status', 'normal')
->find() ?: null;
}
$svc = $serviceCache[$itemServiceId];
if (!$svc) {
$this->error("第 {$rowNo} 条订单关联的服务项目不存在或已下架");
}
if ($svc['price_type'] === 'quote') {
$this->error("第 {$rowNo} 条订单所选服务「{$svc['name']}」为师傅报价项目,不支持批量一口价导入");
}
$goodsNum = max(1, (int)(isset($item['goods_num']) ? $item['goods_num'] : (isset($item['num']) ? $item['num'] : 1)));
$floor = isset($item['floor']) ? max(1, (int)$item['floor']) : 1;
$hasElevator = isset($item['has_elevator'])
? (int)$item['has_elevator']
: (isset($item['elevator']) ? (int)$item['elevator'] : 1);
$urgent = !empty($item['urgent']) ? 1 : 0;
$specId = isset($item['spec_id']) ? (int)$item['spec_id'] : 0;
$reqServiceType = isset($item['service_type']) ? trim((string)$item['service_type']) : '';
// 严禁采信前端传入的 price,强制根据数据库 fa_service / fa_service_spec 与楼层规则计算真实金额
try {
$calc = Home::calcAmount($svc, [
'floor' => $floor,
'has_elevator' => $hasElevator ? 1 : 0,
'urgent' => $urgent,
'goods_num' => $goodsNum,
'spec_id' => $specId,
'service_type' => $reqServiceType,
'strict' => true,
], 0, $this->uid(), 'fixed', 0, []);
} catch (\InvalidArgumentException $e) {
$this->error("第 {$rowNo} 条订单计价校验失败:" . $e->getMessage());
return;
}
if ((float)$calc['pay_amount'] <= 0) {
$this->error("第 {$rowNo} 条订单计算金额异常");
}
$resolvedProvince = mb_substr(trim((string)(isset($item['province']) && $item['province'] !== '' ? $item['province'] : ($merchant['province'] ?: ''))), 0, 50);
$resolvedCity = mb_substr(trim((string)(isset($item['city']) && $item['city'] !== '' ? $item['city'] : ($merchant['city'] ?: ''))), 0, 50);
if ($resolvedProvince === '' || $resolvedCity === '') {
$this->error("第 {$rowNo} 条订单缺少服务省份或城市信息,请在Excel或表格中填写后再提交");
}
$preparedRows[] = [
'svc' => $svc,
'service_id' => (int)$svc['id'],
'cat_id' => (int)$svc['cat_id'],
'service_name' => (string)$svc['name'],
'service_img' => (string)$svc['image'],
'goods_model' => mb_substr(trim((string)(isset($item['goods_model']) ? $item['goods_model'] : '')), 0, 100),
'goods_num' => $goodsNum,
'contact' => mb_substr($contact ?: '买家', 0, 50),
'mobile' => $mobile,
'province' => $resolvedProvince,
'city' => $resolvedCity,
'district' => mb_substr(trim((string)(isset($item['district']) ? $item['district'] : ($merchant['district'] ?: ''))), 0, 50),
'address' => mb_substr($address, 0, 255),
'floor' => $floor,
'has_elevator' => $hasElevator ? 1 : 0,
'urgent' => $urgent,
'remark' => mb_substr(trim((string)(isset($item['remark']) ? $item['remark'] : '')), 0, 500),
'appoint_time' => !empty($item['appoint_time']) ? (int)$item['appoint_time'] : null,
'calc' => $calc,
];
}
if (empty($preparedRows)) {
$this->error('未解析到有效的导入订单数据');
}
$ordersCreated = [];
$orderIds = [];
$totalAmount = 0.00;
$isMonthly = false;
$batchNo = 'MB' . date('YmdHis') . mt_rand(1000, 9999);
$now = time();
// 事务外一次性预加载生效抽佣规则与默认兜底配置,循环内纯内存匹配快照(零额外 SQL)
$activeCommRules = CommissionService::getActiveRules();
$commDefaults = FinanceConfigService::getCommissionDefaults();
Db::startTrans();
try {
$lockedMerchant = Db::name('merchant')->where('id', (int)$merchant['id'])->lock(true)->find();
if (!$lockedMerchant || $lockedMerchant['verify_status'] !== 'pass') {
throw new \InvalidArgumentException('商家资质状态异常,无法批量发单');
}
$isMonthly = ($lockedMerchant['settle_type'] === 'monthly');
$initStatus = $isMonthly ? OrderStatus::PENDING_ACCEPT : OrderStatus::PENDING_PAY;
$initPayStatus = $isMonthly ? 1 : 0;
$initPayType = $isMonthly ? 'monthly' : '';
$initPayTime = $isMonthly ? $now : null;
foreach ($preparedRows as $pRow) {
$orderNo = $this->makeOrderNo();
$verifyCode = str_pad((string)mt_rand(0, 999999), 6, '0', STR_PAD_LEFT);
$calc = $pRow['calc'];
$payAmt = round((float)$calc['pay_amount'], 2);
$unitPrice = round((float)$calc['base_amount'] / max(1, (int)$pRow['goods_num']), 2);
$commMatch = CommissionService::matchOrderSnapshot([
'price_type' => 'fixed',
'customer_type' => 'merchant',
'cat_id' => (int)$pRow['cat_id'],
'urgent' => (int)$pRow['urgent'],
'order_amount' => $payAmt,
], $activeCommRules, $commDefaults);
$orderId = (int)Db::name('order')->insertGetId([
'order_no' => $orderNo,
'user_id' => $this->uid(),
'master_id' => 0,
'cat_id' => $pRow['cat_id'],
'service_id' => $pRow['service_id'],
'service_name' => $pRow['service_name'],
'service_image' => $pRow['service_img'],
'price_type' => 'fixed',
'goods_model' => $pRow['goods_model'],
'goods_num' => $pRow['goods_num'],
'contact' => $pRow['contact'],
'mobile' => $pRow['mobile'],
'province' => $pRow['province'],
'city' => $pRow['city'],
'district' => $pRow['district'],
'address' => $pRow['address'],
'floor' => $pRow['floor'],
'has_elevator' => $pRow['has_elevator'],
'urgent' => $pRow['urgent'],
'remark' => $pRow['remark'],
'appoint_time' => $pRow['appoint_time'],
'base_amount' => $calc['base_amount'],
'floor_amount' => $calc['floor_amount'],
'urgent_amount' => $calc['urgent_amount'],
'discount_amount' => 0.00,
'total_amount' => $calc['total_amount'],
'pay_amount' => $payAmt,
'commission_rate' => $commMatch['commission_rate'],
'commission_snapshot' => $commMatch['commission_snapshot'],
'status' => $initStatus,
'pay_status' => $initPayStatus,
'pay_type' => $initPayType,
'pay_time' => $initPayTime,
'transaction_id' => $isMonthly ? ('MONTHLY' . date('YmdHis', $now) . mt_rand(1000, 9999)) : '',
'verify_code' => $verifyCode,
'createtime' => $now,
'updatetime' => $now,
]);
Db::name('order_goods')->insert([
'order_id' => $orderId,
'service_id' => $pRow['service_id'],
'goods_name' => $pRow['service_name'],
'goods_model' => $pRow['goods_model'],
'goods_num' => $pRow['goods_num'],
'goods_image' => $pRow['service_img'],
'addon_services' => '',
'base_price' => $unitPrice,
'createtime' => $now,
]);
Db::name('merchant_order')->insert([
'merchant_id' => (int)$lockedMerchant['id'],
'order_id' => $orderId,
'batch_no' => $batchNo,
'createtime' => $now,
]);
$this->addLog(
$orderId,
$initStatus,
$isMonthly ? "企业批量导单(月结授信,批次 {$batchNo}),已进入接单大厅" : "企业批量导单创建(待支付,批次 {$batchNo})",
'user',
$this->uid()
);
$orderIds[] = $orderId;
$ordersCreated[] = [
'order_id' => $orderId,
'order_no' => $orderNo,
'contact' => $pRow['contact'],
'amount' => $payAmt,
];
$totalAmount = round($totalAmount + $payAmt, 2);
}
if ($isMonthly) {
Db::name('merchant')->where('id', (int)$lockedMerchant['id'])->update([
'order_count' => (int)$lockedMerchant['order_count'] + count($ordersCreated),
'total_amount' => round((float)$lockedMerchant['total_amount'] + $totalAmount, 2),
'updatetime' => $now,
]);
}
Db::commit();
} catch (\think\exception\HttpResponseException $e) {
Db::rollback();
throw $e;
} catch (\InvalidArgumentException $e) {
Db::rollback();
$this->error($e->getMessage());
return;
} catch (\Exception $e) {
Db::rollback();
\think\Log::error('[Merchant::importBatch] ' . $e->getMessage());
$this->error('批量导入失败:' . $e->getMessage());
return;
}
if ($isMonthly && !empty($orderIds)) {
try {
$masters = Db::name('master')
->where('verify_status', 'pass')
->where('work_status', 'on')
->where('user_id', '<>', $this->uid())
->limit(20)
->select();
$cnt = count($orderIds);
foreach ($masters as $m) {
$this->notify('master', (int)$m['id'], '企业批量新工单就绪', "商家刚发布了 {$cnt} 笔新工单进入接单大厅,请尽快前往查看抢单!", 'order', (int)$orderIds[0]);
}
} catch (\Exception $e) {
\think\Log::error('[Merchant::importBatch broadcast] ' . $e->getMessage());
}
}
$this->success($isMonthly ? '批量下单成功,已按月结授信进入接单大厅!' : '批量导入成功,请完成批次支付', [
'need_pay' => !$isMonthly,
'settle_type' => $isMonthly ? 'monthly' : 'prepay',
'batch_no' => $batchNo,
'count' => count($ordersCreated),
'total_amount' => round($totalAmount, 2),
'order_ids' => $orderIds,
'orders' => $ordersCreated,
]);
}
/**
* 商户端:预付商家按批次号支付待支付批量订单(严禁模拟免付兜底,预付订单须逐笔走真实微信支付)
* @ApiMethod (POST)
*/
public function payBatch()
{
$this->requireMerchant();
$this->error('系统已全面禁用模拟支付通道,企业预付工单请逐笔使用真实微信支付完成付款(月结授信企业导单时已直接授信进入大厅)');
}
protected function merchantInfo()
{
$merchant = Db::name('merchant')->where('user_id', $this->uid())->find();

查看文件

@@ -5,6 +5,7 @@ namespace app\api\controller;
use app\common\library\CommissionService;
use app\common\library\FinanceConfigService;
use app\common\library\OrderStatus;
use app\common\library\OrderServiceSnapshot;
use app\common\library\PaymentService;
use app\common\library\TiandituService;
use think\Db;
@@ -552,17 +553,7 @@ class Order extends Base
}
// 增项服务快照
$addonStr = '';
if (!empty($g['addon_services'])) {
$addonStr = is_array($g['addon_services']) ? json_encode($g['addon_services'], JSON_UNESCAPED_UNICODE) : (string)$g['addon_services'];
} elseif (!empty($g['extras']) && is_array($g['extras'])) {
$hitExtras = array_filter($g['extras'], function ($ex) {
return is_array($ex) && !empty($ex['num']) && (int)$ex['num'] > 0;
});
if (!empty($hitExtras)) {
$addonStr = json_encode(array_values($hitExtras), JSON_UNESCAPED_UNICODE);
}
}
$addonStr = OrderServiceSnapshot::format($g);
$gSid = isset($g['service_id']) ? (int)$g['service_id'] : (int)$serviceId;
$gUnitPrice = round((float)$amount['base_amount'] / max(1, (int)$goodsNum), 2);
@@ -818,9 +809,8 @@ class Order extends Base
$row['goods_list'] = $allGoods[$row['id']];
$firstG = $allGoods[$row['id']][0];
$row['goods_title'] = $firstG['goods_name'] . (!empty($firstG['goods_model']) ? ' (' . $firstG['goods_model'] . ')' : '') . ' x ' . $firstG['goods_num'] . '套';
if (!empty($firstG['addon_services'])) {
$row['service_items_text'] = '服务项目: ' . $firstG['addon_services'];
}
$row['service_items_text'] = !empty($firstG['addon_services'])
? '服务项目: ' . $firstG['addon_services'] : '';
if (!empty($firstG['goods_image'])) {
$row['goods_image_url'] = $firstG['goods_image'];
}
@@ -1132,7 +1122,7 @@ class Order extends Base
$gRow['images'] = $rowImgs;
$gRow['env_images'] = $normalizeUrlList($pg['envImages'] ?? ($pg['env_images'] ?? []));
$gRow['goods_videos'] = $normalizeUrlList($pg['videos'] ?? ($pg['goods_videos'] ?? []));
$gRow['service_type_name'] = isset($pg['service_type_name']) ? (string)$pg['service_type_name'] : '安装';
$gRow['service_type_name'] = isset($pg['service_type_name']) ? (string)$pg['service_type_name'] : '';
$gRow['goods_remark'] = isset($pg['remark']) ? trim((string)$pg['remark']) : '';
$gRow['unit'] = isset($pg['unit']) && $pg['unit'] !== '' ? (string)$pg['unit'] : '套';
}
@@ -1616,7 +1606,15 @@ class Order extends Base
} elseif ($status === OrderStatus::PENDING_ACCEPT) {
$statusTimelineText = '订单已进入接单大厅,正在匹配师傅';
} elseif ($status === OrderStatus::QUOTING) {
$statusTimelineText = '已有师傅进行报价,请比对选择';
$quoteCount = isset($row['quote_count'])
? (int)$row['quote_count']
: (int)Db::name('order_quote')
->where('order_id', (int)$row['id'])
->where('status', 'wait')
->count();
$statusTimelineText = $quoteCount > 0
? '已有 ' . $quoteCount . ' 位师傅进行报价,请比对选择'
: '订单已进入接单大厅,正在等待师傅报价';
} elseif ($status === OrderStatus::ACCEPTED) {
$statusTimelineText = '师傅已接单,请等待师傅联系并上门';
if (!empty($row['accept_time'])) $statusTime = (int)$row['accept_time'];

查看文件

@@ -0,0 +1,20 @@
<?php
namespace app\common\library;
class OrderServiceSnapshot {
public static function format(array $goods) {
if (!empty($goods['addon_services']) && is_string($goods['addon_services'])) {
return $goods['addon_services'];
}
$parts = [];
if (!empty($goods['service_type_name'])) {
$parts[] = trim((string)$goods['service_type_name']) . 'x' . max(1, (int)($goods['num'] ?? $goods['goods_num'] ?? 1));
}
$extras = !empty($goods['addon_services']) && is_array($goods['addon_services']) ? $goods['addon_services'] : ($goods['extras'] ?? []);
foreach (is_array($extras) ? $extras : [] as $extra) {
if (is_array($extra) && !empty($extra['name']) && !empty($extra['num']) && (int)$extra['num'] > 0) {
$parts[] = trim((string)$extra['name']) . 'x' . (int)$extra['num'];
}
}
return implode(';', $parts);
}
}

查看文件

@@ -56,4 +56,8 @@ return array (
'tianditu_key' => '55aee666be14cd0100874d6faf3c963c',
'tencent_secret_id' => 'AKIDPjrlKq8C2e2CBzax97tRlqiS0SqFRXcX',
'tencent_secret_key' => 'kHagZHn6C5nNly1tYzCC1cz96rPAzvrP',
'service_phone' => '',
'service_work_time' => '',
'service_corp_id' => '',
'service_kf_url' => '',
);

查看文件

@@ -1,5 +1,12 @@
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var escapeText = function (value) {
if (value === null || value === undefined || value === '') return '—';
return String(value).replace(/[&<>"']/g, function (c) {
return {'&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;'}[c];
});
};
var statusBadgeMap = {
0: {text: '待支付', cls: 'default'},
1: {text: '待接单', cls: 'warning'},
@@ -47,71 +54,33 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{checkbox: true},
{field: 'index', title: '序号', operate: false, formatter: Table.api.formatter.index, width: '55px'},
{
field: 'order_no',
title: '工单编号',
operate: 'LIKE',
align: 'left',
formatter: function (val, row) {
var html = '<span style="font-family:monospace;font-weight:700;color:#0f172a;">' + (val || '-') + '</span>';
if (Number(row.urgent) === 1) {
html += ' <span class="label label-danger">急</span>';
}
if (row.merchant_name) {
// 企业工单标签:直接输出企业名(不可用 formatter.normal,其内部会以 row[this.field] 即订单号覆盖显示值)
var mName = String(row.merchant_name).replace(/[&<>"']/g, function (c) {
return {'&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;'}[c];
});
html += '<div style="margin-top:2px;"><span class="label label-info" style="font-size:10px;"><i class="fa fa-building-o"></i> ' + mName + '</span></div>';
}
return html;
}
field: 'order_no', title: '工单编号', operate: 'LIKE', align: 'left',
formatter: function (val) { return '<span class="order-number">' + escapeText(val) + '</span>'; }
},
{
field: 'service_name',
title: '服务项目 / 规格',
operate: 'LIKE',
align: 'left',
formatter: function (val, row) {
var spec = row.goods_model ? (row.goods_model + ' ×' + (row.goods_num || 1)) : ('数量 ×' + (row.goods_num || 1));
return '<div><strong>' + (val || '-') + '</strong></div><div class="text-muted" style="font-size:11.5px;">' + spec + '</div>';
}
},
{
field: 'contact',
title: '现场客户 / 区域',
operate: 'LIKE',
align: 'left',
formatter: function (val, row) {
var region = [row.city || '', row.district || ''].join('');
return '<div><strong>' + (val || '-') + '</strong> <span class="text-muted">' + (row.mobile || '') + '</span></div>' +
'<div class="text-muted" style="font-size:11.5px;"><i class="fa fa-map-marker"></i> ' + (region || row.address || '-') + '</div>';
}
},
{field: 'mobile', title: '联系电话', operate: 'LIKE', visible: false},
{field: 'urgent', title: '紧急程度', operate: false, formatter: function (val) {
return val === null || val === undefined || val === '' ? '—' : (Number(val) === 1 ? '<span class="label label-danger">急单</span>' : '<span class="text-muted">普通</span>');
}},
{field: 'merchant_name', visible: false, title: '所属企业', operate: false, align: 'left', formatter: escapeText},
{field: 'service_name', title: '服务项目', operate: 'LIKE', align: 'left', formatter: escapeText},
{field: 'goods_model', visible: false, title: '规格', operate: false, align: 'left', formatter: escapeText},
{field: 'goods_num', visible: false, title: '数量', operate: false, formatter: escapeText},
{field: 'contact', title: '现场客户', operate: 'LIKE', align: 'left', formatter: escapeText},
{field: 'mobile', title: '联系电话', operate: 'LIKE', formatter: escapeText},
{field: 'city', visible: false, title: '城市', operate: false, align: 'left', formatter: escapeText},
{field: 'district', visible: false, title: '区域', operate: false, align: 'left', formatter: escapeText},
{field: 'address', visible: false, title: '详细地址', operate: false, align: 'left', formatter: escapeText},
{field: 'user.nickname', title: '下单账号', operate: 'LIKE', visible: false},
{
field: 'master.realname',
title: '承接师傅',
operate: 'LIKE',
align: 'left',
formatter: function (val, row) {
if (!row.master_id || !val) {
return '<span class="text-muted">待指派</span>';
}
var mMobile = (row.master && row.master.mobile) ? row.master.mobile : '';
return '<div><strong>' + val + '</strong></div><div class="text-muted" style="font-size:11.5px;">' + mMobile + '</div>';
}
},
{
field: 'pay_amount',
title: '实付金额',
operate: 'BETWEEN',
sortable: true,
formatter: function (val, row) {
var pType = row.price_type === 'quote' ? '报价' : (row.price_type === 'custom' ? '自定' : '一口价');
return '<strong style="color:#ea580c;">¥' + Number(val || 0).toFixed(2) + '</strong><div class="text-muted" style="font-size:11px;">' + pType + '</div>';
}
},
{field: 'master.realname', title: '承接师傅', operate: 'LIKE', align: 'left', formatter: function (val) {
return val ? escapeText(val) : '<span class="text-muted">待指派</span>';
}},
{field: 'master.mobile', visible: false, title: '师傅电话', operate: false, formatter: escapeText},
{field: 'pay_amount', title: '实付金额', operate: 'BETWEEN', sortable: true, formatter: function (val) {
return val === null || val === undefined || val === '' ? '—' : '<span class="order-amount">¥' + Number(val).toFixed(2) + '</span>';
}},
{field: 'price_type', visible: false, title: '计价方式', operate: false, formatter: function (val) {
var labels = {quote: '报价', custom: '自定', fixed: '一口价'};
return escapeText(labels[val] || val);
}},
{
field: 'status',
title: '工单状态',

查看文件

@@ -0,0 +1,13 @@
import assert from 'assert';
import { formatServiceItems, formatOrderServiceItems } from '../yjyf-app/utils/order-service-items.mjs';
assert.equal(formatServiceItems('服务项目: [{"id":1,"name":"拆旧","num":1}]'), '服务项目: 拆旧x1');
assert.equal(formatServiceItems('[{"name":"拆旧","num":2},{"name":"搬运","num":3}]'), '拆旧x2;搬运x3');
assert.equal(formatServiceItems('服务项目: 安装x1;拆旧x1'), '服务项目: 安装x1;拆旧x1');
assert.equal(formatServiceItems('服务项目: [{"name":"拆旧"'), '');
assert.equal(formatServiceItems('[]'), '');
assert.equal(formatOrderServiceItems({ service_items_text: '服务项目: [{"name":"拆旧","num":1}]', goods_images: JSON.stringify({goods_list: [{service_type_name: '维修', num: 2}]}) }), '服务项目: 维修x2;拆旧x1');
assert.equal(formatServiceItems('[{"name":"拆旧","num":0},{"name":"搬运","num":2}]'), '搬运x2');
console.log('order service item formatting passed');

查看文件

@@ -0,0 +1,11 @@
<?php
require __DIR__ . '/../server/application/common/library/OrderServiceSnapshot.php';
use app\common\library\OrderServiceSnapshot;
function checkSnapshot($expected, $actual) {
if ($expected !== $actual) throw new RuntimeException(var_export([$expected, $actual], true));
}
checkSnapshot('安装x1;拆旧x1', OrderServiceSnapshot::format(['service_type_name' => '安装', 'num' => 1, 'extras' => [['name' => '拆旧', 'num' => 1], ['name' => '搬运', 'num' => 0]]]));
checkSnapshot('维修x2;搬运x3', OrderServiceSnapshot::format(['service_type_name' => '维修', 'goods_num' => 2, 'addon_services' => [['name' => '搬运', 'num' => 3]]]));
checkSnapshot('安装x1;拆旧x1', OrderServiceSnapshot::format(['addon_services' => '安装x1;拆旧x1']));
checkSnapshot('', OrderServiceSnapshot::format([]));
echo "Order service snapshot tests passed\n";

查看文件

@@ -20,11 +20,11 @@
<input class="m-input" v-model="selProvince" placeholder="请输入省份或直辖市" />
</view>
<view class="m-field">
<text class="m-label">城市 / 州盟</text>
<text class="m-label">{{ allowCityLevel ? '城市 / 州盟(选填)' : '城市 / 州盟' }}</text>
<input class="m-input" v-model="selCity" placeholder="请输入城市或州盟" />
</view>
<view class="m-field">
<text class="m-label">区 / 县 / 县级市</text>
<text class="m-label">{{ allowCityLevel ? '区 / 县 / 县级市(选填)' : '区 / 县 / 县级市' }}</text>
<input class="m-input" v-model="selDistrict" placeholder="请输入区、县或县级市" />
</view>
<view class="confirm-btn clickable-hover" @tap="confirmSelection">
@@ -95,6 +95,13 @@
</view>
</view>
</scroll-view>
<view
class="confirm-btn clickable-hover"
v-if="allowCityLevel && selProvince"
@tap="confirmSelection"
>
<text class="cb-txt">确定({{ [selProvince, selCity, selDistrict].filter(Boolean).join(' ') }})</text>
</view>
</template>
</view>
</view>
@@ -108,7 +115,8 @@
visible: { type: Boolean, default: false },
province: { type: String, default: '' },
city: { type: String, default: '' },
district: { type: String, default: '' }
district: { type: String, default: '' },
allowCityLevel: { type: Boolean, default: false }
});
const emit = defineEmits(['update:visible', 'confirm']);
@@ -199,15 +207,24 @@
function pickProvince(p) {
selProvince.value = p.name;
const firstCity = p.cities && p.cities[0] ? p.cities[0] : null;
selCity.value = firstCity ? firstCity.name : '';
selDistrict.value = (firstCity && firstCity.districts && firstCity.districts[0]) ? firstCity.districts[0] : '';
if (props.allowCityLevel) {
selCity.value = '';
selDistrict.value = '';
} else {
const firstCity = p.cities && p.cities[0] ? p.cities[0] : null;
selCity.value = firstCity ? firstCity.name : '';
selDistrict.value = (firstCity && firstCity.districts && firstCity.districts[0]) ? firstCity.districts[0] : '';
}
activeTab.value = 1;
}
function pickCity(c) {
selCity.value = c.name;
selDistrict.value = (c.districts && c.districts[0]) ? c.districts[0] : '';
if (props.allowCityLevel) {
selDistrict.value = '';
} else {
selDistrict.value = (c.districts && c.districts[0]) ? c.districts[0] : '';
}
activeTab.value = 2;
}
@@ -220,6 +237,15 @@
const p = (selProvince.value || '').trim();
const c = (selCity.value || '').trim();
const d = (selDistrict.value || '').trim();
if (props.allowCityLevel) {
if (!p) {
uni.showToast({ title: '请先选择或填写省份', icon: 'none' });
return;
}
emit('confirm', { province: p, city: c, district: d });
close();
return;
}
if (!p || !c || !d) {
uni.showToast({ title: '请完整选择或填写省市区', icon: 'none' });
return;

查看文件

@@ -0,0 +1,324 @@
<template>
<view class="svc-mask" v-if="visible" @tap="close" @touchmove.stop.prevent>
<view class="svc-sheet" @tap.stop>
<!-- 标题栏 -->
<view class="svc-head">
<view class="svc-head-left">
<text class="svc-title">联系客服</text>
<text class="svc-worktime" v-if="config.service_work_time">服务时间:{{ config.service_work_time }}</text>
</view>
<view class="svc-close clickable-hover" @tap="close">
<image class="svc-close-ico" src="/static/icons/close.svg" mode="aspectFit" />
</view>
</view>
<!-- 客服方式列表 -->
<view class="svc-body">
<!-- 1. 在线客服(微信客服) -->
<!-- #ifdef MP-WEIXIN -->
<view
v-if="hasEnterpriseKf"
class="svc-card clickable-hover"
@tap="openEnterpriseKf"
>
<view class="svc-card-l">
<image class="svc-ico" src="/static/icons/service-online-chat.svg" mode="aspectFit" />
<view class="svc-info">
<text class="svc-name">在线客服</text>
<text class="svc-desc">微信在线实时沟通,快速解答</text>
</view>
</view>
<image class="svc-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
<button
v-else
class="svc-card svc-btn clickable-hover"
open-type="contact"
@contact="close"
@error="onContactError"
>
<view class="svc-card-l">
<image class="svc-ico" src="/static/icons/service-online-chat.svg" mode="aspectFit" />
<view class="svc-info">
<text class="svc-name">在线客服</text>
<text class="svc-desc">微信在线实时沟通,快速解答</text>
</view>
</view>
<image class="svc-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</button>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view class="svc-card clickable-hover" @tap="openNonWxKf">
<view class="svc-card-l">
<image class="svc-ico" src="/static/icons/service-online-chat.svg" mode="aspectFit" />
<view class="svc-info">
<text class="svc-name">在线客服</text>
<text class="svc-desc">微信在线实时沟通,快速解答</text>
</view>
</view>
<image class="svc-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
<!-- #endif -->
<!-- 2. 客服电话(后台配置) -->
<view
class="svc-card clickable-hover"
:class="{ 'svc-card-disabled': !config.service_phone }"
@tap="callServicePhone"
>
<view class="svc-card-l">
<image class="svc-ico" src="/static/icons/service-hotline.svg" mode="aspectFit" />
<view class="svc-info">
<text class="svc-name">客服电话</text>
<text class="svc-desc" v-if="config.service_phone">{{ config.service_phone }}</text>
<text class="svc-desc muted" v-else>暂未配置客服电话</text>
</view>
</view>
<image v-if="config.service_phone" class="svc-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
</view>
<!-- 底部取消按钮 -->
<view class="svc-cancel clickable-hover" @tap="close">取消</view>
</view>
</view>
</template>
<script setup>
import { ref, computed, watch } from 'vue';
import api from '@/utils/api.js';
const props = defineProps({
visible: { type: Boolean, default: false }
});
const emit = defineEmits(['update:visible']);
const config = ref(api.getCachedServiceConfig());
const hasEnterpriseKf = computed(() => {
return Boolean(config.value.service_corp_id && config.value.service_kf_url);
});
watch(() => props.visible, (val) => {
if (val) {
config.value = api.getCachedServiceConfig();
syncLatestConfig();
}
});
async function syncLatestConfig() {
const latest = await api.getServiceConfig(true);
if (latest) {
config.value = latest;
}
}
function close() {
emit('update:visible', false);
}
function onContactError(e) {
console.warn('小程序原生客服打开失败', e);
uni.showToast({ title: '暂无法拉起在线客服,请拨打客服电话', icon: 'none' });
}
function openEnterpriseKf() {
// #ifdef MP-WEIXIN
if (typeof wx !== 'undefined' && typeof wx.openCustomerServiceChat === 'function') {
wx.openCustomerServiceChat({
extInfo: { url: config.value.service_kf_url },
corpId: config.value.service_corp_id,
success: () => {
close();
},
fail: (err) => {
console.warn('拉起微信客服失败', err);
uni.showToast({ title: '拉起微信客服失败,请尝试拨打客服电话', icon: 'none' });
}
});
} else {
uni.showToast({ title: '当前微信版本暂不支持,请升级微信', icon: 'none' });
}
// #endif
}
function openNonWxKf() {
if (config.value.service_kf_url) {
// #ifdef H5
window.open(config.value.service_kf_url, '_blank');
close();
return;
// #endif
}
uni.showToast({ title: '请在微信小程序内使用在线客服', icon: 'none' });
}
function callServicePhone() {
const phone = (config.value.service_phone || '').trim();
if (!phone) {
uni.showToast({ title: '平台暂未配置客服电话', icon: 'none' });
return;
}
close();
uni.makePhoneCall({
phoneNumber: phone,
fail: () => {}
});
}
</script>
<style lang="scss" scoped>
.svc-mask {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.52);
z-index: 9999;
display: flex;
flex-direction: column;
justify-content: flex-end;
}
.svc-sheet {
background: $yjyf-bg-card;
border-top-left-radius: 28rpx;
border-top-right-radius: 28rpx;
padding: 32rpx 32rpx calc(32rpx + env(safe-area-inset-bottom));
box-sizing: border-box;
}
.svc-head {
display: flex;
align-items: flex-start;
justify-content: space-between;
padding-bottom: 24rpx;
}
.svc-head-left {
display: flex;
flex-direction: column;
gap: 6rpx;
}
.svc-title {
font-size: $yjyf-font-title;
font-weight: 700;
color: $yjyf-text-main;
line-height: 1.3;
}
.svc-worktime {
font-size: $yjyf-font-sub;
color: $yjyf-text-secondary;
}
.svc-close {
width: 56rpx;
height: 56rpx;
display: flex;
align-items: center;
justify-content: flex-end;
}
.svc-close-ico {
width: 30rpx;
height: 30rpx;
opacity: 0.6;
}
.svc-body {
display: flex;
flex-direction: column;
gap: 20rpx;
}
.svc-card {
display: flex;
align-items: center;
justify-content: space-between;
padding: 26rpx 24rpx;
background: $yjyf-bg-page;
border-radius: $yjyf-radius-md;
box-sizing: border-box;
width: 100%;
}
.svc-btn {
margin: 0;
border: none;
text-align: left;
line-height: normal;
font-family: inherit;
&::after {
border: none;
}
}
.svc-card-disabled {
opacity: 0.72;
}
.svc-card-l {
display: flex;
align-items: center;
gap: 22rpx;
flex: 1;
min-width: 0;
}
.svc-ico {
width: 80rpx;
height: 80rpx;
flex-shrink: 0;
}
.svc-info {
display: flex;
flex-direction: column;
gap: 6rpx;
min-width: 0;
flex: 1;
}
.svc-name {
font-size: 30rpx;
font-weight: 600;
color: $yjyf-text-main;
line-height: 1.3;
}
.svc-desc {
font-size: $yjyf-font-sub;
color: $yjyf-text-secondary;
line-height: 1.4;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.svc-desc.muted {
color: $yjyf-text-muted;
}
.svc-arrow {
width: 28rpx;
height: 28rpx;
flex-shrink: 0;
opacity: 0.55;
margin-left: 16rpx;
}
.svc-cancel {
margin-top: 24rpx;
height: 88rpx;
border-radius: $yjyf-radius-pill;
background: $yjyf-bg-page;
color: $yjyf-text-regular;
font-size: 30rpx;
font-weight: 500;
display: flex;
align-items: center;
justify-content: center;
}
</style>

查看文件

@@ -0,0 +1,670 @@
<template>
<view class="hall-loader">
<!-- 核心同城雷达搜单动效卡片 -->
<view class="loader-hero-card">
<view class="radar-stage">
<!-- 脉冲扩散波纹 -->
<view class="radar-ripple r1"></view>
<view class="radar-ripple r2"></view>
<!-- 旋转轨道环 -->
<view class="orbit-ring orbit-outer"></view>
<view class="orbit-ring orbit-mid"></view>
<view class="orbit-ring orbit-inner"></view>
<!-- 雷达扇形扫描光束 -->
<view class="radar-sweep"></view>
<!-- 探测信号闪烁点 -->
<view class="blip-dot b1">
<view class="blip-halo"></view>
</view>
<view class="blip-dot b2">
<view class="blip-halo"></view>
</view>
<view class="blip-dot b3">
<view class="blip-halo"></view>
</view>
<!-- 中心派单徽章 -->
<view class="radar-core">
<image
class="radar-core-ico"
src="/static/icons/master/hall-radar-dispatch.svg"
mode="aspectFit"
/>
</view>
</view>
<!-- 动态阶段标题 -->
<view class="loader-status-box">
<view class="loader-title-row">
<text class="loader-title">{{ stageTitle }}</text>
<view class="typing-dots">
<view class="t-dot d1"></view>
<view class="t-dot d2"></view>
<view class="t-dot d3"></view>
</view>
</view>
<text class="loader-sub">{{ stageSub }}</text>
</view>
<!-- 三段式真实加载阶段指示 -->
<view class="stage-steps">
<view class="step-item" :class="{ active: stage === 'location', done: stage !== 'location' }">
<view class="step-node">
<view class="step-node-core"></view>
</view>
<text class="step-label">位置校准</text>
</view>
<view class="step-line" :class="{ active: stage !== 'location' }">
<view class="step-line-flow"></view>
</view>
<view class="step-item" :class="{ active: stage !== 'location' }">
<view class="step-node">
<view class="step-node-core"></view>
</view>
<text class="step-label">技能匹配</text>
</view>
<view class="step-line" :class="{ shimmer: stage !== 'location' }">
<view class="step-line-flow"></view>
</view>
<view class="step-item" :class="{ pending: true }">
<view class="step-node">
<view class="step-node-core"></view>
</view>
<text class="step-label">工单同步</text>
</view>
</view>
<!-- 底部流光进度轨道 -->
<view class="progress-track">
<view class="progress-beam"></view>
</view>
</view>
<!-- 联动微缩工单骨架预览卡片 -->
<view class="preview-skeletons">
<view class="sk-card sk-stagger-1">
<view class="sk-hd">
<view class="sk-hd-left">
<view class="sk-tag warm-shimmer"></view>
<view class="sk-line warm-shimmer w48"></view>
</view>
<view class="sk-line warm-shimmer w22"></view>
</view>
<view class="sk-bd">
<view class="sk-thumb warm-shimmer"></view>
<view class="sk-col">
<view class="sk-line warm-shimmer w82"></view>
<view class="sk-line warm-shimmer w94"></view>
<view class="sk-line warm-shimmer w58"></view>
</view>
</view>
<view class="sk-ft">
<view class="sk-line warm-shimmer w38"></view>
<view class="sk-btn warm-shimmer"></view>
</view>
</view>
<view class="sk-card sk-stagger-2">
<view class="sk-hd">
<view class="sk-hd-left">
<view class="sk-tag warm-shimmer"></view>
<view class="sk-line warm-shimmer w42"></view>
</view>
<view class="sk-line warm-shimmer w26"></view>
</view>
<view class="sk-bd">
<view class="sk-thumb warm-shimmer"></view>
<view class="sk-col">
<view class="sk-line warm-shimmer w76"></view>
<view class="sk-line warm-shimmer w90"></view>
<view class="sk-line warm-shimmer w50"></view>
</view>
</view>
<view class="sk-ft">
<view class="sk-line warm-shimmer w42"></view>
<view class="sk-btn warm-shimmer"></view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import { computed } from 'vue';
const props = defineProps({
stage: {
type: String,
default: 'fetching' // 'location' | 'fetching'
},
city: {
type: String,
default: ''
}
});
const stageTitle = computed(() => {
return props.stage === 'location'
? '正在校准当前位置'
: '正在匹配同城优质工单';
});
const stageSub = computed(() => {
if (props.stage === 'location') {
return '获取实时坐标与周边接单半径';
}
if (props.city) {
return `已定位 ${props.city} · 按技能与距离实时筛选`;
}
return '按技能范围与距离智能筛选待接订单';
});
</script>
<style lang="scss" scoped>
.hall-loader {
padding: 20rpx $yjyf-space-md $yjyf-space-lg;
}
/* 1. 雷达搜单主卡片 */
.loader-hero-card {
position: relative;
overflow: hidden;
background: linear-gradient(180deg, $yjyf-primary-bg 0%, $yjyf-bg-card 56%, $yjyf-bg-card 100%);
border-radius: $yjyf-radius-lg;
border: 1rpx solid rgba(240, 113, 13, 0.14);
box-shadow: $yjyf-shadow-card;
padding: 36rpx $yjyf-space-md 28rpx;
margin-bottom: $yjyf-space-md;
display: flex;
flex-direction: column;
align-items: center;
animation: cardFadeIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* 2. 雷达舞台 */
.radar-stage {
position: relative;
width: 248rpx;
height: 248rpx;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 24rpx;
}
.radar-ripple {
position: absolute;
width: 96rpx;
height: 96rpx;
border-radius: 50%;
border: 2rpx solid rgba(240, 113, 13, 0.45);
background: rgba(240, 113, 13, 0.06);
animation: radarRipple 2.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
pointer-events: none;
}
.radar-ripple.r2 {
animation-delay: 1.2s;
}
.orbit-ring {
position: absolute;
border-radius: 50%;
pointer-events: none;
}
.orbit-outer {
width: 228rpx;
height: 228rpx;
border: 2rpx dashed rgba(240, 113, 13, 0.24);
animation: spinClockwise 14s linear infinite;
}
.orbit-mid {
width: 170rpx;
height: 170rpx;
border: 2rpx solid rgba(240, 113, 13, 0.1);
border-top-color: rgba(255, 169, 63, 0.72);
border-right-color: rgba(240, 113, 13, 0.36);
animation: spinCounter 5.6s linear infinite;
}
.orbit-inner {
width: 118rpx;
height: 118rpx;
border: 1rpx solid rgba(240, 113, 13, 0.16);
}
.radar-sweep {
position: absolute;
width: 224rpx;
height: 224rpx;
border-radius: 50%;
background: conic-gradient(
from 0deg,
rgba(240, 113, 13, 0.34) 0deg,
rgba(255, 169, 63, 0.14) 50deg,
rgba(255, 169, 63, 0) 98deg,
rgba(255, 169, 63, 0) 360deg
);
animation: spinClockwise 2.1s linear infinite;
pointer-events: none;
}
/* 探测到的信号闪烁点 */
.blip-dot {
position: absolute;
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background: $yjyf-primary;
box-shadow: 0 0 10rpx rgba(240, 113, 13, 0.7);
animation: blipPulse 2.1s ease-in-out infinite;
}
.blip-halo {
position: absolute;
top: -6rpx;
left: -6rpx;
width: 24rpx;
height: 24rpx;
border-radius: 50%;
border: 2rpx solid rgba(240, 113, 13, 0.5);
animation: blipHalo 2.1s ease-out infinite;
}
.blip-dot.b1 {
top: 38rpx;
right: 54rpx;
animation-delay: 0.2s;
}
.blip-dot.b1 .blip-halo { animation-delay: 0.2s; }
.blip-dot.b2 {
bottom: 46rpx;
right: 40rpx;
animation-delay: 0.9s;
}
.blip-dot.b2 .blip-halo { animation-delay: 0.9s; }
.blip-dot.b3 {
bottom: 58rpx;
left: 38rpx;
animation-delay: 1.5s;
}
.blip-dot.b3 .blip-halo { animation-delay: 1.5s; }
/* 中心徽章 */
.radar-core {
position: relative;
z-index: 2;
width: 84rpx;
height: 84rpx;
border-radius: 50%;
background: $yjyf-gradient-primary;
box-shadow: 0 8rpx 24rpx rgba(240, 113, 13, 0.36);
display: flex;
align-items: center;
justify-content: center;
animation: coreBreath 2s ease-in-out infinite;
}
.radar-core-ico {
width: 46rpx;
height: 46rpx;
}
/* 3. 动态状态文本 */
.loader-status-box {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 24rpx;
}
.loader-title-row {
display: flex;
align-items: center;
gap: 8rpx;
margin-bottom: 8rpx;
}
.loader-title {
font-size: $yjyf-font-title;
font-weight: 700;
color: $yjyf-text-main;
letter-spacing: 0.5rpx;
}
.typing-dots {
display: flex;
align-items: center;
gap: 6rpx;
padding-top: 6rpx;
}
.t-dot {
width: 8rpx;
height: 8rpx;
border-radius: 50%;
background: $yjyf-primary;
animation: dotBounce 1.2s ease-in-out infinite;
}
.t-dot.d2 { animation-delay: 0.2s; }
.t-dot.d3 { animation-delay: 0.4s; }
.loader-sub {
font-size: $yjyf-font-sub;
color: $yjyf-text-secondary;
}
/* 4. 三段式阶段指示器 */
.stage-steps {
width: 100%;
max-width: 560rpx;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 24rpx;
}
.step-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 10rpx;
flex-shrink: 0;
}
.step-node {
width: 28rpx;
height: 28rpx;
border-radius: 50%;
background: #F2F3F5;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
}
.step-node-core {
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background: #C8C7CC;
}
.step-label {
font-size: $yjyf-font-micro;
color: $yjyf-text-muted;
font-weight: 500;
}
.step-item.done .step-node {
background: rgba(47, 168, 79, 0.14);
}
.step-item.done .step-node-core {
background: $yjyf-success;
}
.step-item.done .step-label {
color: $yjyf-text-regular;
}
.step-item.active .step-node {
background: rgba(240, 113, 13, 0.18);
animation: nodePulse 1.4s ease-in-out infinite;
}
.step-item.active .step-node-core {
background: $yjyf-primary;
}
.step-item.active .step-label {
color: $yjyf-primary;
font-weight: 600;
}
.step-line {
position: relative;
flex: 1;
height: 4rpx;
background: #ECEEF2;
border-radius: 4rpx;
margin: 0 12rpx 34rpx;
overflow: hidden;
}
.step-line.active {
background: rgba(240, 113, 13, 0.25);
}
.step-line.active .step-line-flow,
.step-line.shimmer .step-line-flow {
position: absolute;
top: 0;
left: -40%;
width: 45%;
height: 100%;
background: $yjyf-gradient-primary;
border-radius: 4rpx;
animation: lineFlow 1.3s ease-in-out infinite;
}
/* 5. 底部流光进度条 */
.progress-track {
position: relative;
width: 100%;
height: 6rpx;
border-radius: $yjyf-radius-pill;
background: rgba(240, 113, 13, 0.1);
overflow: hidden;
}
.progress-beam {
position: absolute;
top: 0;
left: -35%;
width: 38%;
height: 100%;
border-radius: $yjyf-radius-pill;
background: $yjyf-gradient-primary;
animation: progressSlide 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
/* 6. 下方联动骨架卡 */
.preview-skeletons {
display: flex;
flex-direction: column;
}
.sk-card {
background: $yjyf-bg-card;
border-radius: $yjyf-radius-card;
padding: $yjyf-space-md;
margin-bottom: $yjyf-space-md;
box-shadow: $yjyf-shadow-card;
opacity: 0;
animation: staggerSlideUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.sk-stagger-1 { animation-delay: 0.08s; }
.sk-stagger-2 { animation-delay: 0.18s; opacity: 0; }
.sk-hd {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 18rpx;
border-bottom: 1rpx solid $yjyf-border-color;
margin-bottom: 20rpx;
}
.sk-hd-left {
flex: 1;
display: flex;
align-items: center;
gap: 12rpx;
}
.sk-tag {
width: 64rpx;
height: 32rpx;
border-radius: 8rpx;
flex-shrink: 0;
}
.sk-bd {
display: flex;
gap: 20rpx;
margin-bottom: 20rpx;
}
.sk-thumb {
width: 148rpx;
height: 148rpx;
border-radius: 16rpx;
flex-shrink: 0;
}
.sk-col {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
gap: $yjyf-space-sm;
}
.sk-ft {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 18rpx;
border-top: 1rpx solid $yjyf-border-color;
}
.sk-line {
height: 26rpx;
border-radius: 8rpx;
}
.sk-btn {
width: 176rpx;
height: 60rpx;
border-radius: $yjyf-radius-pill;
}
.w22 { width: 22%; }
.w26 { width: 26%; }
.w38 { width: 38%; }
.w42 { width: 42%; }
.w48 { width: 48%; }
.w50 { width: 50%; }
.w58 { width: 58%; }
.w76 { width: 76%; }
.w82 { width: 82%; }
.w90 { width: 90%; }
.w94 { width: 94%; }
.warm-shimmer {
background: linear-gradient(
90deg,
#F3F4F6 25%,
#FCEEE3 38%,
#F3F4F6 63%
);
background-size: 800rpx 100%;
animation: warmShimmer 1.4s ease infinite;
}
/* 动画关键帧 */
@keyframes cardFadeIn {
from {
opacity: 0;
transform: translateY(16rpx) scale(0.98);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
@keyframes staggerSlideUp {
from {
opacity: 0;
transform: translateY(20rpx);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes radarRipple {
0% {
transform: scale(0.9);
opacity: 0.85;
}
100% {
transform: scale(2.55);
opacity: 0;
}
}
@keyframes spinClockwise {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
@keyframes spinCounter {
from { transform: rotate(360deg); }
to { transform: rotate(0deg); }
}
@keyframes coreBreath {
0%, 100% {
transform: scale(1);
box-shadow: 0 8rpx 24rpx rgba(240, 113, 13, 0.34);
}
50% {
transform: scale(1.06);
box-shadow: 0 12rpx 32rpx rgba(240, 113, 13, 0.48);
}
}
@keyframes blipPulse {
0%, 100% {
opacity: 0.3;
transform: scale(0.75);
}
35% {
opacity: 1;
transform: scale(1.15);
}
70% {
opacity: 0.45;
transform: scale(0.9);
}
}
@keyframes blipHalo {
0% {
transform: scale(0.6);
opacity: 0.8;
}
100% {
transform: scale(2.1);
opacity: 0;
}
}
@keyframes dotBounce {
0%, 80%, 100% {
transform: translateY(0);
opacity: 0.35;
}
40% {
transform: translateY(-6rpx);
opacity: 1;
}
}
@keyframes nodePulse {
0%, 100% {
box-shadow: 0 0 0 0 rgba(240, 113, 13, 0.35);
}
50% {
box-shadow: 0 0 0 8rpx rgba(240, 113, 13, 0);
}
}
@keyframes lineFlow {
0% { left: -45%; }
100% { left: 105%; }
}
@keyframes progressSlide {
0% { left: -38%; }
100% { left: 102%; }
}
@keyframes warmShimmer {
0% { background-position: -400rpx 0; }
100% { background-position: 400rpx 0; }
}
</style>

查看文件

@@ -120,27 +120,12 @@
</swiper>
</view>
<!-- 状态 1:首屏骨架屏加载态 -->
<view class="skeleton-list" v-if="loading && !list.length">
<view class="sk-card" v-for="n in 3" :key="'sk-' + n">
<view class="sk-hd">
<view class="sk-line yjyf-shimmer w55"></view>
<view class="sk-line yjyf-shimmer w24"></view>
</view>
<view class="sk-bd">
<view class="sk-thumb yjyf-shimmer"></view>
<view class="sk-col">
<view class="sk-line yjyf-shimmer w80"></view>
<view class="sk-line yjyf-shimmer w95"></view>
<view class="sk-line yjyf-shimmer w60"></view>
</view>
</view>
<view class="sk-ft">
<view class="sk-line yjyf-shimmer w40"></view>
<view class="sk-btn yjyf-shimmer"></view>
</view>
</view>
</view>
<!-- 状态 1:首屏同城雷达搜单加载动画 -->
<MasterHallLoader
v-if="showInitialLoader"
:stage="loaderStage"
:city="locationCity"
/>
<!-- 状态 2:异常错误重试态 -->
<view class="state-empty-wrap" v-else-if="loadError && !list.length">
@@ -156,8 +141,9 @@
<view class="list" v-else-if="list.length">
<view
class="order-card clickable-hover"
v-for="o in list"
v-for="(o, idx) in list"
:key="o.id"
:style="idx < 6 ? { animationDelay: (idx * 45) + 'ms' } : null"
@tap="goDetail(o)"
>
<!-- 卡片头部:服务标签 + 标题 + 预计到手报酬 -->
@@ -346,6 +332,7 @@
} from '@/utils/location.js';
import YjyfNavBar from '@/components/YjyfNavBar.vue';
import YjyfRefreshScroll from '@/components/YjyfRefreshScroll.vue';
import MasterHallLoader from '@/components/master/MasterHallLoader.vue';
const list = ref([]);
const info = ref(null);
@@ -353,6 +340,7 @@
const loading = ref(false);
const loadingMore = ref(false);
const loadError = ref('');
const hasCompletedFirstLoad = ref(false);
const page = ref(1);
const hasMore = ref(false);
const coords = ref({ lat: '', lng: '' });
@@ -363,6 +351,8 @@
const serverLocationSource = ref('none');
const requestingLocation = ref(false);
const initializingLocation = ref(false);
const showInitialLoader = computed(() => (loading.value || initializingLocation.value) && !list.value.length);
const loaderStage = computed(() => initializingLocation.value ? 'location' : 'fetching');
const hasCoords = computed(() => Boolean(coords.value.lat && coords.value.lng));
const locBarText = computed(() => {
if (hasCoords.value) {
@@ -731,6 +721,7 @@
async function fetchHallList() {
const seq = ++loadSeq;
const startAt = Date.now();
loading.value = true;
loadError.value = '';
page.value = 1;
@@ -741,6 +732,18 @@
]);
if (seq !== loadSeq) return;
if (!hasCompletedFirstLoad.value) {
const elapsed = Date.now() - startAt;
const minDuration = 520;
if (elapsed < minDuration) {
await new Promise((resolve) => {
const t = setTimeout(resolve, minDuration - elapsed);
timers.push(t);
});
if (seq !== loadSeq) return;
}
}
if (meResult.status === 'fulfilled' && meResult.value) {
const meRes = meResult.value;
if (!meRes.applied || meRes.master?.verify_status !== 'pass') {
@@ -774,6 +777,7 @@
}
} finally {
if (seq === loadSeq) {
hasCompletedFirstLoad.value = true;
loading.value = false;
}
}
@@ -1137,67 +1141,7 @@
flex-shrink: 0;
}
/* 4. 骨架屏 */
.skeleton-list {
padding: 20rpx $yjyf-space-md $yjyf-space-lg;
}
.sk-card {
background: $yjyf-bg-card;
border-radius: $yjyf-radius-card;
padding: $yjyf-space-md;
margin-bottom: $yjyf-space-md;
box-shadow: $yjyf-shadow-card;
}
.sk-hd {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 18rpx;
border-bottom: 1rpx solid $yjyf-border-color;
margin-bottom: 20rpx;
}
.sk-bd {
display: flex;
gap: 20rpx;
margin-bottom: 20rpx;
}
.sk-thumb {
width: 156rpx;
height: 156rpx;
border-radius: 16rpx;
flex-shrink: 0;
}
.sk-col {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
gap: $yjyf-space-sm;
}
.sk-ft {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 18rpx;
border-top: 1rpx solid $yjyf-border-color;
}
.sk-line {
height: 28rpx;
border-radius: 8rpx;
}
.sk-btn {
width: 180rpx;
height: 64rpx;
border-radius: $yjyf-radius-pill;
}
.w24 { width: 24%; }
.w40 { width: 40%; }
.w55 { width: 55%; }
.w60 { width: 60%; }
.w80 { width: 80%; }
.w95 { width: 95%; }
/* 5. 抢单卡片列表 */
/* 4. 抢单卡片列表 */
.list {
padding: 20rpx $yjyf-space-md $yjyf-space-lg;
}
@@ -1215,6 +1159,17 @@
padding: $yjyf-space-md;
margin-bottom: $yjyf-space-md;
box-shadow: $yjyf-shadow-card;
animation: orderCardEnter 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes orderCardEnter {
from {
opacity: 0;
transform: translateY(16rpx);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.card-hd {
display: flex;

查看文件

@@ -1,7 +1,14 @@
<template>
<view class="orders-view">
<!-- 统一品牌橙色导航栏 -->
<YjyfNavBar theme="orange" title="接单管理" />
<YjyfNavBar theme="orange" title="接单管理">
<template #left>
<view class="service-btn clickable-hover" @tap="openServicePopup">
<image class="service-icon" src="/static/icons/customer-service-white.svg" mode="aspectFit" />
<text class="service-txt">客服</text>
</view>
</template>
</YjyfNavBar>
<!-- 顶部状态漏斗看板 -->
<view class="funnel-card">
@@ -138,6 +145,7 @@
<view class="empty-cta clickable-hover" @tap="goHall">前往抢单大厅</view>
</view>
</YjyfRefreshScroll>
<YjyfServicePopup :visible="servicePopupVisible" @update:visible="servicePopupVisible = $event" />
</view>
</template>
@@ -147,8 +155,14 @@
import { isLogin, toLogin } from '@/utils/request.js';
import YjyfNavBar from '@/components/YjyfNavBar.vue';
import YjyfRefreshScroll from '@/components/YjyfRefreshScroll.vue';
import YjyfServicePopup from '@/components/YjyfServicePopup.vue';
const emit = defineEmits(['switch-tab']);
const servicePopupVisible = ref(false);
function openServicePopup() {
servicePopupVisible.value = true;
}
const cur = ref('active');
const list = ref([]);
@@ -313,6 +327,26 @@
min-height: 0;
}
.service-btn {
display: inline-flex;
align-items: center;
gap: 6rpx;
padding: 8rpx 16rpx;
border-radius: 999rpx;
background: rgba(255, 255, 255, 0.22);
}
.service-icon {
width: 30rpx;
height: 30rpx;
}
.service-txt {
font-size: 24rpx;
color: #FFFFFF;
font-weight: 500;
}
/* 顶部状态漏斗看板 */
.funnel-card {
background: $yjyf-bg-card;

查看文件

@@ -214,18 +214,6 @@
</view>
</view>
<!-- #ifdef MP-WEIXIN -->
<button class="menu-item menu-btn clickable-hover" open-type="contact">
<view class="mi-left">
<image class="mi-ico" src="/static/icons/master/menu-service.svg" mode="aspectFit" />
<text class="mi-title">在线客服</text>
</view>
<view class="mi-right">
<image class="mi-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
</button>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view class="menu-item clickable-hover" @tap="callService">
<view class="mi-left">
<image class="mi-ico" src="/static/icons/master/menu-service.svg" mode="aspectFit" />
@@ -236,7 +224,6 @@
<image class="mi-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
</view>
<!-- #endif -->
<view class="menu-item clickable-hover" @tap="openAgreementPicker">
<view class="mi-left">
@@ -268,6 +255,7 @@
</view>
</template>
</YjyfRefreshScroll>
<YjyfServicePopup :visible="servicePopupVisible" @update:visible="servicePopupVisible = $event" />
</view>
</template>
@@ -279,6 +267,7 @@
import { getNavBarMetrics } from '@/utils/system.js';
import YjyfNavBar from '@/components/YjyfNavBar.vue';
import YjyfRefreshScroll from '@/components/YjyfRefreshScroll.vue';
import YjyfServicePopup from '@/components/YjyfServicePopup.vue';
const emit = defineEmits(['switch-tab']);
const MAX_VISIBLE_SKILLS = 8;
@@ -418,8 +407,10 @@
uni.navigateTo({ url: '/pages/master/skills' });
}
const servicePopupVisible = ref(false);
function callService() {
api.contactService();
servicePopupVisible.value = true;
}
function openAgreementPicker() {

查看文件

@@ -148,18 +148,6 @@
<image class="arrow-ico" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
</view>
<!-- #ifdef MP-WEIXIN -->
<button class="menu-item menu-btn clickable-hover" open-type="contact">
<view class="menu-item-l">
<image class="menu-ico" src="/static/icons/menu-service.svg" mode="aspectFit" />
<text class="menu-txt">在线客服</text>
</view>
<view class="menu-item-r">
<image class="arrow-ico" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
</button>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view class="menu-item clickable-hover" @tap="callService">
<view class="menu-item-l">
<image class="menu-ico" src="/static/icons/menu-service.svg" mode="aspectFit" />
@@ -170,7 +158,6 @@
<image class="arrow-ico" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
</view>
<!-- #endif -->
<view class="menu-item clickable-hover" @tap="openAgreementPicker">
<view class="menu-item-l">
<image class="menu-ico" src="/static/icons/menu-agreement.svg" mode="aspectFit" />
@@ -204,6 +191,7 @@
</view>
</view>
</YjyfRefreshScroll>
<YjyfServicePopup :visible="servicePopupVisible" @update:visible="servicePopupVisible = $event" />
</view>
</template>
@@ -211,6 +199,7 @@
import { ref, computed, onMounted } from 'vue';
import YjyfNavBar from '@/components/YjyfNavBar.vue';
import YjyfRefreshScroll from '@/components/YjyfRefreshScroll.vue';
import YjyfServicePopup from '@/components/YjyfServicePopup.vue';
import api from '@/utils/api.js';
import { isLogin, toLogin, setUser, clearAuth } from '@/utils/request.js';
import { getRole, setRole } from '@/utils/role.js';
@@ -303,8 +292,10 @@
});
}
const servicePopupVisible = ref(false);
function callService() {
api.contactService();
servicePopupVisible.value = true;
}
function openAgreementPicker() {

查看文件

@@ -106,7 +106,7 @@
<image class="goods-thumb" :src="o.goods_image_url || o.service_image || '/static/icons/service-default.svg'" mode="aspectFill" />
<view class="goods-info">
<text class="goods-title">{{ o.goods_title || (o.service_name + ' x ' + (o.goods_num || 1) + '套') }}</text>
<text class="service-desc">{{ o.service_items_text || ('服务项目: ' + o.service_name + 'x' + (o.goods_num || 1) + ';') }}</text>
<text class="service-desc" v-if="formatOrderServiceItems(o)">{{ formatOrderServiceItems(o) }}</text>
</view>
</view>
@@ -261,17 +261,20 @@
</view>
</view>
</view>
<YjyfServicePopup :visible="servicePopupVisible" @update:visible="servicePopupVisible = $event" />
</view>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import { formatOrderServiceItems } from '@/utils/order-service-items.mjs';
import api from '@/utils/api.js';
import { executeOrderWxPay } from '@/utils/pay.js';
import { isLogin, toLogin } from '@/utils/request.js';
import { getNavBarMetrics } from '@/utils/system.js';
import YjyfNavBar from '@/components/YjyfNavBar.vue';
import YjyfRefreshScroll from '@/components/YjyfRefreshScroll.vue';
import YjyfServicePopup from '@/components/YjyfServicePopup.vue';
const stickyTop = ref(64);
function updateStickyTop() {
@@ -394,8 +397,10 @@
});
}
const servicePopupVisible = ref(false);
function contactService() {
api.contactService();
servicePopupVisible.value = true;
}
function contactMaster(o) {

查看文件

@@ -50,7 +50,7 @@
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "wx40ca4b02d4d1cb58",
"appid" : null,
"setting" : {
"urlCheck" : false,
"es6" : true,

查看文件

@@ -1,6 +1,6 @@
<template>
<view class="page">
<YjyfNavBar theme="orange" title="师傅入驻" />
<YjyfNavBar theme="white" title="师傅入驻" :border="true" />
<view class="loading-box" v-if="loading">
<text class="loading-txt">正在加载认证信息...</text>
@@ -8,7 +8,7 @@
<template v-else>
<!-- 审核状态提示条 -->
<view class="status-banner" v-if="info" :class="'st-' + info.master.verify_status">
<view class="status-banner" v-if="info && info.master" :class="'st-' + info.master.verify_status">
<view class="sb-top">
<text class="sb-title">审核状态:{{ statusText }}</text>
</view>
@@ -16,92 +16,155 @@
</view>
<!-- 入驻或驳回修改表单 -->
<view class="card" v-if="canEdit">
<view class="section-title">实名基本资料</view>
<view class="fi">
<text class="fk">真实姓名</text>
<input class="fv" v-model="form.realname" placeholder="请填写与身份证一致的姓名" />
<template v-if="canEdit">
<!-- 未登录引导条 -->
<view class="login-tip-bar" v-if="!loggedIn">
<text class="login-tip-txt">请先登录账号,再上传证件并提交实名入驻</text>
<view class="login-tip-btn clickable-hover" @tap="toLogin">
<text class="login-tip-btn-txt">去登录</text>
</view>
</view>
<view class="fi">
<text class="fk">联系电话</text>
<input class="fv" v-model="form.mobile" type="number" maxlength="11" placeholder="请输入 11 位接单手机号" />
<!-- 轻量三步导引条 -->
<view class="step-bar">
<view class="step-item" :class="{ done: step1Done, active: !step1Done }">
<view class="step-num"><text class="step-num-txt">1</text></view>
<text class="step-label">上传证件</text>
</view>
<view class="step-line" :class="{ done: step1Done }"></view>
<view class="step-item" :class="{ done: step2Done, active: step1Done && !step2Done }">
<view class="step-num"><text class="step-num-txt">2</text></view>
<text class="step-label">核对资料</text>
</view>
<view class="step-line" :class="{ done: step2Done }"></view>
<view class="step-item" :class="{ done: step3Done, active: step1Done && step2Done && !step3Done }">
<view class="step-num"><text class="step-num-txt">3</text></view>
<text class="step-label">服务类目</text>
</view>
</view>
<view class="fi">
<text class="fk">身份证号</text>
<input class="fv" v-model="form.idcard_no" maxlength="18" placeholder="请输入 18 位二代身份证号" />
<!-- 第一步:上传身份证件(支持 AI 智能识别) -->
<view class="card">
<view class="section-head">
<text class="section-title">1. 上传身份证件</text>
<text class="section-sub">自动识别姓名与证件号</text>
</view>
<view class="cert-grid">
<view class="cert-box clickable-hover" @tap="uploadCert('front')">
<view v-if="uploadingSide === 'front'" class="cert-ph">
<text class="cert-ph-t">上传识别中...</text>
</view>
<template v-else-if="form.idcard_front">
<image class="cert-img" :src="getWatermarkUrl(form.idcard_front)" mode="aspectFit" />
<view class="cert-reupload">
<text class="cert-reupload-txt">点击更换</text>
</view>
</template>
<view v-else class="cert-ph">
<image class="cert-cam" src="/static/icons/camera.svg" mode="aspectFit" />
<text class="cert-ph-t">身份证人像面</text>
<text class="cert-ph-s">点击拍摄 / 上传</text>
</view>
</view>
<view class="cert-box clickable-hover" @tap="uploadCert('back')">
<view v-if="uploadingSide === 'back'" class="cert-ph">
<text class="cert-ph-t">上传核验中...</text>
</view>
<template v-else-if="form.idcard_back">
<image class="cert-img" :src="getWatermarkUrl(form.idcard_back)" mode="aspectFit" />
<view class="cert-reupload">
<text class="cert-reupload-txt">点击更换</text>
</view>
</template>
<view v-else class="cert-ph">
<image class="cert-cam" src="/static/icons/camera.svg" mode="aspectFit" />
<text class="cert-ph-t">身份证国徽面</text>
<text class="cert-ph-s">点击拍摄 / 上传</text>
</view>
</view>
</view>
<view class="expired-tip" v-if="isExpired">
<text class="expired-tip-txt">检测到身份证已过期({{ validDate }}),请更换有效证件后提交</text>
</view>
</view>
<view class="fi no-border">
<text class="fk">服务地区</text>
<!-- #ifdef MP-WEIXIN -->
<picker class="region-picker" mode="region" :value="[form.province, form.city, form.district]" @change="onRegionChange">
<view class="picker-row">
<text class="picker-val" :class="{ placeholder: !displayRegion }">{{ displayRegion || '点击选择常驻服务省市区' }}</text>
<!-- 第二步:核对实名与接单资料 -->
<view class="card">
<view class="section-head">
<text class="section-title">2. 核对实名与接单资料</text>
</view>
<view class="fi">
<text class="fk">真实姓名</text>
<input class="fv" v-model="form.realname" placeholder="上传人像面后自动识别,可核对修改" />
</view>
<view class="fi">
<text class="fk">身份证号</text>
<input class="fv" v-model="form.idcard_no" maxlength="18" placeholder="上传人像面后自动识别,可核对修改" />
</view>
<view class="fi">
<text class="fk">联系电话</text>
<input class="fv" v-model="form.mobile" type="number" maxlength="11" placeholder="请输入 11 位接单手机号" />
</view>
<view class="fi no-border">
<text class="fk">服务地区</text>
<view class="picker-row region-picker clickable-hover" @tap="showRegionDrawer = true">
<text class="picker-val" :class="{ placeholder: !displayRegion }">{{ displayRegion || '点击选择服务地区' }}</text>
<image class="picker-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
</picker>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view class="picker-row region-picker clickable-hover" @tap="showRegionDrawer = true">
<text class="picker-val" :class="{ placeholder: !displayRegion }">{{ displayRegion || '点击选择常驻服务省市区' }}</text>
<image class="picker-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
<!-- #endif -->
</view>
<view class="section-title mt">主营服务类目(可多选)</view>
<view class="cats">
<view
v-for="c in cats"
:key="c.id"
class="cat clickable-hover"
:class="{ on: skills.indexOf(c.id) > -1 }"
@tap="toggleSkill(c.id)"
>
<text class="cat-txt">{{ c.name }}</text>
</view>
</view>
<view class="section-title mt">身份证件照片(必传,支持智能识别回填)</view>
<view class="cert-grid">
<view class="cert-box clickable-hover" @tap="uploadCert('front')">
<image v-if="form.idcard_front" class="cert-img" :src="getWatermarkUrl(form.idcard_front)" mode="aspectFill" />
<view v-else class="cert-ph">
<image class="cert-cam" src="/static/icons/camera.svg" mode="aspectFit" />
<text class="cert-ph-t">身份证人像面</text>
<text class="cert-ph-s">点击上传(自动提取信息)</text>
<!-- 第三步:主营服务类目 + 提交 -->
<view class="card">
<view class="section-head">
<text class="section-title">3. 主营服务类目(可多选)</text>
<text class="section-sub" v-if="skills.length">已选 {{ skills.length }} 项</text>
</view>
<view class="cats" v-if="cats.length">
<view
v-for="c in cats"
:key="c.id"
class="cat clickable-hover"
:class="{ on: skills.indexOf(c.id) > -1 }"
@tap="toggleSkill(c.id)"
>
<text class="cat-txt">{{ c.name }}</text>
</view>
</view>
<view class="cert-box clickable-hover" @tap="uploadCert('back')">
<image v-if="form.idcard_back" class="cert-img" :src="getWatermarkUrl(form.idcard_back)" mode="aspectFill" />
<view v-else class="cert-ph">
<image class="cert-cam" src="/static/icons/camera.svg" mode="aspectFit" />
<text class="cert-ph-t">身份证国徽面</text>
<text class="cert-ph-s">点击上传(核验有效期限)</text>
<view class="cats-empty" v-else>
<text class="cats-empty-txt">{{ catsError ? '服务类目加载失败' : '暂无可选服务类目' }}</text>
<view class="cats-retry clickable-hover" @tap="loadCats">
<text class="cats-retry-txt">重新加载</text>
</view>
</view>
</view>
<!-- 入驻协议勾选 -->
<view class="agree-row" @tap="agreed = !agreed">
<image
class="agree-ico"
:src="agreed ? '/static/icons/invoice-check-on.svg' : '/static/icons/invoice-check-off.svg'"
mode="aspectFit"
/>
<text class="agree-txt">我已阅读并同意</text>
<text class="agree-link" @tap.stop="openAgreement">《师傅入驻与履约服务协议》</text>
</view>
<!-- 入驻协议勾选 -->
<view class="agree-row" @tap="agreed = !agreed">
<image
class="agree-ico"
:src="agreed ? '/static/icons/invoice-check-on.svg' : '/static/icons/invoice-check-off.svg'"
mode="aspectFit"
/>
<text class="agree-txt">我已阅读并同意</text>
<text class="agree-link" @tap.stop="openAgreement">《师傅入驻与履约服务协议》</text>
</view>
<view class="submit-btn clickable-hover" :class="{ disabled: submitting }" @tap="submit">
<text class="submit-txt">{{ submitting ? '正在进行实名核验...' : '提交实名认证' }}</text>
<view class="submit-btn clickable-hover" :class="{ disabled: submitting }" @tap="submit">
<text class="submit-txt">{{ submitting ? '正在进行实名核验...' : '提交实名认证' }}</text>
</view>
</view>
</view>
</template>
<!-- 已提交待审或已认证档案卡(对标奇兵到家电子工牌大卡) -->
<!-- 已提交待审或已认证档案卡 -->
<view class="card badge-card" v-else-if="info && info.master">
<view class="badge-top">
<view class="badge-avatar-wrap">
<image class="badge-avatar-img" src="/static/icons/avatar-master.svg" mode="aspectFit" />
<image
class="badge-avatar-img"
:src="info.master.avatar || '/static/icons/avatar-master.svg'"
mode="aspectFill"
/>
<view class="v-auth-badge">
<image class="v-badge-ico" src="/static/icons/v-auth.svg" mode="aspectFit" />
<text class="v-badge-txt">{{ info.master.verify_status === 'pass' ? '已实名' : '审核中' }}</text>
@@ -109,13 +172,8 @@
</view>
</view>
<view class="badge-info-row">
<view class="badge-info-left">
<text class="badge-master-name">{{ masterTitleName }}</text>
<text class="badge-master-mobile">{{ info.master.mobile }}</text>
</view>
<view class="badge-qr-box">
<image class="badge-qr-img" src="/static/icons/qrcode.svg" mode="aspectFit" />
</view>
<text class="badge-master-name">{{ masterTitleName }}</text>
<text class="badge-master-mobile">{{ info.master.mobile }}</text>
</view>
<view class="badge-divider"></view>
<view class="li">
@@ -151,6 +209,7 @@
:province="form.province"
:city="form.city"
:district="form.district"
:allow-city-level="true"
@confirm="onDrawerRegionConfirm"
/>
</view>
@@ -168,8 +227,10 @@
const MASTER_AGREEMENT_EVENT = 'master_apply_agreement_confirm';
const loading = ref(true);
const loggedIn = ref(isLogin());
const info = ref(null);
const cats = ref([]);
const catsError = ref(false);
const skills = ref([]);
const submitting = ref(false);
const agreed = ref(false);
@@ -195,6 +256,10 @@
return parts.join(' ');
});
const step1Done = computed(() => !!(form.idcard_front && form.idcard_back && !isExpired.value));
const step2Done = computed(() => !!(form.realname.trim() && form.idcard_no.trim() && form.mobile.trim() && displayRegion.value));
const step3Done = computed(() => skills.value.length > 0 && agreed.value);
useShare(() => ({
title: '优匠优服师傅入驻 · 实名技能认证接同城工单',
path: '/pages/master/apply',
@@ -210,17 +275,25 @@
const masterTitleName = computed(() => {
if (!info.value || !info.value.master || !info.value.master.realname) return '优匠师傅';
const rn = info.value.master.realname.trim();
return (rn.length > 0 ? rn.slice(0, 1) : '') + '师傅';
if (!rn) return '优匠师傅';
if (rn.includes('师傅')) return rn;
return rn.slice(0, 1) + '师傅';
});
const canEdit = computed(() => !info.value || !info.value.applied || info.value.master.verify_status === 'reject');
function onRegionChange(e) {
const arr = e.detail.value || [];
if (arr.length >= 2) {
form.province = arr[0] || '';
form.city = arr[1] || '';
form.district = arr[2] || '';
function parseCityFallback(cityStr) {
const parts = String(cityStr || '').trim().split(/\s+/).filter(Boolean);
if (parts.length === 1) {
form.city = parts[0];
} else if (parts.length === 2) {
form.province = parts[0];
form.city = parts[0];
form.district = parts[1];
} else if (parts.length >= 3) {
form.province = parts[0];
form.city = parts[1];
form.district = parts[2];
}
}
@@ -242,11 +315,6 @@
uni.reLaunch({ url: '/pages/master/workbench' });
}
function goHall() {
setRole('master');
uni.reLaunch({ url: '/pages/master/hall' });
}
function openAgreement() {
uni.navigateTo({
url: `/pages/agreement/detail?type=master&title=${encodeURIComponent('师傅入驻与履约服务协议')}&confirmEvent=${encodeURIComponent(MASTER_AGREEMENT_EVENT)}`
@@ -264,7 +332,7 @@
const isExpired = ref(false);
const validDate = ref('');
// 方案1:腾讯云数据万象动态防伪水印
// 腾讯云数据万象动态防伪水印(仅用于前端预览)
function getWatermarkUrl(url) {
if (!url) return '';
if ((url.includes('myqcloud.com') || url.includes('cos.')) && !url.includes('watermark')) {
@@ -290,29 +358,29 @@
uploadingSide.value = side;
uploadingCert.value = true;
uni.showLoading({ title: '证件上传中...', mask: true });
let toastPayload = null;
try {
const up = await api.upload(temp, 'cert');
const imgUrl = up.fullurl || up.url;
if (side === 'front') {
form.idcard_front = imgUrl;
// 调用腾讯云 OCR 智能识别姓名与身份证号
uni.showLoading({ title: 'AI 识别信息中...', mask: true });
try {
const ocrRes = await api.masterOcrIdCard({ image: imgUrl, side: 'front' });
if (ocrRes && (ocrRes.name || ocrRes.idcard_no)) {
if (ocrRes.name) form.realname = ocrRes.name;
if (ocrRes.idcard_no) form.idcard_no = ocrRes.idcard_no;
uni.showToast({
toastPayload = {
title: `已识别:${ocrRes.name || '姓名与证件号已填入'}`,
icon: 'success',
duration: 2000
});
};
} else {
uni.showToast({ title: '已上传,请核对姓名与证件号', icon: 'none' });
toastPayload = { title: '已上传,请核对姓名与证件号', icon: 'none' };
}
} catch (ocrErr) {
const msg = ocrErr?.message || ocrErr?.msg || '未能清晰识别,请手动核对';
uni.showToast({ title: msg, icon: 'none', duration: 2500 });
toastPayload = { title: msg, icon: 'none', duration: 2500 };
}
} else {
form.idcard_back = imgUrl;
@@ -322,6 +390,7 @@
validDate.value = ocrBack.valid_date;
if (ocrBack.is_expired) {
isExpired.value = true;
uni.hideLoading();
uni.showModal({
title: '身份证已过期提醒',
content: `检测到该身份证有效期截止至【${ocrBack.valid_date}】,已过有效期限,无法通过实名认证,请上传最新有效证件。`,
@@ -331,22 +400,25 @@
});
} else {
isExpired.value = false;
uni.showToast({ title: '国徽面校验通过(' + (ocrBack.expire_info?.text || ocrBack.valid_date) + ')', icon: 'success' });
toastPayload = { title: '国徽面校验通过(' + (ocrBack.expire_info?.text || ocrBack.valid_date) + ')', icon: 'success' };
}
} else {
uni.showToast({ title: '国徽面已上传', icon: 'none' });
toastPayload = { title: '国徽面已上传', icon: 'none' };
}
} catch (e) {
uni.showToast({ title: '国徽面已上传', icon: 'none' });
toastPayload = { title: '国徽面已上传', icon: 'none' };
}
}
} catch (e) {
uni.showToast({ title: '上传失败,请重新选择', icon: 'none' });
toastPayload = { title: '上传失败,请重新选择', icon: 'none' };
} finally {
uploadingSide.value = '';
uploadingCert.value = false;
isSelectingImage.value = false;
uni.hideLoading();
if (toastPayload) {
uni.showToast(toastPayload);
}
}
},
fail: () => {
@@ -356,23 +428,33 @@
}
async function load() {
if (!isLogin()) {
loggedIn.value = isLogin();
if (!loggedIn.value) {
loading.value = false;
return;
}
try {
const res = await api.masterInfo();
info.value = res.applied ? res : null;
if (res.applied) {
// 保护机制:表单中已有新输入或刚上传的值时绝不覆盖
if (res.applied && res.master) {
if (!form.realname && res.master.realname) form.realname = res.master.realname;
if (!form.mobile && res.master.mobile) form.mobile = res.master.mobile;
if (!form.province && res.master.province) form.province = res.master.province;
if (!form.city && res.master.city) form.city = res.master.city;
if (!form.district && res.master.district) form.district = res.master.district;
if (!form.province && !form.city && !form.district) {
if (res.master.province || res.master.district) {
form.province = res.master.province || '';
form.city = res.master.city || '';
form.district = res.master.district || '';
} else if (res.master.city) {
parseCityFallback(res.master.city);
}
}
if (!form.idcard_no && res.master.idcard_no) form.idcard_no = res.master.idcard_no;
if (!form.idcard_front && res.master.idcard_front) form.idcard_front = res.master.idcard_front;
if (!form.idcard_back && res.master.idcard_back) form.idcard_back = res.master.idcard_back;
if (!form.idcard_front && (res.master.idcard_front_raw || res.master.idcard_front)) {
form.idcard_front = res.master.idcard_front_raw || res.master.idcard_front;
}
if (!form.idcard_back && (res.master.idcard_back_raw || res.master.idcard_back)) {
form.idcard_back = res.master.idcard_back_raw || res.master.idcard_back;
}
if (!skills.value.length && res.skills) {
skills.value = res.skills.map(s => s.cat_id).filter(Boolean);
}
@@ -380,10 +462,20 @@
const u = getUser();
if (u && !form.mobile) form.mobile = u.mobile || '';
}
hasInitialLoaded.value = true;
} catch (e) {
} finally {
loading.value = false;
hasInitialLoaded.value = true;
}
}
async function loadCats() {
catsError.value = false;
try {
const res = await api.cats();
cats.value = res.list || [];
} catch (e) {
catsError.value = true;
}
}
@@ -394,11 +486,26 @@
return;
}
if (!form.idcard_front || !form.idcard_back) {
uni.showToast({ title: '请上传身份证人像面和国徽面照片', icon: 'none' });
uni.showToast({ title: '请先上传身份证人像面和国徽面照片', icon: 'none' });
return;
}
if (!form.realname.trim() || !form.mobile.trim() || !form.idcard_no.trim()) {
uni.showToast({ title: '请完整填写姓名、手机号与身份证号', icon: 'none' });
if (isExpired.value) {
uni.showToast({ title: '身份证已过有效期限,无法提交认证', icon: 'none', duration: 2500 });
return;
}
const realname = form.realname.trim();
const mobile = form.mobile.trim();
const idcardNo = form.idcard_no.trim().toUpperCase();
if (!realname || !mobile || !idcardNo) {
uni.showToast({ title: '请完整核对姓名、身份证号与手机号', icon: 'none' });
return;
}
if (!idcardNo.includes('*') && !/^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[\dX]$/.test(idcardNo)) {
uni.showToast({ title: '请输入有效的 18 位身份证号码', icon: 'none' });
return;
}
if (!/^1\d{10}$/.test(mobile)) {
uni.showToast({ title: '请输入正确的 11 位手机号', icon: 'none' });
return;
}
if (!displayRegion.value) {
@@ -409,21 +516,17 @@
uni.showToast({ title: '请至少选择一项主营服务类目', icon: 'none' });
return;
}
if (isExpired.value) {
uni.showToast({ title: '身份证已过有效期限,无法提交认证', icon: 'none', duration: 2500 });
return;
}
if (!agreed.value) {
uni.showToast({ title: '请先阅读并勾选入驻服务协议', icon: 'none' });
return;
}
submitting.value = true;
uni.showLoading({ title: '公安二要素实名核验中...', mask: true });
try {
const payload = {
realname: form.realname.trim(),
mobile: form.mobile.trim(),
idcard_no: form.idcard_no.trim(),
realname,
mobile,
idcard_no: idcardNo,
province: form.province.trim(),
city: (form.city || displayRegion.value).trim(),
district: form.district.trim(),
@@ -433,7 +536,6 @@
};
skills.value.forEach((id, i) => { payload['skills[' + i + ']'] = id; });
await api.masterApply(payload);
uni.hideLoading();
setRole('master');
const u = getUser() || {};
u.is_master = true;
@@ -446,7 +548,7 @@
uni.reLaunch({ url: '/pages/master/workbench' });
}, 1200);
} catch (e) {
uni.hideLoading();
// request.js 已统一弹出具体失败原因 Toast,此处保留 submits 防重恢复即可
} finally {
submitting.value = false;
}
@@ -464,13 +566,13 @@
if (isSelectingImage.value) {
return;
}
loggedIn.value = isLogin();
if (!hasInitialLoaded.value) {
await load();
}
try {
const res = await api.cats();
cats.value = res.list || [];
} catch (e) {}
if (!cats.value.length) {
await loadCats();
}
});
</script>
@@ -522,6 +624,104 @@
color: $yjyf-text-regular;
}
/* 未登录提示条 */
.login-tip-bar {
margin: 20rpx $yjyf-space-md 0;
padding: 18rpx 24rpx;
background: $yjyf-primary-bg;
border: 1rpx solid $yjyf-primary-border;
border-radius: $yjyf-radius-md;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16rpx;
}
.login-tip-txt {
flex: 1;
font-size: $yjyf-font-sub;
color: $yjyf-text-regular;
}
.login-tip-btn {
flex-shrink: 0;
height: 52rpx;
padding: 0 24rpx;
border-radius: $yjyf-radius-pill;
background: $yjyf-gradient-primary;
display: flex;
align-items: center;
justify-content: center;
}
.login-tip-btn-txt {
font-size: $yjyf-font-sub;
color: $yjyf-text-inverse;
font-weight: 600;
}
/* 轻量三步导引条 */
.step-bar {
margin: 20rpx $yjyf-space-md 0;
padding: 20rpx 24rpx;
background: $yjyf-bg-card;
border-radius: $yjyf-radius-md;
box-shadow: $yjyf-shadow-card;
display: flex;
align-items: center;
justify-content: space-between;
}
.step-item {
display: flex;
align-items: center;
gap: 10rpx;
flex-shrink: 0;
}
.step-num {
width: 36rpx;
height: 36rpx;
border-radius: 50%;
background: $yjyf-bg-page;
display: flex;
align-items: center;
justify-content: center;
}
.step-num-txt {
font-size: $yjyf-font-micro;
color: $yjyf-text-secondary;
font-weight: 700;
}
.step-label {
font-size: $yjyf-font-sub;
color: $yjyf-text-secondary;
}
.step-item.active .step-num {
background: $yjyf-primary;
}
.step-item.active .step-num-txt {
color: $yjyf-text-inverse;
}
.step-item.active .step-label {
color: $yjyf-text-main;
font-weight: 600;
}
.step-item.done .step-num {
background: $yjyf-success;
}
.step-item.done .step-num-txt {
color: $yjyf-text-inverse;
}
.step-item.done .step-label {
color: $yjyf-success;
font-weight: 600;
}
.step-line {
flex: 1;
height: 2rpx;
background: $yjyf-border-color;
margin: 0 12rpx;
}
.step-line.done {
background: $yjyf-success;
}
.card {
margin: 20rpx $yjyf-space-md 0;
padding: $yjyf-space-md;
@@ -530,14 +730,20 @@
box-shadow: $yjyf-shadow-card;
}
.section-head {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16rpx;
}
.section-title {
font-size: $yjyf-font-body;
font-weight: 700;
color: $yjyf-text-main;
margin-bottom: 12rpx;
}
.section-title.mt {
margin-top: 28rpx;
.section-sub {
font-size: $yjyf-font-micro;
color: $yjyf-text-secondary;
}
.fi {
@@ -586,7 +792,7 @@
display: flex;
flex-wrap: wrap;
gap: 16rpx;
padding-top: 8rpx;
padding-top: 4rpx;
}
.cat {
height: 64rpx;
@@ -611,14 +817,36 @@
font-weight: 600;
}
.cats-empty {
padding: 28rpx 0;
display: flex;
align-items: center;
justify-content: center;
gap: 16rpx;
}
.cats-empty-txt {
font-size: $yjyf-font-sub;
color: $yjyf-text-secondary;
}
.cats-retry {
padding: 8rpx 20rpx;
border-radius: $yjyf-radius-pill;
background: $yjyf-primary-bg;
}
.cats-retry-txt {
font-size: $yjyf-font-sub;
color: $yjyf-primary;
font-weight: 600;
}
.cert-grid {
display: flex;
gap: 20rpx;
margin-top: 12rpx;
}
.cert-box {
position: relative;
flex: 1;
height: 184rpx;
height: 196rpx;
border: 2rpx dashed $yjyf-text-disabled;
border-radius: $yjyf-radius-sm;
display: flex;
@@ -631,6 +859,18 @@
width: 100%;
height: 100%;
}
.cert-reupload {
position: absolute;
right: 8rpx;
bottom: 8rpx;
padding: 4rpx 14rpx;
border-radius: $yjyf-radius-pill;
background: rgba(31, 31, 31, 0.65);
}
.cert-reupload-txt {
font-size: $yjyf-font-micro;
color: $yjyf-text-inverse;
}
.cert-ph {
display: flex;
flex-direction: column;
@@ -651,9 +891,20 @@
color: $yjyf-text-muted;
margin-top: 4rpx;
}
.expired-tip {
margin-top: 16rpx;
padding: 14rpx 18rpx;
border-radius: $yjyf-radius-sm;
background: rgba(232, 51, 27, 0.08);
}
.expired-tip-txt {
font-size: $yjyf-font-sub;
color: $yjyf-danger;
}
.agree-row {
margin-top: 28rpx;
margin-top: 20rpx;
padding: 16rpx 0;
display: flex;
align-items: center;
}
@@ -675,16 +926,16 @@
.submit-btn {
height: 88rpx;
margin-top: 28rpx;
margin-top: 16rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: $yjyf-radius-pill;
background: $yjyf-gradient-primary;
box-shadow: $yjyf-shadow-card;
box-shadow: $yjyf-shadow-button;
}
.submit-txt {
color: $yjyf-bg-card;
color: $yjyf-text-inverse;
font-size: $yjyf-font-body;
font-weight: 700;
}
@@ -719,10 +970,10 @@
justify-content: center;
border-radius: $yjyf-radius-pill;
background: $yjyf-gradient-primary;
box-shadow: $yjyf-shadow-card;
box-shadow: $yjyf-shadow-button;
}
.go-txt {
color: $yjyf-bg-card;
color: $yjyf-text-inverse;
font-size: $yjyf-font-body;
font-weight: 700;
}
@@ -732,7 +983,7 @@
margin-left: 8rpx;
}
/* 对标奇兵到家电子工牌大卡 */
/* 电子工牌大卡 */
.badge-card {
padding: 36rpx 32rpx;
}
@@ -745,77 +996,70 @@
width: 140rpx;
height: 140rpx;
border-radius: 70rpx;
border: 4rpx solid #FFA93F;
background: #FFF7EC;
border: 4rpx solid $yjyf-primary-light;
background: $yjyf-primary-bg;
display: flex;
align-items: center;
justify-content: center;
position: relative;
box-shadow: 0 4rpx 16rpx rgba(240, 113, 13, 0.15);
box-shadow: $yjyf-shadow-card;
}
.badge-avatar-img {
width: 96rpx;
height: 96rpx;
width: 128rpx;
height: 128rpx;
border-radius: 64rpx;
}
.v-auth-badge {
position: absolute;
bottom: -10rpx;
bottom: -12rpx;
left: 50%;
transform: translateX(-50%);
display: flex;
display: inline-flex;
align-items: center;
width: max-content;
height: 36rpx;
padding: 0 12rpx 0 6rpx;
background: #FFF5E5;
border: 1rpx solid #FFD39B;
border-radius: 18rpx;
box-shadow: 0 2rpx 8rpx rgba(240, 113, 13, 0.2);
padding: 0 14rpx 0 8rpx;
background: $yjyf-primary-bg;
border: 1rpx solid $yjyf-primary-light;
border-radius: $yjyf-radius-pill;
box-shadow: $yjyf-shadow-card;
white-space: nowrap;
}
.v-badge-ico {
width: 26rpx;
height: 26rpx;
width: 24rpx;
height: 24rpx;
margin-right: 4rpx;
flex-shrink: 0;
}
.v-badge-txt {
font-size: 20rpx;
font-size: $yjyf-font-micro;
font-weight: 700;
color: #E36B0C;
color: $yjyf-primary;
line-height: 1;
white-space: nowrap;
flex-shrink: 0;
}
.badge-info-row {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10rpx 10rpx 20rpx;
}
.badge-info-left {
display: flex;
flex-direction: column;
align-items: center;
padding: 12rpx 10rpx 24rpx;
}
.badge-master-name {
font-size: 38rpx;
font-weight: 800;
color: #1F1F1F;
line-height: 1.2;
font-size: $yjyf-font-lg;
font-weight: 700;
color: $yjyf-text-main;
line-height: 1.3;
margin-bottom: 8rpx;
}
.badge-master-mobile {
font-size: 28rpx;
color: #444444;
font-size: $yjyf-font-body;
color: $yjyf-text-regular;
font-family: monospace;
}
.badge-qr-box {
width: 88rpx;
height: 88rpx;
}
.badge-qr-img {
width: 100%;
height: 100%;
}
.badge-divider {
height: 1rpx;
background: #F0F0F2;
background: $yjyf-border-color;
margin-bottom: 20rpx;
}
</style>

查看文件

@@ -590,7 +590,7 @@
</view>
</view>
<!-- ==================== 抽屉 4:输入客户 4 位核销码结算 ==================== -->
<!-- ==================== 抽屉 4:输入客户 6 位核销码结算 ==================== -->
<view class="drawer-mask" v-if="showVerify" @tap="showVerify = false">
<view class="drawer-panel" @tap.stop>
<view class="dp-head">
@@ -600,14 +600,14 @@
</view>
</view>
<text class="dp-sub-tip">请向客户索取订单详情页中的 4 位数字验收码,核销成功后工钱即刻结算至您的钱包</text>
<text class="dp-sub-tip">请向客户索取订单详情页中的 6 位数字验收码,核销成功后工钱即刻结算至您的钱包</text>
<input
class="verify-code-input"
type="number"
maxlength="6"
v-model="verifyCodeVal"
placeholder="请输入 4 位核销码"
placeholder="请输入 6 位核销码"
/>
<view class="dp-submit clickable-hover" :class="{ disabled: submitting }" @tap="submitVerifyCode">
@@ -666,6 +666,7 @@
canvas-id="detailWatermarkCanvas"
:style="{ width: canvasW + 'px', height: canvasH + 'px', position: 'fixed', left: '-9999px', top: '-9999px' }"
></canvas>
<YjyfServicePopup :visible="servicePopupVisible" @update:visible="servicePopupVisible = $event" />
</view>
</template>
@@ -673,6 +674,7 @@
import { ref, reactive, computed, onBeforeUnmount, getCurrentInstance } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
import YjyfNavBar from '@/components/YjyfNavBar.vue';
import YjyfServicePopup from '@/components/YjyfServicePopup.vue';
import api from '@/utils/api.js';
import { isLogin, toLogin } from '@/utils/request.js';
@@ -776,7 +778,7 @@
if (st === 4) return '请携带专业工具准时上门,到达后点击现场打卡';
if (st === 5) return '已到达服务地点,与客户确认商品无误后开始施工';
if (st === 6) return '施工完成后请拍摄现场水印照片提交验收';
if (st === 7) return '等待客户确认验收,您也可向客户索取 4 位核销码当场结算';
if (st === 7) return '等待客户确认验收,您也可向客户索取 6 位核销码当场结算';
if (st === 8) return '工单已核销完成,服务报酬已结算至您的师傅钱包';
if (st === 9) return '该工单已取消';
return '售后跟进处理中';
@@ -1163,8 +1165,8 @@
async function submitVerifyCode() {
if (submitting.value || !order.value) return;
const code = verifyCodeVal.value.trim();
if (code.length < 4) {
uni.showToast({ title: '请输入正确的客户验收核销码', icon: 'none' });
if (!/^\d{6}$/.test(code)) {
uni.showToast({ title: '请输入 6 位数字验收核销码', icon: 'none' });
return;
}
submitting.value = true;
@@ -1246,8 +1248,10 @@
});
}
const servicePopupVisible = ref(false);
function contactPlatform() {
api.contactService();
servicePopupVisible.value = true;
}
function goWallet() {

查看文件

@@ -572,16 +572,26 @@
onLoad(async (options) => {
if (!isLogin()) { toLogin(); return; }
uni.$on('selectAddress', onAddressSelectedEvent);
serviceId = Number(options.service_id || 0);
const res = await api.serviceDetail(serviceId);
svc.value = res.detail;
if (svc.value?.pricing_revision != null) {
serviceId = Number((options && (options.service_id || options.id)) || 0);
if (!serviceId) {
uni.redirectTo({ url: '/pages/order/quick' });
return;
}
try {
const res = await api.serviceDetail(serviceId);
svc.value = res && res.detail ? res.detail : null;
} catch (e) {
svc.value = null;
}
if (!svc.value) {
uni.redirectTo({ url: '/pages/order/quick' });
return;
}
if (svc.value.pricing_revision != null) {
uni.redirectTo({ url: `/pages/order/quick?service_id=${serviceId}&cat_id=${svc.value.cat_id}` });
return;
}
if (svc.value) {
goodsGroups.value[0].goods_name = svc.value.name;
}
goodsGroups.value[0].goods_name = svc.value.name;
priceType.value = svc.value.price_type === 'quote' ? 'quote'
: (svc.value.price_type === 'range' ? 'custom' : 'fixed');
await loadAddress();

查看文件

@@ -75,7 +75,7 @@
/>
<view class="goods-texts">
<text class="goods-name">{{ g.goods_name }}{{ g.goods_model ? `(${g.goods_model})` : '' }} x {{ g.goods_num }}{{ g.unit || '套' }}</text>
<text class="goods-sub">服务项目: {{ formatGoodsServiceText(g) }}</text>
<text class="goods-sub" v-if="formatGoodsServiceText(g)">服务项目: {{ formatGoodsServiceText(g) }}</text>
<text class="goods-sub" v-if="g.goods_remark">商品备注: {{ g.goods_remark }}</text>
</view>
</view>
@@ -416,13 +416,16 @@
<video class="vp-player" :src="activeVideoUrl" controls autoplay />
</view>
</view>
<YjyfServicePopup :visible="servicePopupVisible" @update:visible="servicePopupVisible = $event" />
</view>
</template>
<script setup>
import { ref, computed } from 'vue';
import { formatServiceItems } from '@/utils/order-service-items.mjs';
import { onLoad, onShow } from '@dcloudio/uni-app';
import YjyfNavBar from '@/components/YjyfNavBar.vue';
import YjyfServicePopup from '@/components/YjyfServicePopup.vue';
import api from '@/utils/api.js';
import { executeOrderWxPay } from '@/utils/pay.js';
@@ -451,13 +454,9 @@
function formatGoodsServiceText(g) {
if (g && g.addon_services) {
return String(g.addon_services).replace(/(x\d+)\1+/gi, '$1');
return formatServiceItems(g.addon_services, g.service_type_name, g.goods_num).replace(/^服务项目[::]\s*/, '').replace(/(x\d+)\1+/gi, '$1');
}
const base = (order.value && order.value.service_name) ? String(order.value.service_name).trim() : '安装';
if (/x\d+;?$/i.test(base)) {
return base.endsWith(';') ? base : (base + ';');
}
return `${base}x${(g && g.goods_num) || 1};`;
return g && g.service_type_name && g.goods_num ? `${g.service_type_name}x${g.goods_num}` : '';
}
const displayGoodsList = computed(() => {
@@ -515,8 +514,10 @@
});
}
const servicePopupVisible = ref(false);
function contactService() {
api.contactService();
servicePopupVisible.value = true;
}
function goMasterReviews(mid) {

查看文件

@@ -97,6 +97,7 @@
<image class="empty-ico" src="/static/icons/empty-service.svg" mode="aspectFit" />
<text class="empty-title">未找到该服务项目</text>
</view>
<YjyfServicePopup :visible="servicePopupVisible" @update:visible="servicePopupVisible = $event" />
</view>
</template>
@@ -105,6 +106,7 @@
import { onLoad } from '@dcloudio/uni-app';
import api from '@/utils/api.js';
import { useShare, triggerCustomShare } from '@/utils/share.js';
import YjyfServicePopup from '@/components/YjyfServicePopup.vue';
const detail = ref(null);
const loading = ref(true);
@@ -133,8 +135,10 @@
triggerCustomShare(getSharePayload());
}
const servicePopupVisible = ref(false);
function onContactService() {
api.contactService();
servicePopupVisible.value = true;
}
function goCreate() {

查看文件

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64" fill="none">
<path d="M32 10C22.0589 10 14 18.0589 14 28C14 39.8 28.4 51.6 30.8 53.5C31.51 54.06 32.49 54.06 33.2 53.5C35.6 51.6 50 39.8 50 28C50 18.0589 41.9411 10 32 10Z" stroke="#FFFFFF" stroke-width="3.6" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M33.5 20L26.5 29.5H32L30.5 36L37.5 26.5H32L33.5 20Z" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

之后

宽度:  |  高度:  |  大小: 514 B

查看文件

@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="48" height="48" fill="none">
<rect x="4" y="4" width="40" height="40" rx="14" fill="#EBF9EF"/>
<path d="M16.2 14.5C16.8 13.9 17.8 13.9 18.4 14.5L21.3 17.4C21.9 18 21.9 19 21.3 19.6L19.6 21.3C20.5 23.2 21.9 24.8 23.7 26.2C24.5 26.8 25.4 27.4 26.4 27.9L28.1 26.2C28.7 25.6 29.7 25.6 30.3 26.2L33.2 29.1C33.8 29.7 33.8 30.7 33.2 31.3L31.4 33.1C30.1 34.4 28.1 34.8 26.4 34C21.1 31.6 16.4 26.9 14 21.6C13.2 19.9 13.6 17.9 14.9 16.6L16.2 14.5Z" fill="#FFFFFF" stroke="#2FA84F" stroke-width="2.6" stroke-linejoin="round"/>
<path d="M27 14.5C29.8 14.8 32.2 17.2 32.5 20" stroke="#2FA84F" stroke-width="2.4" stroke-linecap="round"/>
<path d="M27 18.2C28.2 18.5 29.1 19.4 29.4 20.6" stroke="#2FA84F" stroke-width="2.4" stroke-linecap="round"/>
</svg>

之后

宽度:  |  高度:  |  大小: 816 B

查看文件

@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="48" height="48" fill="none">
<rect x="4" y="4" width="40" height="40" rx="14" fill="#FFF7F0"/>
<path d="M13 21C13 15.4772 17.9249 11 24 11C30.0751 11 35 15.4772 35 21C35 26.5228 30.0751 31 24 31C22.4264 31 20.9301 30.6996 19.5764 30.158L14.5 33L15.7248 28.1008C14.0176 26.2839 13 23.773 13 21Z" fill="#FFFFFF" stroke="#F0710D" stroke-width="2.8" stroke-linejoin="round"/>
<circle cx="19.5" cy="21" r="1.6" fill="#F0710D"/>
<circle cx="24" cy="21" r="1.6" fill="#F0710D"/>
<circle cx="28.5" cy="21" r="1.6" fill="#F0710D"/>
</svg>

之后

宽度:  |  高度:  |  大小: 607 B

查看文件

@@ -140,22 +140,60 @@ export default {
invoiceTitleDefault: (id) => post('/invoice/titleDefault', { id: id }),
invoiceTitleDelete: (id) => post('/invoice/titleDelete', { id: id }),
/* ---------- 平台客服统一助手(仅读取后端真实配置,杜绝假号码与并发连击) ---------- */
/* ---------- 平台客服配置读取与统一助手(仅读取后端真实配置,杜绝假号码与并发连击) ---------- */
getCachedServiceConfig: function () {
try {
const cached = uni.getStorageSync('yjyf_service_config');
if (cached && typeof cached === 'object') {
return {
service_phone: String(cached.service_phone || '').trim(),
service_work_time: String(cached.service_work_time || '').trim(),
service_corp_id: String(cached.service_corp_id || '').trim(),
service_kf_url: String(cached.service_kf_url || '').trim(),
};
}
} catch (e) {}
const legacyPhone = String(uni.getStorageSync('yjyf_service_phone') || '').trim();
return {
service_phone: legacyPhone,
service_work_time: '',
service_corp_id: '',
service_kf_url: '',
};
},
getServiceConfig: async function (force = false) {
const cached = this.getCachedServiceConfig();
if (!force && (cached.service_phone || cached.service_corp_id || cached.service_kf_url)) {
return cached;
}
try {
const res = await get('/home/serviceConfig', {}, { silent: true });
if (res && typeof res === 'object') {
const cfg = {
service_phone: String(res.service_phone || '').trim(),
service_work_time: String(res.service_work_time || '').trim(),
service_corp_id: String(res.service_corp_id || '').trim(),
service_kf_url: String(res.service_kf_url || '').trim(),
};
uni.setStorageSync('yjyf_service_config', cfg);
if (cfg.service_phone) {
uni.setStorageSync('yjyf_service_phone', cfg.service_phone);
} else {
uni.removeStorageSync('yjyf_service_phone');
}
return cfg;
}
} catch (e) {
console.warn('获取客服配置失败', e);
}
return cached;
},
_contactingService: false,
contactService: async function () {
if (this._contactingService) return;
this._contactingService = true;
let phone = '';
try {
phone = uni.getStorageSync('yjyf_service_phone') || '';
if (!phone) {
const res = await get('/home/index', {}, { silent: true });
if (res && res.service_phone) {
phone = String(res.service_phone).trim();
uni.setStorageSync('yjyf_service_phone', phone);
}
}
} catch (e) {}
const cfg = await this.getServiceConfig(true);
const phone = cfg.service_phone || '';
setTimeout(() => { this._contactingService = false; }, 500);
if (phone) {
uni.makePhoneCall({ phoneNumber: phone, fail: () => {} });

查看文件

@@ -0,0 +1,39 @@
export function formatServiceItems(value, mainName = '', quantity = null) {
if (value == null) return '';
let prefix = '';
let items = value;
if (typeof items === 'string') {
items = items.trim();
const match = items.match(/^服务项目[::]\s*/);
if (match) {
prefix = match[0];
items = items.slice(match[0].length).trim();
}
if (!/^[\[{]/.test(items)) return prefix + items;
try { items = JSON.parse(items); } catch (_) { return ''; }
}
if (!Array.isArray(items)) return '';
const parts = [];
if (mainName && quantity != null && Number(quantity) > 0) parts.push(`${mainName}x${quantity}`);
items.forEach(item => {
if (!item || typeof item.name !== 'string' || !item.name.trim()) return;
const count = item.num != null ? item.num : item.count;
if (count != null && Number(count) <= 0) return;
parts.push(item.name.trim() + (count != null ? `x${count}` : ''));
});
return parts.length ? prefix + parts.join(';') : '';
}
export function formatOrderServiceItems(order) {
let main = '';
let quantity = null;
try {
const snapshot = typeof order.goods_images === 'string' ? JSON.parse(order.goods_images) : order.goods_images;
const first = snapshot && Array.isArray(snapshot.goods_list) ? snapshot.goods_list[0] : null;
if (first) {
main = first.service_type_name || '';
quantity = first.num != null ? first.num : first.goods_num;
}
} catch (_) {}
return formatServiceItems(order.service_items_text, main, quantity);
}