|
@ -4,7 +4,7 @@ import { reactive, ref, onMounted, getCurrentInstance } from "vue"; |
|
|
import confirmTemplate from "../../components/confirm_template.vue"; |
|
|
import confirmTemplate from "../../components/confirm_template.vue"; |
|
|
import ticketItem from "../../components/ticket_item.vue"; |
|
|
import ticketItem from "../../components/ticket_item.vue"; |
|
|
import venueInfo from "../../components/venue_info.vue"; |
|
|
import venueInfo from "../../components/venue_info.vue"; |
|
|
import { jsapiPreVerifyCertificates, orderAdd } from "../../api"; |
|
|
|
|
|
|
|
|
import { jsapiPreVerifyCertificates, orderAdd, orderPayMini } from "../../api"; |
|
|
import { routeTo, showModal, showLoad, hideLoad } from '@/utils/polish'; |
|
|
import { routeTo, showModal, showLoad, hideLoad } from '@/utils/polish'; |
|
|
const stadiumInfo = ref({}); |
|
|
const stadiumInfo = ref({}); |
|
|
const ticketInfo = ref({}); |
|
|
const ticketInfo = ref({}); |
|
@ -49,7 +49,9 @@ function pvc_func(data){ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function confirmBtn(){ |
|
|
function confirmBtn(){ |
|
|
|
|
|
|
|
|
let _tVal = ticketInfo.value; |
|
|
let _tVal = ticketInfo.value; |
|
|
|
|
|
let _classTags = (venueData.value?.venues ?? []).map(e=>e?._class_tag ?? ''); |
|
|
|
|
|
|
|
|
const _query = { |
|
|
const _query = { |
|
|
verifyToken: verify_token.value ?? '', |
|
|
verifyToken: verify_token.value ?? '', |
|
@ -67,41 +69,63 @@ function confirmBtn(){ |
|
|
hideLoad(); |
|
|
hideLoad(); |
|
|
console.warn('verifyCertificates success', res); |
|
|
console.warn('verifyCertificates success', res); |
|
|
showModal({ content: '核销成功!' }); |
|
|
showModal({ content: '核销成功!' }); |
|
|
let _classTags = (venueData.value?.venues ?? []).map(e=>e?._class_tag ?? ''); |
|
|
|
|
|
|
|
|
return createServerOrder(); |
|
|
|
|
|
}, |
|
|
|
|
|
fail(err){ |
|
|
|
|
|
hideLoad(); |
|
|
|
|
|
console.warn('verifyCertificates fail', err); |
|
|
|
|
|
showModal({ content: err?.errMsg ?? '兑换操作失败!' }) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
console.log('tt.verifyCertificates data -->', _query) |
|
|
|
|
|
showLoad(); |
|
|
|
|
|
return tt.verifyCertificates(_query); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function createServerOrder(){ |
|
|
|
|
|
let _tVal = ticketInfo.value, _vVal = venueData.value, _sVal = stadiumInfo.value; |
|
|
|
|
|
|
|
|
|
|
|
let _classTags = (_vVal?.venues ?? []).map(e=>e?._class_tag ?? ''); |
|
|
createBookOrder({ |
|
|
createBookOrder({ |
|
|
appid: APPID, |
|
|
appid: APPID, |
|
|
brand_id: stadiumInfo.value?.brand_id ?? '', |
|
|
|
|
|
stadium_id: stadiumInfo.value?.id ?? '', |
|
|
|
|
|
date: venueData.value?.date, |
|
|
|
|
|
sessions: (venueData.value?.venues || []).map(el=>({ |
|
|
|
|
|
|
|
|
brand_id: _sVal?.brand_id ?? '', |
|
|
|
|
|
stadium_id: _sVal?.id ?? '', |
|
|
|
|
|
date: _vVal?.date, |
|
|
|
|
|
sessions: (_vVal?.venues || []).map(el=>({ |
|
|
venue_id: el?.venue_id ?? '', |
|
|
venue_id: el?.venue_id ?? '', |
|
|
duration: el?.time ?? '', |
|
|
duration: el?.time ?? '', |
|
|
price: el?.price ?? 0, |
|
|
price: el?.price ?? 0, |
|
|
tag: el?._class_tag ?? '', |
|
|
tag: el?._class_tag ?? '', |
|
|
})), |
|
|
})), |
|
|
type_key: venueData.value?.classify ?? '', |
|
|
|
|
|
|
|
|
type_key: _vVal?.classify ?? '', |
|
|
class_tags_enable: _classTags.filter(e=>e!=='').join(','), |
|
|
class_tags_enable: _classTags.filter(e=>e!=='').join(','), |
|
|
verify_token: verify_token.value ?? '', |
|
|
verify_token: verify_token.value ?? '', |
|
|
douyin_merchant_pay_amount: _tVal?.douyin_merchant_pay_amount ?? 0, |
|
|
douyin_merchant_pay_amount: _tVal?.douyin_merchant_pay_amount ?? 0, |
|
|
douyin_groupon_coupon_code: _tVal?.certificate_id ?? '' |
|
|
|
|
|
|
|
|
douyin_groupon_coupon_code: _tVal?.certificate_id ?? '', |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
|
|
|
fail(err){ |
|
|
|
|
|
hideLoad(); |
|
|
|
|
|
console.warn('verifyCertificates fail', err); |
|
|
|
|
|
showModal({ content: err?.errMsg ?? '兑换操作失败!' }) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.then(cRes=>{ |
|
|
|
|
|
console.log('createBookOrder', cRes); |
|
|
|
|
|
if(!cRes?.order_no)return; |
|
|
|
|
|
orderPayMini({ |
|
|
|
|
|
data: { |
|
|
|
|
|
appid: APPID, |
|
|
|
|
|
brand_id: _sVal?.brand_id ?? '', |
|
|
|
|
|
stadium_id: _sVal?.id ?? '', |
|
|
|
|
|
order_no: cRes?.order_no, |
|
|
|
|
|
platform_type: "wechat_platform", |
|
|
} |
|
|
} |
|
|
console.log('tt.verifyCertificates data -->', _query) |
|
|
|
|
|
showLoad(); |
|
|
|
|
|
return tt.verifyCertificates(_query); |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
.then(oRes=>{ |
|
|
|
|
|
console.warn('orderPayMini', oRes); |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function createBookOrder(data){ |
|
|
function createBookOrder(data){ |
|
|
orderAdd({ data }) |
|
|
|
|
|
|
|
|
return orderAdd({ data }) |
|
|
.then(res=>{ |
|
|
.then(res=>{ |
|
|
console.log('createBookOrder', res); |
|
|
|
|
|
|
|
|
return res?.data ?? {} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|