Browse Source

add logic

dev
刘嘉炜 1 week ago
parent
commit
92a70a7a0d
  1. 36
      src/subpackage/groupon/pages/confirm_order/ticket.vue
  2. 1
      src/subpackage/groupon/pages/stadiums.vue

36
src/subpackage/groupon/pages/confirm_order/ticket.vue

@ -4,7 +4,7 @@ import { reactive, ref, onMounted, getCurrentInstance, computed } from "vue";
import confirmTemplate from "../../components/confirm_template.vue";
import ticketItem from "../../components/ticket_item.vue";
import { jsapiPreVerifyCertificates } from "../../api";
import { routeTo, showModal } from '@/utils/polish';
import { routeTo, showModal, showLoad, hideLoad } from '@/utils/polish';
const stadiumInfo = ref({}); //
const ticketInfo = ref({}); //
const verify_token = ref('');
@ -23,19 +23,22 @@ onMounted(() =>{
ticketInfo.value = ticket || {};
stadiumInfo.value = stadium || {};
pvc_func({
encrypted_codes: ticket?.encrypted_codes ?? '',
appid: tt.getEnvInfoSync()?.microapp?.appId ?? '',
brand_id: stadium?.brand_id ?? '',
stadium_id: stadium?.id ?? '',
encrypted_codes: ticket?.encrypted_codes ?? '',
douyin_merchant_pay_amount: ticket?.douyin_merchant_pay_amount ?? '',
certificate_id: ticket?.certificate_id ?? '',
})
})
})
function pvc_func({
encrypted_codes, stadium_id, douyin_merchant_pay_amount, certificate_id
appid, brand_id, stadium_id, encrypted_codes, douyin_merchant_pay_amount, certificate_id
}){
jsapiPreVerifyCertificates({
data: {
encrypted_codes, stadium_id, douyin_merchant_pay_amount, certificate_id
appid, brand_id, stadium_id,
encrypted_codes, douyin_merchant_pay_amount, certificate_id
},
})
.then(res=>{
@ -61,36 +64,21 @@ function confirmBtn(){
path: 'subpackage/order/pages/detail'
},
success(res){
hideLoad();
console.warn('verifyCertificates success', res);
showModal({ content: '核销成功!' })
},
fail(err){
hideLoad();
console.warn('verifyCertificates fail', err);
showModal({ content: err?.errMsg ?? '兑换操作失败!' })
},
}
console.log('tt.verifyCertificates data -->', _query)
showLoad();
return tt.verifyCertificates(_query);
jsapiPreVerifyCertificates({
data: {
encrypted_codes: _tVal?.encrypted_codes ?? '',
verify_token: _tVal?.verify_token ?? '',
stadium_id: stadiumInfo.value?.id ?? '',
douyin_merchant_pay_amount: _tVal?.douyin_merchant_pay_amount ?? '',
certificate_id: _tVal?.certificate_id ?? '',
},
Catch: true,
})
.then(res=>{
// routeTo(`/subpackage/groupon/pages/exchange_success`);
console.log('jsapiPreVerifyCertificates', res);
console.log('verifyCertificates data -->', _query)
})
}
</script>

1
src/subpackage/groupon/pages/stadiums.vue

@ -133,6 +133,7 @@ function toNextStep(stadiumInfo){
success: res => {
res.eventChannel.emit('dataFromGrouponStadiums', {
stadium: {
brand_id: stadiumInfo?.brand_id ?? '',
id: stadiumInfo?.id || '',
name: stadiumInfo?.name || '',
address: stadiumInfo?.address || '',

Loading…
Cancel
Save