Commit 6ddbf1c2 authored by youjie's avatar youjie

no message

parent e61b8413
......@@ -7,7 +7,9 @@
border-radius: 8px;}
</style>
<template>
<div>
<div class="card" :id="`baidu-map_${center.Id}`"></div>
</div>
</template>
<script>
export default {
......@@ -17,7 +19,8 @@
center:{
Lng: 116.294625,
Lat: 39.961627
}
},
keywords: ''
}
},
watch: {
......@@ -27,6 +30,11 @@
},
deep:true,
immediate:true
},
keywords:{
handler(newValue,onldValue) {
this.getLocalSearch()
},
}
},
mounted() {
......@@ -74,7 +82,7 @@
offset: new BMapGL.Size(10, -60), // 设置标注的偏移量
});
this.map.addOverlay(label); // 将标注添加到地图中
label.addEventListener("click", function () {
label.addEventListener("click", function (e) {
// alert("您点击了标注");
});
label.setStyle({
......@@ -90,7 +98,12 @@
var mPoint = new BMapGL.Point(this.center.Lng, this.center.Lat);
var circle = new BMapGL.Circle(mPoint,this.center.Range,{fillColor:"blue", strokeWeight: 1 ,fillOpacity: 0.3, strokeOpacity: 0.3});
this.map.addOverlay(circle);
}
},
getLocalSearch(){
var mPoint = new BMapGL.Point(this.center.Lng, this.center.Lat);
var local = new BMapGL.LocalSearch(this.map, {renderOptions: {map: this.map, autoViewport: false}});
local.searchNearby(this.keywords,mPoint,this.center.Range);
},
},
}
</script>
......@@ -43,22 +43,6 @@
<div class="text-subtitle1 text-weight-bolder">訂購人資訊</div>
<q-separator color="grey-2" class="q-my-md" />
<div class="row q-col-gutter-md">
<div :class="filedWidth">
<q-input
standout
v-model="userInfo.lastName"
label="名字"
:rules="[(val) => !!val || '請輸入名字']"
/>
</div>
<div :class="filedWidth">
<q-input
standout
v-model="userInfo.firstName"
label="姓氏"
:rules="[(val) => !!val || '請輸入姓氏']"
/>
</div>
<div :class="filedWidth">
<q-select
v-model="userInfo.country"
......@@ -72,29 +56,15 @@
standout
/>
</div>
<div :class="filedWidth">
<q-input
standout
v-model="userInfo.firstName"
label="電話"
:rules="[(val) => !!val || '請輸入行動電話']"
>
<template v-slot:prepend>
<div class="text-subtitle2">+{{ userInfo.areaCode }}</div>
</template>
</q-input>
</div>
<div :class="filedWidth">
<q-input
standout
v-model="userInfo.mail"
label="郵箱地址"
:rules="[(val) => !!val || '請輸入郵箱地址']"
ref="mail"
/>
</div>
<div :class="filedWidth">
<q-toggle v-model="isUpdateUserInfo" label="同步更新會員資料" />
</div>
</div>
</q-card>
......@@ -265,7 +235,7 @@
<template v-slot:append>
<q-icon name="event" class="cursor-pointer"></q-icon>
</template>
<q-popup-proxy :offset="[0, 0]" ref="qDateProxy7">
<q-popup-proxy :offset="[0, 0]" ref="qDateProxy1">
<div class="row">
<!-- <q-date
mask="YYYY-MM-DD HH:mm"
......@@ -305,7 +275,7 @@
<template v-slot:append>
<q-icon name="event" class="cursor-pointer"></q-icon>
</template>
<q-popup-proxy :offset="[0, 0]" ref="qDateProxy8">
<q-popup-proxy :offset="[0, 0]" ref="qDateProxy2">
<div class="row">
<q-time v-model="getBusTime" mask="HH:mm"
@input="getTime(2)"/>
......@@ -322,7 +292,7 @@
:rules="[(val) => !!val || '請輸上車地點和地址供司機參考']"
ref="GetonAddress">
<template v-slot:append>
<q-icon name="iconfont iconaddress" size="20px" class="q-mr-sm" />
<q-icon name="iconfont iconaddress" size="20px" class="q-mr-sm" @click="getAddress(1)"/>
</template>
</q-input>
</div>
......@@ -335,7 +305,7 @@
:rules="[(val) => !!val || '請輸下車地點和地址供司機參考']"
ref="GetoffAddress">
<template v-slot:append>
<q-icon name="iconfont iconaddress" size="20px" class="q-mr-sm" />
<q-icon name="iconfont iconaddress" size="20px" class="q-mr-sm" @click="getAddress(2)"/>
</template>
</q-input>
</div>
......@@ -463,14 +433,14 @@
<div style="width: 80px">{{details.CarType==1?'接':'送'}}機機場:</div>
<div class="q-ml-md ellipsis-2-lines">{{AirportObj.Name}}</div>
</div>
<div class="row q-pb-xs" v-if="onCarObj">
<!-- <div class="row q-pb-xs" v-if="onCarObj">
<div style="width: 80px">上車範圍:</div>
<div class="q-ml-md ellipsis-2-lines">{{onCarObj.Name}}</div>
</div>
<div class="row q-pb-xs" v-if="unCarObj">
<div style="width: 80px">下車範圍:</div>
<div class="q-ml-md ellipsis-2-lines">{{unCarObj.Name}}</div>
</div>
</div> -->
<div class="row">
<div style="width: 80px">出發日期:</div>
<div class="q-ml-md">{{calculationAmount.startDate}}</div>
......@@ -500,6 +470,18 @@
</div>
</div>
</div>
<q-dialog v-model="isShowDialog">
<q-card class="q-pa-lg" :style="{'width':$q.platform.is.desktop?'100%':'500px'}">
<div class="text-h6Detail">
<span>乘客{{onoffbus==1?'上':'下'}}車範圍</span>
<i class="iconfont iconbaseline-close-px" @click="isShowDialog=false"></i>
</div>
<q-separator />
<div style="max-height: 600px;padding:20px 0" class="scroll">
<componentsMap :AddressObj="onCarObj"/>
</div>
</q-card>
</q-dialog>
</div>
</template>
......@@ -507,12 +489,17 @@
import { date } from 'quasar'
import { json } from "body-parser";
import coupon from '../../components/common/coupon.vue'
import componentsMap from "../../components/car/Map.vue";
export default {
components:{
coupon
coupon,
componentsMap
},
data() {
return {
isRangeClick: true,
isShowDialog: false,
AddressObj: null,
onCarObj: null,//上车范围
unCarObj: null,//下车范围
CarObj: null,//车型
......@@ -542,13 +529,10 @@
areaCode: "",
mail: "",
},
chosenObj: {
},
chosenObj: {},
isUpdateUserInfo: false,
countrys: [],
areaCodes: [],
disableSign:false,
loading: false,
parameters: {
OrderId: 0,
......@@ -577,15 +561,13 @@
Mobile:'',//电话
ProductId: '',
CarId: '',//产品类型ID
// PassFirstName: '',//英文姓
// PassLastName: '',//英文名
// Passport: '',//护照
// PassValidate: '',
pType: 1,//类型 1来源B2B
pType: 1,//类型 1来源B2C
},
flightTime: null,//航班起飞抵达时间
getBusTime: null,//预约车时间
TotalPeople: 0,//总人数
onoffbus: 1,//1 上车 2下车
ErpOrderId: 0,//erp订单Id
};
},
computed: {
......@@ -615,21 +597,28 @@
this.onCarObj = OrderDate.onCarObj//上车范围
this.unCarObj = OrderDate.unCarObj//下车范围
}
this.parameters.ProductId = this.details.Id
this.parameters.OrderDate = this.calculationAmount.startDate
if(this.details.CarType!=3){
this.parameters.AirportId = this.AirportObj.Id
this.parameters.FlightTime = this.calculationAmount.startDate
}
this.parameters.CarId = this.CarObj.Id
this.parameters.OrderType = this.details.CarType
this.parameters.Unit_Price = this.calculationAmount.originalB2CPrice
this.parameters.Num = this.chosenObj.Count
this.parameters.Money = this.sumPrice
console.log(this.calculationAmount,'----')
this.initCountry();
this.initGuestHandler();
},
methods: {
submit(){
console.log(this.parameters,'======')
let flag = false
this.$refs.mail.validate()
this.$refs.SurName.validate()
this.$refs.Name.validate()
this.$refs.ContactWay.validate()
......@@ -643,49 +632,95 @@
this.$refs.FlightTime.validate()
if(this.details.CarType!=1){
this.$refs.GetonAddress.validate()
flag = !this.$refs.SurName.hasError && !this.$refs.Name.hasError&& !this.$refs.ContactWay.hasError
flag = !this.$refs.SurName.hasError&& !this.$refs.Name.hasError&& !this.$refs.ContactWay.hasError
&& !this.$refs.Mobile.hasError&& !this.$refs.OrderDate.hasError&& !this.$refs.ManNum.hasError
&& !this.$refs.AirportTerminal.hasError&& !this.$refs.AirLine.hasError&& !this.$refs.FlightNumber.hasError
&& !this.$refs.FlightTime.hasError&& !this.$refs.GetonAddress.hasError
&& !this.$refs.FlightTime.hasError&& !this.$refs.GetonAddress.hasError&& !this.$refs.mail.hasError
}else{
this.$refs.GetoffAddress.validate()
flag = !this.$refs.SurName.hasError && !this.$refs.Name.hasError&& !this.$refs.ContactWay.hasError
flag = !this.$refs.SurName.hasError&& !this.$refs.Name.hasError&& !this.$refs.ContactWay.hasError
&& !this.$refs.Mobile.hasError&& !this.$refs.OrderDate.hasError&& !this.$refs.ManNum.hasError
&& !this.$refs.AirportTerminal.hasError&& !this.$refs.AirLine.hasError&& !this.$refs.FlightNumber.hasError
&& !this.$refs.FlightTime.hasError&& !this.$refs.GetoffAddress.hasError
&& !this.$refs.FlightTime.hasError&& !this.$refs.GetoffAddress.hasError&& !this.$refs.mail.hasError
}
}else{
this.$refs.GetonAddress.validate()
this.$refs.GetoffAddress.validate()
flag = !this.$refs.SurName.hasError && !this.$refs.Name.hasError&& !this.$refs.ContactWay.hasError
flag = !this.$refs.SurName.hasError&& !this.$refs.Name.hasError&& !this.$refs.ContactWay.hasError
&& !this.$refs.Mobile.hasError&& !this.$refs.OrderDate.hasError&& !this.$refs.ManNum.hasError
&&!this.$refs.GetonAddress.hasError&& !this.$refs.GetoffAddress.hasError
&& !this.$refs.GetonAddress.hasError&& !this.$refs.GetoffAddress.hasError&& !this.$refs.mail.hasError
}
if(!flag) return
setOrder()
this.SetCarOrder()
},
setOrder(){
SetCarOrder(){
this.loading = true
this.apipost(
"CarSingle_post_SetTYCarOrder",
this.parameters,
(r) => {
// this.$refs.myform.resetValidation()
if (r.data.resultCode == 1) {
this.step = 2
let ErpOrderId = r.data.data.OrderId
this.AddOrderInfo(ErpOrderId)
}else{
this.$q.notify({
type: "negative",
message: r.data.message,
position: "top",
timeout: 2000,
});
this.loading = false
this.$refs.myform.resetValidation()
}
})
},
AddOrderInfo(ErpOrderId){
this.apipost(
"AddOrderInfo_post",
{
SurName: this.parameters.SurName,
Name: this.parameters.Name,
ContactNumber: this.parameters.Mobile,// 联系电话
Mailbox: this.userInfo.mail,//邮箱
GoodsId: this.parameters.ProductId,//商品id
GoodsName: this.details.Name,//商品名称
GoodsPic: this.details.imgCover[0],//商品图片
GoodsType: this.parameters.OrderType,//商品类型(见枚举)
OrderMake: this.parameters.OrderDate,//订单摘要(例如出行时间)
TotalPrice: this.parameters.Money,//总价格
PreferentialPrice: 0,// 优惠总金额
ErpOrderId: ErpOrderId,//erp订单id
Country: this.userInfo.country,//国家id
PlatformTax: 0,//平台税金默认0
Income: 0,//已收默认0
Refund: 0,//退款金额默认0
OrderSource: this.parameters.pType
},
(r) => {
if (r.data.resultCode == 1) {
this.step = 3
}else{
this.$q.notify({
type: "negative",
message: r.data.message,
position: "top",
timeout: 2000,
});
}
this.loading = false
})
},
// 航班起飞抵达时间
getTime(type){
// 1航班时间 2预约时间
this.onoffbus = type
if(type==1){
this.parameters.FlightTime = this.calculationAmount.startDate+' '+this.flightTime
this.$refs.qDateProxy7.hide()
this.$refs.qDateProxy1.hide()
}else if(type==2){
this.parameters.OrderDate = this.calculationAmount.startDate+' '+this.getBusTime
this.$refs.qDateProxy8.hide()
this.$refs.qDateProxy2.hide()
}
},
......@@ -695,6 +730,15 @@
date.formatDate(date.addToDate(new Date(), { days: 0 }), "YYYY/MM/DD")
);
},
// 地图上选址
getAddress(type){
if(type==1){
this.AddressObj = this.onCarObj
}else{
this.AddressObj = this.unCarObj
}
this.isShowDialog = true
},
// 计算人数
getNum(){
this.TotalPeople = this.parameters.ManNum+this.parameters.ChildNum+this.parameters.BabyNum
......@@ -722,6 +766,7 @@
initGuestHandler() {
},
// 初始化国家
initCountry() {
this.apipost("GetCountryInfo_post", {}, (r) => {
this.countrys = r.data.data.countList;
......@@ -773,5 +818,21 @@
.guest-item:hover{
background: rgba(241,65,108,.04) !important;
}
.text-h6Detail {
text-align: center;
font-size: 18px;
color: #333;
font-weight: 700;
position: relative;
width:100%;
height:50px;
}
.text-h6Detail i {
position: absolute;
right:20px;
top:10px;
cursor: pointer;
font-size:23px;
}
</style>
\ No newline at end of file
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