客服电话 → 13203801799(CUSTOMER_SERVICE_PHONE,协议文案走常量自动同步)

权益页去掉分享按钮,菜单分享保留
支付成功改 reLaunch 清栈;订单列表返回首页
减数量低于起购时 toast「同城/跨城/现场提货至少购买 N 瓶」
核销成功可评星并 POST /redeem/ratings;HQ 新增「门店评价」页 /store-ratings
成功页「回到首页」改用 .redeem-cancel-btn,不再撑破布局
历史记录改为核销流水:GET /redeem/records;生产库已有 2 笔(用户 13073729990)可验证。权益明细字段映射也一并修了
我的页头像提高点击层级,避免被卡片遮挡
This commit is contained in:
2026-08-03 13:09:59 +08:00
parent 9f67221457
commit 87c4af7364
22 changed files with 506 additions and 55 deletions
@@ -1095,11 +1095,51 @@ export class RedeemService {
});
}
async listUserRecords(userId: bigint, page = 1, pageSize = 20) {
const take = Math.min(Math.max(pageSize, 1), 50);
const skip = (Math.max(page, 1) - 1) * take;
const [list, total] = await Promise.all([
this.prisma.redeemRecord.findMany({
where: { userId },
orderBy: { createdAt: 'desc' },
skip,
take,
include: {
store: { select: { id: true, name: true } },
rating: { select: { serviceScore: true, envScore: true } },
},
}),
this.prisma.redeemRecord.count({ where: { userId } }),
]);
return {
list: serializeBigInt(
list.map((r) => ({
id: r.id,
redeemNo: r.redeemNo,
amount: Number(r.amount),
storeId: r.storeId,
storeName: r.store?.name ?? '门店',
createdAt: r.createdAt,
rating: r.rating
? { serviceScore: r.rating.serviceScore, envScore: r.rating.envScore }
: null,
})),
),
total,
page: Math.max(page, 1),
pageSize: take,
};
}
async submitRating(userId: bigint, body: { redeemRecordId: string; serviceScore: number; envScore: number }) {
const record = await this.prisma.redeemRecord.findFirst({
where: { id: BigInt(body.redeemRecordId), userId },
});
if (!record) throw new NotFoundException('核销记录不存在');
const existing = await this.prisma.storeRating.findUnique({
where: { redeemRecordId: record.id },
});
if (existing) return serializeBigInt(existing);
const rating = await this.prisma.storeRating.create({
data: {
redeemRecordId: record.id,