Commit b6070a93 authored by 18224442217's avatar 18224442217

no message

parent 8d556f98
......@@ -131,7 +131,6 @@
<script>
import AirTicketHeader from "./components/airTicketHeader.vue";
import canlendar from "./components/sign/index.vue";
import Address from "./components/address/index.vue";
import AddressGroup from "./components/address/indexGroup.vue";
import AirTicketList from "./components/airTicketList.vue";
import { gegerateDates,getBeforeDate,getDateWeek } from "./dates.js";
......@@ -139,7 +138,6 @@
components: {
AirTicketHeader,
canlendar,
Address,
AddressGroup,
AirTicketList
},
......
<template>
<view class="addressIndex-box">
<view class="fz30 fontBold textCenter MB30 PX53 relative">选择{{AddressType==1?'出发地':'目的地'}}
<text v-if="SelectObj.ID" class="fz24 color9999A5 absolute PX10" style="right: 53rpx;top: 0;bottom: 0;" @click="Clear">清空</text>
</view>
<view class="fz30 fontBold MB30 PX53">当前{{AddressType==1?'出发地':'目的地'}}</view>
<view class="MT30 PX53">
<view class="addressIndex-Orientation inlineblock bgF5 row-ajc-n textCenter">
<img class="inlineblock MR10" mode="widthFix" style="width: 18rpx;height: 22rpx"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1696743247000_254.png"/>
<text class="fz30">{{SelectObj.Name?SelectObj.Name:'--'}}</text>
</view>
</view>
<view class="fz30 fontBold MT45 PX53">地址</view>
<view class="hidden" style="height: calc(100vh - 60vh);">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" :style="{ height: '100%' }">
<view class="addressIndex-toponym row-aic-w">
<view class="addressIndex-toponym-box row-ajc-n" v-for="(item,index) in dataList">
<view class="addressIndex-Orientation inlineblock textCenter MT30 fz30"
:class="[SelectObj.ID==item.ID?'bgDEBF7B':'bgF5']"
@click="getAddress(item)">{{item.Name}}</view>
</view>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
export default {
props:['AddressType','OriginAddressObj','dataList'],
data() {
return {
SelectObj: {
Name: '',
ID: 0
},
}
},
onLoad(options){
},
watch: {
AddressType: {
handler(newVal, oldval) {
if(newVal==1){
this.SelectObj.Name = this.OriginAddressObj.DepartCityName
this.SelectObj.ID = this.OriginAddressObj.DepartCityId
}else{
this.SelectObj.Name = this.OriginAddressObj.ArriveCityName
this.SelectObj.ID = this.OriginAddressObj.ArriveCityId
}
},
deep: false
},
OriginAddressObj: {
handler(newVal, oldval) {
if(this.AddressType==1){
this.SelectObj.Name = newVal.DepartCityName
this.SelectObj.ID = newVal.DepartCityId
}else{
this.SelectObj.Name = newVal.ArriveCityName
this.SelectObj.ID = newVal.ArriveCityId
}
},
deep: true
},
},
created() {},
mounted() {
},
methods: {
Clear(){
this.SelectObj = {
Name: '',
ID: 0,
}
this.$emit('RenewalAddres',this.SelectObj ,this.AddressType)
},
getAddress(item){
if(item.ID==this.SelectObj.ID){
this.SelectObj = {
Name: '',
ID: 0,
}
}else{
this.SelectObj = {
Name: item.Name,
ID: item.ID,
}
}
this.$emit('RenewalAddres',this.SelectObj ,this.AddressType)
// this.$forceUpdate()
},
}
}
</script>
<style scoped>
@import url("@/asset/css/flex.css");
@import url("../../style.css");
.addressIndex-box{
padding: 46rpx 0 139rpx 0;
}
.addressIndex-Orientation{
width: 190rpx;
padding: 15rpx 0;
border-radius: 30rpx;
}
.addressIndex-toponym{
padding: 0 22rpx;
}
.addressIndex-toponym-box{
flex: 0 0 33.33%;
}
</style>
\ No newline at end of file
......@@ -53,7 +53,9 @@
</view>
</view>
<view class="air-arrcity-box">
<div class="air-arrcity-item" @click="getAddress(i)" :class="{'currentCity':SelectObj.ArriveCityId==x.ID && SelectObj.DepartCityId==dataList[active].ID}" v-for="(x,i) in dataList[active].CityList">{{x.Name}}</div>
<div class="air-arrcity-item" @click="getAddress(i)"
:class="{'currentCity':SelectObj.ArriveCityId==x.ID && SelectObj.DepartCityId==dataList[active].ID}"
v-for="(x,i) in dataList[active].CityList">{{x.Name}}</div>
</view>
<!-- <template v-for="(item,index) in dataList">
<view class="addressIndex-toponym row-aic-n" :key="item.ID">
......@@ -117,35 +119,22 @@
this.$emit('RenewalAddres',this.SelectObj)
},
Clear(){
this.ClearData(null,null,1)
this.ClearData()
},
ClearData(item,items,type){
if(item||type){
this.SelectObj.DepartCityName = ''
this.SelectObj.DepartCityId = 0
}
if(items||type){
this.SelectObj.ArriveCityName = ''
this.SelectObj.ArriveCityId = 0
}
ClearData(){
this.SelectObj.DepartCityName = ''
this.SelectObj.DepartCityId = 0
this.SelectObj.ArriveCityName = ''
this.SelectObj.ArriveCityId = 0
},
getAddress(i){
let item = this.dataList[this.active]
let items = this.dataList[this.active].CityList[i]
if(item&&items){
this.ClearData(item,items)
}
if(!items){
this.ClearData(item,items,1)
}
this.ClearData(item,items)
this.SelectObj.DepartCityName = item.Name
this.SelectObj.DepartCityId = item.ID
if(items){
this.SelectObj.ArriveCityName = items.Name
this.SelectObj.ArriveCityId = items.ID
}
// this.$forceUpdate()
this.SelectObj.ArriveCityName = items.Name
this.SelectObj.ArriveCityId = items.ID
this.$forceUpdate()
},
}
......
......@@ -5,34 +5,6 @@
style="height: 100%; flex: 1; box-sizing: border-box"
>
<view class="header">
<!-- <view class="bar"></view>
<view class="set text-gray">
<text @click="close" style="font-size:40upx;">返回</text>
<text @click="reset" style="font-size:35upx;color:#DDDDDD">清空</text>
</view> -->
<!-- <view class="in-and-out">
<view class="item" v-if="start.length > 0">
<view style="font-size:30upx;color:#C0C0C0">入住日期</view>
<view style="font-weight: bold;margin-top:10upx;font-size:36upx">{{ startDay }}</view>
<view style="font-size:24upx;margin-top:10upx">{{ startWeek }}</view>
</view>
<view class="item text" v-if="start.length == 0">
<view>入住日期</view>
</view>
<view class="item">
<view class="count-border" :class="day == 0 ? 'gray' : 'orange'">
<view class="count" style="font-size:26upx;line-height:26upx;">{{ day }}</view>
</view>
</view>
<view class="item text" v-if="end.length == 0">
<view>离店日期</view>
</view>
<view class="item" v-if="end.length > 0">
<view style="font-size:30upx;color:#C0C0C0">离店日期</view>
<view style="font-weight: bold;margin-top:10upx;font-size:36upx">{{ endDay }}</view>
<view style="font-size:24upx;margin-top:10upx">{{ endWeek }}</view>
</view>
</view> -->
<view
style="
font-size: 32rpx;
......@@ -116,10 +88,6 @@
<view style="padding-top: 2px; padding-bottom: 2px">{{
item
}}</view>
<!-- <view class="select-style" v-if="line == start[0] && index == start[1]">最早</view>
<view class="select-style" v-if="line == end[0] && index == end[1]">最晚</view> -->
<!-- userDefaultDate -->
<!-- item.start==start -->
<view
style="font-size: 12px; padding-bottom: 3px"
:style="{'color':line == start[0] && index == start[1]?'':'#DEBF7B'}"
......@@ -280,7 +248,6 @@ export default {
this.isFestival(newVal[0], newVal[1])
);
}
if (this.priceStauts.length > 0) {
console.log(this.lastNot);
for (var i = newVal[0]; i < this.priceStauts.length; i++) {
......@@ -467,125 +434,9 @@ export default {
} else {
this.start = [line, index];
}
if (this.immediately) {
this.submit();
}
return;
if (line == 0 && index + 1 < this.nowDay) return;
//如果有入住情况和价格则需要进行一些列的判断
if (this.priceStauts.length > 0) {
if (
(this.start.length == 0 && this.priceStauts[line][index] < 0) ||
(this.end.length > 0 && this.priceStauts[line][index] < 0)
) {
return uni.showToast({
title: "该日期已被预订",
icon: "none",
});
}
if (
(this.start.length > 0 && line < this.start[0]) ||
(line == this.start[0] && this.start[1] > index)
) {
if (this.priceStauts[line][index] < 0)
return uni.showToast({
title: "该日期已被预订",
icon: "none",
});
this.start = [line, index];
this.end = [];
return;
}
if (this.start.length > 0 && this.end.length == 0) {
if (this.start[0] - line == 0) {
for (var j = this.start[1]; j < index; j++) {
if (this.priceStauts[line][j] < 0)
return uni.showToast({
title: "很抱歉,所选入离店时间包含无房日期",
icon: "none",
mask: true,
});
}
} else {
//如果不在同一个月份有三种情况需要处理
for (var i = this.start[0]; i <= line; i++) {
//开始日期到开始日期当月的最大日期是否包含无房情况
if (i == this.start[0]) {
for (
var j = this.start[1];
j < this.priceStauts[i].length;
j++
) {
if (this.priceStauts[i][j] < 0)
return uni.showToast({
title: "很抱歉,所选入离店时间包含无房日期",
icon: "none",
mask: true,
});
}
} else if (i == line) {
//结束日期到当月结束日期之前是否包含无房情况
for (var j = 0; j < index; j++) {
if (this.priceStauts[i][j] < 0)
return uni.showToast({
title: "很抱歉,所选入离店时间包含无房日期",
icon: "none",
mask: true,
});
}
} else {
//中间间隔的月份需要检查每一天是否包含无房情况
for (var j = 0; j < this.priceStauts[i].length; j++) {
if (this.priceStauts[i][j] < 0)
return uni.showToast({
title: "很抱歉,所选入离店时间包含无房日期",
icon: "none",
mask: true,
});
}
}
}
}
}
}
//如果没有入住时间
if (this.start.length == 0) {
//填充入住时间
this.start = [line, index];
} else if (
this.start.length > 0 &&
this.start[0] == line &&
this.start[1] == index &&
this.end.length == 0
) {
return;
} else {
//如果没有离开时间
if (this.end.length == 0) {
//如果有价格和入住离开情况则需要进行判断所选的离店时间时候包含无房日期
if (
line < this.start[0] ||
(line == this.start[0] && index < this.start[1])
) {
this.end = this.start;
this.start = [line, index];
} else {
//如果离开时间比入住时间晚则填充
this.end = [line, index];
}
} else {
//如果有离开时间则清空离开时间重新填充入住时间
this.start = [line, index];
this.end = [];
}
}
},
//设置日历
setDate() {
......@@ -628,23 +479,12 @@ export default {
},
//确定入住离店事件提交
submit() {
if(!this.start[0]) return
if(this.start.length==0) return
let m = this.date[this.start[0]].month;
m = m > 9 ? m : "0" + m;
let d = this.isFestival(this.start[0], this.start[1], true);
d = d > 9 ? d : "0" + d;
var obj = {
/* startYMD: this.date[this.start[0]].year + this.type + this.date[this.start[0]].month + this.type + this.isFestival(
this.start[0], this.start[1]),
startMD: this.date[this.start[0]].month + this.type + this.isFestival(this.start[0], this.start[1]),
startDay: this.startDay,
startWeek: this.startWeek,
endYMD: this.date[this.end[0]].year + this.type + this.date[this.end[0]].month + this.type + this.isFestival(this
.end[0], this.end[1]),
emdMD: this.date[this.end[0]].month + this.type + this.type + this.isFestival(this.end[0], this.end[1]),
endDay: this.endDay,
endWeek: this.endWeek,
day: this.day */
startWeek: this.startWeek,
start: this.date[this.start[0]].year + this.type + m + this.type + d,
startDay: m + "-" + d,
......
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