修复门票订单详情页 tickets 为 null 时的白屏崩溃,补 .gitignore
- 已退款/已下架订单后端返回 tickets 为 null,orderdetail 直接取 obj.tickets.name 导致页面白屏崩溃 - 新增 ticketName 计算属性,回退订单快照 orderGoods.ticketsName; 重新购买跳转回退 orderGoods.ticketsId - 补 .gitignore 忽略 unpackage/ 与 .DS_Store Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
85272c9363
commit
dd25c0ae63
@@ -17,7 +17,7 @@
|
||||
<view class="detail_rq">
|
||||
<text style="color: #000;line-height: 88rpx;font-size: 36rpx;font-weight: bold;">商品信息</text>
|
||||
<view style="width: 702rpx;display: flex;justify-content: space-between;">
|
||||
<text style="color: #000;font-weight: bold;">{{obj.tickets.name}}</text>
|
||||
<text style="color: #000;font-weight: bold;">{{ticketName}}</text>
|
||||
<u-icon name="arrow-right" color="#808080" size="24"></u-icon>
|
||||
</view>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user