feat: 新增平台客服配置及弹窗组件
- 新增客服电话、服务时间、企业微信客服配置项 - 新增客服弹窗组件支持微信在线客服和电话拨打 - 调整核销码为6位数字,修复相关提示文本 - 优化订单服务项目展示逻辑 - 完善抢单大厅加载动画和列表样式
这个提交包含在:
13
tests/order_service_items.mjs
普通文件
13
tests/order_service_items.mjs
普通文件
@@ -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');
|
||||
|
||||
|
||||
11
tests/order_service_snapshot.php
普通文件
11
tests/order_service_snapshot.php
普通文件
@@ -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";
|
||||
在新工单中引用
屏蔽一个用户