9a620670 by 杨炀

Merge commit '1d7e0d59' into dev

2 parents 65bed76d 1d7e0d59
......@@ -216,6 +216,7 @@ const logout = () => {
return useUserStore().logOut()
}).then(() => {
isLogin.value = true
router.push('/')
location.reload()
})
}
......
......@@ -69,6 +69,7 @@
:disabled-date="disabledDateRZ"
:placeholder="language==0?'选择日期':'Select date'"
format="YYYY-MM-DD"
:clearable="false"
value-format="YYYY-MM-DD"/>
</span>
</li>
......@@ -107,7 +108,7 @@
</el-button>
<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>
<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>
<!-- <div class="text-center text-primary mt10 fontsize14 pointer" v-if="language == 0">-->
<!-- 剩余 {{(r.roomCount - (r.useCount||0)).toFixed()}} 间-->
<!-- </div>-->
......@@ -161,21 +162,25 @@ onMounted(() => {
formTime.value = null
}).finally(()=>{
console.log(formTime.value)
if (formTime.value){
if (dayjs().isBefore(dayjs(formTime.value.hqStart))){
hotTime.value[0]=dayjs(formTime.value.hqStart).format('YYYY-MM-DD')
hotTime.value[1]=dayjs(formTime.value.hqEnd).add(1,'day').format('YYYY-MM-DD')
} else{
hotTime.value[0]=dayjs().format('YYYY-MM-DD')
hotTime.value[1]=dayjs().add(1,'day').format('YYYY-MM-DD')
}
}
getDateTime()
getData()
})
})
function getDateTime(){
if (formTime.value){
if (dayjs().isBefore(dayjs(formTime.value.hqStart))){
hotTime.value[0]=dayjs(formTime.value.hqStart).format('YYYY-MM-DD')
hotTime.value[1]=dayjs(formTime.value.hqStart).add(1,'day').format('YYYY-MM-DD')
} else{
hotTime.value[0]=dayjs().format('YYYY-MM-DD')
hotTime.value[1]=dayjs().add(1,'day').format('YYYY-MM-DD')
}
}
}
function getData() {
loading.value = true
getHotelById(route.params.hotelId).then(res => {
......@@ -278,13 +283,12 @@ function goNext(room) {
})
}
function getDaysBetween(e){
console.log(hotTime.value)
function getDaysBetween(){
if (hotTime.value && hotTime.value.length==2){
const d1=dayjs(hotTime.value[0]).format('YYYY-MM-DD')
const d2=dayjs(hotTime.value[1]).format('YYYY-MM-DD')
if (d1==d2){
hotTime.value=[]
getDateTime()
return proxy.$modal.msgError(language.value==0?'入住时间跨度需要大于一天':'The duration of the stay must be more than one day.')
}else{
getData()
......@@ -292,19 +296,18 @@ function getDaysBetween(e){
}
}
// function disabledDateRZ(date) {
// //判读今天大与form.value.hqStart
// console.log(date)
// if (formTime.value.hqStart) {
// const today = dayjs().format('YYYY-MM-DD')
// if (formTime.value.hqStart < today) {
// return !((date.getTime() >= dayjs(today).valueOf())&&(date.getTime() <= dayjs(formTime.value.hqEnd).valueOf()))
// } else {
// return !((date.getTime() >= dayjs(formTime.value.hqStart).valueOf())&&(date.getTime() <= dayjs(formTime.value.hqEnd).valueOf()))
// }
// }
// // return true
// }
function disabledDateRZ(date) {
//判读今天大与form.value.hqStart
if (formTime.value.hqStart) {
const today = dayjs().format('YYYY-MM-DD')
if (formTime.value.hqStart < today) {
return !((date.getTime() >= dayjs(today).valueOf())&&(date.getTime() <= dayjs(formTime.value.hqEnd).valueOf()))
} else {
return !((date.getTime() >= dayjs(formTime.value.hqStart).valueOf())&&(date.getTime() <= dayjs(formTime.value.hqEnd).valueOf()))
}
}
// return true
}
function goMap() {
return
......@@ -451,7 +454,14 @@ function goMap() {
.oddmb:nth-child(2){margin-bottom: 20px;}
.forbid{
cursor:not-allowed !important;
color: #a8abb2;
filter:grayscale(1);
color: #a8abb2 !important;
//filter:grayscale(1);
background: #fff;
div{
color: #a8abb2 !important;
}
}
.forbid:hover{
box-shadow:none;
}
</style>
......
......@@ -329,6 +329,7 @@ function getDaysBetween(e) {
// console.log('入住时间arr', e, rzRange.value)
// console.log(e)
// console.log(Date.parse(rzRange.value[0]))
form.value.roomNum=0
var d1 = Date.parse(rzRange.value?rzRange.value[0]:null)
var d2 = Date.parse(rzRange.value?rzRange.value[1]:null)
if (d1 == d2) {
......
......@@ -90,7 +90,7 @@
</div>
<div class="text-right">
<el-button v-if="b.orderType == 0" class="mb10" plain round type="success" @click="Rebook(b)">
<el-button v-if="b.orderType == 0&&b.viewStatus!=0" class="mb10" plain round type="success" @click="Rebook(b)">
{{ language==0?'再次预订':'Rebook' }}</el-button>
<el-button class="mb10" plain round type="primary" @click="goDetail(b)">
{{ language==0?'详情':'Detail' }}</el-button>
......@@ -120,6 +120,8 @@ import useUserStore from "@/store/modules/user";
import dayjs from 'dayjs'
import {cancelOrder2,cancelOrder} from "/@/apiPc/booking";
import {ElMessage} from "element-plus";
const router = useRouter()
const language= useStorage('language',0)
const list = ref([])
......
......@@ -80,28 +80,26 @@ const payment = reactive({
),
});
}
if (language.value == 0) {
payOrder({
contactPhone: payment.form.phone,
customerIds: payment.form.viewers,
orderToken: order.data?.orderToken,
payType: 1,
paymentAmount: order.data?.paymentAmount,
}).then((res) => {
if (res.data.language == "zh-cn") {
payment.qrInfo = res.data;
qrcode.toDataURL(res.data.scanCodeUrl, (err, url) => {
if (url) {
payment.qrCodeData = url;
}
});
payment.showCodeDialog = true;
startCheckSuccessListener(res.data.orderSn, props.activityId);
}
});
} else {
// 这里是英文环境支付
}
payOrder({
contactPhone: payment.form.phone,
customerIds: payment.form.viewers,
orderToken: order.data?.orderToken,
payType: 1,
paymentAmount: order.data?.paymentAmount,
}).then((res) => {
if (res.data.language == "zh-cn") {
payment.qrInfo = res.data;
qrcode.toDataURL(res.data.scanCodeUrl, (err, url) => {
if (url) {
payment.qrCodeData = url;
}
});
payment.showCodeDialog = true;
startCheckSuccessListener(res.data.orderSn, props.activityId);
} else {
// TODO:这里是英文环境支付
}
});
},
handleCloce() {
payment.showCodeDialog = false;
......@@ -169,7 +167,9 @@ order.fetchData();
<div class="form">
<el-form>
<el-form-item :label="language == 0 ? '联系人' : 'contacts'">
<el-form-item
:label="language == 0 ? '联系人电话' : 'contact phone'"
>
<el-input
v-model="payment.form.phone"
:placeholder="
......@@ -180,7 +180,7 @@ order.fetchData();
style="width: 260px"
/>
</el-form-item>
<el-form-item :label="language == 0 ? '观看人' : 'contacts'">
<el-form-item :label="language == 0 ? '观看人' : 'Viewer'">
<div class="p_box">
<div class="people">
<el-checkbox-group
......@@ -252,7 +252,8 @@ order.fetchData();
{{ languageFormat(language, "共计", "Total") }}
</div>
<div class="price_num">
<span v-if="language == 0">¥</span>{{ order.data?.paymentAmount }}
<span>{{ language == 0 ? "¥" : "€" }}</span>
{{ order.data?.paymentAmount }}
</div>
</div>
</div>
......@@ -260,9 +261,13 @@ order.fetchData();
</div>
<div class="footer">
<div>
<span class="label"
>{{ languageFormat(language, "共计金额", "Subtotal") }}</span
><span class="value">¥{{ order.data?.paymentAmount }}</span>
<span class="label">
{{ languageFormat(language, "共计金额", "Subtotal") }}
</span>
<span class="value">
<span>{{ language == 0 ? "¥" : "€" }}</span>
{{ order.data?.paymentAmount }}
</span>
</div>
<div class="pay" @click="payment.paymentHandle()">
{{ languageFormat(language, "立即支付", "Pay Now") }}
......
......@@ -20,30 +20,37 @@ const router = useRouter();
const status = reactive({
0: {
txt: "待支付",
text_en: "Pending Payment",
color: "#F740A6",
bgColor: "#FFE2F2",
},
1: {
txt: "购票成功",
text_en: "Transaction completed",
color: "#FFCC00",
bgColor: "#FFF7D9",
},
2: {
txt: "交易关闭",
text_en: "Transaction closed",
color: "#757575",
bgColor: "#DDDDDD",
},
3: {
txt: "已退款",
text_en: "Already refunded",
color: "#757575",
bgColor: "#DDDDDD",
},
4: {
txt: "退款中",
text_en: "In the process of refunding",
color: "#F740A6",
bgColor: "#FFE2F2",
},
5: {
txt: "完成",
text_en: "Finish",
color: "#34C759",
bgColor: "#D2FFDD",
},
......@@ -55,20 +62,24 @@ const props = defineProps({
let timer = null;
const startCheckSuccessListener = (orderSn, actId) => {
console.log(123);
timer = setInterval(() => {
checkPaySuccess({ orderSn }).then((res) => {
if (res.data) {
checkPaySuccess({ orderSn })
.then((res) => {
if (res.data) {
clearInterval(timer);
timer = null;
// 支付成功
detail.showCodeDialog = false;
detail.fetchData();
ElMessage({ type: "success", message: "支付成功" });
} else {
return false;
}
})
.catch((e) => {
clearInterval(timer);
timer = null;
// 支付成功
detail.showCodeDialog = false;
detail.fetchData();
ElMessage({ type: "success", message: "支付成功" });
} else {
return false;
}
});
});
}, 3000);
};
......@@ -126,25 +137,23 @@ const detail = reactive({
payment() {
if (detail.pay_loading) return;
detail.pay_loading = true;
if (language.value == 0) {
// 中文支付
immediatePay({ orderSn: detail.data.orderSn, payType: 1 })
.then((res) => {
if (res.data.language == "zh-cn") {
detail.qrInfo = res.data;
qrcode.toDataURL(res.data.scanCodeUrl, (err, url) => {
if (url) {
detail.qrCodeData = url;
}
});
detail.showCodeDialog = true;
startCheckSuccessListener(detail.data.orderSn);
}
})
.finally(() => (detail.pay_loading = false));
} else {
// TODO: 这里是英文支付
}
// 中文支付
immediatePay({ orderSn: detail.data.orderSn, payType: 1 })
.then((res) => {
if (res.data.language == "zh-cn") {
detail.qrInfo = res.data;
qrcode.toDataURL(res.data.scanCodeUrl, (err, url) => {
if (url) {
detail.qrCodeData = url;
}
});
detail.showCodeDialog = true;
startCheckSuccessListener(detail.data.orderSn);
} else {
// TODO:这里是英文环境支付
}
})
.finally(() => (detail.pay_loading = false));
},
handleClose() {
detail.showCodeDialog = false;
......@@ -259,13 +268,15 @@ detail.fetchData();
<div style="width: 30%" class="td">{{ detail.data?.name }}</div>
<div style="width: 25%" class="td">{{ detail.data?.placeName }}</div>
<div style="width: 20%" class="td">
¥{{ detail.data?.singlePrice }}
<span>{{ language == 0 ? "¥" : "€" }}</span>
{{ detail.data?.singlePrice }}
</div>
<div style="width: 12%" class="td">
x{{ detail.data?.seatList?.length }}
</div>
<div style="width: 13%; text-align: right" class="td">
¥{{ detail.data?.payAmount }}
<span>{{ language == 0 ? "¥" : "€" }}</span>
{{ detail.data?.payAmount }}
</div>
</div>
</div>
......@@ -358,7 +369,11 @@ detail.fetchData();
class="value"
:style="{ color: status[detail.data?.state]?.color }"
>
{{ status[detail.data?.state]?.txt }}
{{
language == 0
? status[detail.data?.state]?.txt
: status[detail.data?.state]?.text_en
}}
</div>
</div>
<div class="cell">
......@@ -369,7 +384,8 @@ detail.fetchData();
class="value"
:style="{ color: status[detail.data?.state]?.color }"
>
<span v-if="language == 0">¥</span>{{ detail.data?.payAmount }}
<span>{{ language == 0 ? "¥" : "€" }}</span>
{{ detail.data?.payAmount }}
</div>
</div>
<!-- button -->
......
......@@ -318,9 +318,10 @@ price.fetchData();
@click="price.onClickPrice(it)"
>
<img class="seat" :src="it.unSelectIcon" />
<span class="price"
>{{ it.price }}<span v-if="language == 0">¥</span></span
>
<span class="price">
{{ it.price }}
<span>{{ language == 0 ? "¥" : "€" }}</span>
</span>
</div>
</div>
</div>
......@@ -346,7 +347,10 @@ price.fetchData();
</div>
</div>
<div class="pay">
<div class="sum">¥{{ sumPrice?.toFixed(2) }}</div>
<div class="sum">
<span>{{ language == 0 ? "¥" : "€" }}</span>
{{ sumPrice?.toFixed(2) }}
</div>
<div class="pay_btn" @click="toConfirmOrder()">
{{ languageFormat(language, "立即购买", "Continue") }}
</div>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!