Commit 4f8de789 authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/viitto/million

parents 0948bf45 b82b8064
...@@ -10,7 +10,7 @@ export default { ...@@ -10,7 +10,7 @@ export default {
}; };
</script> </script>
<style> <style>
@import url("//at.alicdn.com/t/c/font_1890699_l4zj0bx0p69.css"); @import url("//at.alicdn.com/t/c/font_1890699_sm7qminrp2.css");
@font-face { @font-face {
font-family: "oswald"; font-family: "oswald";
src: url("https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/smallapp/Oswald-Regular.ttf"); src: url("https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/smallapp/Oswald-Regular.ttf");
......
<template>
<div class="column full-height">
<div class="col">
<div class="text-right" v-if="$q.platform.is.desktop">
<q-btn
color="primary"
icon="refresh"
label="全部重選"
@click="resetHandler"
flat
/>
</div>
<div class="text-grey-6 f12 q-my-md">選擇門票類型</div>
<div class="row wrap">
<div v-for="(x,i) in dataList.TicketList" :key="i">
<q-chip size="14px" clickable @click="handleSelect(x)"
:text-color="selectedObj&&selectedObj.Id==x.Id?'white':'dark'"
:color="selectedObj&&selectedObj.Id==x.Id?'primary':'grey-3'" square>{{ x.TicketName }}</q-chip>
</div>
</div>
<div class="text-grey-6 f12 q-my-md">選擇數量</div>
<div class="row items-end">
<div class="col" :class="{'column':$q.platform.is.mobile}">
<div v-if="selectedObj">
<span class="text-subtitle2 text-weight-bold">{{selectedObj.TicketName}}</span>
<span class="text-grey-6 f12 q-ml-sm"></span>(1人/票)</span>
</div>
<div v-if="$q.platform.is.mobile">
<span class="text-grey-7 product-price" style="font-size: 13px">
CNY {{ moneyFormat(p.originalB2CPrice, 0) }} /每票
</span>
</div>
</div>
<div class="row items-end">
<span v-if="$q.platform.is.desktop" class="text-grey-7 product-price" style="font-size: 13px">
CNY {{ moneyFormat(p.originalB2CPrice, 0) }} /每票
</span>
<q-input
style="width: 150px"
@input="changePeople"
v-model="chosenObj.Count"
class="col"
:class="{
'q-ml-sm q-px-none q-pl-none': $q.platform.is.desktop,
}"
mask="#"
reverse-fill-mask
dense
standout
readonly
>
<template v-slot:prepend>
<q-btn
color="primary"
size="sm"
class="q-px-none"
flat
icon="remove"
@click="addPeople('Count', -1)"
/>
</template>
<template v-slot:append>
<q-btn
color="primary"
size="sm"
class="q-px-none"
flat
icon="add"
@click="addPeople('Count', 1)"
/>
</template>
</q-input>
</div>
</div>
</div>
<div class="q-mt-md q-pt-md" style="border-top: 1px dashed #eee">
<div class="row items-center">
<span class="text-subtitle2 text-grey-6 col">總金額</span>
<span class="text-h6 text-primary product-price">CNY {{ moneyFormat(sumPrice,0) }}</span>
</div>
<div class="q-mt-md text-right"
:class="{'row wrap justify-end items-start':$q.platform.is.mobile}">
<span :class="{'col-12 q-mb-sm':$q.platform.is.mobile}">
<span class="f12 text-negative" v-if="!p.startDate"
:class="{'q-mr-lg':$q.platform.is.desktop}">
{{$q.platform.is.mobile?'請選擇上面的出行日期':'請選擇左側的出行日期'}}
</span>
<span class="f12 text-negative"
:class="{'q-mr-lg':$q.platform.is.desktop}"
v-if="p.startDate&&!selectedObj">
{{`請選擇上面的門票類型`}}
</span>
</span>
<q-btn color="primary" label="立即訂購" unelevated class="q-px-lg"
:disable="sumPrice==0||!selectedObj"
@click="goOrderHandler"/>
</div>
</div>
</div>
</template>
<script>
import { date } from "quasar";
export default {
props: ["dataList","price","configId","Month"],
watch: {
price: {
handler(n, o) {
this.p = n;
if(n&&n.startDate){
this.chosenObj.startDate = n.startDate;
}
this.calcMoney()
},
deep: true,
immediate: false
},
dataList: {
handler(n, o) {
this.dataList = n;
},
deep: true,
immediate: true
},
},
data() {
return {
p: {},
chosenObj: null,
sumPrice:0,
selectedObj: null,
priceList: [],
};
},
created() {
this.initModel();
if(this.p.startDate){
this.chosenObj.startDate = this.p.startDate;
this.calcMoney()
this.getCarPriceData2()
}
},
methods: {
goOrderHandler(){
let order = {
CouponsId: this.configId,
TicketId: this.selectedObj.Id,
Month: this.Month,
startDate: this.p.startDate,
originalB2CPrice: this.p.originalB2CPrice,
orderInfo: this.chosenObj,
}
let key = this.$md5(JSON.stringify(order))
let pickuporderScenTickets = localStorage.getItem('pickuporderScenTickets')
pickuporderScenTickets = pickuporderScenTickets?JSON.parse(pickuporderScenTickets):[]
pickuporderScenTickets.push({
key,
order
})
localStorage.setItem("pickuporderScenTickets",JSON.stringify(pickuporderScenTickets))
this.CommonJump('/PickuporderForm/'+key, {});
},
// 获取报价的详情
getCarPriceData2() {
this.priceList = []
this.apipost(
"b2c_get_GetTicketCouponsMonthPrice",
{
CouponsId: this.configId,
TicketId: this.selectedObj.Id,
Month: this.Month,
},
(r) => {
if (r.data.resultCode == 1) {
let arr = []
r.data.data.forEach(x=>{
if(x.Price){
if(this.chosenObj.startDate==x.Date){
this.p.originalB2CPrice = x.Price
}
let dataObj = {
startDate: x.Date,
originalB2CPrice: x.Price,
remainNum: 1,
Count: 1,
isSupportChildren: 1,
safeMoney: 0,
}
if(date.formatDate(Date.now(), 'YYYY-MM-DD')!=x.Date&&x.Date>date.formatDate(Date.now(), 'YYYY-MM-DD')){
arr.push(dataObj)
}
}
})
const temp= JSON.parse(JSON.stringify(r.data.data))
let PriceArr = temp.filter(x=>{ return x.Price>0 })
if(PriceArr.length>0){
this.$emit('getPriceList',JSON.stringify(arr),this.selectedObj.Id)
}else{
let dataObj = {
startDate: '',
originalB2CPrice: '',
remainNum: 0,
Count: 0,
safeMoney: 0,
PeopleNum: 1
}
this.priceList.push(dataObj)
this.$emit('getPriceList',JSON.stringify(this.priceList),this.selectedObj.Id)
this.p.originalB2CPrice = 0
this.resetHandler()
}
}
},null)
},
handleSelect(item){
this.selectedObj = item
setTimeout(()=>{
this.getCarPriceData2()
},100)
},
initModel() {
this.sumPrice=0
this.chosenObj = {
startDate: "",
Count: 1,
remark: "",
};
},
resetHandler(type) {
if(type){
this.selectedObj = null
}
setTimeout(()=>{
this.p = {};
this.initModel()
},100)
this.$emit("reset");
},
changePeople(val) {},
addPeople(m, i, isDf = false) {
this.chosenObj[m] = parseInt(this.chosenObj[m]) + i;
if(m!='Count'){
this.chosenObj[m] = this.chosenObj[m] < 0 ? 0 : this.chosenObj[m]++;
}else{
this.chosenObj[m] = this.chosenObj[m] < 1 ? 1 : this.chosenObj[m]++;
}
this.calcMoney()
},
calcMoney() {
if (!this.p) return;
let money = this.p.originalB2CPrice * this.chosenObj.Count;
this.sumPrice = money;
},
},
};
</script>
<style></style>
...@@ -745,6 +745,12 @@ this.dayArray = this.dayArray.filter(item => arr.includes(item.id)) ...@@ -745,6 +745,12 @@ this.dayArray = this.dayArray.filter(item => arr.includes(item.id))
{} {}
); );
return return
}else if(item.productType === 2) { // 景区门票
this.CommonJump(
"/detailsScenicSpotTicket/"+item.configId,
{}
);
return
} }
this.CommonJump( this.CommonJump(
"/detail/" + encodeURIComponent(item.id) + "/" + item.tcid + "/" + item.configId, "/detail/" + encodeURIComponent(item.id) + "/" + item.tcid + "/" + item.configId,
......
...@@ -72,6 +72,7 @@ export default { ...@@ -72,6 +72,7 @@ export default {
methods: { methods: {
formatTeam(){ formatTeam(){
let p = this.trip.priceList[0] let p = this.trip.priceList[0]
if(!p) return
let t = p.priceTeamType??1 let t = p.priceTeamType??1
t=t==0?1:t t=t==0?1:t
if(t==1){ if(t==1){
......
This diff is collapsed.
This diff is collapsed.
...@@ -132,11 +132,10 @@ ...@@ -132,11 +132,10 @@
class="q-mr-sm" class="q-mr-sm"
/> />
<span <span
>日本 - v-for="(x, i) in dataList.CityList2" :key="i">{{x.CountryName}} -
<span>
<span v-for="(x, i) in citys" :key="i"> <span class="cursor-pointer">{{ x.CityName }} </span>
<span class="cursor-pointer">{{ x }} </span> <span v-if="i + 1 != dataList.CityList2.length" class="q-mr-sm">,</span>
<span v-if="i + 1 != citys.length" class="q-mr-sm">,</span>
</span> </span>
</span> </span>
</div> </div>
...@@ -1011,7 +1010,6 @@ export default { ...@@ -1011,7 +1010,6 @@ export default {
originalB2CPrice: x.Price, originalB2CPrice: x.Price,
remainNum: 1, remainNum: 1,
Count: 1, Count: 1,
isSupportChildren: 1,
safeMoney: 0, safeMoney: 0,
} }
if(date.formatDate(Date.now(), 'YYYY-MM-DD')!=x.Date){ if(date.formatDate(Date.now(), 'YYYY-MM-DD')!=x.Date){
...@@ -1025,69 +1023,6 @@ export default { ...@@ -1025,69 +1023,6 @@ export default {
},null) },null)
}, },
getCarPriceData() {
this.$q.loading.show();
this.apipost(
"b2c_get_GetCarSingleProductMonthPriceAll",
{ ProductId: this.msg.configId, Month: this.currentYM.str },
(r) => {
let list = [[]];
let y = 0; // 元素纵向下标
let day = 0;
if (r.data.resultCode == 1) {
let week = dayjs(this.currentYM.str + "-01").day();
console.log("week", week);
list[0].length = week;
const isCurrent =
this.currentYM.year === dayjs().year() &&
this.currentYM.month === dayjs().month() + 1;
this.isCurrent = isCurrent;
this.isLast = this.currentYM.year === dayjs().year() +1 &&
this.currentYM.month === dayjs().month() + 1;
// 如果是当前月
if (isCurrent) {
let days = dayjs(r.data.data[0].Date).date();
day = days;
for (let i = 1; i <= days; i++) {
list[y].push({
day: i,
disabled: true,
});
week++;
if (week === 7) {
week = 0;
y++;
list[y] = [];
}
}
}
r.data.data.forEach((item) => {
list[y].push({
...item,
day: ++day,
});
week++;
if (week === 7) {
week = 0;
y++;
list[y] = [];
}
});
this.daysList = list;
console.log("list", list);
} else {
this.$q.notify({
type: "negative",
message: r.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
this.$q.loading.hide();
},
null
);
},
menu() { menu() {
this.scroll = this.scroll =
document.documentElement.scrollTop || document.body.scrollTop; document.documentElement.scrollTop || document.body.scrollTop;
......
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
/> />
</div> </div>
</div> </div>
<div class="q-mt-lg"> <div class="q-mt-lg" v-if="dataList.productRecommend">
<div <div
class="q-mt-sm" class="q-mt-sm"
v-for="(x, i) in dataList.productRecommend.split('\n')" v-for="(x, i) in dataList.productRecommend.split('\n')"
...@@ -388,7 +388,7 @@ ...@@ -388,7 +388,7 @@
<div <div
class="col q-ml-xl position-relative" class="col q-ml-xl position-relative"
v-if=" v-if="
(!(dataList.priceList && dataList.priceList[0].teamType==2)&&!(dataList.currentPrice && dataList.currentPrice.teamType==2)) && dataList.priceList.length>0&&(!(dataList.priceList && dataList.priceList[0].teamType==2)&&!(dataList.currentPrice && dataList.currentPrice.teamType==2)) &&
currentHeight > days[0].top - 60 && currentHeight > days[0].top - 60 &&
currentHeight < navs[2].top && currentHeight < navs[2].top &&
$q.platform.is.desktop $q.platform.is.desktop
...@@ -452,7 +452,7 @@ ...@@ -452,7 +452,7 @@
'q-px-md': $q.screen.width < 1220 && $q.platform.is.desktop, 'q-px-md': $q.screen.width < 1220 && $q.platform.is.desktop,
}" }"
></smaple> ></smaple>
<template v-if="(dataList.priceList && dataList.priceList[0].teamType==2)||(dataList.currentPrice && dataList.currentPrice.teamType==2)"> <template v-if="dataList.priceList.length>0&&(dataList.priceList && dataList.priceList[0].teamType==2)||(dataList.currentPrice && dataList.currentPrice.teamType==2)">
<trip :trip="dataList" @change="changeTripShowHandler"></trip> <trip :trip="dataList" @change="changeTripShowHandler"></trip>
</template> </template>
<template v-else> <template v-else>
......
...@@ -36,6 +36,14 @@ const routes = [{ ...@@ -36,6 +36,14 @@ const routes = [{
path: '/PickuporderForm/:id', path: '/PickuporderForm/:id',
component: () => component: () =>
import ('pages/Pickuporder/orderForm.vue') import ('pages/Pickuporder/orderForm.vue')
}, { // 景区门票详情
path: '/detailsScenicSpotTicket/:id',
component: () =>
import ('pages/ScenicSpotTicket/details.vue')
}, { // 景区门票下单
path: '/ScenicSpotTicketOrderForm/:id',
component: () =>
import ('pages/ScenicSpotTicket/orderForm.vue')
}, { // 酒店 }, { // 酒店
path: '/detailHotal/:id', path: '/detailHotal/:id',
component: () => component: () =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment