化妆
Showing
6 changed files
with
381 additions
and
263 deletions
| ... | @@ -224,6 +224,14 @@ export function makeUpDetail(data) { | ... | @@ -224,6 +224,14 @@ export function makeUpDetail(data) { |
| 224 | }) | 224 | }) |
| 225 | } | 225 | } |
| 226 | 226 | ||
| 227 | export function getActivityMealVoListByStudioId(data) { | ||
| 228 | return request({ | ||
| 229 | url: `/ota/activityMeal/getActivityMealVoListByStudioId`, | ||
| 230 | method: 'get', | ||
| 231 | params:data | ||
| 232 | }) | ||
| 233 | } | ||
| 234 | |||
| 227 | export function getMealConfList(data) { | 235 | export function getMealConfList(data) { |
| 228 | return request({ | 236 | return request({ |
| 229 | url: `/ota/mealConfig/getMealConfList`, | 237 | url: `/ota/mealConfig/getMealConfList`, |
| ... | @@ -231,3 +239,28 @@ export function getMealConfList(data) { | ... | @@ -231,3 +239,28 @@ export function getMealConfList(data) { |
| 231 | params:data | 239 | params:data |
| 232 | }) | 240 | }) |
| 233 | } | 241 | } |
| 242 | |||
| 243 | export function submitOrderMeal(data) { | ||
| 244 | return request({ | ||
| 245 | url: `/ota/norder/submitOrderMeal`, | ||
| 246 | method: 'post', | ||
| 247 | data | ||
| 248 | }) | ||
| 249 | } | ||
| 250 | |||
| 251 | export function getMealOrderInfo(data) { | ||
| 252 | return request({ | ||
| 253 | url: `/ota/orderMeal/getMealOrderInfo`, | ||
| 254 | method: 'get', | ||
| 255 | params:data | ||
| 256 | }) | ||
| 257 | } | ||
| 258 | |||
| 259 | |||
| 260 | export function getMealOrderInfoByLogex(data) { | ||
| 261 | return request({ | ||
| 262 | url: `/ota/orderMeal/getMealOrderInfoByLogex`, | ||
| 263 | method: 'get', | ||
| 264 | params:data | ||
| 265 | }) | ||
| 266 | } | ... | ... |
| ... | @@ -410,7 +410,7 @@ export const constantRoutes = [ | ... | @@ -410,7 +410,7 @@ export const constantRoutes = [ |
| 410 | meta: { title: 'Makeup Appointment' } | 410 | meta: { title: 'Makeup Appointment' } |
| 411 | }, | 411 | }, |
| 412 | { | 412 | { |
| 413 | path: 'makeUp/:cptId/:id/:orderId', | 413 | path: 'makeUp/:cptId/:id/:lasId', |
| 414 | component: () => import('@/viewsPc/booking/makeUpOrder.vue'), | 414 | component: () => import('@/viewsPc/booking/makeUpOrder.vue'), |
| 415 | name: 'makeUpOrder', | 415 | name: 'makeUpOrder', |
| 416 | meta: { title: 'Makeup Reservation' } | 416 | meta: { title: 'Makeup Reservation' } | ... | ... |
| ... | @@ -10,14 +10,18 @@ | ... | @@ -10,14 +10,18 @@ |
| 10 | <el-row justify="center" align='middle' > | 10 | <el-row justify="center" align='middle' > |
| 11 | <div class="canBtn"><el-icon><ArrowLeftBold /></el-icon></div> | 11 | <div class="canBtn"><el-icon><ArrowLeftBold /></el-icon></div> |
| 12 | <div> | 12 | <div> |
| 13 | <el-date-picker | 13 | <!-- <el-date-picker--> |
| 14 | v-model="value2" | 14 | <!-- v-model="value2"--> |
| 15 | type="datetimerange" | 15 | <!-- type="daterange"--> |
| 16 | range-separator="-" | 16 | <!-- range-separator="-"--> |
| 17 | start-placeholder="Start date" | 17 | <!-- start-placeholder="Start date"--> |
| 18 | end-placeholder="End date" | 18 | <!-- end-placeholder="End date"--> |
| 19 | size="small" | 19 | <!-- format="YYYY-MM-DD"--> |
| 20 | /> | 20 | <!-- value-format="YYYY-MM-DD"--> |
| 21 | <!-- size="small"--> | ||
| 22 | <!-- @change="changee"--> | ||
| 23 | <!-- />--> | ||
| 24 | <el-input readonly v-model="value2" type="text" size="small" style="width: 280px"></el-input> | ||
| 21 | </div> | 25 | </div> |
| 22 | <div class="canBtn"><el-icon><ArrowRightBold /></el-icon></div> | 26 | <div class="canBtn"><el-icon><ArrowRightBold /></el-icon></div> |
| 23 | </el-row> | 27 | </el-row> |
| ... | @@ -25,9 +29,10 @@ | ... | @@ -25,9 +29,10 @@ |
| 25 | <el-col :span="7"> | 29 | <el-col :span="7"> |
| 26 | <div style="text-align: right;padding-right: 10px"> | 30 | <div style="text-align: right;padding-right: 10px"> |
| 27 | <el-date-picker | 31 | <el-date-picker |
| 28 | v-model="currentDate" | 32 | v-model="currentDate1" |
| 29 | type="datetime" | 33 | type="date" |
| 30 | placeholder="YYYY-MM-DD" | 34 | placeholder="YYYY-MM-DD" |
| 35 | format="YYYY-MM-DD" | ||
| 31 | size="small" | 36 | size="small" |
| 32 | @change="dateChange" | 37 | @change="dateChange" |
| 33 | /> | 38 | /> |
| ... | @@ -47,20 +52,27 @@ | ... | @@ -47,20 +52,27 @@ |
| 47 | <li v-for="n in schList" :key="n.id" @click="goMatch(n)"> | 52 | <li v-for="n in schList" :key="n.id" @click="goMatch(n)"> |
| 48 | <el-row style="width: 100%"> | 53 | <el-row style="width: 100%"> |
| 49 | <div style="margin-right: 25px"> | 54 | <div style="margin-right: 25px"> |
| 50 | <el-image style="width: 90px;height: 115px" src="@/assets/dance/banner.png" fit="cover" /> | 55 | <el-image style="width: 90px;height: 115px" :src="fillImgUrl(n.photos?.split(',')[0]) " fit="cover" /> |
| 51 | </div> | 56 | </div> |
| 52 | <div style="flex: 1" > | 57 | <div style="flex: 1" > |
| 53 | <div class="hz-title">A套餐</div> | 58 | <div class="hz-title">{{ n.name }}</div> |
| 54 | <div> | 59 | <div> |
| 55 | <el-row justify="space-between"> | 60 | <el-row justify="space-between"> |
| 56 | <el-row class="hz-p"> | 61 | <el-row class="hz-p" style="flex: 1"> |
| 57 | <div style="margin-right: 80px">项目: <span style="margin-right: 20px">发型x1</span> <span>化妆x1</span> </div> | 62 | <el-col :span="8"> |
| 58 | <div style="margin-right: 80px">服务: 化妆x1 </div> | 63 | <div >{{ language==0?'套餐说明':'Package Description' }}: <span style="margin-right: 20px">{{n.introduction}}</span></div> |
| 59 | <div>剩余 <span class="sign">6</span>名额 </div> | 64 | </el-col> |
| 65 | |||
| 66 | <el-col :span="8"> | ||
| 67 | <div>{{ language==0?'剩余':'' }}<span class="sign">{{ n.num-n.counts }}</span>{{language==0?'名额':'Places Remaining' }} </div> | ||
| 68 | </el-col> | ||
| 69 | <el-col :span="8"> | ||
| 70 | <div >{{n.goHome==1?language==0?'上门化妆':'Door-to-door makeup':''}}</div> | ||
| 71 | </el-col> | ||
| 60 | </el-row> | 72 | </el-row> |
| 61 | <el-row> | 73 | <el-row> |
| 62 | <div class="zh-margin" style="font-size: 36px;color: #ff8124"><span style="font-size: 24px">¥ </span> 120</div> | 74 | <div class="zh-margin" style="font-size: 36px;color: #ff8124"><span style="font-size: 24px">{{ language==0?'¥':'€'}} </span> {{language==0?n.mealPrice:n.mealPriceEn}}</div> |
| 63 | <el-button class="btn-lineG w200px" round type="primary" size="large">{{ language==0?'立即预约':'Select' }} ⇀</el-button> | 75 | <el-button :disabled="n.num-n.counts<=0" class="btn-lineG w200px" round type="primary" size="large">{{ language==0?'立即预约':'Select' }} ⇀</el-button> |
| 64 | </el-row> | 76 | </el-row> |
| 65 | </el-row> | 77 | </el-row> |
| 66 | </div> | 78 | </div> |
| ... | @@ -82,16 +94,19 @@ import {dayjs} from "element-plus"; | ... | @@ -82,16 +94,19 @@ import {dayjs} from "element-plus"; |
| 82 | import {useRoute,useRouter} from 'vue-router' | 94 | import {useRoute,useRouter} from 'vue-router' |
| 83 | import * as booking from "@/apiPc/booking" | 95 | import * as booking from "@/apiPc/booking" |
| 84 | import {useStorage} from "@vueuse/core/index"; | 96 | import {useStorage} from "@vueuse/core/index"; |
| 97 | import useUserStore from "/@/store/modules/user"; | ||
| 98 | |||
| 99 | const user = useUserStore().user | ||
| 85 | const language = useStorage('language', 0) | 100 | const language = useStorage('language', 0) |
| 86 | const router = useRouter() | 101 | const router = useRouter() |
| 87 | const route=useRoute() | 102 | const route=useRoute() |
| 88 | const currentDate = ref(new Date()) | 103 | const currentDate = ref(new Date()) |
| 89 | const calendarRange = ref([dayjs('2024-07-17').toDate(), dayjs('2024-07-17').toDate()]) | 104 | const currentDate1 = ref(new Date()) |
| 105 | const calendarRange = ref([dayjs(currentDate.value).toDate(),(dayjs(currentDate.value).toDate())]) | ||
| 90 | const schList = ref([]) | 106 | const schList = ref([]) |
| 91 | const loading = ref(false) | 107 | const loading = ref(false) |
| 92 | const query = ref({ | 108 | const query = ref({ |
| 93 | currentDate: dayjs(new Date()).format('YYYY-MM-DD') , | 109 | lasId:route.params.id, |
| 94 | // id:route.params.id | ||
| 95 | }) | 110 | }) |
| 96 | const value1=ref('') | 111 | const value1=ref('') |
| 97 | const value2=ref('') | 112 | const value2=ref('') |
| ... | @@ -100,34 +115,46 @@ const value2=ref('') | ... | @@ -100,34 +115,46 @@ const value2=ref('') |
| 100 | getScheduleList() | 115 | getScheduleList() |
| 101 | function getScheduleList() { | 116 | function getScheduleList() { |
| 102 | loading.value = true | 117 | loading.value = true |
| 103 | // query.value.currentDate = dayjs(query.value.currentDate).format('YYYY-MM-DD') | 118 | query.value.currentDate = dayjs(currentDate.value).format('YYYY-MM-DD') |
| 104 | booking.getMealConfList(query.value).then(res=>{ | 119 | booking.getActivityMealVoListByStudioId(query.value).then(res=>{ |
| 105 | loading.value = false | 120 | loading.value = false |
| 106 | schList.value = res.data | 121 | schList.value = res.data |
| 107 | }) | 122 | }) |
| 108 | } | 123 | } |
| 109 | function selectDate(date) { | 124 | function selectDate(date) { |
| 110 | console.log(dayjs(date).format('YYYY-MM-DD')) | 125 | currentDate1.value= currentDate.value=dayjs(date).toDate() |
| 111 | query.value.currentDate = dayjs(date).format('YYYY-MM-DD') | 126 | console.log(date) |
| 112 | console.log(currentDate.value) | ||
| 113 | getScheduleList() | 127 | getScheduleList() |
| 114 | } | 128 | } |
| 115 | 129 | ||
| 116 | function dateChange(){ | 130 | function dateChange(){ |
| 117 | query.value.currentDate = dayjs(currentDate.value).format('YYYY-MM-DD') | 131 | currentDate.value=currentDate1.value |
| 132 | calendarRange.value=[dayjs(currentDate.value).toDate(),(dayjs(currentDate.value).toDate())] | ||
| 118 | getScheduleList() | 133 | getScheduleList() |
| 134 | console.log(currentDate.value) | ||
| 135 | console.log(currentDate1.value) | ||
| 119 | } | 136 | } |
| 137 | |||
| 120 | function goMatch(n) { | 138 | function goMatch(n) { |
| 139 | if (!user) { | ||
| 140 | useUserStore().setVisitor() | ||
| 141 | return | ||
| 142 | } | ||
| 143 | |||
| 121 | router.push({ | 144 | router.push({ |
| 122 | name: 'makeUpOrder', | 145 | name: 'makeUpOrder', |
| 123 | params: { | 146 | params: { |
| 124 | orderId: n.cptId | 147 | lasId: n.id |
| 125 | }, | 148 | }, |
| 126 | query: { | 149 | // query: { |
| 127 | matchId: n.cptId | 150 | // matchId: n.cptId |
| 128 | } | 151 | // } |
| 129 | }) | 152 | }) |
| 130 | } | 153 | } |
| 154 | |||
| 155 | function changee(){ | ||
| 156 | console.log(value2.value) | ||
| 157 | } | ||
| 131 | </script> | 158 | </script> |
| 132 | 159 | ||
| 133 | <style scoped lang="scss"> | 160 | <style scoped lang="scss"> |
| ... | @@ -283,7 +310,7 @@ function goMatch(n) { | ... | @@ -283,7 +310,7 @@ function goMatch(n) { |
| 283 | line-height: 26px; | 310 | line-height: 26px; |
| 284 | text-align: center; | 311 | text-align: center; |
| 285 | background-color: #fff; | 312 | background-color: #fff; |
| 286 | margin: 0 16px 5px 16px; | 313 | margin: 0 16px -2px 16px; |
| 287 | cursor:pointer | 314 | cursor:pointer |
| 288 | } | 315 | } |
| 289 | </style> | 316 | </style> | ... | ... |
| ... | @@ -9,75 +9,79 @@ | ... | @@ -9,75 +9,79 @@ |
| 9 | <el-card> | 9 | <el-card> |
| 10 | <div class='order-header'> | 10 | <div class='order-header'> |
| 11 | <div class="title"> | 11 | <div class="title"> |
| 12 | Mango 美妆工作室 | 12 | {{formData.name }} |
| 13 | </div> | 13 | </div> |
| 14 | <el-row class="hz-row" > | 14 | <el-row class="hz-row" > |
| 15 | <el-icon size="16" style="position: relative;top: 2px" color="#929AA0"> | 15 | <el-icon size="16" style="position: relative;top: 2px" color="#929AA0"> |
| 16 | <LocationFilled/> | 16 | <OfficeBuilding/> |
| 17 | </el-icon> | 17 | </el-icon> |
| 18 | 成立 6 年 | | 18 | {{ language==0?'成立':'Established for'}} <span class="sign" style="padding-top: 2px">6</span>{{language==0?'年':'years'}} | |
| 19 | <el-icon size="16" style="position: relative;top: 2px" color="#929AA0"> | 19 | <el-icon size="16" style="position: relative;top: 2px" color="#929AA0"> |
| 20 | <LocationFilled/> | 20 | <UserFilled/> |
| 21 | </el-icon> | 21 | </el-icon> |
| 22 | 12 名化妆师 | | 22 | <span class="sign" style="padding-top: 2px"> {{ formData.dresserLimit }}</span>{{language==0?'名化妆师':'makeup artists' }} | |
| 23 | <el-icon size="16" style="position: relative;top: 2px" color="#929AA0"> | 23 | <el-icon size="16" style="position: relative;top: 2px" color="#929AA0"> |
| 24 | <LocationFilled/> | 24 | <PhoneFilled/> |
| 25 | </el-icon> | 25 | </el-icon> |
| 26 | 1535891241234 | | 26 | <span style="padding-top: 2px"> |
| 27 | {{ formData.contact }} | ||
| 28 | </span> | ||
| 29 | | | ||
| 27 | <el-icon size="16" style="position: relative;top: 2px" color="#929AA0"> | 30 | <el-icon size="16" style="position: relative;top: 2px" color="#929AA0"> |
| 28 | <LocationFilled/> | 31 | <LocationFilled/> |
| 29 | </el-icon> | 32 | </el-icon> |
| 30 | 江苏省1412341234 | 33 | {{formData.rearks}} |
| 31 | 34 | ||
| 32 | </el-row> | 35 | </el-row> |
| 33 | <hr> | 36 | <hr style="border:1px solid #D3D1F6 "> |
| 34 | <el-row class="table"> | 37 | <el-row class="table"> |
| 35 | <div style="margin-right: 50px"> | 38 | <div style="margin-right: 50px"> |
| 36 | <el-image style="width:55px;height: 70px " src="" fit="cover" /> | 39 | <el-image style="width:55px;height: 70px " :src="fillImgUrl(formDatas.photos?.split(',')[0]) " fit="cover" /> |
| 37 | </div> | 40 | </div> |
| 38 | <el-row style="flex: 1"> | 41 | <el-row style="flex: 1"> |
| 39 | <div style="flex: 1"> | 42 | <div style="flex: 1"> |
| 40 | <div style="margin-bottom: 20px;">预约日期 <span class="span">2024.03.11</span></div> | 43 | <div style="margin-bottom: 20px;">预约日期 <span class="span">2024.03.11</span></div> |
| 41 | <div>套餐名称 <span class="span">A套餐</span></div> | 44 | <div>套餐名称 <span class="span">{{ formDatas.name }}</span></div> |
| 42 | </div> | 45 | </div> |
| 43 | 46 | ||
| 44 | <div style="flex: 1"> | 47 | <div style="flex: 1"> |
| 45 | <div style="margin-bottom: 20px">预约时间 <span class="span">09:00~12:00</span> </div> | 48 | <div style="margin-bottom: 20px">预约时间 <span class="span">09:00~12:00</span> </div> |
| 46 | <div>服务 <span class="span">上门化妆</span></div> | 49 | <div>上门化妆 <span class="span">{{ formDatas.goHome==1?'是':'否' }}</span></div> |
| 47 | </div> | 50 | </div> |
| 48 | 51 | ||
| 49 | <div style="flex: 1"> | 52 | <div style="flex: 1"> |
| 50 | <div style="margin-bottom: 20px">化妆项目 <span class="span">化妆x1 发型x1</span></div> | 53 | <div style="margin-bottom: 20px">套餐说明 <span class="span">{{formDatas.introduction}}</span></div> |
| 51 | <div >价格 <span class="sign">¥450</span></div> | 54 | <div >价格 <span class="sign">{{language==0? '¥'+formDatas.mealPrice:'€'+formDatas.mealPriceEn }}</span></div> |
| 52 | </div> | 55 | </div> |
| 53 | </el-row> | 56 | </el-row> |
| 54 | </el-row> | 57 | </el-row> |
| 55 | </div> | 58 | </div> |
| 56 | <br> | 59 | <br> |
| 60 | <div class="yu">预约时间</div> | ||
| 61 | <el-row style="width: 100%" > | ||
| 62 | <el-button v-for="v in radioList" @click="handleRadio(v)" :disabled="v.num-v.counts<=0" class="radioBox" :class="{'radioBoxbg':v.flag}"> | ||
| 63 | <div> | ||
| 64 | <div>{{ v.nameStart }}-{{ v.nameEnd }}</div> | ||
| 65 | <div>(剩余: <span class="sing">{{ v.num-v.counts }}</span> 个)</div> | ||
| 66 | </div> | ||
| 67 | </el-button> | ||
| 68 | </el-row> | ||
| 69 | <br> | ||
| 57 | <div class="yu">预约信息</div> | 70 | <div class="yu">预约信息</div> |
| 58 | <br> | 71 | <br> |
| 59 | <div class="form-order"> | 72 | <div class="form-order"> |
| 60 | <el-form :model="form" style="width: 600px" :label-width="language==0?'140px':'160px'" :rules="rules" ref="formRef"> | 73 | <el-form :model="form" style="width: 800px" :label-width="language==0?'140px':'200px'" :rules="rules" ref="formRef"> |
| 61 | <el-form-item :label="language==0?'预约时间':'Appointment Time'" required> | 74 | <el-form-item :label="language==0?'预约数量':'Number Of Reservations'" required prop="num"> |
| 62 | <el-date-picker | 75 | <el-input-number style="width: 100%" v-model.trim="form.num" :min="1" :max="10" @change="changNum"/> |
| 63 | @change="getDaysBetween" | ||
| 64 | v-model="rzRange" | ||
| 65 | type="daterange" | ||
| 66 | :disabled-date="disabledDateRZ" | ||
| 67 | :placeholder="language==0?'选择日期':'Select date'" format="YYYY-MM-DD" | ||
| 68 | value-format="YYYY-MM-DD"/> | ||
| 69 | </el-form-item> | 76 | </el-form-item> |
| 70 | <el-form-item :label="language==0?'预约数量':'Appointment Time'" required> | 77 | <el-form-item :label="language==0?'预约联系人':'Appointment Contact'" required prop="contacts"> |
| 71 | <el-input-number v-model="form.number" :min="1" :max="10" label="描述文字"/> | 78 | <el-input v-model.trim="form.contacts" :min="1" :max="10" /> |
| 72 | </el-form-item> | 79 | </el-form-item> |
| 73 | <el-form-item :label="language==0?'预约联系人':'Appointment Time'" required> | 80 | <el-form-item :label="language==0?'联系电话':'Contact Number'" required prop="phone"> |
| 74 | <el-input v-model="form.number" :min="1" :max="10" label="描述文字"/> | 81 | <el-input v-model.trim="form.phone" :min="1" :max="13" /> |
| 75 | </el-form-item> | 82 | </el-form-item> |
| 76 | <el-form-item :label="language==0?'联系电话':'Appointment Time'" required> | 83 | <el-form-item :label="language==0?'备注':'Remarks'" prop="remarks"> |
| 77 | <el-input v-model="form.number" :min="1" :max="10" label="描述文字"/> | 84 | <el-input type="textarea" :rows="3" v-model.trim="form.remarks" :min="1" :max="10" /> |
| 78 | </el-form-item> | ||
| 79 | <el-form-item :label="language==0?'备注':'Appointment Time'" required> | ||
| 80 | <el-input type="textarea" :rows="3" v-model="form.number" :min="1" :max="10" label="描述文字"/> | ||
| 81 | </el-form-item> | 85 | </el-form-item> |
| 82 | </el-form> | 86 | </el-form> |
| 83 | </div> | 87 | </div> |
| ... | @@ -235,13 +239,15 @@ | ... | @@ -235,13 +239,15 @@ |
| 235 | 239 | ||
| 236 | <script setup> | 240 | <script setup> |
| 237 | import {useRouter, useRoute} from "vue-router"; | 241 | import {useRouter, useRoute} from "vue-router"; |
| 238 | import {ref, reactive, onMounted} from "vue"; | 242 | import {ref, reactive, onMounted,getCurrentInstance} from "vue"; |
| 239 | import {useStorage} from "@vueuse/core/index"; | 243 | import {useStorage} from "@vueuse/core/index"; |
| 240 | import {checkResidueRoom, getBaseInfoByActiveId, newsSubmitOrderHotel} from "@/apiPc/booking" | 244 | import {checkResidueRoom, getBaseInfoByActiveId, newsSubmitOrderHotel, submitOrderMeal} from "@/apiPc/booking" |
| 245 | import * as booking from "@/apiPc/booking" | ||
| 241 | import dayjs from 'dayjs' | 246 | import dayjs from 'dayjs' |
| 242 | import {ElMessage, ElMessageBox} from "element-plus"; | 247 | import {ElMessage, ElMessageBox} from "element-plus"; |
| 243 | import useUserStore from "@/store/modules/user"; | 248 | import useUserStore from "@/store/modules/user"; |
| 244 | 249 | import {formatDate} from "/@/utils"; | |
| 250 | const { proxy } = getCurrentInstance() | ||
| 245 | const user = useUserStore().user | 251 | const user = useUserStore().user |
| 246 | const language = useStorage('language', 0) | 252 | const language = useStorage('language', 0) |
| 247 | const router = useRouter() | 253 | const router = useRouter() |
| ... | @@ -251,12 +257,15 @@ const hotelName = ref('') | ... | @@ -251,12 +257,15 @@ const hotelName = ref('') |
| 251 | const canOrderNum = ref(0) | 257 | const canOrderNum = ref(0) |
| 252 | const lform = ref({}) | 258 | const lform = ref({}) |
| 253 | const form = ref({ | 259 | const form = ref({ |
| 254 | isAddbed: '0', | 260 | num: '1', |
| 255 | roomNum: 0, | 261 | roomNum: 0, |
| 256 | addNum: 0, | 262 | addNum: 0, |
| 257 | ddDate: '14:00', | 263 | ddDate: '14:00', |
| 258 | phone: user?.phonenumber || '', | 264 | phone: user?.phonenumber || '', |
| 259 | }) | 265 | }) |
| 266 | const formData=ref({}) | ||
| 267 | const formDatas=ref({}) | ||
| 268 | const timeVal=ref(null) | ||
| 260 | const rzRange = ref([]) | 269 | const rzRange = ref([]) |
| 261 | const rzUserArr = ref([]) | 270 | const rzUserArr = ref([]) |
| 262 | const money = ref(0) | 271 | const money = ref(0) |
| ... | @@ -343,20 +352,62 @@ const ddDateArr = ref([ | ... | @@ -343,20 +352,62 @@ const ddDateArr = ref([ |
| 343 | label: '02:00' | 352 | label: '02:00' |
| 344 | } | 353 | } |
| 345 | ]) | 354 | ]) |
| 346 | const rules = ref({}) | 355 | const rules = ref({ |
| 356 | num: [ | ||
| 357 | { required: true, message: '预约数量不能为空', trigger: 'blur' }, | ||
| 358 | ], | ||
| 359 | contacts: [ | ||
| 360 | { required: true, message: '请输入预约联系人', trigger: 'blur' }, | ||
| 361 | ], | ||
| 362 | phoned: [ | ||
| 363 | { required: true, message: '请输入联系电话', trigger: 'change' }, | ||
| 364 | ], | ||
| 347 | 365 | ||
| 366 | }) | ||
| 367 | const radioList=ref([]) | ||
| 348 | let usedays = 0 | 368 | let usedays = 0 |
| 369 | |||
| 349 | onMounted(() => { | 370 | onMounted(() => { |
| 350 | console.log(route.query) | 371 | console.log(route.query) |
| 351 | room.value = JSON.parse(decodeURIComponent(route.query.room)) | 372 | getData() |
| 352 | console.log(room.value) | 373 | getRadioList() |
| 353 | hotelName.value = route.query.hotelName | ||
| 354 | money.value = 0 | ||
| 355 | // initDays() | ||
| 356 | }) | 374 | }) |
| 357 | 375 | ||
| 376 | function getData() { | ||
| 377 | booking.makeUpDetail({ activityId: route.params.cptId, | ||
| 378 | studioId:route.params.id}).then(res => { | ||
| 379 | formData.value = res.data | ||
| 380 | }).catch(err => { | ||
| 381 | console.log(err) | ||
| 382 | }) | ||
| 383 | } | ||
| 384 | |||
| 385 | getScheduleList() | ||
| 386 | function getScheduleList() { | ||
| 387 | booking.getActivityMealVoListByStudioId({lasId:route.params.id,lasmId:route.params.lasId}).then(res=>{ | ||
| 388 | formDatas.value={} | ||
| 389 | res.data.forEach(v=>{ | ||
| 390 | if (v.id==route.params.lasId) formDatas.value=v | ||
| 391 | }) | ||
| 392 | console.log(formDatas.value) | ||
| 393 | }) | ||
| 394 | } | ||
| 395 | |||
| 396 | function getRadioList(){ | ||
| 397 | booking.getMealConfList({ lasmId:route.params.lasId}).then(res => { | ||
| 398 | radioList.value = res.data | ||
| 399 | radioList.value.forEach(item=>{ | ||
| 400 | item.flag=false | ||
| 401 | }) | ||
| 402 | console.log(radioList.value) | ||
| 403 | }).catch(err => { | ||
| 404 | console.log(err) | ||
| 405 | }) | ||
| 406 | } | ||
| 407 | |||
| 408 | |||
| 358 | function initDays() { | 409 | function initDays() { |
| 359 | getBaseInfoByActiveId(route.params.cptId).then(res => { | 410 | booking.getMealConfList({ lasmId:route.params.lasId}).then(res => { |
| 360 | lform.value = res.data | 411 | lform.value = res.data |
| 361 | // if(lform.value.hqStart){ | 412 | // if(lform.value.hqStart){ |
| 362 | // const today = dayjs() | 413 | // const today = dayjs() |
| ... | @@ -385,196 +436,90 @@ function disabledDateRZ(date) { | ... | @@ -385,196 +436,90 @@ function disabledDateRZ(date) { |
| 385 | return true | 436 | return true |
| 386 | } | 437 | } |
| 387 | 438 | ||
| 388 | function changeRoomNum(e) { | 439 | function submit() { |
| 389 | if (form.value.addNum > e) { | 440 | if (!user) { |
| 390 | form.value.addNum = e | 441 | useUserStore().setVisitor() |
| 391 | } | 442 | return |
| 392 | console.log(e) | ||
| 393 | rzUserArr.value.length = e | ||
| 394 | countMoney() | ||
| 395 | } | ||
| 396 | |||
| 397 | function changeAddBed(e) { | ||
| 398 | if (e == '0') { | ||
| 399 | form.value.addNum = 0 | ||
| 400 | } | 443 | } |
| 401 | changeBed() | ||
| 402 | } | ||
| 403 | 444 | ||
| 404 | function changeBed() { | 445 | if (!timeVal.value)return proxy.$modal.msgError('请选择预约时间!', ) |
| 405 | countMoney() | 446 | |
| 406 | } | 447 | proxy.$refs['formRef'].validate(valid=>{ |
| 407 | 448 | if (valid){ | |
| 408 | function checkreRooms() { | 449 | form.value.total=money.value |
| 409 | var obj = { | 450 | form.value.orderName=formData.value.name |
| 410 | ahrId: room.value.id, | 451 | form.value.dcStart='2024-05-29' |
| 411 | rzStart: rzRange.value[0], | 452 | form.value.activeId=route.params.cptId |
| 412 | rzEnd: rzRange.value[1] | 453 | form.value.asId=route.params.id |
| 413 | } | 454 | form.value.asmId=route.params.lasId |
| 414 | checkResidueRoom(obj).then(res => { | 455 | form.value.asmcId=timeVal.value.id |
| 415 | canOrderNum.value = res.data.useCount | 456 | form.value.packageName=formDatas.value.name |
| 457 | form.value.timePeriod= timeVal.value.nameStart+'-'+timeVal.value.nameEnd | ||
| 458 | console.log(form.value) | ||
| 459 | // 提交确认 | ||
| 460 | ElMessageBox.confirm(language.value == 0 ? '确认提交订单吗?' : 'Confirm to submit the order?', { | ||
| 461 | confirmButtonText: language.value == 0 ? '确定' : 'Confirm', | ||
| 462 | cancelButtonText: language.value == 0 ? '取消' : 'Cancel', | ||
| 463 | type: 'warning' | ||
| 464 | }).then(() => { | ||
| 465 | booking.submitOrderMeal(form.value).then(res => { | ||
| 466 | if (res.data) { | ||
| 467 | if (res.data.roomNum == -100) { | ||
| 468 | ElMessage.warning(language.value == 0 ? '预定时间不足' : 'The remaining number of rooms is insufficient') | ||
| 469 | getRadioList() | ||
| 470 | } else { | ||
| 471 | //去付钱 | ||
| 472 | router.push({ | ||
| 473 | name: 'bookingPay', | ||
| 474 | query: { | ||
| 475 | orderId: res.data.orderId, | ||
| 476 | money: res.data.total, | ||
| 477 | type: 'makeUp' | ||
| 478 | } | ||
| 479 | }) | ||
| 480 | } | ||
| 481 | } else { | ||
| 482 | ElMessage.warning(language.value == 0 ? '无可预订的时间' : 'No rooms available to book') | ||
| 483 | } | ||
| 484 | }).catch(err => { | ||
| 485 | ElMessage.warning(language.value == 0 ? '无可预订的时间' : 'No rooms available to book') | ||
| 486 | }) | ||
| 487 | }) | ||
| 488 | |||
| 489 | }else { | ||
| 490 | return proxy.$message.warning(language.value == 0 ? '请填写完整信息' : 'Please fill in the complete information') | ||
| 491 | } | ||
| 416 | }) | 492 | }) |
| 417 | } | 493 | } |
| 418 | 494 | ||
| 419 | function getDaysBetween(e) { | ||
| 420 | console.log('入住时间arr', e, rzRange.value) | ||
| 421 | var d1 = Date.parse(e[0]) | ||
| 422 | var d2 = Date.parse(e[1]) | ||
| 423 | if (d1 == d2) { | ||
| 424 | usedays = 0 | ||
| 425 | ElMessage.error(language == 0 ? '入住时间跨度需大于一天' : 'The duration of the stay must be more than one day.') | ||
| 426 | // console.trace() | ||
| 427 | rzRange.value = [] | ||
| 428 | return | ||
| 429 | } else { | ||
| 430 | var days = (d2 - d1) / (1 * 24 * 60 * 60 * 1000); | ||
| 431 | usedays = days | ||
| 432 | } | ||
| 433 | countMoney() | ||
| 434 | var startTime = getDate(rzRange.value[0]); | ||
| 435 | var endTime = getDate(rzRange.value[1]); | ||
| 436 | var dateArr = []; | ||
| 437 | while ((endTime.getTime() - startTime.getTime()) > 0) { | ||
| 438 | var year = startTime.getFullYear(); | ||
| 439 | var month = (startTime.getMonth() + 1).toString().length === 1 ? "0" + (parseInt(startTime.getMonth() | ||
| 440 | .toString(), 10) + 1) : (startTime.getMonth() + 1); | ||
| 441 | var day = startTime.getDate().toString().length === 1 ? "0" + startTime.getDate() : startTime.getDate(); | ||
| 442 | dateArr.push(year + "-" + month + "-" + day); | ||
| 443 | startTime.setDate(startTime.getDate() + 1); | ||
| 444 | } | ||
| 445 | choseRooms.value = dateArr; | ||
| 446 | checkreRooms() | ||
| 447 | } | ||
| 448 | 495 | ||
| 449 | function getDate(datestr) { | 496 | function handleRadio(v){ |
| 450 | var temp = datestr.split("-"); | 497 | timeVal.value=null |
| 451 | if (temp[1] === '01') { | 498 | radioList.value.forEach(t=>{ |
| 452 | temp[0] = parseInt(temp[0], 10) - 1; | 499 | if(v.id==t.id){ |
| 453 | temp[1] = '12'; | 500 | t.flag=true |
| 454 | } else { | 501 | v.flag =true |
| 455 | temp[1] = parseInt(temp[1], 10) - 1; | 502 | timeVal.value=v |
| 456 | } | 503 | changeMaony() |
| 457 | //new Date()的月份入参实际都是当前值-1 | 504 | }else{ |
| 458 | var date = new Date(temp[0], temp[1], temp[2]); | 505 | t.flag=false |
| 459 | return date | 506 | } |
| 507 | }) | ||
| 460 | } | 508 | } |
| 461 | 509 | ||
| 462 | function countMoney() { | 510 | function changNum (){ |
| 463 | if (language.value == 0) { | 511 | changeMaony() |
| 464 | money.value = ((room.value.roomPrice * form.value.roomNum * usedays) + (room.value.bedPrice * form.value | ||
| 465 | .addNum * usedays)).toFixed(2) | ||
| 466 | |||
| 467 | } else { | ||
| 468 | money.value = ((room.value.roomPriceEn * form.value.roomNum * usedays) + (room.value.bedPriceEn * form.value | ||
| 469 | .addNum * usedays)).toFixed(2) | ||
| 470 | } | ||
| 471 | // console.log(usedays,money.value) | ||
| 472 | } | 512 | } |
| 473 | 513 | function changeMaony(){ | |
| 474 | function submit() { | 514 | if(timeVal.value&&form.value.num){ |
| 475 | if (!user) { | 515 | if (language.value==0){ |
| 476 | useUserStore().setReLogin() | 516 | money.value= formDatas.value.mealPrice * form.value.num |
| 477 | return | 517 | }else{ |
| 478 | } | 518 | money.value= formDatas.value.mealPriceEn * form.value.num |
| 479 | |||
| 480 | if (usedays == 0) { | ||
| 481 | ElMessage.warning(language.value == 0 ? '入住时间跨度需大于一天' : 'Check-in time must be greater than one day') | ||
| 482 | return | ||
| 483 | } | ||
| 484 | if (form.value.roomNum == 0) { | ||
| 485 | ElMessage.warning(language.value == 0 ? '请选择房间数量' : 'Please select the number of rooms') | ||
| 486 | return | ||
| 487 | } | ||
| 488 | if (!form.value.phone) { | ||
| 489 | ElMessage.warning(language.value == 0 ? '请填写手机号' : 'Please fill in the phone number') | ||
| 490 | return | ||
| 491 | } | ||
| 492 | form.value.rzStart = rzRange.value[0] | ||
| 493 | form.value.rzEnd = rzRange.value[1] | ||
| 494 | |||
| 495 | |||
| 496 | let arr = [] | ||
| 497 | for (var n of rzUserArr.value) { | ||
| 498 | if (n == '' || n == undefined) { | ||
| 499 | |||
| 500 | // '请填写入住人信息' | ||
| 501 | ElMessage.warning(language.value == 0 ? '请填写入住人信息' : 'Please fill in the check-in information') | ||
| 502 | |||
| 503 | return | ||
| 504 | } else { | ||
| 505 | arr.push(n) | ||
| 506 | } | ||
| 507 | } | ||
| 508 | form.value.rzUsers = arr.toString() | ||
| 509 | form.value.activeId = room.value.activityId | ||
| 510 | form.value.ahId = room.value.hotelId | ||
| 511 | form.value.ahrId = room.value.id | ||
| 512 | form.value.orderName = hotelName.value | ||
| 513 | form.value.roomName = room.value.roomType | ||
| 514 | form.value.roomPhoto = room.value.photo | ||
| 515 | var str = '' | ||
| 516 | var str2 = '' | ||
| 517 | if (language.value == 0) { | ||
| 518 | if (form.value.addNum && form.value.addNum > 0) { | ||
| 519 | str = `加床${form.value.addNum}张` | ||
| 520 | } else { | ||
| 521 | str = `未加床` | ||
| 522 | } | ||
| 523 | if (room.value.breakfastNum && room.value.breakfastNum > 0) { | ||
| 524 | str2 = `${room.value.breakfastNum}份早餐` | ||
| 525 | } else { | ||
| 526 | str2 = `无早餐` | ||
| 527 | } | 519 | } |
| 528 | form.value.room = `${form.value.roomNum} 间 · ${usedays}晚 · ${str} · ${str2}` | ||
| 529 | console.log(form.value.room) | ||
| 530 | } | 520 | } |
| 531 | if (language.value == 1) { | ||
| 532 | if (form.value.addNum && form.value.addNum > 0) { | ||
| 533 | str = `have ${form.value.addNum} extra bed` | ||
| 534 | } else { | ||
| 535 | str = `No extra bed` | ||
| 536 | } | ||
| 537 | if (room.value.breakfastNum && room.value.breakfastNum > 0) { | ||
| 538 | str2 = `${room.value.breakfastNum} breakfast` | ||
| 539 | } else { | ||
| 540 | str2 = `No breakfast` | ||
| 541 | } | ||
| 542 | form.value.room = `${form.value.roomNum} rooms · ${usedays} night·${str}·${str2}` | ||
| 543 | console.log(form.value.room) | ||
| 544 | } | ||
| 545 | |||
| 546 | 521 | ||
| 547 | // 提交确认 | ||
| 548 | ElMessageBox.confirm(language.value == 0 ? '确认提交订单吗?' : 'Confirm to submit the order?', { | ||
| 549 | confirmButtonText: language.value == 0 ? '确定' : 'Confirm', | ||
| 550 | cancelButtonText: language.value == 0 ? '取消' : 'Cancel', | ||
| 551 | type: 'warning' | ||
| 552 | }).then(() => { | ||
| 553 | newsSubmitOrderHotel(form.value).then(res => { | ||
| 554 | if (res.data) { | ||
| 555 | if (res.data.roomNum == -100) { | ||
| 556 | ElMessage.warning(language.value == 0 ? '剩余房间数不足' : 'The remaining number of rooms is insufficient') | ||
| 557 | checkreRooms() | ||
| 558 | } else { | ||
| 559 | //去付钱 | ||
| 560 | router.push({ | ||
| 561 | name: 'bookingPay', | ||
| 562 | query: { | ||
| 563 | orderId: res.data.orderId, | ||
| 564 | money: res.data.total, | ||
| 565 | type: 'hotel' | ||
| 566 | } | ||
| 567 | }) | ||
| 568 | } | ||
| 569 | } else { | ||
| 570 | ElMessage.warning(language.value == 0 ? '无可预订的房间' : 'No rooms available to book') | ||
| 571 | } | ||
| 572 | }).catch(err => { | ||
| 573 | ElMessage.warning(language.value == 0 ? '无可预订的房间' : 'No rooms available to book') | ||
| 574 | }) | ||
| 575 | }) | ||
| 576 | } | 522 | } |
| 577 | |||
| 578 | </script> | 523 | </script> |
| 579 | 524 | ||
| 580 | <style scoped lang="scss"> | 525 | <style scoped lang="scss"> |
| ... | @@ -665,4 +610,28 @@ function submit() { | ... | @@ -665,4 +610,28 @@ function submit() { |
| 665 | } | 610 | } |
| 666 | } | 611 | } |
| 667 | 612 | ||
| 613 | .radioBox{ | ||
| 614 | border: 1px dashed #acacac; | ||
| 615 | height: 60px; | ||
| 616 | width: 156px; | ||
| 617 | text-align: center; | ||
| 618 | line-height: 29px; | ||
| 619 | margin: 10px; | ||
| 620 | padding: 0; | ||
| 621 | span{ | ||
| 622 | width: 100%; | ||
| 623 | height: 100%; | ||
| 624 | } | ||
| 625 | } | ||
| 626 | .radioBoxbg{ | ||
| 627 | background-color: #ecebfc; | ||
| 628 | border: 1px solid #453DEA; | ||
| 629 | color:#453DEA; | ||
| 630 | |||
| 631 | } | ||
| 632 | |||
| 633 | .sing{ | ||
| 634 | color:#453DEA; | ||
| 635 | } | ||
| 636 | |||
| 668 | </style> | 637 | </style> | ... | ... |
| ... | @@ -27,7 +27,6 @@ | ... | @@ -27,7 +27,6 @@ |
| 27 | </el-row> | 27 | </el-row> |
| 28 | </div> | 28 | </div> |
| 29 | </div> | 29 | </div> |
| 30 | |||
| 31 | <div v-if="type == 'car'"> | 30 | <div v-if="type == 'car'"> |
| 32 | <div class="leftboderTT">{{ language == 0 ? '路线信息' : 'Car Information' }}</div> | 31 | <div class="leftboderTT">{{ language == 0 ? '路线信息' : 'Car Information' }}</div> |
| 33 | <div class="border-info mt20"> | 32 | <div class="border-info mt20"> |
| ... | @@ -53,7 +52,25 @@ | ... | @@ -53,7 +52,25 @@ |
| 53 | </el-row> | 52 | </el-row> |
| 54 | </div> | 53 | </div> |
| 55 | </div> | 54 | </div> |
| 56 | 55 | <div v-if="type == 'makeUp'"> | |
| 56 | <div class="leftboderTT">{{ language == 0 ? '化妆信息' : 'Hotel Information' }}</div> | ||
| 57 | <div class="border-info mt20"> | ||
| 58 | <h3>{{ formInfo.studioName }}</h3> | ||
| 59 | <el-row> | ||
| 60 | <el-col> | ||
| 61 | {{ language == 0 ?'地址':'Address' }}: | ||
| 62 | <span v-if="language == 0">{{ formInfo.remarks }} {{ form.cityName }} {{ form.areaName }} </span> | ||
| 63 | {{ form.address }} | ||
| 64 | </el-col> | ||
| 65 | <el-col> | ||
| 66 | {{ language == 0 ?'套餐':'Package' }}:{{ formInfo.mealName }} <span style="margin-left: 40px">{{ language==0?'价格':'Price' }}</span><span class="price">{{language==0? '¥'+formInfo.mealPrice:'€'+ formInfo.mealPriceEn}}</span> | ||
| 67 | </el-col> | ||
| 68 | <el-col> | ||
| 69 | {{ language == 0 ?'套餐说明':'Package Description' }}:{{ formInfo.introduction}} | ||
| 70 | </el-col> | ||
| 71 | </el-row> | ||
| 72 | </div> | ||
| 73 | </div> | ||
| 57 | 74 | ||
| 58 | <div class="leftboderTT">{{ language == 0 ? '预订信息' : 'Booking information' }}</div> | 75 | <div class="leftboderTT">{{ language == 0 ? '预订信息' : 'Booking information' }}</div> |
| 59 | 76 | ||
| ... | @@ -127,6 +144,22 @@ | ... | @@ -127,6 +144,22 @@ |
| 127 | <el-col :lg="8" :md="12" :sm="12" :xs="24">{{ language==0?'联系方式':'Contact Phone' }}:{{ form.phone }}</el-col> | 144 | <el-col :lg="8" :md="12" :sm="12" :xs="24">{{ language==0?'联系方式':'Contact Phone' }}:{{ form.phone }}</el-col> |
| 128 | <el-col :span="24" >{{ language==0?'备注':'Remarks' }}:{{ form.remarks || '-' }}</el-col> | 145 | <el-col :span="24" >{{ language==0?'备注':'Remarks' }}:{{ form.remarks || '-' }}</el-col> |
| 129 | </el-row> | 146 | </el-row> |
| 147 | <el-row v-if="type == 'makeUp'"> | ||
| 148 | <el-col :lg="8" :md="12" :sm="12" :xs="24"> | ||
| 149 | <div class="mb10">{{ language==0?'化妆时间':'Makeup time' }}: | ||
| 150 | <!-- {{ dayjs(form.dcStart).format('YYYY-MM-DD') +' ' }} ~ {{dayjs(form.dcStart).format('YYYY-MM-DD') +' '}}--> | ||
| 151 | {{ dayjs(form.dcStart).format('YYYY-MM-DD') +' '+ form.nameStart }} ~ {{dayjs(form.dcStart).format('YYYY-MM-DD') +' '+form.nameEnd}} | ||
| 152 | </div> | ||
| 153 | </el-col> | ||
| 154 | <el-col :lg="12" :md="12" :sm="12" :xs="24"> | ||
| 155 | <div class="mb10">{{ language==0?'预约数':'Number of appointments' }}:{{ form.num }} </div> | ||
| 156 | </el-col> | ||
| 157 | <el-col :lg="8" :md="12" :sm="12" :xs="24"> | ||
| 158 | <div class="mb10">{{ language==0?'联系人':'Contact Person' }}:{{ form.contacts }}</div> | ||
| 159 | </el-col> | ||
| 160 | <el-col :lg="8" :md="12" :sm="12" :xs="24">{{ language==0?'联系方式':'Contact Phone' }}:{{ form.phone }}</el-col> | ||
| 161 | <el-col :span="24" >{{ language==0?'备注':'Remarks' }}:{{ form.remarks }}</el-col> | ||
| 162 | </el-row> | ||
| 130 | </div> | 163 | </div> |
| 131 | 164 | ||
| 132 | <el-row justify="space-between" align="middle"> | 165 | <el-row justify="space-between" align="middle"> |
| ... | @@ -169,7 +202,7 @@ | ... | @@ -169,7 +202,7 @@ |
| 169 | 202 | ||
| 170 | <div class="leftboderTT">{{ language == 0 ? '选择支付方式' : 'Choose payment method' }}</div> | 203 | <div class="leftboderTT">{{ language == 0 ? '选择支付方式' : 'Choose payment method' }}</div> |
| 171 | <div class="mt20"> | 204 | <div class="mt20"> |
| 172 | <el-radio-group v-model="payType"> | 205 | <el-radio-group v-model="payType" > |
| 173 | <el-radio value="2" v-if="language==0" border> | 206 | <el-radio value="2" v-if="language==0" border> |
| 174 | <!-- 微信--> | 207 | <!-- 微信--> |
| 175 | <svg t="1709002960407" class="icon" viewBox="0 0 3152 1024" version="1.1" | 208 | <svg t="1709002960407" class="icon" viewBox="0 0 3152 1024" version="1.1" |
| ... | @@ -298,7 +331,14 @@ import useUserStore from "@/store/modules/user"; | ... | @@ -298,7 +331,14 @@ import useUserStore from "@/store/modules/user"; |
| 298 | import FileUpload from "@/components/FileUpload"; | 331 | import FileUpload from "@/components/FileUpload"; |
| 299 | import {useStorage} from "@vueuse/core/index"; | 332 | import {useStorage} from "@vueuse/core/index"; |
| 300 | import {ElMessage} from "element-plus"; | 333 | import {ElMessage} from "element-plus"; |
| 301 | import {cancelOrder, cancelOrder2, getCarBilldetailbyId, getFoodBilldetailbyId} from "@/apiPc/booking"; | 334 | import { |
| 335 | cancelOrder, | ||
| 336 | cancelOrder2, | ||
| 337 | getCarBilldetailbyId, | ||
| 338 | getFoodBilldetailbyId, | ||
| 339 | getMealOrderInfoByLogex | ||
| 340 | } from "@/apiPc/booking"; | ||
| 341 | import dayjs from 'dayjs' | ||
| 302 | import {delPerson} from "@/api/exam/person"; | 342 | import {delPerson} from "@/api/exam/person"; |
| 303 | 343 | ||
| 304 | const isLogin = ref(false) | 344 | const isLogin = ref(false) |
| ... | @@ -306,12 +346,12 @@ const language = useStorage('language', 0) | ... | @@ -306,12 +346,12 @@ const language = useStorage('language', 0) |
| 306 | const totalFee = ref('') | 346 | const totalFee = ref('') |
| 307 | const wePayCodeUrl = ref('') | 347 | const wePayCodeUrl = ref('') |
| 308 | const form = ref({}) | 348 | const form = ref({}) |
| 349 | const formInfo=ref({}) | ||
| 309 | const type = ref('') | 350 | const type = ref('') |
| 310 | const errorBox = ref(false) | 351 | const errorBox = ref(false) |
| 311 | const hideconfirmbtn = ref(false) | 352 | const hideconfirmbtn = ref(false) |
| 312 | 353 | ||
| 313 | const user = useUserStore().user | 354 | const user = useUserStore().user |
| 314 | console.log(route.query.orderId) | ||
| 315 | // 1763462073870237698 | 355 | // 1763462073870237698 |
| 316 | if (useUserStore().user) { | 356 | if (useUserStore().user) { |
| 317 | isLogin.value = true | 357 | isLogin.value = true |
| ... | @@ -336,8 +376,12 @@ onMounted(() => { | ... | @@ -336,8 +376,12 @@ onMounted(() => { |
| 336 | case '2': | 376 | case '2': |
| 337 | type.value = 'food' | 377 | type.value = 'food' |
| 338 | break | 378 | break |
| 379 | case '3': | ||
| 380 | type.value = 'makeUp' | ||
| 381 | break | ||
| 339 | } | 382 | } |
| 340 | } | 383 | } |
| 384 | |||
| 341 | getData() | 385 | getData() |
| 342 | }) | 386 | }) |
| 343 | 387 | ||
| ... | @@ -384,6 +428,12 @@ function getData() { | ... | @@ -384,6 +428,12 @@ function getData() { |
| 384 | errorBox.value = true | 428 | errorBox.value = true |
| 385 | }) | 429 | }) |
| 386 | } | 430 | } |
| 431 | if(type.value=='makeUp') { | ||
| 432 | MakeUpOrder() | ||
| 433 | MakeUpIno() | ||
| 434 | } | ||
| 435 | |||
| 436 | console.log(payType.value) | ||
| 387 | } | 437 | } |
| 388 | 438 | ||
| 389 | function goHome() { | 439 | function goHome() { |
| ... | @@ -391,6 +441,7 @@ function goHome() { | ... | @@ -391,6 +441,7 @@ function goHome() { |
| 391 | } | 441 | } |
| 392 | 442 | ||
| 393 | function goPay() { | 443 | function goPay() { |
| 444 | debugger | ||
| 394 | if (payType.value == '2') { | 445 | if (payType.value == '2') { |
| 395 | booking.createWePay({orderId: orderId.value}).then(res => { | 446 | booking.createWePay({orderId: orderId.value}).then(res => { |
| 396 | wePayCodeUrl.value = res.data | 447 | wePayCodeUrl.value = res.data |
| ... | @@ -428,6 +479,26 @@ function showLogin() { | ... | @@ -428,6 +479,26 @@ function showLogin() { |
| 428 | useUserStore().setReLogin() | 479 | useUserStore().setReLogin() |
| 429 | } | 480 | } |
| 430 | 481 | ||
| 482 | |||
| 483 | function MakeUpOrder(){ | ||
| 484 | booking.getMealOrderInfo({orderId: orderId.value}).then(res => { | ||
| 485 | form.value=res.data | ||
| 486 | totalFee.value=language.value==0?form.value.total:form.value.totalEn | ||
| 487 | }).catch(err => { | ||
| 488 | console.log(err) | ||
| 489 | errorBox.value = true | ||
| 490 | }) | ||
| 491 | } | ||
| 492 | |||
| 493 | function MakeUpIno(){ | ||
| 494 | booking.getMealOrderInfoByLogex({orderId: orderId.value}).then(res=>{ | ||
| 495 | formInfo.value=res.data | ||
| 496 | }) | ||
| 497 | .catch((e) => { | ||
| 498 | console.log(e) | ||
| 499 | errorBox.value = true | ||
| 500 | }) | ||
| 501 | } | ||
| 431 | const cancel = () => { | 502 | const cancel = () => { |
| 432 | //取消订单 | 503 | //取消订单 |
| 433 | proxy.$modal.confirm(language.value == 0 ? '确定取消订单吗 ?' :`Are you sure to cancel the order?`).then(() => { | 504 | proxy.$modal.confirm(language.value == 0 ? '确定取消订单吗 ?' :`Are you sure to cancel the order?`).then(() => { |
| ... | @@ -451,6 +522,8 @@ const unsubscribe = () => { | ... | @@ -451,6 +522,8 @@ const unsubscribe = () => { |
| 451 | }) | 522 | }) |
| 452 | }) | 523 | }) |
| 453 | } | 524 | } |
| 525 | |||
| 526 | |||
| 454 | </script> | 527 | </script> |
| 455 | 528 | ||
| 456 | <style scoped lang="scss"> | 529 | <style scoped lang="scss"> |
| ... | @@ -606,4 +679,8 @@ const unsubscribe = () => { | ... | @@ -606,4 +679,8 @@ const unsubscribe = () => { |
| 606 | font-size: 16px; | 679 | font-size: 16px; |
| 607 | margin-top: 10px | 680 | margin-top: 10px |
| 608 | } | 681 | } |
| 682 | |||
| 683 | .price{ | ||
| 684 | color:orange; | ||
| 685 | } | ||
| 609 | </style> | 686 | </style> | ... | ... |
| ... | @@ -15,6 +15,8 @@ | ... | @@ -15,6 +15,8 @@ |
| 15 | <label class="blueTag" v-if="b.orderType == 0"> {{ language==0?'酒店':'HOTEL' }} </label> | 15 | <label class="blueTag" v-if="b.orderType == 0"> {{ language==0?'酒店':'HOTEL' }} </label> |
| 16 | <label class="purpleTag" v-if="b.orderType == 1"> {{ language==0?'车辆':'TRANSPORTATION' }} </label> | 16 | <label class="purpleTag" v-if="b.orderType == 1"> {{ language==0?'车辆':'TRANSPORTATION' }} </label> |
| 17 | <label class="orangeTag" v-if="b.orderType == 2"> {{ language==0?'餐饮':'DINING' }} </label> | 17 | <label class="orangeTag" v-if="b.orderType == 2"> {{ language==0?'餐饮':'DINING' }} </label> |
| 18 | <label class="orangeTag" v-if="b.orderType == 3"> {{ language==0?'化妆':'MakeUp' }} </label> | ||
| 19 | |||
| 18 | <span>{{ language==0?'订单编号:':'No.' }} {{ b.id }}</span> | 20 | <span>{{ language==0?'订单编号:':'No.' }} {{ b.id }}</span> |
| 19 | </div> | 21 | </div> |
| 20 | 22 | ||
| ... | @@ -57,6 +59,12 @@ | ... | @@ -57,6 +59,12 @@ |
| 57 | <p>{{language==0?'配送日期':'Delivery Date'}}:{{b.extJsonObj.dcEnd }} ~ {{b.extJsonObj.dcEnd}}</p> | 59 | <p>{{language==0?'配送日期':'Delivery Date'}}:{{b.extJsonObj.dcEnd }} ~ {{b.extJsonObj.dcEnd}}</p> |
| 58 | 60 | ||
| 59 | </div> | 61 | </div> |
| 62 | <div v-if="b.orderType==3"> | ||
| 63 | <h3 class="name">{{b.name}}</h3> | ||
| 64 | <p v-if="language==0"> | ||
| 65 | {{dayjs(b.deliveryTime).format('YYYY-MM-DD')+' '+b.extJsonObj.timePeriod?.split('-')[0]+'-'+dayjs(b.deliveryTime).format('YYYY-MM-DD')+' '+b.extJsonObj.timePeriod?.split('-')[1] }} | ||
| 66 | </p> | ||
| 67 | </div> | ||
| 60 | </el-col> | 68 | </el-col> |
| 61 | <el-col :lg="6"> | 69 | <el-col :lg="6"> |
| 62 | <div v-if="b.orderType == 0"> | 70 | <div v-if="b.orderType == 0"> |
| ... | @@ -67,6 +75,9 @@ | ... | @@ -67,6 +75,9 @@ |
| 67 | </div> | 75 | </div> |
| 68 | <div v-if="b.orderType == 2"> | 76 | <div v-if="b.orderType == 2"> |
| 69 | </div> | 77 | </div> |
| 78 | <div v-if="b.orderType == 3"> | ||
| 79 | <p>{{ b.extJsonObj.packageName }}</p> | ||
| 80 | </div> | ||
| 70 | </el-col> | 81 | </el-col> |
| 71 | <el-col :lg="4" class="text-center"> | 82 | <el-col :lg="4" class="text-center"> |
| 72 | <span class="text-warning"> {{ language==0?'¥':'€' }} | 83 | <span class="text-warning"> {{ language==0?'¥':'€' }} |
| ... | @@ -76,8 +87,7 @@ | ... | @@ -76,8 +87,7 @@ |
| 76 | 87 | ||
| 77 | <el-col :lg="4" > | 88 | <el-col :lg="4" > |
| 78 | <div class="text-right mb20 text-danger"> | 89 | <div class="text-right mb20 text-danger"> |
| 79 | <el-countdown value-style="color:#E60012;font-size:16px;" v-if="b.status == '0'&&(b.surplus!='0,0'&&b.surplus!='0')" format="mm:ss" | 90 | <el-countdown value-style="color:#E60012;font-size:16px;" v-if="b.status == '0'&&(b.surplus!='0,0'&&b.surplus!='0')" format="mm:ss" :value="b.countdown" @finish="finish(b)"/> |
| 80 | :value="b.countdown" @finish="finish(b)"/> | ||
| 81 | </div> | 91 | </div> |
| 82 | 92 | ||
| 83 | <div class="text-right"> | 93 | <div class="text-right"> |
| ... | @@ -102,6 +112,7 @@ import {onMounted} from "@vue/runtime-core"; | ... | @@ -102,6 +112,7 @@ import {onMounted} from "@vue/runtime-core"; |
| 102 | import {useStorage} from "@vueuse/core/index"; | 112 | import {useStorage} from "@vueuse/core/index"; |
| 103 | import {newbilllist} from "@/apiPc/common"; | 113 | import {newbilllist} from "@/apiPc/common"; |
| 104 | import useUserStore from "@/store/modules/user"; | 114 | import useUserStore from "@/store/modules/user"; |
| 115 | import dayjs from 'dayjs' | ||
| 105 | const router = useRouter() | 116 | const router = useRouter() |
| 106 | const language= useStorage('language',0) | 117 | const language= useStorage('language',0) |
| 107 | const list = ref([]) | 118 | const list = ref([]) |
| ... | @@ -118,11 +129,12 @@ function getList() { | ... | @@ -118,11 +129,12 @@ function getList() { |
| 118 | newbilllist({createById:user.userId}).then(res=>{ | 129 | newbilllist({createById:user.userId}).then(res=>{ |
| 119 | list.value = res.rows | 130 | list.value = res.rows |
| 120 | for (var b of list.value) { | 131 | for (var b of list.value) { |
| 121 | b.messageObj = JSON.parse(b.message) | 132 | b.messageObj = JSON.parse(b.message) || {} |
| 122 | b.extJsonObj = JSON.parse(b.extJson) || {} | 133 | b.extJsonObj = JSON.parse(b.extJson) || {} |
| 123 | if(b.surplus&&b.status == '0'&&(b.surplus!='0,0'&&b.surplus!='0')){ | 134 | if(b.surplus&&b.status == '0'&&(b.surplus!='0,0'&&b.surplus!='0')){ |
| 124 | b.countdown = Date.now() + Number((b.surplus.split(',')[0]*60 + b.surplus.split(',')[1])*10) | 135 | const a=Number(b.surplus.split(',')[0]*60) |
| 125 | console.log(b.countdown) | 136 | const c=Number(b.surplus.split(',')[1]*10) |
| 137 | b.countdown = Date.now() + a+c | ||
| 126 | } | 138 | } |
| 127 | } | 139 | } |
| 128 | }) | 140 | }) | ... | ... |
-
Please register or sign in to post a comment