diff --git a/Laravel/app/Http/Controllers/API/Internal/OrderController.php b/Laravel/app/Http/Controllers/API/Internal/OrderController.php index ade2b76..5a07f87 100644 --- a/Laravel/app/Http/Controllers/API/Internal/OrderController.php +++ b/Laravel/app/Http/Controllers/API/Internal/OrderController.php @@ -298,7 +298,12 @@ class OrderController extends Controller if(is_array($date_range) and count($date_range)==2){ - $OrderList=$OrderList ->whereBetween('created_at', [$date_range[0], $date_range[1].' 23:59:59']); + if(isset($status) and $status==3){ + $OrderList=$OrderList ->whereBetween('appointment_date', [$date_range[0], $date_range[1].' 23:59:59']); + }else{ + $OrderList=$OrderList ->whereBetween('created_at', [$date_range[0], $date_range[1].' 23:59:59']); + } + } $OrderList=$OrderList ->where(function ($query) use ($persons_sfz,$user) { diff --git a/h5/pages/buy/done/yuyue_done.vue b/h5/pages/buy/done/yuyue_done.vue index eea022b..b4e8117 100644 --- a/h5/pages/buy/done/yuyue_done.vue +++ b/h5/pages/buy/done/yuyue_done.vue @@ -111,7 +111,7 @@ - 支付成功预约成功 + 支付成功预约成功 请您的配偶在15分钟内完成预约,否则本次预约将会失效,如有支付金额会原路退回 diff --git a/h5/pages/main/index/index.vue b/h5/pages/main/index/index.vue index 136e28e..acf4d8b 100644 --- a/h5/pages/main/index/index.vue +++ b/h5/pages/main/index/index.vue @@ -26,7 +26,11 @@ path:{ type:String, default:'' - } + }, + orderid:{ + type:String, + default:'' + }, }); const getUserInfo = async () => { @@ -232,8 +236,10 @@ $response(response, () => { NoticeInfo.value=response.data if (!!$props.path && $props.path=='order') { + let orderid=$props.orderid?$props.orderid:'' + let canshu='?orderid='+orderid uni.navigateTo({ - url: "/pages/main/order/order" + url: "/pages/main/order/order"+canshu }) } }); diff --git a/h5/pages/main/login/login.vue b/h5/pages/main/login/login.vue index cbe6ef2..5a1eedd 100644 --- a/h5/pages/main/login/login.vue +++ b/h5/pages/main/login/login.vue @@ -22,6 +22,10 @@ import DraggableButton from "@/pages/components/goHome.vue"; path:{ type:String, default:'' + }, + orderid:{ + type:String, + default:'' } }); const tip_str = ref('授权登录中,请稍候...') @@ -42,6 +46,14 @@ import DraggableButton from "@/pages/components/goHome.vue"; param=param+"?path="+path } + if (!!$props.orderid) { + path = decodeURIComponent($props.orderid) + const index = path.indexOf('#'); + if (index !== -1) { + path= path.substring(0, index); // 包含 # 时,返回 # 前面的部分 + } + param=param+"&orderid="+path + } if (!!openid) { const index = openid.indexOf('#'); if (index !== -1) { diff --git a/h5/pages/main/order/order - 副本.vue b/h5/pages/main/order/order - 副本.vue new file mode 100644 index 0000000..7e8aa23 --- /dev/null +++ b/h5/pages/main/order/order - 副本.vue @@ -0,0 +1,266 @@ + + + \ No newline at end of file diff --git a/h5/pages/main/order/order.vue b/h5/pages/main/order/order.vue index 3a3dd5d..e7bf7d2 100644 --- a/h5/pages/main/order/order.vue +++ b/h5/pages/main/order/order.vue @@ -24,38 +24,91 @@ import TabBar from "@/common/TabBar.vue"; useStore } from '@/store' import { useRouter } from 'vue-router'; + + const $props = defineProps({ + orderid:{ + type:String, + default:'' + }, + status:{ + type:Number, + default:null + } + }); + let searchInfo=ref({ + orderid:null + }) + let DaiBanArr=ref([0,0,0,0]); const router = useRouter(); const $store = useStore() const order_list = ref([]) const getOrderList = async () => { uni.showLoading() - const response = await $api('OrderList') + const response = await $api('OrderList',{ + searchInfo:searchInfo.value + }) uni.hideLoading() $response(response, () => { order_list.value = response.data.list + DaiBanArr.value=response.data.DaiBanCountArr + + if(searchInfo.value.orderid && order_list.value.length>0){ + + nextTick(() => { + statusClick(getTabByOrder(order_list.value[0])) + }) + + } + if($props.status){ + status_active.value = $props.status + } + }) } + const getStatusAllow = (statusActive) => { + switch (statusActive) { + case '0': return [1, 2, 3, 4, 5, 6] + case '1': return [1] + case '2': return [2] // 未预约 + case '3': return [2] // 已预约 + + default: return [] + } + } + const getTabByOrder = (order) => { + const { status, appointment_number } = order + + if (status === 1) { + return '1' + } else if (status === 2) { + return (appointment_number == null || appointment_number === '') ? '2' : '3' + } else { + return '0' // 默认全部 + } + } + const order_list_computed = computed(() => { let list = [] - let status_allow = [] - switch (status_active.value) { - case '0': - status_allow = [1, 2, 3, 4, 5,6] - break; - case '1': - status_allow = [1] - break; - case '2': - status_allow = [2] - break; - case '3': - status_allow = [2] - break; - case '4': - status_allow = [3,4,5,6] - break; - } + // let status_allow = [] + // switch (status_active.value) { + // case '0': + // status_allow = [1, 2, 3, 4, 5,6] + // break; + // case '1': + // status_allow = [1] + // break; + // case '2': + // status_allow = [2] + // break; + // case '3': + // status_allow = [2] + // break; + // case '4': + // status_allow = [3,4,5,6] + // break; + // } + const status_allow = getStatusAllow(status_active.value) for (let i in order_list.value) { if (status_allow.includes(order_list.value[i].status)) { @@ -86,25 +139,32 @@ import TabBar from "@/common/TabBar.vue"; } const status_active = ref('0') const status_arr = ref([{ - label: '全部', - value: '0' - }, { label: '待支付', value: '1' }, { label: '待预约', value: '2' }, { - label: '进行中', + label: '已预约', value: '3' - }, { - label: '已结束', - value: '4' + },{ + label: '全部', + value: '0' }]) - const statusClick = (status) => { + const statusClick = (status,dotype=0) => { //dotype=1为手动点击,0为自动点击 status_active.value = '-1' nextTick(() => { status_active.value = status + if(status=='0' && searchInfo.value.orderid && dotype==1){ + uni.redirectTo({ + url: "/pages/main/order/order" + }); + } + if( searchInfo.value.orderid && dotype==1){ + uni.redirectTo({ + url: "/pages/main/order/order?status="+status + }); + } }) } @@ -120,9 +180,14 @@ import TabBar from "@/common/TabBar.vue"; }; onShow(() => { + uni.showLoading() if (!!config_ref.value) { getOrderList() } + searchInfo.value.orderid=$props.orderid + if($props.orderid){ + status_active.value=null + } }) onBackPress((options)=> { console.log(options) @@ -142,7 +207,8 @@ import TabBar from "@/common/TabBar.vue"; + ]" @click="statusClick(i.value,1)"> + {{ i.label }} @@ -155,6 +221,20 @@ import TabBar from "@/common/TabBar.vue";