From dd25c0ae63f471d9e544f491950f70d75c1be65b Mon Sep 17 00:00:00 2001 From: jacobxu666 Date: Tue, 4 Aug 2026 17:38:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=97=A8=E7=A5=A8=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E8=AF=A6=E6=83=85=E9=A1=B5=20tickets=20=E4=B8=BA=20nu?= =?UTF-8?q?ll=20=E6=97=B6=E7=9A=84=E7=99=BD=E5=B1=8F=E5=B4=A9=E6=BA=83?= =?UTF-8?q?=EF=BC=8C=E8=A1=A5=20.gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 已退款/已下架订单后端返回 tickets 为 null,orderdetail 直接取 obj.tickets.name 导致页面白屏崩溃 - 新增 ticketName 计算属性,回退订单快照 orderGoods.ticketsName; 重新购买跳转回退 orderGoods.ticketsId - 补 .gitignore 忽略 unpackage/ 与 .DS_Store Co-Authored-By: Claude Opus 4.8 --- .gitignore | 1 + pages/ticket/orderdetail.vue | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index a503fa2..c6a900e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /unpackage/ +.DS_Store diff --git a/pages/ticket/orderdetail.vue b/pages/ticket/orderdetail.vue index eba6511..c88c36d 100644 --- a/pages/ticket/orderdetail.vue +++ b/pages/ticket/orderdetail.vue @@ -17,7 +17,7 @@ 商品信息 - {{obj.tickets.name}} + {{ticketName}} @@ -270,6 +270,11 @@ } }, computed: { + // xuchao: 门票名称兜底 —— 已退款/下架订单 tickets 可能为 null,回退订单快照 orderGoods.ticketsName + ticketName() { + if (this.obj && this.obj.tickets) return this.obj.tickets.name + return this.obj && this.obj.orderGoods ? this.obj.orderGoods.ticketsName : '' + }, orderStatus() { let str = '' if (this.obj) { @@ -365,8 +370,10 @@ }, aginPlay() { + // xuchao: tickets 可能为 null(已下架),回退订单快照 orderGoods.ticketsId + let ticketsId = this.obj.tickets ? this.obj.tickets.id : this.obj.orderGoods.ticketsId uni.reLaunch({ - url: 'scenicdetail?id=' + this.obj.tickets.id + url: 'scenicdetail?id=' + ticketsId }) }, coyp(e) {