|
|
@ -2,8 +2,9 @@ |
|
|
|
import { onLoad, onReady } from '@dcloudio/uni-app'; |
|
|
|
import { reactive, ref, computed, watch, nextTick, onMounted, getCurrentInstance } from 'vue'; |
|
|
|
import { stadiumBookList } from "@/api"; |
|
|
|
import { venueTypes, bookDate, bookList } from '../api'; |
|
|
|
import { venueTypes, bookDate, bookList, orderAdd } from '../api'; |
|
|
|
import { getNodeMes, showModal } from "@/utils/polish"; |
|
|
|
import { debounce } from "@/utils"; |
|
|
|
import siteTable from "../components/site/table.vue"; |
|
|
|
import siteFooter from "../components/site/footer.vue"; |
|
|
|
import { get_zh_day, get_zh_date } from "../js/site_select/handle"; |
|
|
@ -15,6 +16,7 @@ const currentVenueType = ref({}); // 当前场地类型 |
|
|
|
const bookDateData = ref([]); // 日期列表 |
|
|
|
const currentBookDate = ref({}); // 当前选中日期 |
|
|
|
const isShowTypeRuleTxt = ref(false); |
|
|
|
const APPID = tt.getEnvInfoSync()?.microapp?.appId ?? ''; |
|
|
|
|
|
|
|
const stadiumInfo = ref({}); // 场馆信息 |
|
|
|
let ticketInfo = null; // 票券信息 |
|
|
@ -161,15 +163,9 @@ async function setScrollViewSize(){ |
|
|
|
scrollHeight.value = _sysInfo?.windowHeight - (_otherHeight || 0); |
|
|
|
} |
|
|
|
|
|
|
|
function submitClick(venues){ |
|
|
|
console.warn('submitClick venues', venues); |
|
|
|
uni.navigateTo({ |
|
|
|
url: `/subpackage/groupon/pages/confirm_order/venue`, |
|
|
|
success: res => { |
|
|
|
res.eventChannel.emit('dataFromGrouponSiteSelect', { |
|
|
|
stadium: stadiumInfo.value, |
|
|
|
ticket: ticketInfo, |
|
|
|
venueInfo: { |
|
|
|
const submitClick = debounce(function(venues){ |
|
|
|
let _sVal = stadiumInfo.value; |
|
|
|
let _vInfo = { |
|
|
|
classify: currentVenueType.value?.key ?? '', |
|
|
|
typeName: currentVenueType.value?.name ?? '', |
|
|
|
date: (currentBookDate.value?.date ?? '').slice(0, 10), |
|
|
@ -183,12 +179,42 @@ function submitClick(venues){ |
|
|
|
index: e?.index ?? '', |
|
|
|
_class_tag: e?._class_tag ?? '', |
|
|
|
})) |
|
|
|
}, |
|
|
|
} |
|
|
|
let _classTags = (_vInfo?.venues ?? []).map(e=>e?._class_tag ?? ''); |
|
|
|
// 用 add 检查是否存在连场禁止下单 |
|
|
|
return orderAdd({ data: { |
|
|
|
appid: APPID, |
|
|
|
brand_id: _sVal?.brand_id ?? '', |
|
|
|
stadium_id: _sVal?.id ?? '', |
|
|
|
date: _vInfo?.date, |
|
|
|
sessions: (_vInfo?.venues || []).map(el=>({ |
|
|
|
venue_id: el?.venue_id ?? '', |
|
|
|
duration: el?.time ?? '', |
|
|
|
price: el?.price ?? 0, |
|
|
|
tag: el?._class_tag ?? '', |
|
|
|
})), |
|
|
|
type_key: _vInfo?.classify ?? '', |
|
|
|
class_tags_enable: _classTags.filter(e=>e!=='').join(','), |
|
|
|
douyin_merchant_pay_amount: ticketInfo?.douyin_merchant_pay_amount ?? 0, |
|
|
|
douyin_groupon_coupon_code: ticketInfo?.certificate_id ?? '', |
|
|
|
} }) |
|
|
|
.then(res=>{ |
|
|
|
if(res?.code === 0 && res?.data?.order_no){ |
|
|
|
uni.navigateTo({ |
|
|
|
url: `/subpackage/groupon/pages/confirm_order/venue`, |
|
|
|
success: res => { |
|
|
|
res.eventChannel.emit('dataFromGrouponSiteSelect', { |
|
|
|
stadium: stadiumInfo.value, |
|
|
|
ticket: ticketInfo, |
|
|
|
venueInfo: _vInfo, |
|
|
|
}) |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}, 300, true); |
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
<template> |
|
|
|