Commit 81450a70 authored by 罗超's avatar 罗超

完成机票

parent 8a468cf3
...@@ -132,6 +132,9 @@ ...@@ -132,6 +132,9 @@
.flexS{ .flexS{
flex-shrink: 0; flex-shrink: 0;
} }
.text-right{
text-align: right;
}
.column{ .column{
display: flex; display: flex;
flex-direction: column; flex-direction: column;
......
@font-face { @font-face {
font-family: "tffont"; /* Project id 4816119 */ font-family: "tffont"; /* Project id 4816119 */
src: url('//at.alicdn.com/t/c/font_4816119_61ojoauzfi8.woff2?t=1739876734691') format('woff2'), src: url('//at.alicdn.com/t/c/font_4816119_3fhqn0zoshb.woff2?t=1739957291854') format('woff2'),
url('//at.alicdn.com/t/c/font_4816119_61ojoauzfi8.woff?t=1739876734691') format('woff'), url('//at.alicdn.com/t/c/font_4816119_3fhqn0zoshb.woff?t=1739957291854') format('woff'),
url('//at.alicdn.com/t/c/font_4816119_61ojoauzfi8.ttf?t=1739876734691') format('truetype'); url('//at.alicdn.com/t/c/font_4816119_3fhqn0zoshb.ttf?t=1739957291854') format('truetype');
} }
.tffont { .tffont {
...@@ -13,6 +13,22 @@ ...@@ -13,6 +13,22 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.tffont-baby:before {
content: "\e650";
}
.tffont-chengren:before {
content: "\e75f";
}
.tffont-ertong:before {
content: "\e760";
}
.tffont-pen_:before {
content: "\e8a5";
}
.tffont-qianwangx:before { .tffont-qianwangx:before {
content: "\e608"; content: "\e608";
} }
......
...@@ -37,13 +37,13 @@ ...@@ -37,13 +37,13 @@
</scroll-view> </scroll-view>
<view class="btton-box"> <view class="btton-box">
<u-button size="80" :ripple="true" shape="circle" :custom-style="{ <u-button size="80" :ripple="true" shape="circle" :custom-style="{
backgroundColor: mc, backgroundColor: mc,
height: '80rpx', height: '80rpx',
color: '#FFF', color: '#FFF',
fontSize: '14px', fontSize: '14px',
margin: '0 3vw', margin: '0 3vw',
width: '90vw', width: '90vw',
}" }"
@click="popupClose">确定</u-button> @click="popupClose">确定</u-button>
</view> </view>
</view> </view>
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<script> <script>
export default { export default {
props: ["list", "current","currentPrice","order"], props: ["list", "current","price","currentPrice","order"],
data() { data() {
return { return {
mc: "", mc: "",
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
}, },
methods: { methods: {
checkOrderCoupon(){ checkOrderCoupon(){
if (this.currentPrice.teamType==1) { if (this.currentPrice && this.currentPrice.teamType==1) {
//totalSeat:总机位 isSubstitution:1 (可候补) leaderNum:领队 //totalSeat:总机位 isSubstitution:1 (可候补) leaderNum:领队
const shengyu = this.currentPrice.totalSeat-this.currentPrice.leaderNum const shengyu = this.currentPrice.totalSeat-this.currentPrice.leaderNum
...@@ -90,9 +90,18 @@ ...@@ -90,9 +90,18 @@
this.ts.forEach(x => { this.ts.forEach(x => {
if(x.couponsUseScope==10) x.err = errorMsg if(x.couponsUseScope==10) x.err = errorMsg
}) })
this.ts.sort((a,b) => {
console.log(this.ts) const aerr = (a.err?a.err:'').length
const berr = (b.err?b.err:'').length
return aerr-berr
})
} }
this.ts.forEach((x)=>{
if(!x.err && x.useCondition>this.price){
x.err = '订单金额不满足'
}
})
console.log('useCondition')
}, },
popupClose() { popupClose() {
if (this.currentChosen != this.current) { if (this.currentChosen != this.current) {
......
<template> <template>
<view> <view>
<u-popup :zoom="zoom" mode="center" :z-index="uZIndex" v-model="value" :length="width" :mask-close-able="false" :border-radius="borderRadius"> <u-popup :zoom="zoom" mode="center" :z-index="uZIndex" v-model="value" :length="width" :mask-close-able="false" :border-radius="borderRadius">
<view class="u-model"> <view class="u-model" :style="{'border-radius': `${borderRadius}rpx`}">
<view v-if="showTitle" class="u-model-title u-line-1" :style="[titleStyle]">{{ title }}</view> <view v-if="showTitle" class="u-model-title u-line-1" :style="[titleStyle]">{{ title }}</view>
<view class="u-model-content"> <view class="u-model-content">
<slot v-if="contentSlot"> <slot v-if="contentSlot">
......
<template> <template>
<view> <view class="flight-guest">
<view class="row items-center"> <view class="row items-center" style="margin-top: 24rpx;">
<u-radio-group v-model="ia"> <view class="num row items-center">
<u-radio shape="circle">月明人倚楼</u-radio> <text style="padding: 6rpx;">剩余</text>
</u-radio-group> <text class="col text-center" style="padding:6rpx;background-color: #B99846;">{{maxNum}}</text>
</view>
<view v-if="(crCount+etCount+babyCount)>0" class="col text-right" style="font-size: 26rpx;color: #1D1D20;">
<text>已选:</text>
<text class="q-ml-sm">{{crCount}}成人</text>
<text class="q-ml-sm">{{etCount}}儿童</text>
<text class="q-ml-sm">{{babyCount}}婴儿</text>
</view>
</view> </view>
<view class="row items-center" v-for="(x,i) in showGuests" style="padding: 30rpx 0;">
<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="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}">
{{x.year>11?'成人':(x.year>2?'儿童':'婴儿')}}
</view>
</view>
<view class="guest-card">
护照号 {{x.Passport}}
<text class="q-ml-sm">{{x.Sex=='M'?'男':'女'}}</text>
</view>
</view>
<view @click="updateGuestHandle(x)" style="width: 50px;height: 50rpx;align-items: flex-end;" class="column justify-center">
<u-icon name="pen_" custom-prefix="tffont" color="#B99846" size="30"></u-icon>
</view>
</view>
<view class="add" @click="listVisible=true">
{{showGuests.length==0?'添加乘机人':'更多乘机人'}}
</view>
<u-popup mode="bottom" border-radius="20" :popup="false" v-model="listVisible" :maskCloseAble="true" length="auto" :safeAreaInsetBottom="true" @close="()=>listVisible=false" :z-index="9999">
<guest-list :list="guests" ref="guestManagerRef" :max-num="maxNum" @selected="selectedHandle" @change="guestChangeHandle"></guest-list>
</u-popup>
</view> </view>
</template> </template>
<script> <script>
import GuestList from './list.vue'
export default{ export default{
data(){ data(){
return { return {
ia:false checked:false,
guestObj:{
Id:'',
Name:'',
SurName:'',
GivenName:'',
Sex:'M',
BrithDay:'',
Country:'',
IdCard:'',
IdCardExpired:'',
Passport:'',
PassportExpired:'',
Mobile:''
},
guests:[],
listVisible:false
}
},
props:{
maxNum:{
type:Number
}
},
components:{GuestList},
computed: {
showGuests() {
this.guests.forEach(x=>{
if(x.Checked) x.Display=true
})
const r = this.guests.filter(x=>x.Display)
return r
},
crCount(){
const r = this.guests.filter(x=>x.year>=12 && x.Checked)
return r.length
},
etCount(){
const r = this.guests.filter(x=>x.year>=2 && x.year<12 && x.Checked)
return r.length
},
babyCount(){
const r = this.guests.filter(x=>x.year<2 && x.Checked)
return r.length
},
canChecked(){
const r = this.guests.filter(x=>x.year>=2 && x.Checked)
return r.length<this.maxNum
}
},
watch: {
guests: {
deep: true,
immediate: true,
handler: function(newVal, oldVal) {
this.checkedChange()
},
},
},
created() {
if(uni.getStorageSync('guest')){
this.guests = uni.getStorageSync('guest').filter(x=>x.Id!='')
this.guests.forEach((x,i)=>{
x.Checked=false
x.Display=i==0
})
this.calcYearHandle()
this.chosenGuest = this.guests.slice(0, 1)
}
},
methods:{
guestChangeHandle(val){
this.guests = val
},
checkedChange(){
const r = this.guests.filter(x=>x.Checked)
this.$emit('selected',r)
},
selectedHandle(val){
this.guests=val
this.listVisible=false
},
calcYearHandle(date){
this.guests.forEach(x=>{
x.year=this.calculateAge(x.BirthDay)
})
},
updateGuestHandle(g){
this.$refs.guestManagerRef.createNewGuest(g)
this.listVisible = true
},
calculateAge(birthDate) {
const birth = new Date(birthDate);
const now = new Date();
let birthYear = birth.getFullYear();
let birthMonth = birth.getMonth();
let birthDay = birth.getDate();
let currentYear = now.getFullYear();
let currentMonth = now.getMonth();
let currentDay = now.getDate();
let age = currentYear - birthYear;
if (currentMonth < birthMonth || (currentMonth === birthMonth && currentDay < birthDay)) {
age--;
}
return age;
} }
} }
} }
</script> </script>
<style> <style>
.flight-guest {
margin: 10px;
}
.flight-guest *{
line-height: 1;
}
.flight-guest .guest-name{
font-weight: bold;
font-size: 30rpx;
color: #1D1D20;
line-height: 1;
}
.flight-guest .guest-card{
font-size: 26rpx;
color: #9999A5;
font-weight: 300;
margin-top: 10rpx;
}
.flight-guest .add{
padding: 22rpx;
background-color: #00000009;
font-size: 26rpx;
font-weight: bold;
text-align: center;
color: #000;
border-radius: 12rpx;
margin-top: 30rpx;
}
.flight-guest .num{
margin-top: 24rpx;
border-radius: 7rpx;
background-color: #080A09;
font-size: 22rpx;
font-weight: 400;
color: #FFF;
overflow: hidden;
padding: 0;
line-height: 1;
}
.flight-guest .num{
border-radius: 7rpx;
background-color: #080A09;
font-size: 22rpx;
font-weight: 400;
color: #FFF;
overflow: hidden;
padding: 0;
line-height: 1;
width: 120rpx;
}
.guest-tag{
font-size: 22rpx;
padding: 6rpx 14rpx;
line-height: 1;
border-radius: 8rpx;
margin-left: 20rpx;
}
.guest-tag.cr{
background-color: #FFFFFF;
color: #2979ff;
border: 1px solid #2979ff;
}
.guest-tag.et{
background-color: #FFFFFF;
color: #f90;
border: 1px solid #f90;
}
.guest-tag.baby{
background-color: #FFFFFF;
color: #fa3534;
border: 1px solid #fa3534;
}
</style> </style>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</view> </view>
<scroll-view scroll-y="true" class="col" style="width: 100%;height: 1px;"> <scroll-view scroll-y="true" class="col" style="width: 100%;height: 1px;">
<view style="padding:30rpx"> <view style="padding:30rpx">
<view class="flight-card" v-for="(x,i) in flights"> <view class="flight-card" @click="nativageToOrderHandle(x.TCID)" v-for="(x,i) in flights">
<view class="q-mt-md row items-start"> <view class="q-mt-md row items-start">
<view class="col"> <view class="col">
...@@ -240,6 +240,11 @@ ...@@ -240,6 +240,11 @@
}); });
}, },
methods: { methods: {
nativageToOrderHandle(id){
uni.navigateTo({
url:'/pages/airTicket/flightDetail?id='+id
})
},
applySorting(flights) { applySorting(flights) {
switch (this.sortBy) { switch (this.sortBy) {
case 0: case 0:
......
...@@ -422,7 +422,7 @@ ...@@ -422,7 +422,7 @@
</view> </view>
</view> </view>
<view class="empty-block"></view> <view class="empty-block"></view>
<coupon v-if="couponList.length > 0 && showCoupon" :list="couponList" :current="useCouponId" @close="closeCouponHandler" :current-price="realCurrentPriceInfo" :order="orderMsg"></coupon> <coupon v-if="couponList.length > 0 && showCoupon" :price="price" :list="couponList" :current="useCouponId" @close="closeCouponHandler" :current-price="realCurrentPriceInfo" :order="orderMsg"></coupon>
<view style="padding: 50rpx 40rpx" v-if="tips != ''"> <view style="padding: 50rpx 40rpx" v-if="tips != ''">
<view class="big-title"> <view class="big-title">
<text>重要提示</text> <text>重要提示</text>
......
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