Fix: 订单列表所有按钮点击都没反应了

(cherry picked from commit 76a877f2c2)
This commit is contained in:
linxi
2026-07-24 11:35:35 +08:00
committed by lifizer
parent fb03ad9f4a
commit cb8a4bb33c
+160 -50
View File
@@ -61,7 +61,7 @@
v-if="order.experienceOrderInfo" v-if="order.experienceOrderInfo"
class="shop-info flex jc-between ai-center" class="shop-info flex jc-between ai-center"
style="padding-bottom: 0" style="padding-bottom: 0"
@click.stop="goStore(order)" @click.stop="goStore(orderListIndex)"
> >
<view class="flex ai-center"> <view class="flex ai-center">
<image <image
@@ -79,7 +79,7 @@
v-if="order.merName && !order.experienceOrderInfo" v-if="order.merName && !order.experienceOrderInfo"
class="shop-info flex jc-between ai-center" class="shop-info flex jc-between ai-center"
style="padding-bottom: 0" style="padding-bottom: 0"
@click="goStore(order)" @click="goStore(orderListIndex)"
> >
<view class="flex ai-center"> <view class="flex ai-center">
<image <image
@@ -133,7 +133,7 @@
class="font-color-white statusTag v12-primary" class="font-color-white statusTag v12-primary"
>{{ (order.isGiftCardSend || order.isGiftCardReceive) ? '礼包' : (getStatus(order) || (order._status && order._status._title) || '已完成') }}</view> >{{ (order.isGiftCardSend || order.isGiftCardReceive) ? '礼包' : (getStatus(order) || (order._status && order._status._title) || '已完成') }}</view>
</view> </view>
<view @click="goOrderDetails(order)"> <view @click="goOrderDetails(orderListIndex)">
<view <view
v-if="order.isGiftCardReceiveBlind === 1" v-if="order.isGiftCardReceiveBlind === 1"
class="item-info acea-row row-between row-top" class="item-info acea-row row-between row-top"
@@ -334,17 +334,17 @@
<view <view
v-if="order.experienceOrderStatus === 0 || order.experienceOrderStatus === 1" v-if="order.experienceOrderStatus === 0 || order.experienceOrderStatus === 1"
class="bnt service" class="bnt service"
@click.stop="goRoom(order)" @click.stop="goRoom(orderListIndex)"
>联系商家</view> >联系商家</view>
<view <view
v-if="order.experienceOrderStatus === 0" v-if="order.experienceOrderStatus === 0"
class="bnt v12-primary v12-white-text v12-primary-border v12-radius-40" class="bnt v12-primary v12-white-text v12-primary-border v12-radius-40"
@click.stop="goOrderDetails(order)" @click.stop="goOrderDetails(orderListIndex)"
>去使用</view> >去使用</view>
<view <view
v-if="order.experienceOrderStatus === 1 || order.experienceOrderStatus === 2" v-if="order.experienceOrderStatus === 1 || order.experienceOrderStatus === 2"
class="bnt service" class="bnt service"
@click.stop="delOrder(order)" @click.stop="delOrder(orderListIndex)"
>删除订单</view> >删除订单</view>
</view> </view>
<view <view
@@ -358,18 +358,18 @@
> >
<text <text
class="btn-more v12-font-28 v12-font-bold" class="btn-more v12-font-28 v12-font-bold"
@click.stop="tapShowMore(order, orderListIndex)" @click.stop="tapShowMore(orderListIndex)"
>更多</text> >更多</text>
<view class="group-float" v-show="order.showMore"> <view class="group-float" v-show="order.showMore">
<view <view
v-if="order.merName && order.isGiftCardReceiveBlind === 0" v-if="order.merName && order.isGiftCardReceiveBlind === 0"
class="btn btn-service flex jc-center ai-center v12-font-24" class="btn btn-service flex jc-center ai-center v12-font-24"
@click="goRoom(order)" @click="goRoom(orderListIndex)"
>联系商家</view> >联系商家</view>
<view <view
v-if="order.isTravelGroup === 0 && order.refundSystemStatus !== 2" v-if="order.isTravelGroup === 0 && order.refundSystemStatus !== 2"
class="btn flex jc-center ai-center v12-font-24" class="btn flex jc-center ai-center v12-font-24"
@click="goRefund(order)" @click="goRefund(orderListIndex)"
>申请退款</view> >申请退款</view>
</view> </view>
</view> </view>
@@ -378,7 +378,7 @@
<view <view
v-if="order.isDrawOrder > 0" v-if="order.isDrawOrder > 0"
class="bnt service" class="bnt service"
@click.stop="callMerPhone(order)" @click.stop="callMerPhone(orderListIndex)"
>联系客服 >联系客服
</view> </view>
<view> <view>
@@ -389,18 +389,18 @@
parseInt(order._status._type) !== 9 parseInt(order._status._type) !== 9
" "
class="bnt service" class="bnt service"
@click="goRoom(order)" @click="goRoom(orderListIndex)"
>联系商家</view> >联系商家</view>
</view> </view>
<view class="v12-justify-between"> <view class="v12-justify-between">
<view <view
class="bnt service" class="bnt service"
@click="goOrderDetails(order)" @click="goOrderDetails(orderListIndex)"
v-if="[-1, -2, -3].includes(parseInt(order._status._type))" v-if="[-1, -2, -3].includes(parseInt(order._status._type))"
>查看详情</view> >查看详情</view>
<view <view
class="bnt service" class="bnt service"
@click="delOrder(order)" @click="delOrder(orderListIndex)"
v-if="[9].includes(parseInt(order._status._type))" v-if="[9].includes(parseInt(order._status._type))"
>删除订单</view> >删除订单</view>
</view> </view>
@@ -411,61 +411,61 @@
<template v-if="parseInt(order._status._type) === 0"> <template v-if="parseInt(order._status._type) === 0">
<view <view
class="bnt cancelBnt v12-dark-text v12-dark-border" class="bnt cancelBnt v12-dark-text v12-dark-border"
@click="cancelOrder(order)" @click="cancelOrder(orderListIndex)"
>取消订单</view> >取消订单</view>
<view <view
v-if="order.isTravelGroup === 0 && order.isDrawOrder === 0" v-if="order.isTravelGroup === 0 && order.isDrawOrder === 0"
class="bnt cancelBnt v12-dark-text v12-dark-border" class="bnt cancelBnt v12-dark-text v12-dark-border"
@click="addressTap(order)" @click="addressTap(orderListIndex)"
>修改地址</view> >修改地址</view>
<view <view
class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40" class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40"
@click="subscribePay(order)" @click="subscribePay(orderListIndex)"
>立即付款</view> >立即付款</view>
</template> </template>
<template v-if="parseInt(order._status._type) === 1 && order.isTickets === 0"> <template v-if="parseInt(order._status._type) === 1 && order.isTickets === 0">
<view <view
v-if="order.isTravelGroup === 1" v-if="order.isTravelGroup === 1"
class="bnt service" class="bnt service"
@click="editTime(order)" @click="editTime(orderListIndex)"
>{{ '修改时间' }}</view> >{{ '修改时间' }}</view>
<view <view
v-if="order.isTravelGroup === 1" v-if="order.isTravelGroup === 1"
class="bnt service" class="bnt service"
@click="applyRefund(order)" @click="applyRefund(orderListIndex)"
>{{ '申请退款' }}</view> >{{ '申请退款' }}</view>
<view <view
v-if="canShowModifyAddress(order) && order.isDrawOrder === 0" v-if="canShowModifyAddress(order) && order.isDrawOrder === 0"
class="bnt service" class="bnt service"
@click="addressTap(order)" @click="addressTap(orderListIndex)"
>修改地址</view> >修改地址</view>
<view <view
class="bnt service" class="bnt service"
:class="{'v12-primary-text v12-primary-border': order.isTravelGroup === 1}" :class="{'v12-primary-text v12-primary-border': order.isTravelGroup === 1}"
@click="goOrderDetails(order)" @click="goOrderDetails(orderListIndex)"
>{{ order.isTravelGroup === 0 ? '查看详情' : '查看券码' }}</view> >{{ order.isTravelGroup === 0 ? '查看详情' : '查看券码' }}</view>
</template> </template>
<template v-if="parseInt(order._status._type) === 1 && order.isTickets === 1"> <template v-if="parseInt(order._status._type) === 1 && order.isTickets === 1">
<view <view
class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40" class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40"
@click="goOrderDetails(order)" @click="goOrderDetails(orderListIndex)"
>立即核销</view> >立即核销</view>
</template> </template>
<template v-if="parseInt(order._status._type) === 2 && order.isTickets === 0 && order.isTravelGroup === 1"> <template v-if="parseInt(order._status._type) === 2 && order.isTickets === 0 && order.isTravelGroup === 1">
<view <view
v-if="order.isTravelGroup === 1" v-if="order.isTravelGroup === 1"
class="bnt service" class="bnt service"
@click="editTime(order)" @click="editTime(orderListIndex)"
>{{ '修改时间' }}</view> >{{ '修改时间' }}</view>
<view <view
v-if="order.isTravelGroup === 1" v-if="order.isTravelGroup === 1"
class="bnt service" class="bnt service"
@click="applyRefund(order)" @click="applyRefund(orderListIndex)"
>{{ '申请退款' }}</view> >{{ '申请退款' }}</view>
<view <view
class="bnt service" class="bnt service"
:class="{'v12-primary-text v12-primary-border': order.isTravelGroup === 1}" :class="{'v12-primary-text v12-primary-border': order.isTravelGroup === 1}"
@click="goOrderDetails(order)" @click="goOrderDetails(orderListIndex)"
>{{ order.isTravelGroup === 0 ? '查看详情' : '查看券码' }}</view> >{{ order.isTravelGroup === 0 ? '查看详情' : '查看券码' }}</view>
</template> </template>
<template v-if="parseInt(order._status._type) === 2 && order.isTickets === 0 && order.isTravelGroup === 0"> <template v-if="parseInt(order._status._type) === 2 && order.isTickets === 0 && order.isTravelGroup === 0">
@@ -477,23 +477,23 @@
</view> </view>
<view <view
class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40" class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40"
@click="takeOrder(order)" @click="takeOrder(orderListIndex)"
>确认收货</view> >确认收货</view>
</template> </template>
<template v-if="parseInt(order._status._type) === 3 && order.isTravelGroup === 0"> <template v-if="parseInt(order._status._type) === 3 && order.isTravelGroup === 0">
<view <view
class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40" class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40"
@click="goOrderDetails(order)" @click="goOrderDetails(orderListIndex)"
>去评价</view> >去评价</view>
</template> </template>
<template v-if="parseInt(order._status._type) === 3 && order.isTravelGroup === 1"> <template v-if="parseInt(order._status._type) === 3 && order.isTravelGroup === 1">
<view <view
class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40" class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40"
@click="goOrderDetails(order)" @click="goOrderDetails(orderListIndex)"
>去评价</view> >去评价</view>
</template> </template>
<template v-if="parseInt(order._status._type) === 4"> <template v-if="parseInt(order._status._type) === 4">
<view class="bnt service" @click="goOrderDetails(order)">查看订单</view> <view class="bnt service" @click="goOrderDetails(orderListIndex)">查看订单</view>
</template> </template>
</view> </view>
</view> </view>
@@ -505,7 +505,7 @@
<view <view
v-if="order.merName && order.isGiftCardReceiveBlind === 0" v-if="order.merName && order.isGiftCardReceiveBlind === 0"
class="bnt btn-service flex jc-center ai-center v12-font-24" class="bnt btn-service flex jc-center ai-center v12-font-24"
@click="goRoom(order)" @click="goRoom(orderListIndex)"
>联系商家 >联系商家
</view> </view>
<view class="v12-align-center"> <view class="v12-align-center">
@@ -519,14 +519,14 @@
" "
open-type="share" open-type="share"
class="gift-btn service v12-primary-text v12-primary-border" class="gift-btn service v12-primary-text v12-primary-border"
@click="shareGift(order)" @click="shareGift(orderListIndex)"
>送给朋友</button> >送给朋友</button>
<button <button
v-if="Number(order.status) === 0" v-if="Number(order.status) === 0"
class="gift-btn service v12-primary-text v12-primary-border" class="gift-btn service v12-primary-text v12-primary-border"
@click="subscribePay(order)" @click="subscribePay(orderListIndex)"
>立即支付</button> >立即支付</button>
<view class="bnt service" @click="goOrderDetails(order)">查看详情</view> <view class="bnt service" @click="goOrderDetails(orderListIndex)">查看详情</view>
</view> </view>
</view> </view>
</view> </view>
@@ -930,12 +930,28 @@ export default {
uni.hideLoading(); uni.hideLoading();
}) })
}, },
editTime(order) { editTime(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
this.showDatePicker = true this.showDatePicker = true
this.travelGroupOrderInfo = order.travelGroupOrderInfo this.travelGroupOrderInfo = order.travelGroupOrderInfo
this.orderInfo = order this.orderInfo = order
}, },
applyRefund(order) { applyRefund(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
// 这里可以添加申请退款的逻辑,比如跳转到退款页面 // 这里可以添加申请退款的逻辑,比如跳转到退款页面
uni.navigateTo({ uni.navigateTo({
url: '/pkg_product/views/sojoumOrderRefund?id=' + order.orderId url: '/pkg_product/views/sojoumOrderRefund?id=' + order.orderId
@@ -951,8 +967,16 @@ export default {
} }
return timeMap[type] return timeMap[type]
}, },
shareGift(item) { shareGift(orderOrIndex) {
this.giftItem = item const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
this.giftItem = order
}, },
getGiftTips(giftCardInfo) { getGiftTips(giftCardInfo) {
// giftCardStatus int 礼品卡状态 0-未领取 1-已领取 2-已失效 // giftCardStatus int 礼品卡状态 0-未领取 1-已领取 2-已失效
@@ -983,12 +1007,30 @@ export default {
}) })
this.$forceUpdate() this.$forceUpdate()
}, },
delOrder(order) { getOrderByIndex(orderOrIndex) {
if (typeof orderOrIndex === 'number') {
return this.orderList[orderOrIndex]
}
if (typeof orderOrIndex === 'string' && /^\d+$/.test(orderOrIndex)) {
return this.orderList[Number(orderOrIndex)]
}
return orderOrIndex
},
delOrder(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
delOrderHandle(order.orderId).then(() => { delOrderHandle(order.orderId).then(() => {
this.changeType() this.changeType()
}) })
}, },
goStore(order) { goStore(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) { if (!order) {
return return
} }
@@ -1070,14 +1112,30 @@ export default {
this.toYuePay(payPwd) this.toYuePay(payPwd)
this.isShowPayPwdPop = false this.isShowPayPwdPop = false
}, },
subscribePay(order) { subscribePay(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
this.orderInfo = order this.orderInfo = order
uni.requestSubscribeMessage({ uni.requestSubscribeMessage({
tmplIds: settings.SubscribeMessageTmplIds, tmplIds: settings.SubscribeMessageTmplIds,
complete: () => this.pay = true complete: () => this.pay = true
}) })
}, },
addressTap(order) { addressTap(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
this._orderId = order.orderId this._orderId = order.orderId
uni.setStorageSync('updateOrderSourceAddress', { uni.setStorageSync('updateOrderSourceAddress', {
id: order.addressId || order.userAddressId || '', id: order.addressId || order.userAddressId || '',
@@ -1095,7 +1153,8 @@ export default {
force2Decimal(v) { force2Decimal(v) {
return this.$force2Decimal(v) return this.$force2Decimal(v)
}, },
callMerPhone(order) { callMerPhone(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
const phone = String((order && order.merPhone) || '').trim() const phone = String((order && order.merPhone) || '').trim()
if (!phone) { if (!phone) {
uni.showToast({ uni.showToast({
@@ -1108,10 +1167,17 @@ export default {
phoneNumber: phone phoneNumber: phone
}) })
}, },
goRoom(order) { goRoom(orderOrIndex) {
console.log(order); const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
if (order.experienceOrderInfo) { if (order.experienceOrderInfo) {
const phone = order.merchantPhone || order.merPhone || order.experienceOrderInfo.phone || order.companyTel; const phone = order.merchantPhone || order.merPhone || order.experienceOrderInfo.phone || order.companyTel
if (phone) { if (phone) {
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: phone phoneNumber: phone
@@ -1142,7 +1208,15 @@ export default {
url: `/pkg_common/views/room?id=${order.merId}&name=${order.merName}&params=${JSON.stringify(params)}` url: `/pkg_common/views/room?id=${order.merId}&name=${order.merName}&params=${JSON.stringify(params)}`
}) })
}, },
goRefund(order) { goRefund(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
// fix bug#1631 // fix bug#1631
if (this.type === 4 || parseInt(order._status._type) === 3) { if (this.type === 4 || parseInt(order._status._type) === 3) {
// 打开售后的目的就是开启已完成/待评价订单的退款功能,确认打开售后之后,小程序用户再点击申请退款,就可以进入退款申请填写页面,正常走退款流程,提交退款申请以后,订单状态变为退款中 // 打开售后的目的就是开启已完成/待评价订单的退款功能,确认打开售后之后,小程序用户再点击申请退款,就可以进入退款申请填写页面,正常走退款流程,提交退款申请以后,订单状态变为退款中
@@ -1164,7 +1238,15 @@ export default {
}) })
} }
}, },
goLogistics(order) { goLogistics(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
this.$yrouter.push({ this.$yrouter.push({
path: "/pagesOrder/order/Logistics/index", path: "/pagesOrder/order/Logistics/index",
query: { query: {
@@ -1172,7 +1254,15 @@ export default {
} }
}); });
}, },
goOrderDetails(order) { goOrderDetails(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
if (order.experienceOrderInfo) { if (order.experienceOrderInfo) {
this.$yrouter.push({ this.$yrouter.push({
path: "/pkg_product/views/experienceCouponOrderDetail", path: "/pkg_product/views/experienceCouponOrderDetail",
@@ -1238,7 +1328,15 @@ export default {
this.orderData = res.data this.orderData = res.data
}) })
}, },
takeOrder(order) { takeOrder(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
const that = this const that = this
uni.showModal({ uni.showModal({
title: '是否确认收货?', title: '是否确认收货?',
@@ -1369,7 +1467,11 @@ export default {
uni.hideLoading() uni.hideLoading()
}); });
}, },
tapShowMore(order, index) { tapShowMore(index) {
const order = this.getOrderByIndex(index)
if (!order) {
return
}
order.showMore = !order.showMore; order.showMore = !order.showMore;
this.$set(this.orderList, index, order); this.$set(this.orderList, index, order);
}, },
@@ -1409,7 +1511,15 @@ export default {
} }
return status return status
}, },
cancelOrder(order) { cancelOrder(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
uni.showToast({
title: '订单信息异常',
icon: 'none'
})
return
}
cancelOrderHandle(order.orderId).then(() => { cancelOrderHandle(order.orderId).then(() => {
this.getOrderData(); this.getOrderData();
this.orderList.splice(this.orderList.indexOf(order), 1) this.orderList.splice(this.orderList.indexOf(order), 1)