Commit e7160b92 authored by youjie's avatar youjie

包机选址

parent 91062cbb
......@@ -102,11 +102,19 @@
},
methods: {
getAirportList(){
this.apipost('CarSingle_post_GetCarSingleAllAirportList',{
Type: this.busInfor.CarType,
CountryId: this.busInfor.CountryId?this.busInfor.CountryId:this.busInfor.desCountryId,
CityId: this.busInfor.CityId?this.busInfor.CityId:this.busInfor.desCityId,
},res=>{
let query = {
Type: this.busInfor.CarType,
CountryId: '',
CityId: '',
}
if(this.busInfor.CarType==1){
query.CountryId = ''
query.CityId = ''
} else {
query.CountryId = this.busInfor.CountryId?this.busInfor.CountryId:this.busInfor.desCountryId,
query.CityId = this.busInfor.CityId?this.busInfor.CityId:this.busInfor.desCityId
}
this.apipost('CarSingle_post_GetCarSingleAllAirportList',query,res=>{
if(res.resultCode==1){
this.airportListAll = res.data
this.airportList = res.data
......
......@@ -10,7 +10,7 @@
<view class="row items-center">
<view class="internationalSearch row" @click="isShow=false">
<view class="row items-center" @click.stop="isShow=!isShow">
<text>{{ busInfor.desCityName }}</text>
<text>{{ type<3?busInfor.desCityName:busInfor.CityName }}</text>
<u-icon name="arrow" :size="32" color="#000" style="position: relative;top: 2rpx;margin-left: 10repx;"></u-icon>
</view>
<u-search class="col" :placeholder="`请输入${type<3?'下车':'上车'}地址`"
......@@ -106,6 +106,13 @@
deep: true,
immediate: true
},
type: {
handler(val, oldval) {
this.getPlaceList()
},
deep: false,
immediate: true
}
},
created() {
const that = this
......@@ -130,13 +137,19 @@
if(res.resultCode==1){
if(res.data.length>0){
this.PlaceList = res.data
if(!this.busInfor.desCountryId){
if(this.type<3&&(!this.busInfor.desCountryId||this.busInfor.desCountryId=='')){
this.busInfor.desCountryId = res.data[0].Country
this.busInfor.desCountryName = res.data[0].CountryName
this.busInfor.ThreeCode = res.data[0].ThreeCode
this.busInfor.desCityId = res.data[0].CityList[0].City
this.busInfor.desCityName = res.data[0].CityList[0].CityName
}
if(this.type==3&&(!this.busInfor.CountryId||this.busInfor.CountryId=='')){
this.busInfor.CountryId = res.data[0].Country
this.busInfor.CountryName = res.data[0].CountryName
this.busInfor.ThreeCode = res.data[0].ThreeCode
this.busInfor.CityId = res.data[0].CityList[0].City
this.busInfor.CityName = res.data[0].CityList[0].CityName
}
}
}
......@@ -164,6 +177,7 @@
})
},
searchClose() {
this.isShow = false
this.$emit('close')
},
currentData(item,items,type) {
......@@ -210,9 +224,9 @@
this.busInfor.oriLongitude = item.longitude
this.$emit('change',this.busInfor)
}
this.parameters.KeyWords = ''
this.addressList = []
}
this.parameters.KeyWords = ''
this.addressList = []
this.isShow = false
},
}
......
......@@ -190,7 +190,7 @@
@change="getAirport"
@close="popupClose"></airport>
</u-popup>
<!--下车点-->
<!--下车点-->
<u-popup mode="bottom" border-radius="20"
:popup="false"
v-model="citiesVisible" :maskCloseAble="true"
......@@ -358,15 +358,29 @@
setType(type){
if(type) {
if(this.busInfor.CarType!=type){
this.busInfor.CountryId = ''
this.busInfor.CityId = ''
this.busInfor.CityName = ''
this.busInfor.desCountryId = ''
this.busInfor.desCityId = ''
this.busInfor.desCityName = ''
this.busInfor.CarType = type
this.busInfor.startaddress = ''
this.busInfor.destination = ''
this.busInfor.AirportId = null
this.busInfor.AirportName = ''
}
this.getPlaceList()
// this.getPlaceList()
}else {
if(this.busInfor.CarType!=this.current ){
this.busInfor.CountryId = ''
this.busInfor.CityId = ''
this.busInfor.CityName = ''
this.busInfor.desCountryId = ''
this.busInfor.desCityId = ''
this.busInfor.desCityName = ''
this.busInfor.CarType = this.current
this.busInfor.startaddress = ''
this.busInfor.destination = ''
......@@ -424,6 +438,14 @@
if(this.current!=e){
this.busInfor.CarType = e
this.current = e
this.busInfor.CountryId = ''
this.busInfor.CityId = ''
this.busInfor.CityName = ''
this.busInfor.desCountryId = ''
this.busInfor.desCityId = ''
this.busInfor.desCityName = ''
this.busInfor.startaddress = ''
this.busInfor.destination = ''
this.busInfor.AirportId = null
......@@ -485,7 +507,7 @@
setCityHandler(val){
this.busInfor = val
this.citiesVisible = false
this.getAirportList()
// this.getAirportList()
},
setDateHandler(val){
this.busInfor.time = `${val.year}-${val.month}-${val.day} ${val.hour}:${val.minute}`
......
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