|
@ -68,6 +68,13 @@ |
|
|
</view> |
|
|
</view> |
|
|
<view class="td-btn" @click="isEndBill = true" v-if="orderInfo.pay_status == 0&&orderInfo.early_end_timing==false">结束计费</view> |
|
|
<view class="td-btn" @click="isEndBill = true" v-if="orderInfo.pay_status == 0&&orderInfo.early_end_timing==false">结束计费</view> |
|
|
<view class="td-btn" @click="completeBtn" v-if="orderInfo.pay_status == 0&&orderInfo.early_end_timing==true">完结订单</view> |
|
|
<view class="td-btn" @click="completeBtn" v-if="orderInfo.pay_status == 0&&orderInfo.early_end_timing==true">完结订单</view> |
|
|
|
|
|
<!-- 退款按钮拦 --> |
|
|
|
|
|
<order-refund-fixed |
|
|
|
|
|
:pay_amount="orderInfo.pay_amount || 0" |
|
|
|
|
|
:refund_amount="orderInfo.refund_amount || 0" |
|
|
|
|
|
:refund_times="refundTimes" |
|
|
|
|
|
@click:button="refunndBtn" |
|
|
|
|
|
></order-refund-fixed> |
|
|
|
|
|
|
|
|
<!-- 结束计费弹框 --> |
|
|
<!-- 结束计费弹框 --> |
|
|
<end-billing-modal |
|
|
<end-billing-modal |
|
@ -76,25 +83,26 @@ |
|
|
@timeEndBtn="timeEndBtn" |
|
|
@timeEndBtn="timeEndBtn" |
|
|
:orderInfo="orderInfo" |
|
|
:orderInfo="orderInfo" |
|
|
></end-billing-modal> |
|
|
></end-billing-modal> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 退款弹窗 --> |
|
|
|
|
|
<order-refund-modal |
|
|
|
|
|
ref="orderRefundModal" |
|
|
|
|
|
></order-refund-modal> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import util from '@/utils/util'; |
|
|
import util from '@/utils/util'; |
|
|
import deviceServer from '../../../js/device_server'; |
|
|
|
|
|
import deviceApi from '../../../js/device_api'; |
|
|
|
|
|
|
|
|
import { ORDER_API } from '../../js/api'; |
|
|
|
|
|
import server from '../../js/server'; |
|
|
import { mapState } from 'vuex'; |
|
|
import { mapState } from 'vuex'; |
|
|
import end_billing_modal from '../../../../../components/end_billing_modal/end_billing_modal.vue'; |
|
|
|
|
|
|
|
|
import end_billing_modal from '@/components/end_billing_modal/end_billing_modal.vue'; |
|
|
|
|
|
import orderRefundFixed from '@/components/order_refund/fixed.vue' |
|
|
|
|
|
import orderRefundModal from '@/components/order_refund/modal.vue'; |
|
|
export default { |
|
|
export default { |
|
|
components: { |
|
|
components: { |
|
|
'end-billing-modal': end_billing_modal, |
|
|
'end-billing-modal': end_billing_modal, |
|
|
}, |
|
|
|
|
|
props: { |
|
|
|
|
|
orderInfo: { |
|
|
|
|
|
type: Object, |
|
|
|
|
|
default: ()=>({}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
'order-refund-fixed': orderRefundFixed, |
|
|
|
|
|
'order-refund-modal': orderRefundModal, |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
...mapState(['brandInfo']), |
|
|
...mapState(['brandInfo']), |
|
@ -110,38 +118,140 @@ export default { |
|
|
return _obj[`${status}`] || '-' |
|
|
return _obj[`${status}`] || '-' |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
zh_pay_type(){ |
|
|
|
|
|
// 支付类型 0微信支付1支付宝支付2储值卡支付 |
|
|
|
|
|
return status =>{ |
|
|
|
|
|
const _obj = { |
|
|
|
|
|
'0': '微信支付', |
|
|
|
|
|
'1': '支付宝支付', |
|
|
|
|
|
'2': '储值卡支付', |
|
|
|
|
|
'3': '商家主动结束计费', |
|
|
|
|
|
} |
|
|
|
|
|
return _obj[`${status}`] || '-' |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
isEndBill: false, |
|
|
isEndBill: false, |
|
|
|
|
|
orderInfo: {}, |
|
|
|
|
|
refundTimes: -1, // 退款次数 |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
onLoad(options){ |
|
|
|
|
|
this.getOrderInfo({ |
|
|
|
|
|
order_no: options?.order_no || '', |
|
|
|
|
|
stadium_id: options?.stadium_id || '' |
|
|
|
|
|
}) |
|
|
|
|
|
this.getRefundTimes(options?.order_no || ''); |
|
|
|
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
refunndBtn(){ |
|
|
|
|
|
let { orderInfo, refundTimes } = this; |
|
|
|
|
|
this.$refs.orderRefundModal.show({ |
|
|
|
|
|
stadium_name: orderInfo?.stadium_name ?? '', |
|
|
|
|
|
order_no: orderInfo?.order_no ?? '', |
|
|
|
|
|
mobile: orderInfo?.mobile ?? '', |
|
|
|
|
|
refundable_amount: orderInfo?.extension?.refundable_amount ?? 0, |
|
|
|
|
|
refundable_integral: orderInfo?.extension?.refundable_integral ?? 0, |
|
|
|
|
|
refund_times: refundTimes, |
|
|
|
|
|
confirm: e => { |
|
|
|
|
|
this.orderRefund({ |
|
|
|
|
|
order_no: orderInfo?.order_no || '', |
|
|
|
|
|
amount: e.refund_amount || 0, |
|
|
|
|
|
integral: e.refund_integral || 0, |
|
|
|
|
|
stadium_id: orderInfo?.stadium_id || '' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
orderRefund({ order_no = '', amount = 0, integral = 0, stadium_id = ''}){ |
|
|
|
|
|
util.showLoad(); |
|
|
|
|
|
server.get({ |
|
|
|
|
|
url: ORDER_API.orderRefund, |
|
|
|
|
|
data: { order_no, amount, integral }, |
|
|
|
|
|
isDefaultGet: false |
|
|
|
|
|
}) |
|
|
|
|
|
.then(res=>{ |
|
|
|
|
|
util.hideLoad(); |
|
|
|
|
|
if(res.data.code == 0){ |
|
|
|
|
|
util.showNone(res.data.message || '操作成功!'); |
|
|
|
|
|
}else{ |
|
|
|
|
|
util.showNone(res.data.message || '操作失败!'); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(util.hideLoad) |
|
|
|
|
|
.finally(_=>setTimeout(_=>{ |
|
|
|
|
|
this.getOrderInfo({ order_no, stadium_id }); |
|
|
|
|
|
this.getRefundTimes(order_no); |
|
|
|
|
|
}, 1200)); |
|
|
|
|
|
}, |
|
|
|
|
|
async getRefundTimes(order_no){ |
|
|
|
|
|
try{ |
|
|
|
|
|
let _refundRes = await this.$store.dispatch('getOrderRefundList', order_no); |
|
|
|
|
|
let _refundLs = _refundRes?.data?.data?.list || []; |
|
|
|
|
|
this.refundTimes = _refundLs.length; |
|
|
|
|
|
console.log('refundRes', _refundRes); |
|
|
|
|
|
}catch(err){ |
|
|
|
|
|
console.warn('getRefundTimes err', err); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
getOrderInfo({ order_no, stadium_id }){ |
|
|
|
|
|
util.showLoad(); |
|
|
|
|
|
server.get({ |
|
|
|
|
|
url: ORDER_API.timeOrderDetail, |
|
|
|
|
|
data: { order_no, stadium_id }, |
|
|
|
|
|
failMsg: '加载失败!' |
|
|
|
|
|
}) |
|
|
|
|
|
.then(res=>{ |
|
|
|
|
|
util.hideLoad() |
|
|
|
|
|
this.orderInfo = res || {} |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(util.hideLoad) |
|
|
|
|
|
}, |
|
|
|
|
|
zh_pay_type: util.order_pay_type_txt, |
|
|
completeBtn(){ |
|
|
completeBtn(){ |
|
|
this.$emit('completeBtn'); |
|
|
this.$emit('completeBtn'); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
timeEndBtn(){ |
|
|
timeEndBtn(){ |
|
|
this.$emit('refreshPage'); |
|
|
|
|
|
|
|
|
let { orderInfo } = this; |
|
|
|
|
|
this.getOrderInfo({ |
|
|
|
|
|
order_no: orderInfo?.order_no || '', |
|
|
|
|
|
stadium_id: orderInfo?.stadium_id || '' |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 计时订单-完结订单 |
|
|
|
|
|
completeBtn(){ |
|
|
|
|
|
let { orderInfo } = this |
|
|
|
|
|
util.showModal({ |
|
|
|
|
|
title: '提示', |
|
|
|
|
|
content: '是否确认完结订单?', |
|
|
|
|
|
showCancel: true, |
|
|
|
|
|
success: modalRes=>{ |
|
|
|
|
|
if(modalRes.confirm)this.timeOrderComplete({ |
|
|
|
|
|
brand_id: orderInfo?.brand_id || '', |
|
|
|
|
|
order_no: orderInfo?.order_no || '', |
|
|
|
|
|
stadium_id: orderInfo?.stadium_id || '' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
//计时订单完结 请求 |
|
|
|
|
|
timeOrderComplete({ brand_id, order_no, stadium_id }){ |
|
|
|
|
|
util.showLoad(); |
|
|
|
|
|
server.get({ |
|
|
|
|
|
url: ORDER_API.timeOrderComplete, //计时订单完结 |
|
|
|
|
|
data: { brand_id, order_no }, |
|
|
|
|
|
failMsg: '请求失败!' |
|
|
|
|
|
}) |
|
|
|
|
|
.then(res=>{ |
|
|
|
|
|
util.hideLoad(); |
|
|
|
|
|
util.showNone('操作成功!'); |
|
|
|
|
|
|
|
|
|
|
|
setTimeout(_=>{ |
|
|
|
|
|
this.getOrderInfo({ order_no, stadium_id }); |
|
|
|
|
|
util.previousPageFunction({ |
|
|
|
|
|
fnName: 'refreshList', |
|
|
|
|
|
query: { isLoad: false}, |
|
|
|
|
|
}); |
|
|
|
|
|
}, 1200) |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(util.hideLoad) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style lang="scss" > |
|
|
<style lang="scss" > |
|
|
@import '~style/public.scss'; |
|
|
|
|
|
.timing-details{ |
|
|
.timing-details{ |
|
|
margin-bottom: 24rpx; |
|
|
margin-bottom: 24rpx; |
|
|
.td-head{ |
|
|
.td-head{ |
|
@ -159,8 +269,6 @@ export default { |
|
|
flex-shrink: 0; |
|
|
flex-shrink: 0; |
|
|
width: 40rpx; |
|
|
width: 40rpx; |
|
|
height: 40rpx; |
|
|
height: 40rpx; |
|
|
background-color: skyblue; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
>view{ |
|
|
>view{ |
|
|
flex-grow: 1; |
|
|
flex-grow: 1; |
|
@ -171,7 +279,7 @@ export default { |
|
|
} |
|
|
} |
|
|
.th-line{ |
|
|
.th-line{ |
|
|
margin-top: 8rpx; |
|
|
margin-top: 8rpx; |
|
|
@include centerFlex(space-between); |
|
|
|
|
|
|
|
|
@include ctf(space-between); |
|
|
>view{ |
|
|
>view{ |
|
|
line-height: 40rpx; |
|
|
line-height: 40rpx; |
|
|
font-size: 28rpx; |
|
|
font-size: 28rpx; |
|
@ -186,7 +294,7 @@ export default { |
|
|
color: #9A9A9D; |
|
|
color: #9A9A9D; |
|
|
} |
|
|
} |
|
|
.tl-active{ |
|
|
.tl-active{ |
|
|
color: #009874; |
|
|
|
|
|
|
|
|
color: $mColor; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -218,7 +326,7 @@ export default { |
|
|
border-top: 2rpx solid #D8D8D8; |
|
|
border-top: 2rpx solid #D8D8D8; |
|
|
.ts-line{ |
|
|
.ts-line{ |
|
|
margin-top: 26rpx; |
|
|
margin-top: 26rpx; |
|
|
@include centerFlex(space-between); |
|
|
|
|
|
|
|
|
@include ctf(space-between); |
|
|
>view{ |
|
|
>view{ |
|
|
color: #333333; |
|
|
color: #333333; |
|
|
&:first-child{ |
|
|
&:first-child{ |
|
@ -232,7 +340,7 @@ export default { |
|
|
} |
|
|
} |
|
|
.ts-total{ |
|
|
.ts-total{ |
|
|
margin-top: 22rpx; |
|
|
margin-top: 22rpx; |
|
|
@include centerFlex(flex-end); |
|
|
|
|
|
|
|
|
@include ctf(flex-end); |
|
|
>view{ |
|
|
>view{ |
|
|
color: #333333; |
|
|
color: #333333; |
|
|
font-size: 28rpx; |
|
|
font-size: 28rpx; |
|
@ -252,9 +360,9 @@ export default { |
|
|
} |
|
|
} |
|
|
.td-btn{ |
|
|
.td-btn{ |
|
|
height: 112rpx; |
|
|
height: 112rpx; |
|
|
margin: 80rpx 24rpx; |
|
|
|
|
|
|
|
|
margin: 80rpx 24rpx 10upx; |
|
|
border-radius: 10rpx; |
|
|
border-radius: 10rpx; |
|
|
background-color: #009874; |
|
|
|
|
|
|
|
|
background-color: $mColor; |
|
|
color: #FFF; |
|
|
color: #FFF; |
|
|
font-size: 32rpx; |
|
|
font-size: 32rpx; |
|
|
line-height: 112rpx; |
|
|
line-height: 112rpx; |