Commit f5e781bb authored by 罗超's avatar 罗超

修改机票样式

parent b9eb6016
......@@ -16,7 +16,7 @@
<u-checkbox-group>
<u-checkbox :disabled="!x.Checked && !canChecked && x.year>1" shape="circle" v-model="x.Checked" active-color="#B99846"></u-checkbox>
</u-checkbox-group>
<view class="col q-ml-md q-mr-md">
<view class="col q-ml-md q-mr-md" @click="setCheckStatusHandle(x)">
<view class="row items-center">
<view class="guest-name">{{x.SurName}}/{{x.GivenName}} {{x.Name!=''?`(${x.Name})`:''}}</view>
<view class="guest-tag" :class="{'cr':x.year>11,'et':x.year>1&&x.year<12,'baby':x.year<2}">
......@@ -106,6 +106,12 @@
this.checkedChange()
},
},
listVisible: {
immediate: true,
handler: function(newVal, oldVal) {
this.$emit('change-visible',newVal)
},
}
},
created() {
if(uni.getStorageSync('guest')){
......@@ -120,6 +126,10 @@
}
},
methods:{
setCheckStatusHandle(x){
if(!x.Checked && !this.canChecked && x.year>1) return
x.Checked = !x.Checked
},
guestChangeHandle(val){
this.guests = val
},
......
......@@ -29,7 +29,7 @@
<u-checkbox-group>
<u-checkbox @change="guestChangeHandle" :disabled="!x.Checked && !canChecked && x.year>1" shape="circle" v-model="x.Checked" active-color="#B99846"></u-checkbox>
</u-checkbox-group>
<view class="col q-ml-md q-mr-md">
<view class="col q-ml-md q-mr-md" @click="setCheckStatusHandle(x)">
<view class="row items-center">
<view class="guest-name">{{x.SurName}}/{{x.GivenName}} {{x.Name!=''?`(${x.Name})`:''}}</view>
<view class="guest-tag" :class="{'cr':x.year>11,'et':x.year>1&&x.year<12,'baby':x.year<2}">
......@@ -210,6 +210,11 @@
},
methods:{
setCheckStatusHandle(x){
if(!x.Checked && !this.canChecked && x.year>1) return
x.Checked = !x.Checked
this.guestChangeHandle()
},
calcYearHandle(date){
this.guests.forEach(x=>{
x.year=this.calculateAge(x.BirthDay)
......
......@@ -47,6 +47,10 @@ export default {
defaultEndDate: {
type: String,
default: ""
},
displayList:{
type:Object,
default:{}
}
},
data() {
......@@ -116,6 +120,8 @@ export default {
});
return { ...acc, ...Object.assign({}, ...subResult) };
}, {});
console.log(this.calendarFestivals,this.displayList)
this.calendarFestivals = Object.assign(this.calendarFestivals, this.displayList);
},
setInitialSelection() {
......
......@@ -42,6 +42,13 @@ export default {
defaultDate: {
type: String,
default: ""
},
/**
* displayList,对象值{'20230202':'休息'}
*/
displayList:{
type:Object,
default:{}
}
},
data() {
......@@ -116,6 +123,7 @@ export default {
});
return {...acc,...Object.assign({},...subResult) };
}, {})
this.calendarFestivals = Object.assign(this.calendarFestivals, this.displayList);
},
......
......@@ -4,8 +4,8 @@
<u-popup mode="bottom" border-radius="20" :popup="false" v-model="showDateVisible" :maskCloseAble="true" length="auto" :safeAreaInsetBottom="true" @close="()=>showDateVisible=false" :z-index="9999">
<view class="column" style="height: 70vh;">
<scroll-view scroll-y="true" class="col" style="width: 100%;height: 1px;">
<date-select-range @selected-range="changeHandle" v-if="selectType==1" :default-start-date="rangeValue[0]" :default-end-date="rangeValue[1]"></date-select-range>
<date-select @selected="changeHandle" v-else :default-date="value"></date-select>
<date-select-range :display-list="displayList" @selected-range="changeHandle" v-if="selectType==1" :default-start-date="rangeValue[0]" :default-end-date="rangeValue[1]"></date-select-range>
<date-select :display-list="displayList" @selected="changeHandle" v-else :default-date="value"></date-select>
</scroll-view>
<view @click="selected" class="text-center q-mt-md q-ml-md q-mr-md" style="background-color: #B99846;border-radius: 10rpx;height: 90rpx; line-height: 90rpx;color:#EEF1F4;font-weight: bold;font-size: 32rpx;">确定</view>
</view>
......@@ -29,6 +29,13 @@
defaultValue:{
type:String|Array,
default:''
},
/**
* displayList,对象值{'20230202':'休息'}
*/
displayList:{
type:Object,
default:{}
}
},
components:{
......
......@@ -34,7 +34,7 @@
<view class="flight-card q-mt-md">
<view class="title">选择乘机人</view>
<guest :max-num="flight.B2BSellNum" @selected="guestChangeHandle"></guest>
<guest @change-visible="(val)=>statusVisible=val" :max-num="flight.B2BSellNum" @selected="guestChangeHandle"></guest>
<u-field
v-model="contactName"
label="联系人"
......@@ -131,7 +131,7 @@
</view>
</view>
</scroll-view>
<view class="order-box" v-if="flight && !loading">
<view class="order-box" v-if="flight && !loading && !statusVisible">
<view class="flight-card order-preview row items-center">
<view class="col" style="color: #ff3166; font-weight: bold">
<text style="font-size: 22rpx">¥</text>
......@@ -218,7 +218,8 @@
CreateBy:0
},
sales:[],
saleVisable:false
saleVisable:false,
statusVisible:false
}
},
components: {
......@@ -650,7 +651,7 @@
padding-top: 24rpx;
padding-bottom: calc(constant(safe-area-inset-bottom));
padding-bottom: calc(env(safe-area-inset-bottom));
z-index: 2;
min-height: 156rpx;
background: #F5F5F5;
}
......
......@@ -39,7 +39,7 @@
</view>
</scroll-view>
<view class="time-item more row items-center justify-center">
<date-select @change="dateFilterChange" :default-value="[filterDate.start,filterDate.end]">
<date-select :display-list="dateDisplay" @change="dateFilterChange" :default-value="[filterDate.start,filterDate.end]">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638753835239709518.png" mode="widthFix" style="width: 30rpx;max-height: 60px;"></image>
</date-select>
</view>
......@@ -57,6 +57,7 @@
<view class="row items-start">
<view class="flight-status">去程</view>
<view class="flight-time">
<view class="date-box">{{formatDateString(x.GoFlightList[0].FlightDate)}}</view>
<view class="">{{x.GoFlightList[0].Departure_time}}</view>
<view class="thin">{{x.GoFlightList[0].dName.replaceAll('国际机场','').replaceAll('机场','')}}</view>
</view>
......@@ -82,7 +83,7 @@
<view class="thin">{{x.GoFlightList[x.GoFlightList.length-1].aName.replaceAll('国际机场','').replaceAll('机场','')}}</view>
</view>
</view>
<view class="q-mt-md row items-center">
<view class="row items-center" style="margin-top: 14rpx;">
<view class="row items-center" v-for="(a,ai) in x.GoFlightList">
<view class="login-box">
<image :src="`https://static.tripcdn.com/packages/flight/airline-logo/latest/airline/48/${a.AlCode}.png`" mode="widthFix"></image>
......@@ -95,6 +96,7 @@
<view class="row items-start">
<view class="flight-status">回程</view>
<view class="flight-time">
<view class="date-box">{{formatDateString(x.BackFlightList[0].FlightDate)}}</view>
<view class="">{{x.BackFlightList[0].Departure_time}}</view>
<view class="thin">{{x.BackFlightList[0].dName.replaceAll('国际机场','').replaceAll('机场','')}}</view>
</view>
......@@ -120,7 +122,7 @@
<view class="thin">{{x.BackFlightList[x.BackFlightList.length-1].aName.replaceAll('国际机场','').replaceAll('机场','')}}</view>
</view>
</view>
<view class="q-mt-md row items-center">
<view class="row items-center" style="margin-top: 14rpx;">
<view class="row items-center" v-for="(a,ai) in x.BackFlightList">
<view class="login-box">
<image :src="`https://static.tripcdn.com/packages/flight/airline-logo/latest/airline/48/${a.AlCode}.png`" mode="widthFix"></image>
......@@ -136,8 +138,8 @@
<text class="big">{{x.B2BPrice}}</text>
</view>
<view class="num row items-center">
<text style="padding: 6rpx;"></text>
<text class="col text-center" style="padding:6rpx;background-color: #B99846;">{{x.B2BSellNum}}张</text>
<text style="padding: 6rpx;width: 56rpx;" class="text-center"></text>
<text class="col text-center" style="padding:6rpx;color:#fff;background-color: #B99846;">{{x.B2BSellNum}}张</text>
</view>
<view class="text-center buy-button">预定</view>
</view>
......@@ -208,7 +210,8 @@
filterDate:{
start:'',
end:''
}
},
dateDisplay:{}
}
},
components:{DateSelect,ChosenCity},
......@@ -358,6 +361,7 @@
this.resolveParameterHanle()
this.lowData = []
this.loadingLow = true
this.dateDisplay = {}
this.apipost('AirTicket_get_GetTopTicketProduct', this.parementers, (r) => {
if (r.resultCode == 1) {
this.lowData = this.formatLowData(r.data)
......@@ -383,12 +387,28 @@
x.GoDiffDay = this.resolveDiffDayHandle(`${go.FlightDate} ${go.Departure_time}`,go.DepartureUTCZone,go.ArrivalCityUTCZone,x.DepartureTime)
x.BackDiffDay = this.resolveDiffDayHandle(`${back.FlightDate} ${back.Departure_time}`,back.DepartureUTCZone,back.ArrivalCityUTCZone,x.ArrivalTime)
})
this.formatDisplayHandle(list)
this.lowHeadData =this.foramtHeaderListHandle(list)
if(this.lowHeadData.findIndex(x=>x.FlightDate==this.currentDate)==-1){
this.currentDate = this.lowHeadData[0].FlightDate
}
return list
},
formatDisplayHandle(list){
this.dateDisplay = list.reduce((acc, item) => {
const arr = item.FlightDate.split('-')
const groupValue = `${arr[0]}${Number(arr[1])}${Number(arr[2])}`;
const currentPrice = item.B2BPrice;
if (!acc[groupValue]) {
acc[groupValue] = '¥'+currentPrice;
} else {
acc[groupValue] = '¥'+Math.min(parseFloat(acc[groupValue].replaceAll('¥','')), currentPrice);
}
return acc;
}, {});
},
foramtHeaderListHandle(list){
const d = list.filter(x=>{
const td = new Date(x.FlightDate)
......@@ -593,9 +613,8 @@
font-size: 24rpx;
color: #111111;
font-weight: 400;
padding: 14rpx 4rpx;
text-orientation: mixed;
writing-mode: tb;
padding: 4rpx 10rpx;
width: 44rpx;
}
.flight-card .flight-time{
......@@ -607,6 +626,19 @@
position: relative;
}
.flight-card .date-box{
position: absolute;
top: -20px;
left: 0;
padding: 4rpx 9rpx;
border-radius: 8rpx;
background-color: #f3f1ef;
color: #bcbcbc;
font-size: 20rpx;
width: 62px;
text-align: center;
line-height: 1;
}
.flight-card .flight-time .day-diff{
position: absolute;
top: -35rpx;
......@@ -703,10 +735,10 @@
.flight-card .num{
margin-top: 24rpx;
border-radius: 7rpx;
background-color: #080A09;
background-color: #f1f2f4;
font-size: 22rpx;
font-weight: 400;
color: #FFF;
color: #111;
overflow: hidden;
padding: 0;
line-height: 1;
......
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