Commit 0f92e232 authored by 吴春's avatar 吴春

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

parents df15a353 03f3b4a6
...@@ -135,7 +135,7 @@ Vue.prototype.apiJavaPost = function(cmd, msg, successCall, faildCall) { ...@@ -135,7 +135,7 @@ Vue.prototype.apiJavaPost = function(cmd, msg, successCall, faildCall) {
var GroupId = 0; var GroupId = 0;
if (this.getLocalStorage() != null) { if (this.getLocalStorage() != null) {
token = this.getLocalStorage().token; token = this.getLocalStorage().token;
key = this.getLocalStorage().secretKey; key = '' //this.getLocalStorage().secretKey;
} }
if (localStorage.groupinfo && localStorage.groupinfo != 'undefined') { if (localStorage.groupinfo && localStorage.groupinfo != 'undefined') {
var groupJson = JSON.parse(localStorage.groupinfo); var groupJson = JSON.parse(localStorage.groupinfo);
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
left:0px; left:0px;
} }
.wrapper input:checked + label { .wrapper input:checked + label {
background:green; background:#66D344;
} }
.wrapper input:checked + label::before { .wrapper input:checked + label::before {
left: calc(100%); left: calc(100%);
......
<template> <template>
<q-card flat class="q-pa-md q-mt-lg"> <q-card flat class="q-pa-md q-mt-lg" v-if="coupons">
<div class="row items-center"> <div class="row items-center">
<div class="text-subtitle1 text-weight-bolder q-mb-md col"> <div class="text-subtitle1 text-weight-bolder q-mb-md col">
<span>優惠券</span> <span>優惠券</span>
<span class="text-weight-regular q-ml-sm text-body2">(可用優惠券 0 張)</span> <span class="text-weight-regular q-ml-sm text-body2">(可用優惠券 {{ coupons.length }} 張)</span>
</div> </div>
<q-toggle v-model="showDisable" label="顯示不可用優惠券" style="zoom:0.8;margin-top: -24px;" v-if="isExplends"/> <!-- <q-toggle v-model="showDisable" label="顯示不可用優惠券" style="zoom:0.8;margin-top: -24px;" v-if="isExplends"/> -->
<q-icon :name="isExplends?'keyboard_arrow_up':'keyboard_arrow_down'" @click="$event=>isExplends=!isExplends" size="32px" color="grey-9" class="q-ml-md cursor-pointer" style="margin-top:-10px;"/> <q-icon :name="isExplends?'keyboard_arrow_up':'keyboard_arrow_down'" @click="$event=>isExplends=!isExplends" size="32px" color="grey-9" class="q-ml-md cursor-pointer" style="margin-top:-10px;"/>
</div> </div>
<div v-if="isExplends"> <div v-if="isExplends">
<div class="row q-col-gutter-md"> <div class="row q-col-gutter-md">
<div :class="filedWidth"> <div :class="filedWidth" v-for="(x,i) in coupons" :key="i">
<div class="cursor-pointer"> <div class="cursor-pointer" :class="{'unUsed':currentPrice<x.useCondition}">
<div class="coupon-head"> <div class="coupon-head">
<div class="check-tools"> <div class="check-tools" v-if="currentPrice>=x.useCondition">
<q-checkbox v-model="chosenCouponId" :value="1" dense color="teal" /> {{ x.couponId }}
<q-checkbox v-model="chosenCouponId" :val="x.couponId" label="" dense color="teal" />
{{ chosenCouponId }}
</div> </div>
<div class="q-pa-lg q-mt-lg"> <div class="q-pa-lg q-mt-lg">
<div class="row items-center"> <div class="row items-center">
<div class="text-h4 text-weight-bold text-white col"> <div class="text-h4 text-weight-bold text-white col" v-if="x.couponsType==1">
{{ moneyFormat(500,2) }} {{ moneyFormat(x.denomination,2) }}
</div> </div>
<div class=" f12 text-white">滿 2000 可用</div> <div class="text-h4 text-weight-bold text-white col" v-if="x.couponsType==2">
{{ x.denomination }}
<span class="q-ml-sm text-weight-thin text-subtitle1"></span>
</div>
<div class=" f12 text-white">滿 {{ x.useCondition }} 可用</div>
</div> </div>
<div class="q-mt-sm f12" style="color:#195954">有效期至:2023.02.30</div> <div class="q-mt-sm f12" style="color:#195954">有效期至:{{ x.expirationDate}}</div>
</div> </div>
</div> </div>
<div class="q-px-lg q-py-md coupon-content"> <div class="q-px-lg q-py-md coupon-content">
...@@ -34,12 +40,12 @@ ...@@ -34,12 +40,12 @@
</div> </div>
<div class="row q-mt-sm"> <div class="row q-mt-sm">
<div class="col-5">使用品類:</div> <div class="col-5">使用品類:</div>
<div class="">多日遊行程適用</div> <div class="">{{ x.rangeName }}</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div :class="filedWidth"> <!-- <div :class="filedWidth">
<div class="unUsed"> <div class="unUsed">
<div class="coupon-head"> <div class="coupon-head">
<div class="q-pa-lg q-mt-lg"> <div class="q-pa-lg q-mt-lg">
...@@ -63,9 +69,9 @@ ...@@ -63,9 +69,9 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div> -->
</div> </div>
<div class="text-center q-mt-lg" v-if="1==2"> <div class="text-center q-mt-lg" v-if="coupons.length==0">
<p> <p>
<img src="~assets/sad.svg" style="width: 50px" /> <img src="~assets/sad.svg" style="width: 50px" />
</p> </p>
...@@ -76,8 +82,21 @@ ...@@ -76,8 +82,21 @@
</template> </template>
<script> <script>
import EnumHelper from 'src/utils/enumhelper';
import ProductTypeEnum from 'src/utils/producttypeenum';
import {date} from 'quasar'
export default { export default {
props:["goodsInfo"], props:{
productType:{
type:Number,
required:true
},
currentPrice:{
type:Number,
required:false,
default:0
}
},
computed: { computed: {
filedWidth() { filedWidth() {
return { return {
...@@ -90,13 +109,43 @@ export default { ...@@ -90,13 +109,43 @@ export default {
return { return {
showDisable:false, showDisable:false,
isExplends:false, isExplends:false,
chosenCouponId:false chosenCouponId:[],
couponsUseScope:1,
coupons:null
}; };
}, },
created() {
this.couponsUseScope = this.productType+1
this.getProductCouponHandler()
},
methods: { methods: {
changeDiscountHandler(){ changeDiscountHandler(x){
} },
getProductCouponHandler(){
this.apiJavaPost(
"/api/b2b/user/getUserCanUseCouponList",
{
lineId:0,
lineteamId:0,
CouponsUseScope:this.couponsUseScope
},
res => {
this.coupons = res.data.data
if(this.coupons && this.coupons.length>0){
this.coupons.forEach(x=>{
x.rangeName = EnumHelper.ParseToEnum(ProductTypeEnum,this.couponsUseScope,'value').desc
x.expirationDate = date.formatDate(x.expirationDate,'YYYY.MM.DD')
})
this.isExplends = this.coupons.length>0
}else{
this.coupons = []
}
},
null
);
},
}, },
} }
</script> </script>
......
...@@ -266,7 +266,7 @@ color: #EE4454; ...@@ -266,7 +266,7 @@ color: #EE4454;
</q-btn> </q-btn>
<q-btn label="帮助中心" flat></q-btn> <q-btn label="帮助中心" flat></q-btn>
<q-btn v-if="LoginUser.id <= 0" label="注册" flat></q-btn> <q-btn v-if="LoginUser.id <= 0" label="注册" flat></q-btn>
<template v-if="LoginUser.id > 0"> <template v-if="LoginUser.token">
<q-btn-dropdown <q-btn-dropdown
style="color: #444; font-weight: bold" style="color: #444; font-weight: bold"
class="q-ml-lg" class="q-ml-lg"
...@@ -703,7 +703,7 @@ export default { ...@@ -703,7 +703,7 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.isPic = this.isPic =
document.URL.indexOf("localhost") != -1 || document.URL.indexOf("localhost") != -1 ||
document.URL.indexOf("t.oytour.com") != -1; document.URL.indexOf("www.oytour.com") != -1;
}); });
}, },
err => {} err => {}
......
...@@ -117,15 +117,18 @@ export default { ...@@ -117,15 +117,18 @@ export default {
}, },
created() { created() {
this.prices = this.priceList; this.prices = this.priceList;
console.log(this.prices)
this.init(); this.init();
}, },
methods: { methods: {
init() { init() {
this.createChosenDateHandler(); this.createChosenDateHandler();
let firstMonth = date.formatDate( let firstMonth = date.formatDate(
new Date(this.prices[0].startDate), new Date(this.prices[0].startDate),
"YYYY/MM" "YYYY/MM"
); );
console.log(firstMonth)
let current = this.months.findIndex((x) => x.monthValue == firstMonth) let current = this.months.findIndex((x) => x.monthValue == firstMonth)
this.currentMonth = current>-1?current:0; this.currentMonth = current>-1?current:0;
this.changeMonthHandler(); this.changeMonthHandler();
......
...@@ -504,9 +504,10 @@ export default { ...@@ -504,9 +504,10 @@ export default {
let order = { let order = {
configId:this.travel.id, configId:this.travel.id,
tcid:this.p.tcid, tcid:this.p.tcid,
startCityId:this.currentUnionCity?this.currentUnionCity.cityId:this.travel.startCityId, startCityId:this.currentUnionCity && this.currentUnionCity.cityId ?this.currentUnionCity.cityId:this.travel.startCityId,
orderInfo:this.chosenObj orderInfo:this.chosenObj
} }
let key = this.$md5(JSON.stringify(order)) let key = this.$md5(JSON.stringify(order))
let lineCars = localStorage.getItem('lineCars') let lineCars = localStorage.getItem('lineCars')
lineCars = lineCars?JSON.parse(lineCars):[] lineCars = lineCars?JSON.parse(lineCars):[]
......
...@@ -99,6 +99,9 @@ ...@@ -99,6 +99,9 @@
.f20 { .f20 {
font-size: 20px; font-size: 20px;
} }
.f22 {
font-size: 22px;
}
.f26 { .f26 {
font-size: 26px; font-size: 26px;
} }
......
...@@ -439,7 +439,7 @@ export default { ...@@ -439,7 +439,7 @@ export default {
} }
} }
this.$nextTick(()=>{ this.$nextTick(()=>{
this.isPic = document.URL.indexOf("localhost")!=-1||document.URL.indexOf("t.oytour.com")!=-1 this.isPic = document.URL.indexOf("localhost")!=-1||document.URL.indexOf("www.oytour.com")!=-1
}); });
}, },
(err) => {} (err) => {}
......
...@@ -306,7 +306,7 @@ ...@@ -306,7 +306,7 @@
/> />
</q-card> </q-card>
<coupon></coupon> <coupon v-if="price && price.tcid" :product-type="productType" :current-price="sumPrice"></coupon>
</div> </div>
<div <div
class="relative-position" class="relative-position"
...@@ -458,6 +458,8 @@ import coupon from "../../components/common/coupon.vue"; ...@@ -458,6 +458,8 @@ import coupon from "../../components/common/coupon.vue";
import NoneData from "src/components/common/noneData.vue"; import NoneData from "src/components/common/noneData.vue";
import auth from "src/components/common/auth.vue"; import auth from "src/components/common/auth.vue";
import {date} from 'quasar' import {date} from 'quasar'
import ProductTypeEnum from '../../utils/producttypeenum'
import EnumHelper from '../../utils/enumhelper'
export default { export default {
components: { components: {
coupon, coupon,
...@@ -546,7 +548,8 @@ export default { ...@@ -546,7 +548,8 @@ export default {
unionCity: null, unionCity: null,
sumPrice:0, sumPrice:0,
submiting:false, submiting:false,
CouponIds:[] CouponIds:[],
productType:0
}; };
}, },
computed: { computed: {
...@@ -564,6 +567,7 @@ export default { ...@@ -564,6 +567,7 @@ export default {
} }
}, },
created() { created() {
if (this.checkParamsHandler()) { if (this.checkParamsHandler()) {
this.initGuestHandler(); this.initGuestHandler();
this.getTripData(); this.getTripData();
...@@ -594,6 +598,8 @@ export default { ...@@ -594,6 +598,8 @@ export default {
} }
this.submiting=false this.submiting=false
}, },
submitOrderHandler(){ submitOrderHandler(){
let msg={ let msg={
OrderId:0, OrderId:0,
...@@ -702,7 +708,7 @@ export default { ...@@ -702,7 +708,7 @@ export default {
GoodsId:this.order.order.tcid, GoodsId:this.order.order.tcid,
GoodsName:this.trip.title, GoodsName:this.trip.title,
GoodsPic:this.trip.imgCover[0].Url, GoodsPic:this.trip.imgCover[0].Url,
GoodsType:this.price.teamType==0?2:(this.price.teamType==2?1:3), GoodsType:this.productType,
OrderMake:`${ this.unionCity && this.unionCity.goFlight? this.unionCity.goFlight.startDate :this.price.startDate}${this.unionCity?this.unionCity.cityName:this.trip.startCityName }出發 ${guestInfo}`, 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, TotalPrice:this.sumPrice,
PreferentialPrice:this.chosenObj.discountPrice, PreferentialPrice:this.chosenObj.discountPrice,
...@@ -721,6 +727,9 @@ export default { ...@@ -721,6 +727,9 @@ export default {
} }
}) })
}, },
getProductTypeHandler(){
return (this.price.teamType==0?ProductTypeEnum.TEAM_TRIP:(this.price.teamType==2?ProductTypeEnum.ONE_DAY:ProductTypeEnum.UNIT_TRIP)).value
},
goPayHandler(pay){ goPayHandler(pay){
let key = this.$md5(JSON.stringify(pay)) let key = this.$md5(JSON.stringify(pay))
let pays = localStorage.getItem('pays') let pays = localStorage.getItem('pays')
...@@ -886,6 +895,7 @@ export default { ...@@ -886,6 +895,7 @@ export default {
}, },
getTripData() { getTripData() {
this.$q.loading.show(); this.$q.loading.show();
let msg = { let msg = {
cityId: this.order.order.startCityId, cityId: this.order.order.startCityId,
...@@ -904,8 +914,8 @@ export default { ...@@ -904,8 +914,8 @@ export default {
this.trip = r.data.data; this.trip = r.data.data;
this.trip.imgCover = JSON.parse(this.trip.imgCover); this.trip.imgCover = JSON.parse(this.trip.imgCover);
this.price = this.trip.priceList[0]; this.price = this.trip.currentPriceInfo;
if(this.order.order.startCityId!=this.trip.startCityId){ if(this.order.order.startCityId && this.order.order.startCityId!=this.trip.startCityId){
this.unionCity = this.price.unionCityList.find(x=>x.cityId == this.order.order.startCityId) this.unionCity = this.price.unionCityList.find(x=>x.cityId == this.order.order.startCityId)
if(this.unionCity.backFlight && this.unionCity.backFlight.addPrice){ if(this.unionCity.backFlight && this.unionCity.backFlight.addPrice){
this.price.originalB2CPrice+=this.unionCity.backFlight.addPrice this.price.originalB2CPrice+=this.unionCity.backFlight.addPrice
...@@ -915,8 +925,8 @@ export default { ...@@ -915,8 +925,8 @@ export default {
} }
} }
this.calcMoney() this.calcMoney()
this.productType=this.getProductTypeHandler()
} else { } else {
this.$q.notify({ this.$q.notify({
type: "negative", type: "negative",
......
...@@ -98,14 +98,13 @@ ...@@ -98,14 +98,13 @@
color="blue" color="blue"
unelevated unelevated
outline outline
@click="isShowDialog = true" @click="addAddress"
label="添加郵寄地址" ><img class="q-mr-sm" style="width: 28px;" src="../../assets/img/address-add.png" />添加郵寄地址</q-btn>
></q-btn>
</div> </div>
</div> </div>
<q-dialog content-style="width: 900px" v-model="isShowDialog"> <q-dialog content-style="width: 900px" v-model="isShowDialog">
<div class="bg-white dialog-box" style="width: 800px; padding: 20px"> <div class="bg-white dialog-box" style="width: 800px; padding: 20px">
<div>添加邮寄地址</div> <div class="f22 bold">{{form.Id ? '编辑': '添加'}}邮寄地址</div>
<form @submit.prevent.stop="submit" class="q-gutter-md"> <form @submit.prevent.stop="submit" class="q-gutter-md">
<div> <div>
<div class="row"> <div class="row">
...@@ -126,6 +125,8 @@ ...@@ -126,6 +125,8 @@
<div class="title">選擇手機區號</div> <div class="title">選擇手機區號</div>
<q-select <q-select
ref="AreaCode" ref="AreaCode"
emit-value
map-options
square square
outlined outlined
option-value="ID" option-value="ID"
...@@ -154,6 +155,8 @@ ...@@ -154,6 +155,8 @@
<div class="col"> <div class="col">
<div class="title">國家/地區</div> <div class="title">國家/地區</div>
<q-select <q-select
emit-value
map-options
ref="CountryId" ref="CountryId"
square square
outlined outlined
...@@ -244,6 +247,12 @@ export default { ...@@ -244,6 +247,12 @@ export default {
this.getCountryInfo(); this.getCountryInfo();
}, },
methods: { methods: {
addAddress() {
this.isShowDialog = true
this.form = {
Name: "",
Mobile: "",}
},
getCountryInfo() { getCountryInfo() {
this.apipost( this.apipost(
"GetCountryInfo_post", "GetCountryInfo_post",
...@@ -322,6 +331,7 @@ export default { ...@@ -322,6 +331,7 @@ export default {
editUser(item) { editUser(item) {
console.log("editUser", item); console.log("editUser", item);
this.form = {...item}; this.form = {...item};
this.form.AreaCode = Number(this.form.AreaCode)
this.form.IsDefault = this.form.IsDefault === 1 this.form.IsDefault = this.form.IsDefault === 1
this.isShowDialog = true; this.isShowDialog = true;
}, },
...@@ -355,8 +365,8 @@ export default { ...@@ -355,8 +365,8 @@ export default {
}, },
submitUserInfo() { submitUserInfo() {
let params = { ...this.form }; let params = { ...this.form };
params.AreaCode = params.AreaCode.ID; // params.AreaCode = params.AreaCode.ID;
params.CountryId = params.CountryId.ID; // params.CountryId = params.CountryId.ID;
params.IsDefault = params.IsDefault ? 1 : 2; params.IsDefault = params.IsDefault ? 1 : 2;
this.apipost( this.apipost(
"b2c_post_SetMailingAddressInfo", "b2c_post_SetMailingAddressInfo",
......
...@@ -93,6 +93,8 @@ ...@@ -93,6 +93,8 @@
<div class="col"> <div class="col">
<div class="title">居住國家/地區</div> <div class="title">居住國家/地區</div>
<q-select <q-select
emit-value
map-options
ref="Country" ref="Country"
square square
outlined outlined
...@@ -108,6 +110,8 @@ ...@@ -108,6 +110,8 @@
<div class="col"> <div class="col">
<div class="title">稱謂</div> <div class="title">稱謂</div>
<q-select <q-select
emit-value
map-options
ref="Appellation" ref="Appellation"
square square
outlined outlined
...@@ -126,6 +130,8 @@ ...@@ -126,6 +130,8 @@
<div class="col"> <div class="col">
<div class="title">國家/地區代碼</div> <div class="title">國家/地區代碼</div>
<q-select <q-select
emit-value
map-options
ref="PhoneCountry" ref="PhoneCountry"
square square
outlined outlined
......
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
width: 900px; width: 900px;
} }
.title { .title {
margin-top: 20px; margin: 20px 10px 10px 10px;
margin-bottom: 10px;
} }
.card { .card {
margin: 10px; margin: 10px;
...@@ -75,6 +74,12 @@ ...@@ -75,6 +74,12 @@
background-color: $primary; background-color: $primary;
margin: -8px auto 0 auto; margin: -8px auto 0 auto;
} }
.card-info {
height: 20px;
padding: 0 4px;
background: #DDDDDD;
border-radius: 8px;
}
</style> </style>
<template> <template>
<div class="content q-ma-lg bg-white"> <div class="content q-ma-lg bg-white">
...@@ -98,17 +103,32 @@ ...@@ -98,17 +103,32 @@
</div> </div>
</div> </div>
</div> </div>
<q-btn <div class="q-pa-sm full-width">
<q-btn class="full-width"
color="primary" color="primary"
unelevated unelevated
outline outline
@click="isShowDialog = true" @click="addUser"
label="添加出行人" ><img class="q-mr-sm" style="width: 28px;" src="../../assets/img/add.png" />添加出行人</q-btn>
></q-btn> </div>
<div class="mt flex justify-end">
<q-pagination
v-model="current"
:max="pageCount"
direction-links
color="primary"
active-color="primary"
:max-pages="5"
@input="pageChange"
/>
</div>
<q-dialog content-style="width: 900px" v-model="isShowDialog"> <q-dialog content-style="width: 900px" v-model="isShowDialog">
<div class="bg-white dialog-box" style="width: 800px; padding: 20px"> <div class="bg-white dialog-box" style="width: 800px; padding: 20px">
<div>添加邮寄地址</div> <div class="f22 bold">{{form.Id ? '编辑': '新增'}}出行人信息</div>
<form @submit.prevent.stop="submit" class="q-gutter-md"> <form @submit.prevent.stop="submit" class="q-gutter-md">
<div> <div>
<div class="row"> <div class="row">
...@@ -164,43 +184,53 @@ ...@@ -164,43 +184,53 @@
<div class="col"> <div class="col">
<div class="title">國家/地區代碼</div> <div class="title">國家/地區代碼</div>
<q-select <q-select
ref="PhoneCountry" emit-value
map-options
ref="AreaCode"
square square
outlined outlined
option-value="ID" option-value="ID"
option-label="PhoneCode" option-label="PhoneCode"
class="form-item" class="form-item"
v-model="form.PhoneCountry" v-model="form.AreaCode"
:options="phoneCountList" :options="phoneCountList"
placeholder="Filled" placeholder="请选择國家/地區代碼"
:rules="[(val) => Boolean(val) || '请选择國家/地區代碼']" :rules="[(val) => Boolean(val) || '请选择國家/地區代碼']"
/> />
</div> </div>
<div class="col"> <div class="col">
<div class="title">電話(首次需驗證)</div> <div class="title">手機號</div>
<q-input <q-input
ref="Mobile" ref="Mobile"
class="form-item" class="form-item"
placeholder="電話(首次需驗證)" placeholder="手機號"
v-model="form.Mobile" v-model="form.Mobile"
outlined outlined
:rules="[(val) => !!val || '请输入電話(首次需驗證)']" :rules="[(val) => !!val || '请输入手機號']"
></q-input> ></q-input>
</div> </div>
</div> </div>
<div
<div
v-for="(item, index) in form.CardList" v-for="(item, index) in form.CardList"
:key="item.id" :key="item.id">
<div class="flex justify-between ml mr q-mt-lg" style="margin-bottom: -10px"><span class="card-info">证件信息#{{index+ 1}}</span>
<div v-if="index > 0" @click="deleteCardItem(item)">
<i class="iconfont iconline"></i>
<i class="iconfont icondelete"></i>
</div>
</div>
<div
class="row" class="row"
> >
<div class="col"> <div class="col">
<div class="title">证件类型</div> <div class="title">证件类型</div>
<q-select <q-select
emit-value
map-options
ref="card" ref="card"
square square
outlined outlined
option-value="ID" option-value="Id"
option-label="Name" option-label="Name"
class="form-item" class="form-item"
v-model="item.Type" v-model="item.Type"
...@@ -212,25 +242,23 @@ ...@@ -212,25 +242,23 @@
<div class="col"> <div class="col">
<div class="title flex justify-between items-center"> <div class="title flex justify-between items-center">
<div>证件号码</div> <div>证件号码</div>
<div v-if="index > 0" @click="deleteCardItem(item)">删除</div>
</div> </div>
<q-input <q-input
class="form-item" class="form-item"
placeholder="電話(首次需驗證)" placeholder="证件号码"
v-model="item.CardNo" v-model="item.CardNo"
outlined outlined
:rules="[(val) => !!val || '请输入電話(首次需驗證)']" :rules="[(val) => !!val || '请输入证件号码']"
></q-input> ></q-input>
</div> </div>
</div> </div></div>
<q-btn <q-btn class="ml"
color="primary" color="primary"
@click="addCard" @click="addCard"
unelevated unelevated
outline outline
label="新增证件" ><img class="q-mr-sm" style="width: 28px;" src="../../assets/img/add.png" />新增证件</q-btn>
/> <div class="mt flex flex-center">
<div>
<q-btn color="primary" type="submit" unelevated label="保存" /> <q-btn color="primary" type="submit" unelevated label="保存" />
</div> </div>
</div> </div>
...@@ -243,6 +271,8 @@ ...@@ -243,6 +271,8 @@
export default { export default {
data() { data() {
return { return {
current: 1,
pageCount: 0,
isShowDialog: false, isShowDialog: false,
selectedKey: "全部", selectedKey: "全部",
form: { form: {
...@@ -270,6 +300,22 @@ export default { ...@@ -270,6 +300,22 @@ export default {
this.getCardTypeList(); this.getCardTypeList();
}, },
methods: { methods: {
pageChange(value) {
console.log('pageChange', value)
this.current = value
this.getUsersList()
},
addUser() {
this.isShowDialog = true
this.form = {
SurName: "",
Name: "",
EnName: "",
EnSurName: "",
Mobile: "",
CardList: [],}
this.addCard()
},
getCardTypeList() { getCardTypeList() {
this.apipost( this.apipost(
"b2c_post_GetTripCardEnumList", "b2c_post_GetTripCardEnumList",
...@@ -277,6 +323,8 @@ export default { ...@@ -277,6 +323,8 @@ export default {
(res) => { (res) => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.cardList = res.data.data; this.cardList = res.data.data;
this.cardList.forEach(item => item.Id = Number(item.Id));
console.log('this.cardList', this.cardList)
} else { } else {
// this.$notify(res.data.message); // this.$notify(res.data.message);
this.$q.notify({ this.$q.notify({
...@@ -298,7 +346,7 @@ export default { ...@@ -298,7 +346,7 @@ export default {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
const { phoneCountList, countList } = res.data.data; const { phoneCountList, countList } = res.data.data;
this.countList = countList; this.countList = countList;
this.phoneCountList = phoneCountList; this.phoneCountList = phoneCountList
} else { } else {
// this.$notify(res.data.message); // this.$notify(res.data.message);
this.$q.notify({ this.$q.notify({
...@@ -319,6 +367,7 @@ export default { ...@@ -319,6 +367,7 @@ export default {
this.id++; this.id++;
this.form.CardList.push({ this.form.CardList.push({
id: this.id, id: this.id,
Type: '',
}); });
}, },
deleteCardItem(card) { deleteCardItem(card) {
...@@ -333,6 +382,7 @@ export default { ...@@ -333,6 +382,7 @@ export default {
"EnName", "EnName",
"EnSurName", "EnSurName",
"Mobile", "Mobile",
"AreaCode",
]; ];
verifyArr.forEach((item) => { verifyArr.forEach((item) => {
console.log("this.$refs[item]", this, item, this.$refs[item]); console.log("this.$refs[item]", this, item, this.$refs[item]);
...@@ -349,16 +399,31 @@ export default { ...@@ -349,16 +399,31 @@ export default {
if (this.formHasError) { if (this.formHasError) {
return; return;
} }
for(let i = 0; i < this.form.CardList.length; i++) {
let item = this.form.CardList[i]
if(!item.Type || !item.CardNo) {
// this.$notify(res.data.message);
this.$q.notify({
type: "negative",
message: '证件信息不完善,请补充',
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
return
}
}
this.submitUserInfo(); this.submitUserInfo();
}, },
getUsersList() { getUsersList() {
this.apipost( this.apipost(
"b2c_post_GetTripGuestPageList", "b2c_post_GetTripGuestPageList",
{pageIndex: 1, pageSize: 20}, {pageIndex: this.current, pageSize: 10},
(res) => { (res) => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
const { count, pageData } = res.data.data; const { count, pageData, pageCount } = res.data.data;
this.count = count; this.count = count;
this.pageCount = pageCount
this.pageData = pageData; this.pageData = pageData;
} else { } else {
// this.$notify(res.data.message); // this.$notify(res.data.message);
...@@ -375,7 +440,8 @@ export default { ...@@ -375,7 +440,8 @@ export default {
}, },
editUser(item) { editUser(item) {
console.log('editUser', item) console.log('editUser', item)
this.form = item this.form = {...item}
this.form.AreaCode = Number(this.form.AreaCode)
this.isShowDialog = true this.isShowDialog = true
}, },
deleteUser(item) { deleteUser(item) {
...@@ -392,6 +458,7 @@ export default { ...@@ -392,6 +458,7 @@ export default {
position: "top", position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时 timeout: 2000, // 以毫秒为单位; 0意味着没有超时
}); });
this.current = 1
this.getUsersList(); this.getUsersList();
} else { } else {
// this.$notify(res.data.message); // this.$notify(res.data.message);
...@@ -408,10 +475,9 @@ export default { ...@@ -408,10 +475,9 @@ export default {
}, },
submitUserInfo() { submitUserInfo() {
let params = { ...this.form }; let params = { ...this.form };
params.PhoneCountry = params.PhoneCountry.ID; // params.CardList.forEach(item => {
params.CardList.forEach(item => { // item.Type = item.Type.Id
item.Type = item.Type.Id // })
})
this.apipost( this.apipost(
"b2c_post_SetTripGuestInfo", "b2c_post_SetTripGuestInfo",
params, params,
......
const EnumHelper = {
ParseToEnum(TEnum, value, comparison = '') {
if (Object.isFrozen) {
let t = Object.values(TEnum)
console.log(t, Symbol(1) == 1)
let r = t.find(x => (comparison != '' && x[comparison] == value) || (comparison == '' && x == value))
return r
} else {
throw new Error("这不是一个枚举类型");
}
}
}
export default EnumHelper
\ No newline at end of file
const ProductTypeEnum = Object.freeze({
/**
* 一日游
*/
ONE_DAY: {
value: 1,
desc: '一日游产品'
},
/**
* 多日游
*/
TEAM_TRIP: {
value: 2,
desc: '多日游产品'
},
/**
* 小包团
*/
UNIT_TRIP: {
value: 3,
desc: '小包团产品'
},
/**
* 景点门票
*/
SCENIC_SPOT: {
value: 4,
desc: '景点门票产品'
},
/**
* 主题乐园
*/
THEME_PART: {
value: 5,
desc: '主题乐园门票'
},
/**
* 博物馆
*/
MUSEUM: {
value: 6,
desc: '博物馆门票'
},
/**
* 历史景点
*/
HISTORY: {
value: 7,
desc: '历史景点门票'
},
/**
* 温泉酒店
*/
HOT_SPRING: {
value: 8,
desc: '温泉酒店产品'
},
/**
* 星级酒店
*/
STAR_HOTEL: {
value: 9,
desc: '星级酒店产品'
},
/**
* 度假酒店
*/
RESORT_HOTEL: {
value: 10,
desc: '度假酒店产品'
},
/**
* 民宿
*/
HOMESTAY: {
value: 11,
desc: '民宿产品'
},
/**
* 包车
*/
CHARTER: {
value: 12,
desc: '包车产品'
},
/**
* 接机
*/
PICK_UP: {
value: 13,
desc: '接机产品'
},
/**
* 送机
*/
DROP_OFF: {
value: 14,
desc: '送机产品'
}
})
export default ProductTypeEnum
\ 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