v3.5.11企业微信通知调整
CI / verify (pull_request) Has been cancelled

This commit is contained in:
2026-08-26 09:55:19 +08:00
parent 632539e8dc
commit 3afbdfe6b9
17 changed files with 775 additions and 83 deletions
@@ -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)}` },