diff --git a/src/pages/order/list.vue b/src/pages/order/list.vue index 5172e69..71200b1 100644 --- a/src/pages/order/list.vue +++ b/src/pages/order/list.vue @@ -21,8 +21,9 @@ onReachBottom(()=>{ }) -function toOrderDetail(){ - routeTo('/subpackage/order/pages/detail'); +function toOrderDetail(e){ + let _qryStr = `brand_id=${e?.brand_id ?? ''}&order_no=${e?.order_no ?? ''}`; + routeTo(`/subpackage/order/pages/detail?${_qryStr}`); } function getOrderLs({ @@ -49,7 +50,7 @@ function getOrderLs({ - + {{ e.stadium_name ?? '-' }} diff --git a/src/subpackage/groupon/components/venue_info.vue b/src/subpackage/groupon/components/venue_info.vue index e4cc90c..89613c3 100644 --- a/src/subpackage/groupon/components/venue_info.vue +++ b/src/subpackage/groupon/components/venue_info.vue @@ -19,11 +19,16 @@ const props = defineProps({ venueLs: { type: Array, default: [] + }, + gatherLs: { + type: Array, + default: [] } }) const gatherList = computed({ get(){ + if(props?.gatherLs?.length)return props?.gatherLs; return formatVenueLs(props.venueLs); } }) @@ -41,7 +46,7 @@ function formatVenueLs(list){ if(!v?.length)return; let _name, start, end, lastIdx; v.forEach(ele=>{ - let [ _st, _et ] = (ele.time).split('-'); + let [ _st, _et ] = (ele?.time ?? ele?.duration).split('-'); if(_name&&ele.index !== (lastIdx + 1)){ showArr.push({ name: _name, duration: `${start}-${end}` }); start = _st; @@ -69,14 +74,14 @@ function formatVenueLs(list){ 预定场次: - {{ e.name || '几号馆' }} {{ e.duration || '时间段' }} + {{ e.name || '-' }} {{ e.duration ?? e.time ?? '-' }} 具体场次: - {{ e.venue_name ?? '' }} {{ e.time ?? '' }} ({{ e?.price ?? 0 }}元) + {{ e.venue_name ?? '' }} {{ e.time ?? e?.duration ?? '' }} ({{ e?.price ?? 0 }}元) diff --git a/src/subpackage/order/components/detail/contact.vue b/src/subpackage/order/components/detail/contact.vue index 1ee214f..45e6bb7 100644 --- a/src/subpackage/order/components/detail/contact.vue +++ b/src/subpackage/order/components/detail/contact.vue @@ -2,6 +2,12 @@ import { onLoad } from '@dcloudio/uni-app'; import { reactive, ref } from "vue"; const emits = defineEmits([ 'click:phone', 'click:nav' ]); +const props = defineProps({ + address: { + type: String, + default: '' + }, +}) onLoad(() => { }); @@ -17,7 +23,7 @@ onLoad(() => { - 白云区从云路822号城市像素6楼(电梯5楼走到6楼)> + {{ address ?? '-' }}> diff --git a/src/subpackage/order/pages/detail.vue b/src/subpackage/order/pages/detail.vue index ca6f4a1..1587fee 100644 --- a/src/subpackage/order/pages/detail.vue +++ b/src/subpackage/order/pages/detail.vue @@ -7,18 +7,19 @@ import detailVerify from "../components/detail/verify.vue"; import detailContact from "../components/detail/contact.vue"; import venueInfoAsync from "@/subpackage/groupon/components/venue_info.vue"; import { orderGet } from "../api"; +import { get_zh_day } from "@/utils"; const orderInfo = ref({}); // order_type 0场地 1/2次卡 -onLoad(() => { +onLoad(options => { + orderGet({ data: { - brand_id: 63, - order_no: "CC20250717152050893843" + brand_id: options?.brand_id ?? '', + order_no: options?.order_no ?? '' } }) .then(res=>{ orderInfo.value = res?.data ?? {}; - console.warn('CC20250717152050893843', res); }) }); @@ -27,7 +28,9 @@ function previewImg(img){ } function phoneClick(){ - + if(orderInfo.value?.venue_mobile){ + uni.makePhoneCall({ phoneNumber: orderInfo.value?.venue_mobile }); + } } function navClick(){ @@ -56,13 +59,20 @@ function navClick(){ - + diff --git a/src/utils/index.js b/src/utils/index.js index d05bb80..843f0d8 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -79,4 +79,18 @@ export function jsonStr(data){ export function jsonPar(json){ return JSON.parse(decodeURIComponent(decodeURIComponent(json))) -} \ No newline at end of file +} + +export function get_zh_day(date){ + if(!date)return ''; + if(isSameDay(new Date().getTime(),new Date(date).getTime()))return '今天' + const Arr = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']; + return Arr[new Date(date).getDay()] || ''; +} + +// 判断是否同一天 +export function isSameDay(timeStampA, timeStampB) { + let dateA = new Date(timeStampA); + let dateB = new Date(timeStampB); + return (dateA.setHours(0, 0, 0, 0) == dateB.setHours(0, 0, 0, 0)); +}