@@ -10,6 +10,7 @@ import type { FreightPayType } from '@prisma/client';
|
||||
import {
|
||||
calcBenefitAmount,
|
||||
generateOrderNo,
|
||||
maskContactPhone,
|
||||
minBottleQtyForDelivery,
|
||||
orderTabToStatuses,
|
||||
toMinSaleQuantity,
|
||||
@@ -501,10 +502,22 @@ export class TradeService {
|
||||
if (!order) return;
|
||||
|
||||
if (!order.isTest) {
|
||||
const skuSummary = `${order.productName}×${order.quantity}`;
|
||||
const phone = order.user?.phone || '';
|
||||
const phoneMasked =
|
||||
phone.length >= 7 ? `${phone.slice(0, 3)}****${phone.slice(-4)}` : phone || '—';
|
||||
const unit = order.saleUnit === 'BOX' ? '箱' : '瓶';
|
||||
const spec = (order.productSpec || '').trim();
|
||||
const skuSummary = spec
|
||||
? `${order.productName} ${spec} ${unit}×${order.quantity}`
|
||||
: `${order.productName} ${unit}×${order.quantity}`;
|
||||
const deliveryLabel =
|
||||
order.deliveryType === 'ON_SITE_PICKUP'
|
||||
? '现场提货'
|
||||
: order.deliveryType === 'CROSS_CITY'
|
||||
? '跨城'
|
||||
: '同城';
|
||||
const receiverInfo =
|
||||
order.deliveryType === 'ON_SITE_PICKUP'
|
||||
? `${order.receiverName} ${order.receiverPhone}`.trim()
|
||||
: `${order.receiverName} ${order.receiverPhone} ${order.receiverAddress}`.trim();
|
||||
const phoneMasked = maskContactPhone(order.user?.phone || order.receiverPhone);
|
||||
void this.wecomPush.dispatchEvent(
|
||||
'order.paid',
|
||||
{
|
||||
@@ -512,6 +525,8 @@ export class TradeService {
|
||||
payAmount: Number(order.payAmount).toFixed(2),
|
||||
cityName: order.city?.name || '—',
|
||||
skuSummary,
|
||||
deliveryLabel,
|
||||
receiverInfo,
|
||||
phoneMasked,
|
||||
},
|
||||
{ handlePath: `/orders?orderNo=${encodeURIComponent(order.orderNo)}` },
|
||||
|
||||
Reference in New Issue
Block a user