Commit 92629165 authored by 吴春's avatar 吴春

解决冲突

parents 8c59bc51 0574c6fd
......@@ -22,12 +22,14 @@
"qrcode.vue": "^1.7.0",
"qrcodejs2": "^0.0.2",
"quasar": "^1.22.5",
"swiper": "3.0.4",
"v-viewer": "^1.6.4",
"vue-awesome-swiper": "^3.0.4",
"vue-concise-slider": "^4.2.5",
"vue-core-video-player": "^0.2.0",
"vue-core-video-players": "0.0.5",
"vue-i18n": "^8.0.0"
"vue-i18n": "^8.0.0",
"vuelidate": "^0.7.7"
},
"devDependencies": {
"@quasar/app": "^1.0.0"
......
import { Notify, QSpinnerIos } from 'quasar'
const message = {
warn: (msg) => {
Notify.create({
message: msg,
color: 'warning',
textColor: 'dark',
position: 'top',
icon: 'announcement'
})
},
error: (msg) => {
Notify.create({
message: msg,
type: 'negative',
position: 'top'
})
},
success: (msg) => {
Notify.create({
message: msg,
color: 'positive',
position: 'top',
textColor: 'white',
icon: 'check'
})
}
}
export default message
\ No newline at end of file
......@@ -18,7 +18,7 @@ const user = {
if (u) {
localStorage.setItem('b2bUser', JSON.stringify(u))
} else {
localStorage.setItem('b2bUser', JSON.stringify(u))
//localStorage.removeItem('b2bUser')
}
},
loginOut() {
......
......@@ -2,17 +2,17 @@ import Vue from 'vue'
import axios from 'axios'
import md5 from 'js-md5'
// import {eventBus} from './eventBus'
// import VueCoreVideoPlayer from 'vue-core-video-players'
import VueCoreVideoPlayer from 'vue-core-video-players'
import 'viewerjs/dist/viewer.css'
import Vuelidate from 'vuelidate'
import user from './user'
import message from './message'
import VueViewer from 'v-viewer'
// import VueCoreVideoPlayer from 'vue-core-video-player'
Vue.prototype.$EventBus = new Vue()
// Vue.use(VueCoreVideoPlayer)
Vue.use(VueCoreVideoPlayer)
Vue.use(VueViewer)
Vue.prototype.$md5 = md5;
Vue.use(Vuelidate)
Vue.prototype.$message = message
//域名管理对象
Vue.prototype.domainManager = function() {
let domainUrl = '';
......
......@@ -13,44 +13,32 @@
<template v-if="dataList.CarType!=3">
<div class="text-grey-6 f12 q-my-md">選擇機場</div>
<div class="row wrap">
<q-btn @click="handleSelect(item,1)"
:color="selectedAirportObj&&item.Id === selectedAirportObj.Id?'primary':'grey-5'"
unelevated
class="car-tag mr"
v-for="item in AirportList"
:key="item.Id"
>
{{ item.AirportName }}
</q-btn>
<div v-for="(x,i) in AirportList" :key="i">
<q-chip size="14px" clickable @click="handleSelect(x,1)"
:text-color="selectedAirportObj&&selectedAirportObj.Id==x.Id?'white':'dark'"
:color="selectedAirportObj&&selectedAirportObj.Id==x.Id?'primary':'grey-3'" square>{{ x.AirportName }}</q-chip>
</div>
</div>
</template>
<div class="row">
<div v-if="dataList.CarType!=1">
<div class="row no-wrap">
<div v-if="dataList.CarType!=1" :class="{'col':PlaceList.length>2}">
<div class="text-grey-6 f12 q-my-md">選擇上車範圍</div>
<div class="row wrap">
<q-btn @click="handleSelect(item,3)"
:color="onCarObj&&item.Id === onCarObj.Id?'primary':'grey-5'"
unelevated
class="car-tag mr"
v-for="item in PlaceList"
:key="item.Id"
>
{{ item.Name }}({{ item.Range }}m)
</q-btn>
<div v-for="(x,i) in PlaceList" :key="i">
<q-chip size="14px" clickable @click="handleSelect(x,3)"
:text-color="onCarObj&&onCarObj.Id==x.Id?'white':'dark'"
:color="onCarObj&&onCarObj.Id==x.Id?'primary':'grey-3'" square>{{ x.Name }}({{ x.Range }}m)</q-chip>
</div>
</div>
</div>
<div v-if="dataList.CarType!=2">
<div v-if="dataList.CarType!=2" class="q-ml-md" :class="{'col':PlaceList.length>2}">
<div class="text-grey-6 f12 q-my-md">選擇下車範圍</div>
<div class="row wrap">
<q-btn @click="handleSelect(item,4)"
:color="unCarObj&&item.Id === unCarObj.Id?'primary':'grey-5'"
unelevated
class="car-tag mr"
v-for="item in PlaceList"
:key="item.Id"
>
{{ item.Name }}({{ item.Range }}m)
</q-btn>
<div v-for="(x,i) in PlaceList" :key="i">
<q-chip size="14px" clickable @click="handleSelect(x,4)"
:text-color="unCarObj&&unCarObj.Id==x.Id?'white':'dark'"
:color="unCarObj&&unCarObj.Id==x.Id?'primary':'grey-3'" square>{{ x.Name }}({{ x.Range }}m)</q-chip>
</div>
</div>
</div>
</div>
......@@ -58,15 +46,11 @@
<div class="text-grey-6 f12 q-my-md">選擇車類型</div>
<div class="row wrap">
<q-btn @click="handleSelect(item,2)"
:color="selectedCarObj&&item.Id === selectedCarObj.Id?'primary':'grey-5'"
unelevated
class="car-tag mr"
v-for="item in CarTypeList"
:key="item.Id"
>
{{ item.CarName }}({{ item.PeopleNum }}人)
</q-btn>
<div v-for="(x,i) in CarTypeList" :key="i">
<q-chip size="14px" clickable @click="handleSelect(x,2)"
:text-color="selectedCarObj&&selectedCarObj.Id==x.Id?'white':'dark'"
:color="selectedCarObj&&selectedCarObj.Id==x.Id?'primary':'grey-3'" square>{{ x.CarName }}({{ x.PeopleNum }}人)</q-chip>
</div>
</div>
<div class="text-grey-6 f12 q-my-md">選擇數量</div>
<div class="row items-end">
......@@ -201,44 +185,24 @@ export default {
methods: {
goOrderHandler(){
let order = {
key: null,
CarObj: this.selectedCarObj,
AirportObj: {
Address: this.selectedAirportObj?this.selectedAirportObj.Address:'',
AirportId: this.selectedAirportObj?this.selectedAirportObj.AirportId:'',
AirportName: this.selectedAirportObj?this.selectedAirportObj.AirportName:'',
Id: this.selectedAirportObj?this.selectedAirportObj.Id:'',
Name: this.selectedAirportObj?this.selectedAirportObj.Name:''
},
calculationAmount: this.p,
calculationNum: this.chosenObj,
CarId: this.selectedCarObj.Id,
AirportId: this.selectedAirportObj?this.selectedAirportObj.Id:'',
startDate: this.p.startDate,
originalB2CPrice: this.p.originalB2CPrice,
orderInfo: this.chosenObj,
sumPrice: this.sumPrice,
details: {
Name: this.dataList.Name,
Description: this.dataList.Description,
videoStr: this.dataList.videoStr,
imgCover: this.dataList.imgCover,
CarType: this.dataList.CarType,
Id: this.dataList.Id,
},
onCarObj: {
Address: this.onCarObj?this.onCarObj.Address:'',
Name: this.onCarObj?this.onCarObj.Name:'',
Lat: this.onCarObj?this.onCarObj.Lat:'',
Lng: this.onCarObj?this.onCarObj.Lng:'',
Range: this.onCarObj?this.onCarObj.Range:'',
},
unCarObj: {
Address: this.unCarObj?this.unCarObj.Address:'',
Name: this.unCarObj?this.unCarObj.Name:'',
Lat: this.unCarObj?this.unCarObj.Lat:'',
Lng: this.unCarObj?this.unCarObj.Lng:'',
Range: this.unCarObj?this.unCarObj.Range:''
},
onCarId: this.onCarObj?this.onCarObj.Id:'',
unCarId: this.unCarObj?this.unCarObj.Id:'',
}
let key = this.$md5(JSON.stringify(order))
order.key = key
localStorage.setItem("pickuporderCars",JSON.stringify(order))
let pickuporderCars = localStorage.getItem('pickuporderCars')
pickuporderCars = pickuporderCars?JSON.parse(pickuporderCars):[]
pickuporderCars.push({
key,
order
})
localStorage.setItem("pickuporderCars",JSON.stringify(pickuporderCars))
this.CommonJump('/PickuporderForm/'+key, {});
},
// 获取车的详情
......
......@@ -248,7 +248,7 @@
</p>
</div>
</div>
<div style="display: flex; justify-content: center">
<div class="row justify-end">
<q-pagination
v-if="PageCount > 1"
v-model="msg.pageIndex"
......@@ -644,7 +644,7 @@ export default {
var companyId = -1;
if (localStorage.groupinfo) {
var groupinfo = JSON.parse(localStorage.groupinfo);
companyId = groupinfo.siteList[0].companyId;
companyId = groupinfo.siteList[0]&&groupinfo.siteList[0].companyId?groupinfo.siteList[0].companyId:-1;
}
if (localStorage.b2bUser) {
var b2bUser = JSON.parse(window.localStorage.getItem("b2bUser"));
......@@ -661,7 +661,7 @@ export default {
this.$q.loading.hide();
if (res.data.resultCode == 1) {
this.PageCount = res.data.data.pageData.pageCount;
this.PageCount = res.data.data.pageCount;
this.TotalCount = res.data.data.pageData.count;
var tempArray = res.data.data.pageData.list;
console.log('getSearch data', tempArray)
......
......@@ -12,7 +12,8 @@
<p class="day"><span v-if='item.dayNum<10'>0</span>{{item.dayNum}}</p>
<!-- <p>{{item.dateTime}}</p> -->
</div>
<div class="desc" v-html="item.title"></div>
<div class="desc" v-html="item.title!='null'?item.title:''"></div>
</div>
<oneday v-if="item.details && item.details.length==1" :day='item' :isDirect="isDirect"></oneday>
<twoday v-if="item.details && item.details.length==2" :day='item' :isDirect="isDirect"></twoday>
......
......@@ -53,9 +53,8 @@
></q-img>
</template>
</div>
<div class="row items-end" style="border: 1px solid #ccc; left: 0">
<div class="q-pb-lg">
<div class="down q-pa-lg" :class="{ col: index == 0 }">
<div class="row items-end col" style="border: 1px solid #ccc; left: 0">
<div class="down q-pa-lg q-mb-lg" :class="{ col: index == 0 }">
<div
v-if="item.title != ''"
class="text-h6 text-bold q-pb-sm"
......@@ -92,7 +91,6 @@
</div>
</div>
</div>
</div>
</template>
<template v-for="(item, index) in day.details">
<div
......
......@@ -381,7 +381,7 @@ export default {
if (this.p.startDate) {
this.chosenObj.startDate = this.p.startDate;
this.calcMoney();
if(this.p.unionCityList && this.p.unionCityList.length>0){
if(this.p.unionCityList && this.p.unionCityList.length>0 && this.p.originalB2CPrice==this.p.RealPrice){
this.currentUnionCity = this.p.unionCityList[0]
}
}
......
......@@ -39,13 +39,14 @@
}"
>
<div class="col">
<q-form ref="baseUserInfo">
<q-card flat class="q-pa-md">
<div class="text-subtitle1 text-weight-bolder" ref="baseUserInfoTitle">訂購人資訊</div>
<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-select
v-model="userInfo.country"
v-model="userInfo.Country"
@input="changeCountry"
:options="countrys"
emit-value
......@@ -59,7 +60,7 @@
<div :class="filedWidth">
<q-input
standout
v-model="userInfo.mail"
v-model="userInfo.Mailbox"
label="郵箱地址"
:rules="[(val) => /^[a-zA-Z0-9]+([-_.][A-Za-zd]+)*@([a-zA-Z0-9]+[-.])+[A-Za-zd]{2,5}$/.test(val) || '請輸入正確的郵箱地址']"
ref="mail"
......@@ -69,8 +70,7 @@
</q-card>
<q-card flat class="q-pa-md q-mt-lg" v-if="details">
<div class="text-subtitle1 text-weight-bolder q-mb-md" ref="passengerInformation">旅客資料</div>
<div class="text-subtitle1 text-weight-bolder q-mb-md">旅客資料</div>
<div class="row">
<vue-core-video-players
v-if="details.videoStr"
......@@ -91,7 +91,7 @@
/>
<q-img
v-else
:src="details?details.imgCover[0]:'https://image.kkday.com/v2/image/get/s1.kkday.com/product_138437/20230217083232_t5rcO/jpg'"
:src="details?details.ImageList[0]:'https://image.kkday.com/v2/image/get/s1.kkday.com/product_138437/20230217083232_t5rcO/jpg'"
class="rounded-borders"
spinner-color="grey-3"
style="width: 80px"
......@@ -108,16 +108,22 @@
<div class="q-mt-md row">
<div class="text-grey-9">
<q-icon name="iconfont iconrili" size="20px" class="q-mr-sm" />
<span>{{calculationAmount.startDate}}</span>
<span>{{OrderDate.startDate}}</span>
</div>
<div class="text-grey-9 q-ml-md">
<div class="text-grey-9 q-ml-md" v-if="chosenObj.Count > 0&&CarObj">
<q-icon name="iconfont iconjiaotong" size="20px" class="q-mr-sm" />
<span class="q-mr-sm" v-if="chosenObj.Count > 0"
<span class="q-mr-sm"
>{{CarObj.CarName}} x {{ chosenObj.Count }}</span
>
<span class="q-mr-sm"
>({{CarObj.PeopleNum}}人/辆)</span
>
<template v-if="details.TravelHours>0">
<q-icon name="iconfont icontime" size="20px" class="q-mr-xs q-ml-sm" />
<span class="q-mr-sm">
{{`行程時間:${details.TravelHours}小時`}}
</span>
</template>
</div>
</div>
<q-separator color="grey-2" class="q-mt-md" />
......@@ -293,6 +299,15 @@
</template>
<q-popup-proxy :offset="[0, 0]" ref="qDateProxy2">
<div class="row">
<!-- <q-date
mask="YYYY-MM-DD"
:title="$t('search_date_begin')"
subtitle="選擇"
v-model="getBusTimeDate"
:options="optionsFn"
@input="getTime(3)"
/>
<div class="q-px-sm"></div> -->
<q-time format24h v-model="getBusTime" mask="HH:mm"
@input="getTime(2)"/>
</div>
......@@ -407,7 +422,9 @@
<div class="text-subtitle1 q-my-md text-weight-bold">特殊需求備註:</div>
<q-input standout v-model="parameters.Remark" input-style="height:170px;" type="textarea" placeholder="此欄位僅限資料備註。不在商品規範內的個人需求,不保證提供" maxlength="200" counter />
</q-card>
</q-form>
</div>
<div class="relative-position" v-if="details"
:class="{
'q-ml-lg': !($q.screen.width < 1200 || $q.platform.is.mobile),
......@@ -447,7 +464,7 @@
/>
<q-img
v-else
:src="details?details.imgCover[0]:'https://image.kkday.com/v2/image/get/s1.kkday.com/product_138437/20230217083232_t5rcO/jpg'"
:src="details?details.ImageList[0]:'https://image.kkday.com/v2/image/get/s1.kkday.com/product_138437/20230217083232_t5rcO/jpg'"
class="rounded-borders"
spinner-color="grey-3"
style="width: 80px"
......@@ -466,6 +483,10 @@
<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 no-wrap" v-if="AirportObj&&AirportObj.Name">
<div style="width: 80px">{{details.CarType==1?'抵達':'起飛'}}時間:</div>
<div class="q-ml-md ellipsis-2-lines">{{parameters.FlightTime}}</div>
</div>
<div class="row q-pb-xs no-wrap" v-if="parameters.GetonAddress">
<div style="width: 80px">上車點:</div>
<div class="q-ml-md ellipsis-2-lines">{{parameters.GetonAddress}}</div>
......@@ -480,25 +501,24 @@
接駁日期:</div>
<div class="q-ml-md">
{{parameters.OrderDate}}
<!-- {{calculationAmount.startDate}} -->
</div>
</div>
</div>
<q-separator color="grey-2" class="q-my-md"/>
<div class="text-grey-9">
<div class="row q-mb-sm" v-if="chosenObj.Count>0">
<div class="row q-mb-sm" v-if="chosenObj.Count>0&&CarObj">
<div class="col">{{CarObj.CarName}} x {{ chosenObj.Count }}</div>
<div>CNY {{ moneyFormat(sumPrice,2) }}</div>
<div>{{details.CurrencyCode}} {{ moneyFormat(OrderDate.originalB2CPrice,2) }}</div>
</div>
<!-- <hr style="border:none;border-top:1px dashed #EEE !important;" class="bg-transparent q-mb-sm" />
<div class="row q-mb-sm items-center" v-if="(chosenObj.Count)>0">
<div class="col">總金額</div>
<div class="text-subtitle2 text-weight-bolder text-primary">CNY {{ moneyFormat(sumPrice,2) }}</div>
<div class="text-subtitle2 text-weight-bolder text-primary">{{details.CurrencyCode}} {{ moneyFormat(OrderDate.sumPrice,2) }}</div>
</div> -->
<hr style="border:none;border-top:1px dashed #EEE !important;" class="bg-transparent q-mb-sm" />
<div class="row q-mb-sm items-center" v-if="chosenObj.Count>0">
<div class="col">支付金額</div>
<div class="text-h6 text-weight-bolder text-primary product-price">CNY {{ moneyFormat(sumPrice,2) }}</div>
<div class="text-h6 text-weight-bolder text-primary product-price">{{details.CurrencyCode}} {{ moneyFormat(OrderDate.sumPrice,2) }}</div>
</div>
</div>
<div class="text-right q-mt-md" v-if="step!=3">
......@@ -532,16 +552,16 @@
</div>
<auth></auth>
</div>
</template>
</template>
<script>
import NoneData from "src/components/common/noneData.vue";
import auth from "src/components/common/auth.vue";
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 {
<script>
import NoneData from "src/components/common/noneData.vue";
import auth from "src/components/common/auth.vue";
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,
componentsMap,
......@@ -550,19 +570,16 @@
},
data() {
return {
order: null,//订单信息
orderKey: "",
isRangeClick: true,
isShowDialog: false,
AddressObj: null,
onCarObj: null,//上车范围
unCarObj: null,//下车范围
CarObj: null,//车型
AirportObj: null,//机场
calculationAmount: null,//日期
calculationNum: null,//数量
sumPrice: null,//总价
details: null,//产品详情
options: {
options: {//音频控件
currentPage: 0,
speed: 300,
itemAnimation: true,
......@@ -576,15 +593,11 @@
OrderDate: null,//接收产品相关信息
step: 1,
userInfo: {
lastName: "",
firstName: "",
country: 0,
phone: "",
Country: 0,
areaCode: "",
mail: "",
Mailbox: "",
},
chosenObj: {},
isUpdateUserInfo: false,
countrys: [],
areaCodes: [],
loading: false,
......@@ -615,13 +628,13 @@
Mobile:'',//电话
ProductId: '',
CarId: '',//产品类型ID
pType: 1,//类型 1来源B2C
OrderSource: 1,//类型 0来源B2B 1来源B2C
},
flightTime: null,//航班起飞抵达时间
getBusTime: null,//预约车时间
getBusTimeDate: null,//预约日期
TotalPeople: 0,//总人数
onoffbus: 1,//1 上车 2下车
ErpOrderId: 0,//erp订单Id
};
},
computed: {
......@@ -640,39 +653,64 @@
},
created() {},
mounted() {
this.checkParamsHandler()
this.initCountry();
if(this.checkParamsHandler()){
this.getCarData()
}
this.initGuestHandler();
this.getUserInfoHandler()
},
methods: {
// 获取商品详情
getCarData() {
this.$q.loading.show();
this.apipost(
"b2c_get_GetCarSingleProductDetail",
{ ProductId: this.parameters.ProductId },
(r) => {
if (r.data.resultCode == 1) {
this.details = r.data.data;
this.CarObj = this.details.CarTypeList.find((x) => this.OrderDate.CarId == x.Id);
this.onCarObj = this.details.PlaceList.find((x) => this.OrderDate.onCarId == x.Id)//上车范围
this.unCarObj = this.details.PlaceList.find((x) => this.OrderDate.unCarId == x.Id)//下车范围
if(this.details.CarType!=3){
this.AirportObj = this.details.AirportList.find((x) => this.OrderDate.AirportId == x.Id);
this.parameters.AirportId = this.OrderDate.AirportId
this.parameters.FlightTime = this.OrderDate.startDate
}
this.parameters.CarId = this.OrderDate.CarId
this.parameters.OrderType = this.details.CarType
} else {
this.$q.notify({
type: "negative",
message: r.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
this.$q.loading.hide();
},
null
);
},
checkParamsHandler() {
try {
if (this.$route.params && this.$route.params.id) {
let key = this.$route.params.id;
let pickuporderCars = localStorage.getItem("pickuporderCars");
let OrderDate = pickuporderCars ? JSON.parse(pickuporderCars) : null;
if (OrderDate) {
this.CarObj = OrderDate.CarObj,//车型
this.AirportObj = OrderDate.AirportObj,//机场
this.calculationAmount = OrderDate.calculationAmount,//日期
this.chosenObj = OrderDate.calculationNum,//数量
this.sumPrice = OrderDate.sumPrice,//总金额
this.details = OrderDate.details//产品详情
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
if (OrderDate) {
pickuporderCars = pickuporderCars ? JSON.parse(pickuporderCars) : [];
if (pickuporderCars.length > 0) {
this.order = pickuporderCars.find((x) => x.key == key);
if (this.order) {
this.orderKey = key;
this.OrderDate = this.order.order
this.chosenObj = this.OrderDate.orderInfo;
this.parameters.ProductId = this.order.order.Id
this.parameters.OrderDate = this.OrderDate.startDate
this.getBusTimeDate = this.OrderDate.startDate
this.parameters.Unit_Price = this.OrderDate.originalB2CPrice
this.parameters.Num = this.chosenObj.Count
this.parameters.Money = this.OrderDate.sumPrice
}
}
}
......@@ -686,10 +724,7 @@
}
return this.orderKey != "";
},
submit(){
let flag = false
async submit() {
this.$refs.mail.validate()
this.$refs.SurName.validate()
......@@ -706,31 +741,26 @@
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
&& !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.mail.hasError
}else{
this.$refs.GetoffAddress.validate()
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.mail.hasError
}
}else{
this.$refs.GetonAddress.validate()
this.$refs.GetoffAddress.validate()
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.mail.hasError
}
if(!flag) return this.goScrollToForm('baseUserInfoTitle')
let flag = true
flag = await this.formValidateHandler('baseUserInfo')
if(!flag){
let errorObj = this.$refs.baseUserInfo.getValidationComponents().find(x=>x.innerError)
window.scrollTo(0,errorObj.$el.offsetTop)
}else{
this.SetCarOrder()
}
},
goScrollToForm(formName){
async formValidateHandler(formName){
let temp=this.$refs[formName]
let formObj = temp instanceof Array ? temp[0] : temp
window.scrollTo(0,formObj.offsetTop)
return formObj.validate()
},
SetCarOrder(){
this.loading = true
......@@ -744,62 +774,82 @@
let ErpOrderId = r.data.data.Id
this.AddOrderInfo(ErpOrderId)
}else{
this.$q.notify({
type: "negative",
message: r.data.message,
position: "top",
timeout: 2000,
});
this.$message.error(r.data.message)
this.loading = false
}
})
},
AddOrderInfo(ErpOrderId){
let GoodsType = null
//13接机 14送机 12包车
if(this.parameters.OrderType==1){
GoodsType = 13
}else if(this.parameters.OrderType==2){
GoodsType = 14
}else if(this.parameters.OrderType==3){
GoodsType = 12
}
this.apipost(
"AddOrderInfo_post",
{
SurName: this.parameters.SurName,
Name: this.parameters.Name,
ContactNumber: this.parameters.Mobile,// 联系电话
Mailbox: this.userInfo.mail,//邮箱
Mailbox: this.userInfo.Mailbox,//邮箱
GoodsId: this.parameters.ProductId,//商品id
GoodsName: this.details.Name,//商品名称
GoodsPic: this.details.imgCover[0],//商品图片
GoodsType: this.parameters.OrderType,//商品类型(见枚举)
GoodsPic: this.details.ImageList[0],//商品图片
GoodsType: GoodsType,//商品类型(见枚举) 12包车 13 接机 14送机
OrderMake: this.parameters.OrderDate,//订单摘要(例如出行时间)
TotalPrice: this.parameters.Money,//总价格
PreferentialPrice: 0,// 优惠总金额
ErpOrderId: ErpOrderId,//erp订单id
Country: this.userInfo.country,//国家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
this.$message.success("訂單創建成功")
this.goPayHandler(r.data.data)
}else{
this.$q.notify({
type: "negative",
message: r.data.message,
position: "top",
timeout: 2000,
});
this.$message.error(r.data.message)
}
this.loading = false
})
},
goPayHandler(pay){
let key = this.$md5(JSON.stringify(pay))
let pays = localStorage.getItem('pays')
pays = pays?JSON.parse(pays):[]
pays.push({
key,
pay
})
localStorage.setItem("pays",JSON.stringify(pays))
let pickuporderCars = localStorage.getItem('pickuporderCars')
pickuporderCars = pickuporderCars?JSON.parse(pickuporderCars):[]
let i = pickuporderCars.findIndex(x=>x.key==this.orderKey)
if(i>=0){
pickuporderCars.splice(i,1)
localStorage.setItem("pickuporderCars",JSON.stringify(pickuporderCars))
}
this.CommonJump('/pay/'+key, {});
},
// 航班起飞抵达时间
getTime(type){
// 1航班时间 2预约时间
this.onoffbus = type
if(type==1){
this.parameters.FlightTime = this.calculationAmount.startDate+' '+this.flightTime
this.parameters.FlightTime = this.OrderDate.startDate+' '+this.flightTime
this.$refs.qDateProxy1.hide()
}else if(type==2){
this.parameters.OrderDate = this.calculationAmount.startDate+' '+this.getBusTime
this.parameters.OrderDate = this.OrderDate.startDate+' '+this.getBusTime
this.$refs.qDateProxy2.hide()
}else if(type==3){
this.parameters.OrderDate = this.OrderDate.startDate+' '+this.getBusTime
}
},
......@@ -844,16 +894,30 @@
},
initGuestHandler() {
},
// 获取当前用户信息
getUserInfoHandler() {
let u = this.$user.userInfo;
if (u) {
this.apipost("GetCustomerInfo_post", { Id: u.id }, (r) => {
if (r.data.resultCode == 1) {
this.userInfo = r.data.data;
} else {
this.$user.userInfo = null;
}
this.initCountry();
});
}
},
// 初始化国家
initCountry() {
this.apipost("GetCountryInfo_post", {}, (r) => {
if (r.data.resultCode == 1) {
this.countrys = r.data.data.countList;
this.userInfo.country = this.countrys[0].ID;
this.userInfo.Country = this.countrys[0].ID;
this.areaCodes = r.data.data.phoneCountList;
this.changeCountry(this.userInfo.country);
this.changeCountry(this.userInfo.Country);
this.areaCodes.forEach((x) => {
let temp = this.countrys.find((y) => y.ID == x.ID);
x.EnName = `${temp.EnName}(${x.PhoneCode})`;
......@@ -865,20 +929,20 @@
this.userInfo.areaCode = this.areaCodes.find((x) => x.ID == id).PhoneCode;
},
},
};
</script>
};
</script>
<style>
.order-preview .q-stepper__content {
<style>
.order-preview .q-stepper__content {
display: none !important;
}
.order-preview .q-toggle__track {
}
.order-preview .q-toggle__track {
height: 0.7em;
border-radius: 0.35em;
opacity: 0.38;
width: 50px;
}
.order-preview .q-toggle__thumb {
}
.order-preview .q-toggle__thumb {
top: 0.42em;
left: 0.45em;
width: 0.5em;
......@@ -886,20 +950,20 @@
transition: left 0.22s ease-in-out;
user-select: none;
z-index: 0;
}
.order-preview .q-toggle__inner--truthy .q-toggle__thumb {
}
.order-preview .q-toggle__inner--truthy .q-toggle__thumb {
left: 0.94em;
}
.order-preview .q-toggle__inner {
}
.order-preview .q-toggle__inner {
width: 1.9em;
}
.order-preview .q-toggle__label {
}
.order-preview .q-toggle__label {
margin-top: 12px;
}
.guest-item:hover{
}
.guest-item:hover{
background: rgba(241,65,108,.04) !important;
}
.text-h6Detail {
}
.text-h6Detail {
text-align: center;
font-size: 18px;
color: #333;
......@@ -907,13 +971,12 @@
position: relative;
width:100%;
height:50px;
}
.text-h6Detail i {
}
.text-h6Detail i {
position: absolute;
right:20px;
top:10px;
cursor: pointer;
font-size:23px;
}
</style>
\ No newline at end of file
}
</style>
......@@ -23,7 +23,7 @@
class="col product-price text-subtitle1 text-weight-bold"
style="text-align: left"
>
<span v-if="dataList&&dataList.MinPrice">CNY {{ moneyFormat(dataList.MinPrice, 0) }}</span>
<span v-if="dataList&&dataList.MinPrice">{{dataList.CurrencyCode}} {{ moneyFormat(dataList.MinPrice, 0) }}</span>
<span class="q-ml-sm f12 text-grey-7"></span>
</span>
<q-btn
......@@ -173,7 +173,7 @@
>
<div class="product-price text-h6" v-if="dataList.MinPrice > 0">
<!-- CNY:{{ dataList. }} -->
CNY{{ moneyFormat(dataList.MinPrice, 0) }}
{{dataList.CurrencyCode}}{{ moneyFormat(dataList.MinPrice, 0) }}
<span class="f12 text-grey-6"></span>
</div>
<div v-else class="text-subtitle1 text-grey-6">暫無報價</div>
......@@ -327,7 +327,7 @@
<div class="" v-if="$q.platform.is.desktop">
<div class="row items-center">
<span class="product-price text-h6 q-mr-md"
>CNY
>{{dataList.CurrencyCode}}
{{
moneyFormat(priceList[0].originalB2CPrice, 0)
}}</span
......@@ -350,7 +350,7 @@
style="border-top: 1px solid #eee"
v-if="showOrderPreview"
>
<div class="q-pa-md bg-grey-2 row items-center rounded-borders">
<div v-if="dataList.FreeCancelDay>0||dataList.TravelHours>0" class="q-pa-md bg-grey-2 row items-center rounded-borders">
<div class="text-subtitle2 text-weight-bold q-mr-xl">
關於此方案
</div>
......@@ -361,6 +361,8 @@
icon="iconfont iconcancel"
:label="`${dataList.FreeCancelDay}天前可免费取消`"
/>
<q-chip v-if="dataList.TravelHours>0" class="transparent q-mr-xl no-padding"
icon="iconfont icontime" :label="`行程時間:${dataList.TravelHours}小時`" />
</div>
<div class="q-mt-lg row" v-if="$q.platform.is.desktop">
<div class="col">
......
......@@ -50,8 +50,6 @@
standout
v-model="userInfo.Name"
label="名字"
mask="A"
reverse-fill-mask
ref="name"
:rules="[(val) => !!val || '請輸入名字']"
/>
......@@ -62,8 +60,6 @@
v-model="userInfo.Surname"
ref="surname"
label="姓氏"
mask="A"
reverse-fill-mask
:rules="[(val) => !!val || '請輸入姓氏']"
/>
</div>
......@@ -171,7 +167,7 @@
<div :class="filedGuestWidth">
<q-input
standout
v-model="x.FirstName"
v-model="x.SurName"
label="本國姓"
placeholder="例:張"
:rules="[(val) => !!val || '請輸本國姓']"
......@@ -180,7 +176,7 @@
<div :class="filedGuestWidth">
<q-input
standout
v-model="x.LastName"
v-model="x.Name"
label="本國名"
placeholder="例:三"
:rules="[(val) => !!val || '請輸本國名']"
......@@ -202,7 +198,7 @@
<div :class="filedGuestWidth">
<q-input
standout
v-model="x.PassFirstName"
v-model="x.ESurName"
label="護照英文姓"
placeholder="例:ZHANG"
mask="A"
......@@ -213,7 +209,7 @@
<div :class="filedGuestWidth">
<q-input
standout
v-model="x.PassLastName"
v-model="x.EName"
label="護照英文名"
placeholder="例:SAN"
mask="A"
......@@ -224,7 +220,7 @@
<div :class="filedGuestWidth">
<q-input
standout
v-model="x.Passport"
v-model="x.PassportNo"
label="護照號"
mask="X"
reverse-fill-mask
......@@ -234,7 +230,7 @@
<div :class="filedGuestWidth">
<q-input
standout
v-model="x.PassValidate"
v-model="x.PassportExpiry"
label="護照有效期"
readonly
:rules="[(val) => !!val || '請選擇護照有效期']"
......@@ -247,8 +243,28 @@
mask="YYYY-MM-DD"
:title="$t('search_date_begin')"
subtitle="選擇"
v-model="x.PassValidate"
@input="() => $refs.qDateProxy7.hide()"
v-model="x.PassportExpiry"
/>
</q-popup-proxy>
</q-input>
</div>
<div :class="filedGuestWidth">
<q-input
standout
v-model="x.Birthday"
label="出生日期"
readonly
:rules="[(val) => !!val || '請選擇旅客出生日期']"
>
<template v-slot:append>
<q-icon name="event" class="cursor-pointer"></q-icon>
</template>
<q-popup-proxy :offset="[0, 0]" ref="qDateProxy8">
<q-date
mask="YYYY-MM-DD"
:title="$t('search_date_begin')"
subtitle="選擇"
v-model="x.Birthday"
/>
</q-popup-proxy>
</q-input>
......@@ -258,7 +274,7 @@
standout
v-model="x.MobilePhone"
label="聯絡電話"
mask="+# #"
mask=""
reverse-fill-mask
placeholder="格式:國家區號+號碼,例如:+81 25xxxx"
/>
......@@ -336,7 +352,7 @@
</div>
<div class="row">
<div style="width: 80px">出發日期:</div>
<div class="q-ml-md">{{ price.startDate }}</div>
<div class="q-ml-md">{{ unionCity && unionCity.goFlight? unionCity.goFlight.startDate :price.startDate }}</div>
</div>
</div>
<q-separator color="grey-2" class="q-my-md" />
......@@ -357,6 +373,30 @@
<div class="col">嬰兒不佔床 x {{ chosenObj.yeCount }}</div>
<div>CNY {{ moneyFormat(price.babyPrice, 2) }}</div>
</div>
<div v-if="price.safeMoney>0">
<hr
style="border: none; border-top: 1px dashed #eee !important"
class="bg-transparent q-mb-sm"
/>
<div class="row q-mb-sm" v-if="price.safeMoney > 0">
<div class="col">保險費 x {{ price.safeMoney }}/人</div>
<div>CNY {{ moneyFormat(price.safeMoney*(chosenObj.crCount+chosenObj.etCount+chosenObj.yeCount), 2) }}</div>
</div>
</div>
<div v-if="price.visaPrice>0||price.otherPrice>0">
<hr
style="border: none; border-top: 1px dashed #eee !important"
class="bg-transparent q-mb-sm"
/>
<div class="row q-mb-sm" v-if="price.visaPrice > 0">
<div class="col">簽證費 x {{ price.visaPrice }}/人</div>
<div>CNY {{ moneyFormat(price.visaPrice*(chosenObj.crCount+chosenObj.etCount+chosenObj.yeCount), 2) }}</div>
</div>
<div class="row q-mb-sm" v-if="price.otherPrice > 0">
<div class="col">雜費 x {{ price.otherPrice }}/人</div>
<div>CNY {{ moneyFormat(price.otherPrice*(chosenObj.crCount+chosenObj.etCount+chosenObj.yeCount), 2) }}</div>
</div>
</div>
<hr
style="border: none; border-top: 1px dashed #eee !important"
class="bg-transparent q-mb-sm"
......@@ -375,6 +415,7 @@
CNY {{ moneyFormat(sumPrice, 2) }}
</div>
</div>
<hr
style="border: none; border-top: 1px dashed #eee !important"
class="bg-transparent q-mb-sm"
......@@ -416,6 +457,7 @@
import coupon from "../../components/common/coupon.vue";
import NoneData from "src/components/common/noneData.vue";
import auth from "src/components/common/auth.vue";
import {date} from 'quasar'
export default {
components: {
coupon,
......@@ -464,19 +506,36 @@ export default {
countrys: [],
areaCodes: [],
guest: {
FirstName: "",
LastName: "",
Passport: "",
PassFirstName: "",
PassLastName: "",
Id:0,
TCID:0,
OrderId:0,
VisaPlanId:0,
SurName: "羅",
Name: "超",
PassportNo: "D56465465",
ESurName: "LUO",
EName: "CHAO",
GuestType: 0,
EnableSignRoom: false,
PassValidate: "",
PassportExpiry: "2035-12-31",
FormatTypeName: "",
MobilePhone: "",
MobilePhone: "17308037817",
RoomType: 0,
IsSignRoom: false,
Sex: 0,
Sex: 1,
IdCard:'',
PassportIssued:'',
Purpose: "观光",
IsBed:1,
IsNeedAirticket:2,
IsNeedSafe:1,
IsVisaFree:2,
IssuingAuthority:2,
IsCriminalRecord:2,
IsDepartureRecord:2,
IsHightSchool:2,
IsB2B:1,
Birthday:'1990-12-26'
},
guests: [],
disableSign: false,
......@@ -486,7 +545,8 @@ export default {
price: null,
unionCity: null,
sumPrice:0,
submiting:false
submiting:false,
CouponIds:[]
};
},
computed: {
......@@ -527,10 +587,164 @@ export default {
}
}
if(flag){
this.submitOrderHandler()
//this.submitB2COrderHandler(81192)
return;
}
}
this.submiting=false
},
submitOrderHandler(){
let msg={
OrderId:0,
TCID:this.order.order.tcid,
CustomerType:4,
GroupType:1,
ContactName:this.userInfo.Surname+this.userInfo.Name,
ContactMobile:this.userInfo.PhoneCountryStr+' '+this.userInfo.Moblie,
CustomerId:0,
DepartureCityId:this.order.order.startCityId,
IsIntermodal:this.unionCity?1:2,
Unit_Price:this.price.originalB2CPrice,
TC_Price:this.price.originalB2CPrice,
ManNum:this.chosenObj.crCount,
ChirdNum:this.chosenObj.etCount,
ChirdNeedBedNum:this.chosenObj.etzcCount,
BabyNum:this.chosenObj.yeCount,
OldPeopleNum: 0,
SingleRoomNum:this.chosenObj.df,
PreferPrice:this.sumPrice,
DiscountMoney:this.discountPrice,
CouponAllotIds: this.CouponIds.join(','),
YSeatNum:this.chosenObj.crCount+this.chosenObj.etCount,
ESeatNum:0,
FSeatNum:0,
Commission:0,//todo 提成
ClientSource:3,
BrandId:0,
TradeWay:0,
PlatformOrder:'',
GuestNum:this.chosenObj.crCount+this.chosenObj.etCount,
IsChildrenTour:this.price.isSupportChildren,
IsBirdDiscount:2,
PredictRoomNum:(parseFloat((this.chosenObj.crCount+this.chosenObj.etzcCount-this.chosenObj.df))/2.0)+this.chosenObj.df,
BigRoomNum:0,
TripleRoomNum:0,
TradeDate:date.formatDate(new Date(),'YYYY-MM-DD'),
CostType:0,
MinOrderPrice:0,
Remarks:this.chosenObj.remark,
VisaNum:this.chosenObj.crCount+this.chosenObj.etCount+this.chosenObj.yeCount,
SafeNum:this.chosenObj.crCount+this.chosenObj.etCount+this.chosenObj.yeCount,
AirticketNum:0,
ReturnArriveCityId:this.unionCity && this.unionCity.backFlight?this.unionCity.backFlight.arrivalCityId:this.trip.returnArriveCityId,
IsReturnIntermodal:this.unionCity && this.unionCity.backFlight?1:2,
GoCityTime:this.unionCity && this.unionCity.goFlight ? this.unionCity.goFlight.startDate:'',
BackCityTime:this.unionCity && this.unionCity.backFlight ? this.unionCity.backFlight.startDate:'',
ScenicRefundArr:[],
CommissionSharePeople:0,
CommissionShareMoney:0,
OrderSource:3,
RedEnvelopeMoney: 0
}
this.apipost("sellorder_post_SetOrderInfoForB2B",msg,
res => {
if(res.data.resultCode==1){
this.uploadGuests(0,res.data.data.OrderId)
}else{
this.$message.error(res.data.message)
this.submiting=false
}
},
err => {
this.submiting=false
});
},
uploadGuests(i,orderId){
let currentGuest = this.guests[i]
currentGuest.OrderId=orderId
currentGuest.TCID = this.order.order.tcid
this.apipost('sellorder_post_SetTravelGuestInfo_V2',currentGuest,r=>{
console.log(r)
if(i<this.guests.length-1){
this.uploadGuests(i,orderId)
}else{
this.submitB2COrderHandler(orderId)
}
})
},
submitB2COrderHandler(orderId){
let guestInfo = `成人x${this.chosenObj.crCount}; `
if(this.chosenObj.etzcCount>0){
guestInfo += `佔床兒童x${this.chosenObj.etzcCount}; `
}
if(this.chosenObj.etbzcCount>0){
guestInfo += `不佔床兒童x${this.chosenObj.etbzcCount}; `
}
if(this.chosenObj.yeCount>0){
guestInfo += `嬰兒x${this.chosenObj.yeCount}; `
}
if(this.chosenObj.df>0){
guestInfo += `單房x${this.chosenObj.df}; `
}
if(this.chosenObj.visaPrice>0){
guestInfo += `簽證x${this.chosenObj.crCount+this.chosenObj.etCount+this.chosenObj.yeCount}; `
}
if(this.chosenObj.safeMoney>0){
guestInfo += `旅行保險x${this.chosenObj.crCount+this.chosenObj.etCount+this.chosenObj.yeCount};`
}
let msg = {
SurName:this.userInfo.Surname,
Name:this.userInfo.Name,
ContactNumber:this.userInfo.PhoneCountryStr+' '+this.userInfo.Moblie,
Mailbox:this.userInfo.Mailbox,
GoodsId:this.order.order.tcid,
GoodsName:this.trip.title,
GoodsPic:this.trip.imgCover[0].Url,
GoodsType:this.price.teamType==0?2:(this.price.teamType==2?1:3),
OrderMake:`${ this.unionCity && this.unionCity.goFlight? this.unionCity.goFlight.startDate :this.price.startDate}${this.unionCity?this.unionCity.cityName:this.trip.startCityName }出發 ${guestInfo}`,
TotalPrice:this.sumPrice,
PreferentialPrice:this.chosenObj.discountPrice,
ErpOrderId:orderId,
Country:this.userInfo.Country,
PlatformTax:0,
Income:0,
Refund:0
}
this.apipost("AddOrderInfo_post",msg,r=>{
if(r.data.resultCode==1){
this.$message.success("訂單創建成功")
this.goPayHandler(r.data.data)
} else {
this.$message.error(r.data.message)
}
})
},
goPayHandler(pay){
let key = this.$md5(JSON.stringify(pay))
let pays = localStorage.getItem('pays')
pays = pays?JSON.parse(pays):[]
pays.push({
key,
pay
})
localStorage.setItem("pays",JSON.stringify(pays))
let lineCars = localStorage.getItem('lineCars')
lineCars = lineCars?JSON.parse(lineCars):[]
let i = lineCars.findIndex(x=>x.key==this.orderKey)
if(i>=0){
lineCars.splice(i,1)
localStorage.setItem("lineCars",JSON.stringify(lineCars))
}
this.CommonJump('/pay/'+key, {});
},
GUID() {
return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random()*16|0,
v = c == 'x' ? r : (r&0x3|0x8);
return v.toString(16);
})
},
async formValidateHandler(formName){
let temp=this.$refs[formName]
......@@ -562,7 +776,7 @@ export default {
}
if (this.orderKey == "") {
setTimeout(() => {
//location.href=location.origin
location.href=location.origin
}, 3000);
}
return this.orderKey != "";
......@@ -583,7 +797,8 @@ export default {
money += this.price.singleRoomPrice * this.chosenObj.df;
let sumCount = this.chosenObj.crCount + this.chosenObj.etCount
//money += this.price.visaPrice * sumCount;
money += this.price.visaPrice * sumCount;
money += this.price.safeMoney * sumCount;
money += this.price.otherPrice * sumCount;
this.sumPrice = money;
},
......@@ -599,6 +814,8 @@ export default {
if (this.chosenObj.df > 0) {
obj.EnableSignRoom = true;
}
obj.IsBed=1
obj.IdCard=this.GUID()
this.guests.push(obj);
}
for (let i = 0; i < this.chosenObj.etzcCount; i++) {
......@@ -608,18 +825,24 @@ export default {
if (this.chosenObj.df > 0) {
obj.EnableSignRoom = true;
}
obj.IsBed=1
obj.IdCard=this.GUID()
this.guests.push(obj);
}
for (let i = 0; i < this.chosenObj.etbzcCount; i++) {
let obj = JSON.parse(JSON.stringify(this.guest));
obj.GuestType = 3;
obj.FormatTypeName = `儿童不占床 ${i + 1}:`;
obj.IsBed=0
obj.IdCard=this.GUID()
this.guests.push(obj);
}
for (let i = 0; i < this.chosenObj.yeCount; i++) {
let obj = JSON.parse(JSON.stringify(this.guest));
obj.GuestType = 4;
obj.FormatTypeName = `婴儿 ${i + 1}:`;
obj.IsBed=0
obj.IdCard=this.GUID()
this.guests.push(obj);
}
},
......@@ -661,6 +884,7 @@ export default {
});
}
},
getTripData() {
this.$q.loading.show();
let msg = {
......@@ -684,7 +908,7 @@ export default {
if(this.order.order.startCityId!=this.trip.startCityId){
this.unionCity = this.price.unionCityList.find(x=>x.cityId == this.order.order.startCityId)
if(this.unionCity.backFlight && this.unionCity.backFlight.addPrice){
this.price.originalB2CPrice+=unionCity.backFlight.addPrice
this.price.originalB2CPrice+=this.unionCity.backFlight.addPrice
}
if(this.unionCity.goFlight && this.unionCity.goFlight.addPrice){
this.price.originalB2CPrice+=this.unionCity.goFlight.addPrice
......
<template>
<div class="content-page order-preview">
<q-stepper
v-model="step"
ref="stepper"
color="primary"
inactive-color="grey-5 "
done-color="primary"
class="bg-transparent"
flat
animated
>
<q-step
:name="1"
title="確認訂單"
icon="settings"
:done="step > 1"
></q-step>
<q-step
:name="2"
title="付款"
icon="iconfont iconPayment-1"
:done="step > 2"
></q-step>
<q-step
:name="3"
title="訂購完成"
icon="iconfont iconicon_finish_R"
:done="step == 3"
></q-step>
</q-stepper>
</div>
</template>
<script>
export default {
data() {
return {
step:2
}
},
}
</script>
<style>
</style>
\ No newline at end of file
......@@ -326,9 +326,6 @@ export default {
console.log('this.$refs[item]', this, item, this.$refs[item])
this.$refs[item].validate();
});
// this.$refs.Surname.validate();
// this.$refs.Name.validate();
// this.$refs.BirthDate.validate();
verifyArr.forEach((item) => {
console.log('item', item)
if (this.$refs[item].hasError) {
......
......@@ -5,7 +5,25 @@
margin: 10px;
}
.content {
max-width: 940px;
width: 900px;
}
.title {
margin-top: 20px;
margin-bottom: 10px;
}
.card {
margin: 10px;
background: #ffffff;
border: 1px solid #eeeeee;
border-radius: 8px;
}
.card-title {
height: 37px;
height: 37px;
padding: 0 20px;
line-height: 37px;
background: #f5f5f5;
border-radius: 8px 8px 0px 0px;
}
.tips {
height: 42px;
......@@ -17,41 +35,103 @@
::v-deep .q-field__control {
height: 40px;
}
::v-deep .q-field--auto-height .q-field__control {
min-height: 40px;
}
::v-deep .q-field__marginal {
height: 40px;
}
.title {
margin-top: 20px;
margin-bottom: 10px;
}
.phone {
margin-left: 100px;
}
.name {
width: 300px;
}
.user-name {
width: 120px;
}
.pay-info {
width: 120px;
}
.order-info {
width: 120px;
}
.order-action {
width: 120px;
}
.nav-item {
width: 100px;
margin: 0 10px;
text-align: center;
}
.border-bottom {
width: 20px;
height: 4px;
border-radius: 2px;
background-color: $primary;
margin: -8px auto 0 auto;
}
</style>
<template>
<div class="content q-ma-lg bg-white q-pa-lg">
<div class="tips">
出行人<span class="text-grey-6"
>共計 3人,最多新增20人(含本人)</span
>
</div>
<div class="content q-ma-lg bg-white">
<div>
<div class="card" v-for="item in pageData" :key="item.id">
<div class="flex card-title justify-between">
<div class="flex">
<span>订单号</span>
<span class="phone">联系客服</span>
</div>
<span>
<span>编辑</span>
<span>删除</span>
</span>
</div>
<div class="flex q-py-sm">
<div class="row">
<div class="col-12">中國內地身份證:510181********0920</div>
<div class="col-12">中國內地身份證:510181********0920</div>
</div>
</div>
</div>
</div>
<q-btn
color="primary"
unelevated
outline
@click="isShowDialog = true"
label="添加出行人"
></q-btn>
<q-dialog content-style="width: 900px" v-model="isShowDialog">
<div class="bg-white dialog-box" style="width: 800px; padding: 20px">
<div>添加邮寄地址</div>
<form @submit.prevent.stop="submit" class="q-gutter-md">
<div>
<div class="row">
<div class="col">
<div class="title"></div>
<q-input
class="form-item"
v-model="form.firstName"
v-model="form.Surname"
outlined
placeholder="姓"
ref="firstName"
:rules="[(val) => val !== '' || '请输入姓氏']"
ref="Surname"
:rules="[(val) => !!val || '请输入姓氏']"
></q-input>
</div>
<div class="col">
<div class="title"></div>
<q-input
ref="lastName"
ref="Name"
class="form-item"
placeholder="名"
v-model="form.lastName"
v-model="form.Name"
outlined
:rules="[(val) => val !== '' || '请输入名字']"
:rules="[(val) => !!val || '请输入名字']"
></q-input>
</div>
</div>
......@@ -60,106 +140,296 @@
<div class="title">姓氏(需與旅遊證件一致)</div>
<q-input
class="form-item"
v-model="form.firstName"
v-model="form.EnName"
outlined
placeholder="姓氏(需與旅遊證件一致)"
ref="firstName"
:rules="[(val) => val !== '' || '请输入姓氏']"
ref="EnName"
:rules="[(val) => !!val || '请输入姓氏(需與旅遊證件一致)']"
></q-input>
</div>
<div class="col">
<div class="title">名字(需與旅遊證件一致)</div>
<q-input
ref="lastName"
ref="EnSurname"
class="form-item"
placeholder="名字(需與旅遊證件一致)"
v-model="form.lastName"
v-model="form.EnSurname"
outlined
:rules="[(val) => val !== '' || '请输入名字']"
:rules="[(val) => !!val || '请输入名字(需與旅遊證件一致)']"
></q-input>
</div>
</div>
<div class="row">
<div class="col">
<div class="title">居住國家/地區</div>
<q-select filled v-model="model" :options="options" label="Filled" />
</div>
<div class="col">
<div class="title">稱謂</div>
<q-select filled v-model="model" :options="options" label="Filled" />
</div>
</div>
<div class="row">
<div class="col">
<div class="title">國家/地區代碼</div>
<q-select filled v-model="model" :options="options" label="Filled" />
<q-select
ref="PhoneCountry"
square
outlined
option-value="ID"
option-label="PhoneCode"
class="form-item"
v-model="form.PhoneCountry"
:options="phoneCountList"
placeholder="Filled"
:rules="[(val) => Boolean(val) || '请选择國家/地區代碼']"
/>
</div>
<div class="col">
<div class="title">電話(首次需驗證)</div>
<q-input
ref="lastName"
ref="Moblie"
class="form-item"
placeholder="名字(需與旅遊證件一致)"
v-model="form.lastName"
placeholder="電話(首次需驗證)"
v-model="form.Moblie"
outlined
:rules="[(val) => val !== '' || '请输入名字']"
:rules="[(val) => !!val || '请输入電話(首次需驗證)']"
></q-input>
</div>
</div>
<div class="row">
<div
v-for="(item, index) in form.CardList"
:key="item.id"
class="row"
>
<div class="col">
<div class="title">出生日期</div><q-date
v-model="date"
minimal
<div class="title">证件类型</div>
<q-select
ref="card"
square
outlined
option-value="ID"
option-label="Name"
class="form-item"
v-model="item.Type"
:options="cardList"
placeholder="Filled"
:rules="[(val) => Boolean(val) || '请选择國家/地區代碼']"
/>
</div>
<div class="col">
<div class="title">電子郵件(接收订单确认邮件)</div>
<div class="flex justify-between items-center">
<div class="title">证件号码</div>
<div v-if="index > 0" @click="deleteCardItem(item)">删除</div>
</div>
<q-input
ref="lastName"
class="form-item"
placeholder="名字(需與旅遊證件一致)"
v-model="form.lastName"
placeholder="電話(首次需驗證)"
v-model="item.CardNo"
outlined
:rules="[(val) => val !== '' || '请输入名字']"
:rules="[(val) => !!val || '请输入電話(首次需驗證)']"
></q-input>
</div>
</div>
<q-btn
color="primary"
@click="addCard"
unelevated
outline
label="新增证件"
/>
<div>
<q-btn color="primary" unelevated label="保存" @click="submit" />
<q-btn color="primary" type="submit" unelevated label="保存" />
</div>
</div>
</form>
</div>
</q-dialog>
</div>
</template>
<script>
export default {
data() {
return {
isShowDialog: false,
selectedKey: "全部",
form: {
lastName: "",
firstName: "",
Surname: "",
Name: "",
EnName: "",
EnSurname: "",
Moblie: "",
CardList: [],
},
model: '',
date: '',
options: []
model: "",
date: "",
options: [],
cardList: [],
phoneCountList: [],
count: 0,
pageData: [],
};
},
mounted() {
this.id = 0;
this.addCard();
this.getUsersList();
this.getCountryInfo();
this.getCardTypeList();
},
methods: {
getCardTypeList() {
this.apipost(
"b2c_post_GetTripCardEnumList",
{},
(res) => {
if (res.data.resultCode == 1) {
this.cardList = res.data.data;
} else {
// this.$notify(res.data.message);
this.$q.notify({
type: "negative",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
},
getCountryInfo() {
this.apipost(
"GetCountryInfo_post",
{},
(res) => {
if (res.data.resultCode == 1) {
const { phoneCountList, countList } = res.data.data;
this.countList = countList;
this.phoneCountList = phoneCountList;
} else {
// this.$notify(res.data.message);
this.$q.notify({
type: "negative",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
},
changeCouponType(item) {
this.selectedKey = item;
},
addCard() {
this.id++;
this.form.CardList.push({
id: this.id,
});
},
deleteCardItem(card) {
const index = this.form.CardList.findIndex(item => item.id === card.id)
this.form.CardList.splice(index, 1)
},
submit() {
const verifyArr = ['fastName', 'lastName'];
this.formHasError = false;
const verifyArr = [
"Surname",
"Name",
"EnName",
"EnSurname",
"Moblie",
];
verifyArr.forEach((item) => {
console.log("this.$refs[item]", this, item, this.$refs[item]);
this.$refs[item].validate();
});
verifyArr.forEach((item) => {
if (item.$refs[item].hasError) {
console.log("item", item);
if (this.$refs[item].hasError) {
console.log("item", item);
this.formHasError = true;
}
});
if ((this.formHasError = true)) {
console.log("this.formHasError", this.formHasError, this.form);
if (this.formHasError) {
return;
}
this.submitUserInfo();
},
getUsersList() {
this.apipost(
"b2c_post_GetTripGuestPageList",
{pageIndex: 1, pageSize: 20},
(res) => {
if (res.data.resultCode == 1) {
const { count, pageData } = res.data.data;
this.count = count;
this.pageData = pageData;
} else {
// this.$notify(res.data.message);
this.$q.notify({
type: "negative",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
},
deleteUser() {
this.apipost(
"b2c_post_DelTripGuestInfo",
{
Id: this.userInfo?.id,
},
(res) => {
if (res.data.resultCode == 1) {
this.$q.notify({
type: "positive",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
this.getUsersList();
} else {
// this.$notify(res.data.message);
this.$q.notify({
type: "negative",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
},
submitUserInfo() {
let params = { ...this.form };
params.PhoneCountry = params.PhoneCountry.ID;
params.CardList.forEach(item => {
item.Type = item.Type.Id
})
this.apipost(
"b2c_post_SetTripGuestInfo",
params,
(res) => {
if (res.data.resultCode == 1) {
this.$q.notify({
type: "positive",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
} else {
// this.$notify(res.data.message);
this.$q.notify({
type: "negative",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
},
},
};
......
......@@ -51,91 +51,91 @@ const routes = [{
},
{
path: '/account', //用户信息
meta: {isUserCenter: true},
meta: { isUserCenter: true },
component: () =>
import ('pages/usercenter/account.vue')
},
{
path: '/demandlist', //需求单列表
meta: {isUserCenter: true},
meta: { isUserCenter: true },
component: () =>
import ('pages/usercenter/demandlist.vue')
},
{
path: '/demandinfo/:id', //需求单详情
meta: {isUserCenter: true},
meta: { isUserCenter: true },
component: () =>
import ('pages/usercenter/demandinfo.vue')
},
{
path: '/orderlist', //订单列表
meta: {isUserCenter: true},
meta: { isUserCenter: true },
component: () =>
import ('pages/usercenter/orderlist.vue')
},
{
path: '/orderinfo/:id', //订单详情
meta: {isUserCenter: true},
meta: { isUserCenter: true },
component: () =>
import ('pages/usercenter/orderinfo.vue')
},
{
path: '/passengerList/:id', //旅客名单
meta: {isUserCenter: true},
meta: { isUserCenter: true },
component: () =>
import ('pages/usercenter/passengerList.vue')
},
{
path: '/register', //用户注册
meta: {isUserCenter: true},
meta: { isUserCenter: true },
component: () =>
import ('pages/usercenter/register.vue')
},
{
path: '/loginInfo', //账户设置
meta: {isUserCenter: true},
meta: { isUserCenter: true },
component: () =>
import ('pages/usercenter/loginInfo.vue')
},
{
path: '/setAddress', //地址管理
meta: {isUserCenter: true},
meta: { isUserCenter: true },
component: () =>
import ('pages/usercenter/setAddress.vue')
},
{
path: '/setInfo', //账户设置
meta: {isUserCenter: true},
meta: { isUserCenter: true },
component: () =>
import ('pages/usercenter/setInfo.vue')
},
{
path: '/setUserInfo', //用户信息
meta: {isUserCenter: true},
meta: { isUserCenter: true },
component: () =>
import ('pages/usercenter/setUserInfo.vue')
},
{
path: '/coupon', //优惠券
meta: {isUserCenter: true},
meta: { isUserCenter: true },
component: () =>
import ('pages/usercenter/coupon.vue')
},
{
path: '/order', //用户订单
meta: {isUserCenter: true},
meta: { isUserCenter: true },
component: () =>
import ('pages/usercenter/order.vue')
},
{
path: '/setUsersList', //用户订单
meta: {isUserCenter: true},
meta: { isUserCenter: true },
component: () =>
import ('pages/usercenter/setUsersList.vue')
},
{
path: '/payInfo', //支付管理
meta: {isUserCenter: true},
meta: { isUserCenter: true },
component: () =>
import ('pages/usercenter/payInfo.vue')
},
......@@ -154,6 +154,11 @@ const routes = [{
component: () =>
import ('pages/line/orderPreview.vue')
},
{
path: '/pay/:id?', //自定义页面
component: () =>
import ('pages/line/pay.vue')
},
]
},
......
......@@ -8916,6 +8916,11 @@ svgo@^1.0.0:
unquote "~1.1.1"
util.promisify "~1.0.0"
swiper@3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/swiper/-/swiper-3.0.4.tgz#6a9810d33431bb05dbfa4276a8338e20968e3e12"
integrity sha512-t/EPKnUHHtH1A3Owj904EO8kWy6QVLeuVT2p1/P/TAzuvY5AI/37265o8f2OrVCK/qoafJ8mT52ymOGb6M0BbA==
swiper@^4.0.7:
version "4.5.1"
resolved "https://registry.yarnpkg.com/swiper/-/swiper-4.5.1.tgz#ed43998e780ceb478610079c8d23fd425eca636f"
......@@ -9622,6 +9627,11 @@ vue@^2.6.10:
"@vue/compiler-sfc" "2.7.14"
csstype "^3.1.0"
vuelidate@^0.7.7:
version "0.7.7"
resolved "https://registry.yarnpkg.com/vuelidate/-/vuelidate-0.7.7.tgz#5df3930a63ddecf56fde7bdacea9dbaf0c9bf899"
integrity sha512-pT/U2lDI67wkIqI4tum7cMSIfGcAMfB+Phtqh2ttdXURwvHRBJEAQ0tVbUsW9Upg83Q5QH59bnCoXI7A9JDGnA==
vuex@3.4.0:
version "3.4.0"
resolved "https://registry.npmmirror.com/vuex/-/vuex-3.4.0.tgz"
......
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