Commit 7cbd3931 authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/viitto/million

parents 8c32791b a3c752bc
......@@ -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"
......
......@@ -144,7 +144,7 @@
||(dataList.CarType!=3&&!selectedAirportObj)
||(dataList.CarType==1&&!unCarObj)||(dataList.CarType==2&&!onCarObj)
||(dataList.CarType==3&&(!onCarObj||!unCarObj))"
@click="goUrl"/>
@click="goOrderHandler"/>
</div>
</div>
</div>
......@@ -199,8 +199,9 @@ export default {
},
methods: {
goUrl(){
let OrderDate = {
goOrderHandler(){
let order = {
key: null,
CarObj: this.selectedCarObj,
AirportObj: {
Address: this.selectedAirportObj?this.selectedAirportObj.Address:'',
......@@ -219,6 +220,7 @@ export default {
imgCover: this.dataList.imgCover,
CarType: this.dataList.CarType,
Id: this.dataList.Id,
CurrencyCode: this.dataList.CurrencyCode,
},
onCarObj: {
Address: this.onCarObj?this.onCarObj.Address:'',
......@@ -235,20 +237,10 @@ export default {
Range: this.unCarObj?this.unCarObj.Range:''
},
}
// console.log(OrderDate,'========')
// return
this.CommonJump(
"/PickuporderForm",
{
OrderDate: encodeURIComponent(JSON.stringify(OrderDate)),
// CarObj: JSON.stringify(this.selectedCarObj),
// AirportObj: JSON.stringify(this.selectedAirportObj),
// calculationAmount: JSON.stringify(this.p),
// calculationNum: JSON.stringify(this.chosenObj),
// sumPrice: JSON.stringify(this.sumPrice),
// details: JSON.stringify(this.dataList)
}
);
let key = this.$md5(JSON.stringify(order))
order.key = key
localStorage.setItem("pickuporderCars",JSON.stringify(order))
this.CommonJump('/PickuporderForm/'+key, {});
},
// 获取车的详情
getCarPriceData2() {
......
......@@ -40,7 +40,7 @@
>
<div class="col">
<q-card flat class="q-pa-md">
<div class="text-subtitle1 text-weight-bolder">訂購人資訊</div>
<div class="text-subtitle1 text-weight-bolder" ref="baseUserInfoTitle">訂購人資訊</div>
<q-separator color="grey-2" class="q-my-md" />
<div class="row q-col-gutter-md">
<div :class="filedWidth">
......@@ -55,26 +55,13 @@
label="國家/地區"
standout
/>
</div>
<div :class="filedWidth">
<q-input
standout
v-model="parameters.Mobile"
label="電話"
:rules="[(val) => !!val && val.length == 11 || '請輸正確電話']"
ref="Mobile"
>
<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 || '請輸入郵箱地址']"
:rules="[(val) => /^[a-zA-Z0-9]+([-_.][A-Za-zd]+)*@([a-zA-Z0-9]+[-.])+[A-Za-zd]{2,5}$/.test(val) || '請輸入正確的郵箱地址']"
ref="mail"
/>
</div>
......@@ -82,7 +69,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">旅客資料</div>
<div class="text-subtitle1 text-weight-bolder q-mb-md" ref="passengerInformation">旅客資料</div>
<div class="row">
<vue-core-video-players
......@@ -167,6 +154,8 @@
placeholder="例:WeChat"
:rules="[(val) => !!val || '請輸联络方式']"
ref="ContactWay"
mask="X"
reverse-fill-mask
>
</q-input>
</div>
......@@ -177,6 +166,8 @@
label="電話"
:rules="[(val) => !!val && val.length == 11 || '請輸正確電話']"
ref="Mobile"
mask="#"
reverse-fill-mask
>
<template v-slot:prepend>
<div class="text-subtitle2">+{{ userInfo.areaCode }}</div>
......@@ -214,7 +205,12 @@
placeholder="例:航廈"
:rules="[(val) => !!val || '請輸航廈']"
ref="AirportTerminal"
/>
readonly>
<q-popup-proxy :offset="[0, 10]" ref="qDateProxy7">
<q-input type="textarea" dense standout autofocus
v-model="parameters.AirportTerminal" placeholder="請輸航廈" />
</q-popup-proxy>
</q-input>
</div>
<div :class="filedGuestWidth">
<q-input
......@@ -224,7 +220,12 @@
placeholder=""
:rules="[(val) => !!val || '請輸航空公司名稱']"
ref="AirLine"
/>
readonly>
<q-popup-proxy :offset="[0, 10]" ref="qDateProxy8">
<q-input type="textarea" dense standout autofocus
v-model="parameters.AirLine" placeholder="請輸航空公司名稱" />
</q-popup-proxy>
</q-input>
</div>
<div :class="filedGuestWidth">
<q-input
......@@ -234,6 +235,8 @@
placeholder="例:CA123"
:rules="[(val) => !!val || '請輸航班編號']"
ref="FlightNumber"
mask="X"
reverse-fill-mask
/>
</div>
<div :class="filedGuestWidth">
......@@ -302,11 +305,16 @@
v-model="parameters.GetonAddress"
label="上車地點"
placeholder=""
:rules="[(val) => !!val || '請輸上車地點和地址供司機參考']"
ref="GetonAddress">
:rules="[(val) => !!val || '請輸上車地點供司機參考']"
ref="GetonAddress"
readonly>
<template v-slot:append>
<q-icon name="iconfont iconaddress" size="20px" class="q-mr-sm" @click="getAddress(1)"/>
<!-- <q-icon name="iconfont iconaddress" size="20px" class="q-mr-sm" @click="getAddress(1)"/> -->
</template>
<q-popup-proxy :offset="[0, 10]" ref="qDateProxy5">
<q-input type="textarea" dense standout autofocus
v-model="parameters.GetonAddress" placeholder="請輸上車地點供司機參考" />
</q-popup-proxy>
</q-input>
</div>
<div :class="filedGuestWidth" v-if="details.CarType!=2">
......@@ -315,11 +323,16 @@
v-model="parameters.GetoffAddress"
label="下車地點"
placeholder=""
:rules="[(val) => !!val || '請輸下車地點和地址供司機參考']"
ref="GetoffAddress">
:rules="[(val) => !!val || '請輸下車地點供司機參考']"
ref="GetoffAddress"
readonly>
<template v-slot:append>
<q-icon name="iconfont iconaddress" size="20px" class="q-mr-sm" @click="getAddress(2)"/>
<!-- <q-icon name="iconfont iconaddress" size="20px" class="q-mr-sm" @click="getAddress(2)"/> -->
</template>
<q-popup-proxy :offset="[0, 10]" ref="qDateProxy6">
<q-input type="textarea" dense standout autofocus
v-model="parameters.GetoffAddress" placeholder="請輸下車地點供司機參考" />
</q-popup-proxy>
</q-input>
</div>
......@@ -334,31 +347,34 @@
<div class="row q-col-gutter-md">
<div :class="filedGuestWidth">
<q-input
type="Number"
standout
v-model="parameters.ManNum"
label="成人數(18-99岁)"
@input="getNum"
:rules="[(val) => !!val || '請輸成人數']"
ref="ManNum"
mask="#"
reverse-fill-mask
/>
</div>
<div :class="filedGuestWidth">
<q-input
type="Number"
standout
v-model="parameters.ChildNum"
label="兒童數(3-17岁)"
@input="getNum"
mask="#"
reverse-fill-mask
/>
</div>
<div :class="filedGuestWidth">
<q-input
type="Number"
standout
v-model="parameters.BabyNum"
label="嬰幼兒數(0-2岁)"
@input="getNum"
mask="#"
reverse-fill-mask
/>
</div>
......@@ -368,18 +384,20 @@
<div class="row q-col-gutter-md">
<div :class="filedGuestWidth">
<q-input
type="Number"
standout
v-model="parameters.HandLuggageNum"
label="手提行李"
mask="#"
reverse-fill-mask
/>
</div>
<div :class="filedGuestWidth">
<q-input
type="Number"
standout
v-model="parameters.RegisteredLuggageNum"
label="托运行李"
mask="#"
reverse-fill-mask
/>
</div>
......@@ -444,15 +462,15 @@
</div>
</div>
<div class="q-mt-md text-grey-6">
<div class="row q-pb-xs" v-if="AirportObj&&AirportObj.Name">
<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">{{AirportObj.Name}}</div>
</div>
<div class="row q-pb-xs" v-if="parameters.GetonAddress">
<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>
</div>
<div class="row q-pb-xs" v-if="parameters.GetoffAddress">
<div class="row q-pb-xs no-wrap" v-if="parameters.GetoffAddress">
<div style="width: 80px">下車點:</div>
<div class="q-ml-md ellipsis-2-lines">{{parameters.GetoffAddress}}</div>
</div>
......@@ -470,17 +488,17 @@
<div class="text-grey-9">
<div class="row q-mb-sm" v-if="chosenObj.Count>0">
<div class="col">{{CarObj.CarName}} x {{ chosenObj.Count }}</div>
<div>CNY {{ moneyFormat(sumPrice,2) }}</div>
<div>{{details.CurrencyCode}} {{ moneyFormat(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-subtitle2 text-weight-bolder text-primary">CNY {{ moneyFormat(sumPrice,2) }}</div>
<div class="text-subtitle2 text-weight-bolder text-primary">{{details.CurrencyCode}} {{ moneyFormat(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(sumPrice,2) }}</div>
</div>
</div>
<div class="text-right q-mt-md" v-if="step!=3">
......@@ -505,21 +523,34 @@
</div>
</q-card>
</q-dialog>
<div v-if="!orderKey || orderKey == ''" class="text-center q-my-xl">
<none-data
iconType="order"
title="沒有找到您的訂單信息哦"
subtitle="趕緊去挑選心儀的旅遊產品吧,三秒後自動跳轉到首頁"
></none-data>
</div>
</template>
<auth></auth>
</div>
</template>
<script>
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
componentsMap,
NoneData,
auth
},
data() {
return {
orderKey: "",
isRangeClick: true,
isShowDialog: false,
AddressObj: null,
......@@ -609,9 +640,18 @@
},
created() {},
mounted() {
if(this.$route.query.OrderDate){
let obj = decodeURIComponent(this.$route.query.OrderDate)
let OrderDate = JSON.parse(obj)
this.checkParamsHandler()
this.initCountry();
this.initGuestHandler();
},
methods: {
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,//日期
......@@ -620,7 +660,6 @@
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){
......@@ -632,11 +671,22 @@
this.parameters.Unit_Price = this.calculationAmount.originalB2CPrice
this.parameters.Num = this.chosenObj.Count
this.parameters.Money = this.sumPrice
if (OrderDate) {
this.orderKey = key;
}
}
}
} catch (error) {
console.log(error);
}
if (this.orderKey == "") {
setTimeout(() => {
this.initCountry();
this.initGuestHandler();
}, 3000);
}
return this.orderKey != "";
},
methods: {
submit(){
let flag = false
......@@ -648,6 +698,7 @@
this.$refs.Mobile.validate()
this.$refs.OrderDate.validate()
this.$refs.ManNum.validate()
if(this.details.CarType!=3){
this.$refs.AirportTerminal.validate()
this.$refs.AirLine.validate()
......@@ -673,9 +724,14 @@
&& !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
if(!flag) return this.goScrollToForm('baseUserInfoTitle')
this.SetCarOrder()
},
goScrollToForm(formName){
let temp=this.$refs[formName]
let formObj = temp instanceof Array ? temp[0] : temp
window.scrollTo(0,formObj.offsetTop)
},
SetCarOrder(){
this.loading = true
this.apipost(
......@@ -699,6 +755,15 @@
})
},
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",
{
......@@ -709,7 +774,7 @@
GoodsId: this.parameters.ProductId,//商品id
GoodsName: this.details.Name,//商品名称
GoodsPic: this.details.imgCover[0],//商品图片
GoodsType: this.parameters.OrderType,//商品类型(见枚举)
GoodsType: GoodsType,//商品类型(见枚举)
OrderMake: this.parameters.OrderDate,//订单摘要(例如出行时间)
TotalPrice: this.parameters.Money,//总价格
PreferentialPrice: 0,// 优惠总金额
......@@ -723,6 +788,13 @@
(r) => {
if (r.data.resultCode == 1) {
this.step = 3
this.$q.notify({
color: "green-4",
textColor: "white",
icon: "cloud_done",
message: "訂單提交成功",
position:'center',
});
}else{
this.$q.notify({
type: "negative",
......@@ -792,6 +864,7 @@
// 初始化国家
initCountry() {
this.apipost("GetCountryInfo_post", {}, (r) => {
if (r.data.resultCode == 1) {
this.countrys = r.data.data.countList;
this.userInfo.country = this.countrys[0].ID;
......@@ -801,26 +874,27 @@
let temp = this.countrys.find((y) => y.ID == x.ID);
x.EnName = `${temp.EnName}(${x.PhoneCode})`;
});
}
});
},
changeCountry(id) {
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;
......@@ -828,20 +902,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;
......@@ -849,13 +923,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>
<template>
<div style="min-height: 80vh">
<div
style="
position: fixed;
......@@ -22,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
......@@ -172,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>
......@@ -326,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
......@@ -597,10 +598,12 @@
</div>
</template>
</div>
<!-- <auth></auth> -->
</div>
</template>
<script>
import auth from "src/components/common/auth.vue";
import { slider, slideritem } from "vue-concise-slider";
import calendar from "../components/trip/calendar.vue";
import OrderPreview from "src/components/car/orderPreview.vue";
......@@ -729,7 +732,8 @@ export default {
smaple,
Trip,
block,
componentsMap
componentsMap,
auth,
},
watch: {
days: {
......
......@@ -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
);
},
},
};
......
......@@ -33,7 +33,7 @@ const routes = [{
component: () =>
import ('pages/detailsCar.vue')
}, { // 包车,接机下单
path: '/PickuporderForm',
path: '/PickuporderForm/:id',
component: () =>
import ('pages/Pickuporder/orderForm.vue')
}, { // 酒店
......
......@@ -3395,6 +3395,11 @@ dashdash@^1.12.0:
dependencies:
assert-plus "^1.0.0"
dayjs@^1.11.7:
version "1.11.7"
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.7.tgz#4b296922642f70999544d1144a2c25730fce63e2"
integrity sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==
de-indent@^1.0.2:
version "1.0.2"
resolved "https://registry.npmmirror.com/de-indent/-/de-indent-1.0.2.tgz"
......@@ -3618,6 +3623,13 @@ dom-serializer@^1.0.1:
domhandler "^4.2.0"
entities "^2.0.0"
dom7@^2.1.3:
version "2.1.5"
resolved "https://registry.yarnpkg.com/dom7/-/dom7-2.1.5.tgz#a79411017800b31d8400070cdaebbfc92c1f6377"
integrity sha512-xnhwVgyOh3eD++/XGtH+5qBwYTgCm0aW91GFgPJ3XG+jlsRLyJivnbP0QmUBFhI+Oaz9FV0s7cxgXHezwOEBYA==
dependencies:
ssr-window "^2.0.0"
domain-browser@^1.1.1:
version "1.2.0"
resolved "https://registry.npmmirror.com/domain-browser/-/domain-browser-1.2.0.tgz"
......@@ -8583,6 +8595,16 @@ sshpk@^1.7.0:
safer-buffer "^2.0.2"
tweetnacl "~0.14.0"
ssr-window@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/ssr-window/-/ssr-window-1.0.1.tgz#30752a6a4666e7767f0b7e6aa6fc2fdbd0d9b369"
integrity sha512-dgFqB+f00LJTEgb6UXhx0h+SrG50LJvti2yMKMqAgzfUmUXZrLSv2fjULF7AWGwK25EXu8+smLR3jYsJQChPsg==
ssr-window@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ssr-window/-/ssr-window-2.0.0.tgz#98c301aef99523317f8d69618f0010791096efc4"
integrity sha512-NXzN+/HPObKAx191H3zKlYomE5WrVIkoCB5IaSdvKokxTpjBdWfr0RaP+1Z5KOfDT0ZVz+2tdtiBkhsEQ9p+0A==
ssri@^6.0.1:
version "6.0.2"
resolved "https://registry.npmmirror.com/ssri/-/ssri-6.0.2.tgz"
......@@ -8894,6 +8916,19 @@ 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"
integrity sha512-se6I7PWWu950NAMXXT+ENtF/6SVb8mPyO+bTfNxbQBILSeLqsYp3Ndap+YOA0EczOIUlea274PKejT6gKZDseA==
dependencies:
dom7 "^2.1.3"
ssr-window "^1.0.1"
table@5.4.6:
version "5.4.6"
resolved "https://registry.npmmirror.com/table/-/table-5.4.6.tgz"
......@@ -9481,6 +9516,14 @@ vm-browserify@^1.0.1:
resolved "https://registry.npmmirror.com/vm-browserify/-/vm-browserify-1.1.2.tgz"
integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==
vue-awesome-swiper@^3.0.4:
version "3.1.3"
resolved "https://registry.yarnpkg.com/vue-awesome-swiper/-/vue-awesome-swiper-3.1.3.tgz#05500b501ffb3fec9bf7eb9985bcf4ae8360ed9e"
integrity sha512-E7suzkyApO8vNZbgdEnjSmnpsmQZyRvSVXJ7sey3XYwKPOkLhH3+GnHroBw+5PZIQXvWBwdCeQsPG1xQ1r1Rhg==
dependencies:
object-assign "^4.1.1"
swiper "^4.0.7"
vue-concise-slider@^4.2.5:
version "4.2.5"
resolved "https://registry.yarnpkg.com/vue-concise-slider/-/vue-concise-slider-4.2.5.tgz#4ff799e91b8148041ede12d1d3d994fdd5f8e354"
......@@ -9584,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