revert(order): 移除订单站内聊天,沟通统一走官方客服
- 删除 pages/order/chat、聊天接口/仓储方法/order_messages 建表与客户端 API - 买家「联系大神」、大神「联系老板」、大神详情「在线客服」、组局「私聊」统一改为 openSupportSheet(读取后台 customer_service 配置的客服微信/热线) - 保留派单实时通知与雷达/大厅轮询 - 114 套件/742 用例全绿;聊天接口线上已 404
这个提交包含在:
@@ -706,21 +706,6 @@ export async function getOrdersPool(options = {}) {
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单站内聊天(仅交易双方)
|
||||
*/
|
||||
export async function getOrderChat(orderId) {
|
||||
return http.get(`/orders/${encodeURIComponent(orderId)}/chat`);
|
||||
}
|
||||
|
||||
export async function sendOrderMessage(orderId, content) {
|
||||
return http.post(`/orders/${encodeURIComponent(orderId)}/chat/messages`, { content });
|
||||
}
|
||||
|
||||
export async function markOrderChatRead(orderId) {
|
||||
return http.post(`/orders/${encodeURIComponent(orderId)}/chat/read`, {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 坐标反查行政区/地址(雷达顶部定位文案)
|
||||
*/
|
||||
|
||||
60
pwuniapp/common/support.js
普通文件
60
pwuniapp/common/support.js
普通文件
@@ -0,0 +1,60 @@
|
||||
// pwuniapp/common/support.js
|
||||
// 统一客服入口:平台沟通仅通过官方客服微信/热线,不在买卖双方之间直接建立联系。
|
||||
import { getPlatformConfigs } from '@/common/api.js';
|
||||
|
||||
let cachedContact = null;
|
||||
let cachedAt = 0;
|
||||
|
||||
export async function getSupportContact() {
|
||||
if (cachedContact && Date.now() - cachedAt < 5 * 60 * 1000) {
|
||||
return cachedContact;
|
||||
}
|
||||
let hotline = '';
|
||||
let wechat = '';
|
||||
try {
|
||||
const configs = await getPlatformConfigs();
|
||||
const cs = (configs && configs.customer_service) || {};
|
||||
hotline = String(cs.hotline || '').trim();
|
||||
wechat = String(cs.wechat || '').trim();
|
||||
} catch (_) {
|
||||
// 配置拉取失败时使用空值,避免展示写死的客服账号
|
||||
}
|
||||
cachedContact = { hotline, wechat };
|
||||
cachedAt = Date.now();
|
||||
return cachedContact;
|
||||
}
|
||||
|
||||
export async function openSupportSheet() {
|
||||
const contact = await getSupportContact();
|
||||
const actions = [];
|
||||
if (contact.wechat) actions.push({ key: 'wechat', label: `复制客服微信(${contact.wechat})` });
|
||||
if (contact.hotline) actions.push({ key: 'hotline', label: `拨打客服热线(${contact.hotline})` });
|
||||
|
||||
if (actions.length === 0) {
|
||||
uni.showToast({ title: '客服信息暂未配置,请稍后再试', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
|
||||
uni.showActionSheet({
|
||||
itemList: actions.map((a) => a.label),
|
||||
success: (res) => {
|
||||
const picked = actions[res.tapIndex];
|
||||
if (!picked) return;
|
||||
if (picked.key === 'wechat') {
|
||||
uni.setClipboardData({
|
||||
data: contact.wechat,
|
||||
success: () => {
|
||||
uni.showToast({ title: '客服微信已复制,请前往微信添加', icon: 'none', duration: 2200 });
|
||||
}
|
||||
});
|
||||
} else if (picked.key === 'hotline') {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: contact.hotline.replace(/[^0-9+]/g, ''),
|
||||
fail: () => {
|
||||
uni.showToast({ title: `客服热线:${contact.hotline}`, icon: 'none' });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户