diff --git a/src/pages/member/index.vue b/src/pages/member/index.vue index dfa20de..18fbf54 100644 --- a/src/pages/member/index.vue +++ b/src/pages/member/index.vue @@ -1,7 +1,7 @@ @@ -58,14 +48,18 @@ function login() { 登录 - + 我的工具 - + + @@ -128,6 +122,7 @@ function login() { margin-top: 40upx; padding: 0 30upx; .ml-item{ + @include clearBtn; display: inline-block; font-size: 0; .mi-icon{ diff --git a/src/static/images/service.png b/src/static/images/service.png new file mode 100644 index 0000000..bd593c3 Binary files /dev/null and b/src/static/images/service.png differ diff --git a/src/subpackage/groupon/pages/confirm_order/venue.vue b/src/subpackage/groupon/pages/confirm_order/venue.vue index fe29d61..7a38066 100644 --- a/src/subpackage/groupon/pages/confirm_order/venue.vue +++ b/src/subpackage/groupon/pages/confirm_order/venue.vue @@ -116,6 +116,7 @@ function confirmBtn(){ } console.log('tt.verifyCertificates data -->', _query) showLoad(); + // 这个api 只能接受点击触发,不能在回调里 return tt.verifyCertificates(_query); } diff --git a/src/subpackage/groupon/pages/list.vue b/src/subpackage/groupon/pages/list.vue index d0f87e8..2374fa4 100644 --- a/src/subpackage/groupon/pages/list.vue +++ b/src/subpackage/groupon/pages/list.vue @@ -16,8 +16,10 @@ onLoad(() => { } }) .then(res => { - if(res?.data?.data?.total === 0)return showModal({ content: '暂无票券' }); - ticketLs.value = res.data?.data?.orders || []; + let _data = res?.data?.data || {}; + if(_data?.error_code&&_data?.description)return showModal({ content: _data?.description }); + if(_data?.total === 0)return showModal({ content: '暂无票券' }); + ticketLs.value = _data?.orders || []; }); }); diff --git a/src/subpackage/groupon/pages/site_select.vue b/src/subpackage/groupon/pages/site_select.vue index 2f9978f..34fac11 100644 --- a/src/subpackage/groupon/pages/site_select.vue +++ b/src/subpackage/groupon/pages/site_select.vue @@ -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,34 +163,58 @@ 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: { - classify: currentVenueType.value?.key ?? '', - typeName: currentVenueType.value?.name ?? '', - date: (currentBookDate.value?.date ?? '').slice(0, 10), - zh_day: currentBookDate.value?._zh_day, - venues: venues.map(e=>({ - time: e?.time ?? '', - venue_name: e?._venue_name ?? '', - venue_id: e?._venue_id ?? '', - price: e?.price ?? '', - date: e?.date ?? '', - index: e?.index ?? '', - _class_tag: e?._class_tag ?? '', - })) - }, - }) +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), + zh_day: currentBookDate.value?._zh_day, + venues: venues.map(e=>({ + time: e?.time ?? '', + venue_name: e?._venue_name ?? '', + venue_id: e?._venue_id ?? '', + price: e?.price ?? '', + date: e?.date ?? '', + 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); + -}