9a620670 by 杨炀

Merge commit '1d7e0d59' into dev

2 parents 65bed76d 1d7e0d59
...@@ -216,6 +216,7 @@ const logout = () => { ...@@ -216,6 +216,7 @@ const logout = () => {
216 return useUserStore().logOut() 216 return useUserStore().logOut()
217 }).then(() => { 217 }).then(() => {
218 isLogin.value = true 218 isLogin.value = true
219 router.push('/')
219 location.reload() 220 location.reload()
220 }) 221 })
221 } 222 }
......
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
69 :disabled-date="disabledDateRZ" 69 :disabled-date="disabledDateRZ"
70 :placeholder="language==0?'选择日期':'Select date'" 70 :placeholder="language==0?'选择日期':'Select date'"
71 format="YYYY-MM-DD" 71 format="YYYY-MM-DD"
72 :clearable="false"
72 value-format="YYYY-MM-DD"/> 73 value-format="YYYY-MM-DD"/>
73 </span> 74 </span>
74 </li> 75 </li>
...@@ -107,7 +108,7 @@ ...@@ -107,7 +108,7 @@
107 </el-button> 108 </el-button>
108 109
109 110
110 <el-button v-else :disabled="!r.useCount" class="btn-lineG w100" :class="{'forbid':!r.useCount}" round type="pri mary" @click="goOrder(r)">Select</el-button> 111 <el-button v-else style="color: #fff" :disabled="!r.useCount" class="btn-lineG w100" :class="{'forbid':!r.useCount}" round type="pri mary" @click="goOrder(r)">Select</el-button>
111 <!-- <div class="text-center text-primary mt10 fontsize14 pointer" v-if="language == 0">--> 112 <!-- <div class="text-center text-primary mt10 fontsize14 pointer" v-if="language == 0">-->
112 <!-- 剩余 {{(r.roomCount - (r.useCount||0)).toFixed()}} 间--> 113 <!-- 剩余 {{(r.roomCount - (r.useCount||0)).toFixed()}} 间-->
113 <!-- </div>--> 114 <!-- </div>-->
...@@ -161,21 +162,25 @@ onMounted(() => { ...@@ -161,21 +162,25 @@ onMounted(() => {
161 formTime.value = null 162 formTime.value = null
162 }).finally(()=>{ 163 }).finally(()=>{
163 console.log(formTime.value) 164 console.log(formTime.value)
164 if (formTime.value){ 165 getDateTime()
165 if (dayjs().isBefore(dayjs(formTime.value.hqStart))){
166 hotTime.value[0]=dayjs(formTime.value.hqStart).format('YYYY-MM-DD')
167 hotTime.value[1]=dayjs(formTime.value.hqEnd).add(1,'day').format('YYYY-MM-DD')
168 } else{
169 hotTime.value[0]=dayjs().format('YYYY-MM-DD')
170 hotTime.value[1]=dayjs().add(1,'day').format('YYYY-MM-DD')
171 }
172 }
173 166
174 getData() 167 getData()
175 }) 168 })
176 169
177 }) 170 })
178 171
172 function getDateTime(){
173 if (formTime.value){
174 if (dayjs().isBefore(dayjs(formTime.value.hqStart))){
175 hotTime.value[0]=dayjs(formTime.value.hqStart).format('YYYY-MM-DD')
176 hotTime.value[1]=dayjs(formTime.value.hqStart).add(1,'day').format('YYYY-MM-DD')
177 } else{
178 hotTime.value[0]=dayjs().format('YYYY-MM-DD')
179 hotTime.value[1]=dayjs().add(1,'day').format('YYYY-MM-DD')
180 }
181 }
182 }
183
179 function getData() { 184 function getData() {
180 loading.value = true 185 loading.value = true
181 getHotelById(route.params.hotelId).then(res => { 186 getHotelById(route.params.hotelId).then(res => {
...@@ -278,13 +283,12 @@ function goNext(room) { ...@@ -278,13 +283,12 @@ function goNext(room) {
278 }) 283 })
279 } 284 }
280 285
281 function getDaysBetween(e){ 286 function getDaysBetween(){
282 console.log(hotTime.value)
283 if (hotTime.value && hotTime.value.length==2){ 287 if (hotTime.value && hotTime.value.length==2){
284 const d1=dayjs(hotTime.value[0]).format('YYYY-MM-DD') 288 const d1=dayjs(hotTime.value[0]).format('YYYY-MM-DD')
285 const d2=dayjs(hotTime.value[1]).format('YYYY-MM-DD') 289 const d2=dayjs(hotTime.value[1]).format('YYYY-MM-DD')
286 if (d1==d2){ 290 if (d1==d2){
287 hotTime.value=[] 291 getDateTime()
288 return proxy.$modal.msgError(language.value==0?'入住时间跨度需要大于一天':'The duration of the stay must be more than one day.') 292 return proxy.$modal.msgError(language.value==0?'入住时间跨度需要大于一天':'The duration of the stay must be more than one day.')
289 }else{ 293 }else{
290 getData() 294 getData()
...@@ -292,19 +296,18 @@ function getDaysBetween(e){ ...@@ -292,19 +296,18 @@ function getDaysBetween(e){
292 } 296 }
293 } 297 }
294 298
295 // function disabledDateRZ(date) { 299 function disabledDateRZ(date) {
296 // //判读今天大与form.value.hqStart 300 //判读今天大与form.value.hqStart
297 // console.log(date) 301 if (formTime.value.hqStart) {
298 // if (formTime.value.hqStart) { 302 const today = dayjs().format('YYYY-MM-DD')
299 // const today = dayjs().format('YYYY-MM-DD') 303 if (formTime.value.hqStart < today) {
300 // if (formTime.value.hqStart < today) { 304 return !((date.getTime() >= dayjs(today).valueOf())&&(date.getTime() <= dayjs(formTime.value.hqEnd).valueOf()))
301 // return !((date.getTime() >= dayjs(today).valueOf())&&(date.getTime() <= dayjs(formTime.value.hqEnd).valueOf())) 305 } else {
302 // } else { 306 return !((date.getTime() >= dayjs(formTime.value.hqStart).valueOf())&&(date.getTime() <= dayjs(formTime.value.hqEnd).valueOf()))
303 // return !((date.getTime() >= dayjs(formTime.value.hqStart).valueOf())&&(date.getTime() <= dayjs(formTime.value.hqEnd).valueOf())) 307 }
304 // } 308 }
305 // } 309 // return true
306 // // return true 310 }
307 // }
308 311
309 function goMap() { 312 function goMap() {
310 return 313 return
...@@ -451,7 +454,14 @@ function goMap() { ...@@ -451,7 +454,14 @@ function goMap() {
451 .oddmb:nth-child(2){margin-bottom: 20px;} 454 .oddmb:nth-child(2){margin-bottom: 20px;}
452 .forbid{ 455 .forbid{
453 cursor:not-allowed !important; 456 cursor:not-allowed !important;
454 color: #a8abb2; 457 color: #a8abb2 !important;
455 filter:grayscale(1); 458 //filter:grayscale(1);
459 background: #fff;
460 div{
461 color: #a8abb2 !important;
462 }
463 }
464 .forbid:hover{
465 box-shadow:none;
456 } 466 }
457 </style> 467 </style>
......
...@@ -329,6 +329,7 @@ function getDaysBetween(e) { ...@@ -329,6 +329,7 @@ function getDaysBetween(e) {
329 // console.log('入住时间arr', e, rzRange.value) 329 // console.log('入住时间arr', e, rzRange.value)
330 // console.log(e) 330 // console.log(e)
331 // console.log(Date.parse(rzRange.value[0])) 331 // console.log(Date.parse(rzRange.value[0]))
332 form.value.roomNum=0
332 var d1 = Date.parse(rzRange.value?rzRange.value[0]:null) 333 var d1 = Date.parse(rzRange.value?rzRange.value[0]:null)
333 var d2 = Date.parse(rzRange.value?rzRange.value[1]:null) 334 var d2 = Date.parse(rzRange.value?rzRange.value[1]:null)
334 if (d1 == d2) { 335 if (d1 == d2) {
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
90 </div> 90 </div>
91 91
92 <div class="text-right"> 92 <div class="text-right">
93 <el-button v-if="b.orderType == 0" class="mb10" plain round type="success" @click="Rebook(b)"> 93 <el-button v-if="b.orderType == 0&&b.viewStatus!=0" class="mb10" plain round type="success" @click="Rebook(b)">
94 {{ language==0?'再次预订':'Rebook' }}</el-button> 94 {{ language==0?'再次预订':'Rebook' }}</el-button>
95 <el-button class="mb10" plain round type="primary" @click="goDetail(b)"> 95 <el-button class="mb10" plain round type="primary" @click="goDetail(b)">
96 {{ language==0?'详情':'Detail' }}</el-button> 96 {{ language==0?'详情':'Detail' }}</el-button>
...@@ -120,6 +120,8 @@ import useUserStore from "@/store/modules/user"; ...@@ -120,6 +120,8 @@ import useUserStore from "@/store/modules/user";
120 import dayjs from 'dayjs' 120 import dayjs from 'dayjs'
121 import {cancelOrder2,cancelOrder} from "/@/apiPc/booking"; 121 import {cancelOrder2,cancelOrder} from "/@/apiPc/booking";
122 122
123 import {ElMessage} from "element-plus";
124
123 const router = useRouter() 125 const router = useRouter()
124 const language= useStorage('language',0) 126 const language= useStorage('language',0)
125 const list = ref([]) 127 const list = ref([])
......
...@@ -80,28 +80,26 @@ const payment = reactive({ ...@@ -80,28 +80,26 @@ const payment = reactive({
80 ), 80 ),
81 }); 81 });
82 } 82 }
83 if (language.value == 0) { 83 payOrder({
84 payOrder({ 84 contactPhone: payment.form.phone,
85 contactPhone: payment.form.phone, 85 customerIds: payment.form.viewers,
86 customerIds: payment.form.viewers, 86 orderToken: order.data?.orderToken,
87 orderToken: order.data?.orderToken, 87 payType: 1,
88 payType: 1, 88 paymentAmount: order.data?.paymentAmount,
89 paymentAmount: order.data?.paymentAmount, 89 }).then((res) => {
90 }).then((res) => { 90 if (res.data.language == "zh-cn") {
91 if (res.data.language == "zh-cn") { 91 payment.qrInfo = res.data;
92 payment.qrInfo = res.data; 92 qrcode.toDataURL(res.data.scanCodeUrl, (err, url) => {
93 qrcode.toDataURL(res.data.scanCodeUrl, (err, url) => { 93 if (url) {
94 if (url) { 94 payment.qrCodeData = url;
95 payment.qrCodeData = url; 95 }
96 } 96 });
97 }); 97 payment.showCodeDialog = true;
98 payment.showCodeDialog = true; 98 startCheckSuccessListener(res.data.orderSn, props.activityId);
99 startCheckSuccessListener(res.data.orderSn, props.activityId); 99 } else {
100 } 100 // TODO:这里是英文环境支付
101 }); 101 }
102 } else { 102 });
103 // 这里是英文环境支付
104 }
105 }, 103 },
106 handleCloce() { 104 handleCloce() {
107 payment.showCodeDialog = false; 105 payment.showCodeDialog = false;
...@@ -169,7 +167,9 @@ order.fetchData(); ...@@ -169,7 +167,9 @@ order.fetchData();
169 167
170 <div class="form"> 168 <div class="form">
171 <el-form> 169 <el-form>
172 <el-form-item :label="language == 0 ? '联系人' : 'contacts'"> 170 <el-form-item
171 :label="language == 0 ? '联系人电话' : 'contact phone'"
172 >
173 <el-input 173 <el-input
174 v-model="payment.form.phone" 174 v-model="payment.form.phone"
175 :placeholder=" 175 :placeholder="
...@@ -180,7 +180,7 @@ order.fetchData(); ...@@ -180,7 +180,7 @@ order.fetchData();
180 style="width: 260px" 180 style="width: 260px"
181 /> 181 />
182 </el-form-item> 182 </el-form-item>
183 <el-form-item :label="language == 0 ? '观看人' : 'contacts'"> 183 <el-form-item :label="language == 0 ? '观看人' : 'Viewer'">
184 <div class="p_box"> 184 <div class="p_box">
185 <div class="people"> 185 <div class="people">
186 <el-checkbox-group 186 <el-checkbox-group
...@@ -252,7 +252,8 @@ order.fetchData(); ...@@ -252,7 +252,8 @@ order.fetchData();
252 {{ languageFormat(language, "共计", "Total") }} 252 {{ languageFormat(language, "共计", "Total") }}
253 </div> 253 </div>
254 <div class="price_num"> 254 <div class="price_num">
255 <span v-if="language == 0">¥</span>{{ order.data?.paymentAmount }} 255 <span>{{ language == 0 ? "¥" : "€" }}</span>
256 {{ order.data?.paymentAmount }}
256 </div> 257 </div>
257 </div> 258 </div>
258 </div> 259 </div>
...@@ -260,9 +261,13 @@ order.fetchData(); ...@@ -260,9 +261,13 @@ order.fetchData();
260 </div> 261 </div>
261 <div class="footer"> 262 <div class="footer">
262 <div> 263 <div>
263 <span class="label" 264 <span class="label">
264 >{{ languageFormat(language, "共计金额", "Subtotal") }}</span 265 {{ languageFormat(language, "共计金额", "Subtotal") }}
265 ><span class="value">¥{{ order.data?.paymentAmount }}</span> 266 </span>
267 <span class="value">
268 <span>{{ language == 0 ? "¥" : "€" }}</span>
269 {{ order.data?.paymentAmount }}
270 </span>
266 </div> 271 </div>
267 <div class="pay" @click="payment.paymentHandle()"> 272 <div class="pay" @click="payment.paymentHandle()">
268 {{ languageFormat(language, "立即支付", "Pay Now") }} 273 {{ languageFormat(language, "立即支付", "Pay Now") }}
......
...@@ -20,30 +20,37 @@ const router = useRouter(); ...@@ -20,30 +20,37 @@ const router = useRouter();
20 const status = reactive({ 20 const status = reactive({
21 0: { 21 0: {
22 txt: "待支付", 22 txt: "待支付",
23 text_en: "Pending Payment",
23 color: "#F740A6", 24 color: "#F740A6",
24 bgColor: "#FFE2F2", 25 bgColor: "#FFE2F2",
25 }, 26 },
26 1: { 27 1: {
27 txt: "购票成功", 28 txt: "购票成功",
29 text_en: "Transaction completed",
28 color: "#FFCC00", 30 color: "#FFCC00",
29 bgColor: "#FFF7D9", 31 bgColor: "#FFF7D9",
30 }, 32 },
31 2: { 33 2: {
32 txt: "交易关闭", 34 txt: "交易关闭",
35 text_en: "Transaction closed",
33 color: "#757575", 36 color: "#757575",
34 bgColor: "#DDDDDD", 37 bgColor: "#DDDDDD",
35 }, 38 },
36 3: { 39 3: {
37 txt: "已退款", 40 txt: "已退款",
41 text_en: "Already refunded",
38 color: "#757575", 42 color: "#757575",
39 bgColor: "#DDDDDD", 43 bgColor: "#DDDDDD",
40 }, 44 },
41 4: { 45 4: {
46 txt: "退款中",
47 text_en: "In the process of refunding",
42 color: "#F740A6", 48 color: "#F740A6",
43 bgColor: "#FFE2F2", 49 bgColor: "#FFE2F2",
44 }, 50 },
45 5: { 51 5: {
46 txt: "完成", 52 txt: "完成",
53 text_en: "Finish",
47 color: "#34C759", 54 color: "#34C759",
48 bgColor: "#D2FFDD", 55 bgColor: "#D2FFDD",
49 }, 56 },
...@@ -55,20 +62,24 @@ const props = defineProps({ ...@@ -55,20 +62,24 @@ const props = defineProps({
55 62
56 let timer = null; 63 let timer = null;
57 const startCheckSuccessListener = (orderSn, actId) => { 64 const startCheckSuccessListener = (orderSn, actId) => {
58 console.log(123);
59 timer = setInterval(() => { 65 timer = setInterval(() => {
60 checkPaySuccess({ orderSn }).then((res) => { 66 checkPaySuccess({ orderSn })
61 if (res.data) { 67 .then((res) => {
68 if (res.data) {
69 clearInterval(timer);
70 timer = null;
71 // 支付成功
72 detail.showCodeDialog = false;
73 detail.fetchData();
74 ElMessage({ type: "success", message: "支付成功" });
75 } else {
76 return false;
77 }
78 })
79 .catch((e) => {
62 clearInterval(timer); 80 clearInterval(timer);
63 timer = null; 81 timer = null;
64 // 支付成功 82 });
65 detail.showCodeDialog = false;
66 detail.fetchData();
67 ElMessage({ type: "success", message: "支付成功" });
68 } else {
69 return false;
70 }
71 });
72 }, 3000); 83 }, 3000);
73 }; 84 };
74 85
...@@ -126,25 +137,23 @@ const detail = reactive({ ...@@ -126,25 +137,23 @@ const detail = reactive({
126 payment() { 137 payment() {
127 if (detail.pay_loading) return; 138 if (detail.pay_loading) return;
128 detail.pay_loading = true; 139 detail.pay_loading = true;
129 if (language.value == 0) { 140 // 中文支付
130 // 中文支付 141 immediatePay({ orderSn: detail.data.orderSn, payType: 1 })
131 immediatePay({ orderSn: detail.data.orderSn, payType: 1 }) 142 .then((res) => {
132 .then((res) => { 143 if (res.data.language == "zh-cn") {
133 if (res.data.language == "zh-cn") { 144 detail.qrInfo = res.data;
134 detail.qrInfo = res.data; 145 qrcode.toDataURL(res.data.scanCodeUrl, (err, url) => {
135 qrcode.toDataURL(res.data.scanCodeUrl, (err, url) => { 146 if (url) {
136 if (url) { 147 detail.qrCodeData = url;
137 detail.qrCodeData = url; 148 }
138 } 149 });
139 }); 150 detail.showCodeDialog = true;
140 detail.showCodeDialog = true; 151 startCheckSuccessListener(detail.data.orderSn);
141 startCheckSuccessListener(detail.data.orderSn); 152 } else {
142 } 153 // TODO:这里是英文环境支付
143 }) 154 }
144 .finally(() => (detail.pay_loading = false)); 155 })
145 } else { 156 .finally(() => (detail.pay_loading = false));
146 // TODO: 这里是英文支付
147 }
148 }, 157 },
149 handleClose() { 158 handleClose() {
150 detail.showCodeDialog = false; 159 detail.showCodeDialog = false;
...@@ -259,13 +268,15 @@ detail.fetchData(); ...@@ -259,13 +268,15 @@ detail.fetchData();
259 <div style="width: 30%" class="td">{{ detail.data?.name }}</div> 268 <div style="width: 30%" class="td">{{ detail.data?.name }}</div>
260 <div style="width: 25%" class="td">{{ detail.data?.placeName }}</div> 269 <div style="width: 25%" class="td">{{ detail.data?.placeName }}</div>
261 <div style="width: 20%" class="td"> 270 <div style="width: 20%" class="td">
262 ¥{{ detail.data?.singlePrice }} 271 <span>{{ language == 0 ? "¥" : "€" }}</span>
272 {{ detail.data?.singlePrice }}
263 </div> 273 </div>
264 <div style="width: 12%" class="td"> 274 <div style="width: 12%" class="td">
265 x{{ detail.data?.seatList?.length }} 275 x{{ detail.data?.seatList?.length }}
266 </div> 276 </div>
267 <div style="width: 13%; text-align: right" class="td"> 277 <div style="width: 13%; text-align: right" class="td">
268 ¥{{ detail.data?.payAmount }} 278 <span>{{ language == 0 ? "¥" : "€" }}</span>
279 {{ detail.data?.payAmount }}
269 </div> 280 </div>
270 </div> 281 </div>
271 </div> 282 </div>
...@@ -358,7 +369,11 @@ detail.fetchData(); ...@@ -358,7 +369,11 @@ detail.fetchData();
358 class="value" 369 class="value"
359 :style="{ color: status[detail.data?.state]?.color }" 370 :style="{ color: status[detail.data?.state]?.color }"
360 > 371 >
361 {{ status[detail.data?.state]?.txt }} 372 {{
373 language == 0
374 ? status[detail.data?.state]?.txt
375 : status[detail.data?.state]?.text_en
376 }}
362 </div> 377 </div>
363 </div> 378 </div>
364 <div class="cell"> 379 <div class="cell">
...@@ -369,7 +384,8 @@ detail.fetchData(); ...@@ -369,7 +384,8 @@ detail.fetchData();
369 class="value" 384 class="value"
370 :style="{ color: status[detail.data?.state]?.color }" 385 :style="{ color: status[detail.data?.state]?.color }"
371 > 386 >
372 <span v-if="language == 0">¥</span>{{ detail.data?.payAmount }} 387 <span>{{ language == 0 ? "¥" : "€" }}</span>
388 {{ detail.data?.payAmount }}
373 </div> 389 </div>
374 </div> 390 </div>
375 <!-- button --> 391 <!-- button -->
......
...@@ -318,9 +318,10 @@ price.fetchData(); ...@@ -318,9 +318,10 @@ price.fetchData();
318 @click="price.onClickPrice(it)" 318 @click="price.onClickPrice(it)"
319 > 319 >
320 <img class="seat" :src="it.unSelectIcon" /> 320 <img class="seat" :src="it.unSelectIcon" />
321 <span class="price" 321 <span class="price">
322 >{{ it.price }}<span v-if="language == 0">¥</span></span 322 {{ it.price }}
323 > 323 <span>{{ language == 0 ? "¥" : "€" }}</span>
324 </span>
324 </div> 325 </div>
325 </div> 326 </div>
326 </div> 327 </div>
...@@ -346,7 +347,10 @@ price.fetchData(); ...@@ -346,7 +347,10 @@ price.fetchData();
346 </div> 347 </div>
347 </div> 348 </div>
348 <div class="pay"> 349 <div class="pay">
349 <div class="sum">¥{{ sumPrice?.toFixed(2) }}</div> 350 <div class="sum">
351 <span>{{ language == 0 ? "¥" : "€" }}</span>
352 {{ sumPrice?.toFixed(2) }}
353 </div>
350 <div class="pay_btn" @click="toConfirmOrder()"> 354 <div class="pay_btn" @click="toConfirmOrder()">
351 {{ languageFormat(language, "立即购买", "Continue") }} 355 {{ languageFormat(language, "立即购买", "Continue") }}
352 </div> 356 </div>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!