|
@ -54,6 +54,17 @@ |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<order-refund-fixed |
|
|
|
|
|
:pay_amount="1" |
|
|
|
|
|
:refund_amount="0" |
|
|
|
|
|
:refund_times="0" |
|
|
|
|
|
@click:button="refunndBtn" |
|
|
|
|
|
></order-refund-fixed> |
|
|
|
|
|
|
|
|
|
|
|
<order-refund-modal |
|
|
|
|
|
ref="orderRefundModal" |
|
|
|
|
|
></order-refund-modal> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
@ -67,6 +78,8 @@ |
|
|
import a_line from '../../../../../components/order_list/a_line/a_line.vue'; |
|
|
import a_line from '../../../../../components/order_list/a_line/a_line.vue'; |
|
|
import s_line from '../../../components/s_line/s_line.vue'; |
|
|
import s_line from '../../../components/s_line/s_line.vue'; |
|
|
import p_line from '../../../components/p_line/p_line.vue'; |
|
|
import p_line from '../../../components/p_line/p_line.vue'; |
|
|
|
|
|
import orderRefundFixed from '@/components/order_refund/fixed.vue' |
|
|
|
|
|
import orderRefundModal from '@/components/order_refund/modal.vue'; |
|
|
import util from '../../../../../utils/util'; |
|
|
import util from '../../../../../utils/util'; |
|
|
import { ORDER_API } from '../../../js/api'; |
|
|
import { ORDER_API } from '../../../js/api'; |
|
|
import server from '../../../js/server'; |
|
|
import server from '../../../js/server'; |
|
@ -75,7 +88,13 @@ export default { |
|
|
'a-line': a_line, |
|
|
'a-line': a_line, |
|
|
's-line': s_line, |
|
|
's-line': s_line, |
|
|
'p-line': p_line, |
|
|
'p-line': p_line, |
|
|
|
|
|
|
|
|
|
|
|
'order-refund-fixed': orderRefundFixed, |
|
|
|
|
|
'order-refund-modal': orderRefundModal, |
|
|
|
|
|
}, |
|
|
|
|
|
computed: { |
|
|
|
|
|
_extension(){ |
|
|
|
|
|
return this.orderInfo?.extension || {} |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
data(){ |
|
|
data(){ |
|
|
return { |
|
|
return { |
|
@ -84,16 +103,70 @@ export default { |
|
|
extension: {} |
|
|
extension: {} |
|
|
}, |
|
|
}, |
|
|
optionsQuery: {}, |
|
|
optionsQuery: {}, |
|
|
|
|
|
refundInfo: {} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onLoad(options){ |
|
|
onLoad(options){ |
|
|
this.getCardInfo({ |
|
|
this.getCardInfo({ |
|
|
id: options.id, |
|
|
id: options.id, |
|
|
card_no: options.card_no |
|
|
card_no: options.card_no |
|
|
}); |
|
|
|
|
|
this.optionsQuery = options || {}; |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
.then(res=>{ |
|
|
|
|
|
if(res.order_no)this.getRefundInfo(res.order_no || ''); |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
refunndBtn(){ |
|
|
|
|
|
let { orderInfo, _extension } = this; |
|
|
|
|
|
this.$refs.orderRefundModal.show({ |
|
|
|
|
|
stadium_name: _extension?.name ?? '', |
|
|
|
|
|
order_no: orderInfo?.order_no ?? '', |
|
|
|
|
|
mobile: orderInfo?.mobile ?? '', |
|
|
|
|
|
refundable_amount: +_extension?.pay_amount || 0, |
|
|
|
|
|
refundable_integral: 0, |
|
|
|
|
|
refund_times: 0, |
|
|
|
|
|
confirm: e => { |
|
|
|
|
|
this.userMonthlyCardRefundFixed({ |
|
|
|
|
|
order_no: orderInfo?.order_no || '', |
|
|
|
|
|
amount: e.refund_amount || 0, |
|
|
|
|
|
integral: e.refund_integral || 0 |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
async getRefundInfo(order_no){ |
|
|
|
|
|
try{ |
|
|
|
|
|
let _refundRes = await this.$store.dispatch('getOrderRefundList', order_no); |
|
|
|
|
|
|
|
|
|
|
|
console.log('refundRes', _refundRes); |
|
|
|
|
|
}catch(err){ |
|
|
|
|
|
console.warn('getRefundTimes err', err); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
// 年月卡订单-订单退款 |
|
|
|
|
|
userMonthlyCardRefundFixed({ order_no = '', amount = 0, integral = 0 }){ |
|
|
|
|
|
util.showLoad(); |
|
|
|
|
|
server.get({ |
|
|
|
|
|
url: ORDER_API.userMonthlyCardRefundFixed, |
|
|
|
|
|
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.getCardInfo({ |
|
|
|
|
|
id: this.optionsQuery?.id, |
|
|
|
|
|
card_no: this.optionsQuery?.card_no |
|
|
|
|
|
|
|
|
|
|
|
}), 1200)); |
|
|
|
|
|
}, |
|
|
previewImg(url){ |
|
|
previewImg(url){ |
|
|
if(!url)return |
|
|
if(!url)return |
|
|
uni.previewImage({ urls: [ url ] }); |
|
|
uni.previewImage({ urls: [ url ] }); |
|
@ -166,14 +239,18 @@ export default { |
|
|
}, |
|
|
}, |
|
|
getCardInfo({id, card_no}){ |
|
|
getCardInfo({id, card_no}){ |
|
|
util.showLoad(); |
|
|
util.showLoad(); |
|
|
server.get({ |
|
|
|
|
|
|
|
|
return server.get({ |
|
|
url: ORDER_API.userMonthlyCardInfo, |
|
|
url: ORDER_API.userMonthlyCardInfo, |
|
|
data: { id, card_no }, |
|
|
data: { id, card_no }, |
|
|
failMsg: '加载失败!' |
|
|
failMsg: '加载失败!' |
|
|
}) |
|
|
}) |
|
|
.then(res=>{ |
|
|
.then(res=>{ |
|
|
util.hideLoad(); |
|
|
util.hideLoad(); |
|
|
this.orderInfo = res || {}; |
|
|
|
|
|
|
|
|
return this.orderInfo = res || {}; |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(err=>{ |
|
|
|
|
|
util.hideLoad(); |
|
|
|
|
|
console.warn('getCardInfo err', err); |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
toRecord(){ |
|
|
toRecord(){ |
|
|