|
|
@ -23,22 +23,18 @@ |
|
|
|
<view class="card info"> |
|
|
|
<view class="info-header">核销信息</view> |
|
|
|
<view class="flex flex-column info-content"> |
|
|
|
<!-- <image class="info-qr" :src="orderDetail.qrCodeImgUrl" mode="widthFix"></image> --> |
|
|
|
|
|
|
|
<view class="" style="margin: 20rpx;"> |
|
|
|
<!-- <uv-qrcode ref="qrcode" size="300rpx" value="https://h5.uvui.cn"></uv-qrcode> --> |
|
|
|
<uv-qrcode ref="qrcode" size="300px" :value="orderDetail.id"></uv-qrcode> |
|
|
|
<uv-qrcode ref="qrcode" size="300px" :value="`${orderDetail.id},0`"></uv-qrcode> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="info-no">{{ `订单号:${orderDetail.id}` }}</view> |
|
|
|
<view class="info-desc">{{ `有效时间:${orderDetail.startTime}至${orderDetail.endTime}` }}</view> |
|
|
|
<view class="info-desc">{{ `有效时间:${validRange}` }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 下单 --> |
|
|
|
<view class="flex bar"> |
|
|
|
<button plain class="btn btn-plain" @click="overOrder">核销</button> |
|
|
|
<button plain class="btn btn-plain" @click="onRefund">申请退款</button> |
|
|
|
<button plain class="btn" @click="onBuyAgain">再次购买</button> |
|
|
|
</view> |
|
|
@ -58,6 +54,16 @@ |
|
|
|
orderDetail: {}, |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
validRange() { |
|
|
|
const { createTime, validTime } = this.orderDetail || {} |
|
|
|
|
|
|
|
let startTime = createTime ? this.$dayjs(createTime).format('YYYY-MM-DD') : '-' |
|
|
|
let endTime = validTime ? this.$dayjs(validTime).format('YYYY-MM-DD') : '-' |
|
|
|
|
|
|
|
return `${startTime}至${endTime}` |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad(args) { |
|
|
|
this.id = args.id |
|
|
|
this.fetchOrderDetail() |
|
|
@ -79,32 +85,35 @@ |
|
|
|
|
|
|
|
uni.stopPullDownRefresh() |
|
|
|
}, |
|
|
|
|
|
|
|
overOrder() { |
|
|
|
uni.showModal({ |
|
|
|
title: '确认核销订单吗?', |
|
|
|
success: e => { |
|
|
|
if (e.confirm) { |
|
|
|
this.$api('overOrder', { |
|
|
|
orderId: this.orderDetail.id, |
|
|
|
}, res => { |
|
|
|
this.$emit('done') |
|
|
|
// 请求成功后返回上一个页面 |
|
|
|
uni.navigateBack() |
|
|
|
}) |
|
|
|
} |
|
|
|
async fetchRefund() { |
|
|
|
try { |
|
|
|
const res = await this.$fetch('refundOrder', { orderId: this.orderDetail.id }, false) |
|
|
|
|
|
|
|
if (res.code == 200) { |
|
|
|
uni.showToast({ |
|
|
|
title: '退款成功', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
setTimeout(uni.navigateBack, 800, -1) |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
title: res.data, |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} catch (err) { |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
onRefund() { |
|
|
|
uni.showModal({ |
|
|
|
title: '确认申请订单退款嘛?', |
|
|
|
success: e => { |
|
|
|
if (e.confirm) { |
|
|
|
this.$api('refundOrder', { |
|
|
|
orderId: this.orderDetail.id, |
|
|
|
}, res => { |
|
|
|
this.$emit('done') |
|
|
|
this.fetchRefund() |
|
|
|
uni.showToast({ |
|
|
|
title: '已提交申请,请耐心等候', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|