Commit 03f3b4a6 authored by 罗超's avatar 罗超

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

parents 15ca8469 cbe70c63
<template>
<div class='wrapper'>
<input type="checkbox" :checked="inputSelect" @change="changeSelect" id='checkLabel'>
<label for="checkLabel"></label>
</div>
</template>
<style scoped>
.wrapper {
display: inline-block;
}
.wrapper input{
display:none;
}
.wrapper label{
position: relative;
background:grey;
cursor:pointer;
width: 50px;
height: 30px;
border-radius: 100px;
display:block;
}
.wrapper label::before {
content:'';
position: absolute;
/* display:block; */
width:30px;
height:30px;
border-radius: 30px;
background:white;
transition: all 0.36s;
top:0px;
left:0px;
}
.wrapper input:checked + label {
background:#66D344;
}
.wrapper input:checked + label::before {
left: calc(100%);
transform: translateX(-100%);
transition: all .36s cubic-bezier(.78, .14, .15, .86);
}
</style>
<script>
export default {
props: {
value: {
default: false
}
},
data() {
return {
inputSelect: false
}
},
watch: {
value: function() {
this.inputSelect = this.value
}
},
methods: {
changeSelect() {
this.inputSelect = !this.inputSelect
console.log('changeSelect', this.inputSelect, this.value)
this.$emit('input', this.inputSelect)
}
}
}
</script>
\ No newline at end of file
<template> <template>
<div class="column full-height"> <div class="column full-height">
<div class="col"> <div class="col">
<div class="text-right"> <div class="text-right" v-if="$q.platform.is.desktop">
<q-btn <q-btn
color="primary" color="primary"
icon="refresh" icon="refresh"
...@@ -13,44 +13,32 @@ ...@@ -13,44 +13,32 @@
<template v-if="dataList.CarType!=3"> <template v-if="dataList.CarType!=3">
<div class="text-grey-6 f12 q-my-md">選擇機場</div> <div class="text-grey-6 f12 q-my-md">選擇機場</div>
<div class="row wrap"> <div class="row wrap">
<q-btn @click="handleSelect(item,1)" <div v-for="(x,i) in dataList.AirportList" :key="i">
:color="selectedAirportObj&&item.Id === selectedAirportObj.Id?'primary':'grey-5'" <q-chip size="14px" clickable @click="handleSelect(x,1)"
unelevated :text-color="selectedAirportObj&&selectedAirportObj.Id==x.Id?'white':'dark'"
class="car-tag mr" :color="selectedAirportObj&&selectedAirportObj.Id==x.Id?'primary':'grey-3'" square>{{ x.AirportName }}</q-chip>
v-for="item in AirportList" </div>
:key="item.Id"
>
{{ item.AirportName }}
</q-btn>
</div> </div>
</template> </template>
<div class="row"> <div class="row no-wrap">
<div v-if="dataList.CarType!=1"> <div v-if="dataList.CarType!=1" :class="{'col':dataList.PlaceList.length>2}">
<div class="text-grey-6 f12 q-my-md">選擇上車範圍</div> <div class="text-grey-6 f12 q-my-md">選擇上車範圍</div>
<div class="row wrap"> <div class="row wrap">
<q-btn @click="handleSelect(item,3)" <div v-for="(x,i) in dataList.PlaceList" :key="i">
:color="onCarObj&&item.Id === onCarObj.Id?'primary':'grey-5'" <q-chip size="14px" clickable @click="handleSelect(x,3)"
unelevated :text-color="onCarObj&&onCarObj.Id==x.Id?'white':'dark'"
class="car-tag mr" :color="onCarObj&&onCarObj.Id==x.Id?'primary':'grey-3'" square>{{ x.Name }}({{ x.Range }}m)</q-chip>
v-for="item in PlaceList" </div>
:key="item.Id"
>
{{ item.Name }}({{ item.Range }}m)
</q-btn>
</div> </div>
</div> </div>
<div v-if="dataList.CarType!=2"> <div v-if="dataList.CarType!=2" :class="{'col':dataList.PlaceList.length>2,'q-ml-md':dataList.CarType!=1}">
<div class="text-grey-6 f12 q-my-md">選擇下車範圍</div> <div class="text-grey-6 f12 q-my-md">選擇下車範圍</div>
<div class="row wrap"> <div class="row wrap">
<q-btn @click="handleSelect(item,4)" <div v-for="(x,i) in dataList.PlaceList" :key="i">
:color="unCarObj&&item.Id === unCarObj.Id?'primary':'grey-5'" <q-chip size="14px" clickable @click="handleSelect(x,4)"
unelevated :text-color="unCarObj&&unCarObj.Id==x.Id?'white':'dark'"
class="car-tag mr" :color="unCarObj&&unCarObj.Id==x.Id?'primary':'grey-3'" square>{{ x.Name }}({{ x.Range }}m)</q-chip>
v-for="item in PlaceList" </div>
:key="item.Id"
>
{{ item.Name }}({{ item.Range }}m)
</q-btn>
</div> </div>
</div> </div>
</div> </div>
...@@ -58,15 +46,11 @@ ...@@ -58,15 +46,11 @@
<div class="text-grey-6 f12 q-my-md">選擇車類型</div> <div class="text-grey-6 f12 q-my-md">選擇車類型</div>
<div class="row wrap"> <div class="row wrap">
<q-btn @click="handleSelect(item,2)" <div v-for="(x,i) in dataList.CarTypeList" :key="i">
:color="selectedCarObj&&item.Id === selectedCarObj.Id?'primary':'grey-5'" <q-chip size="14px" clickable @click="handleSelect(x,2)"
unelevated :text-color="selectedCarObj&&selectedCarObj.Id==x.Id?'white':'dark'"
class="car-tag mr" :color="selectedCarObj&&selectedCarObj.Id==x.Id?'primary':'grey-3'" square>{{ x.CarName }}({{ x.PeopleNum }}人)</q-chip>
v-for="item in CarTypeList" </div>
:key="item.Id"
>
{{ item.CarName }}({{ item.PeopleNum }}人)
</q-btn>
</div> </div>
<div class="text-grey-6 f12 q-my-md">選擇數量</div> <div class="text-grey-6 f12 q-my-md">選擇數量</div>
<div class="row items-end"> <div class="row items-end">
...@@ -128,39 +112,46 @@ ...@@ -128,39 +112,46 @@
<span class="text-subtitle2 text-grey-6 col">總金額</span> <span class="text-subtitle2 text-grey-6 col">總金額</span>
<span class="text-h6 text-primary product-price">CNY {{ moneyFormat(sumPrice,0) }}</span> <span class="text-h6 text-primary product-price">CNY {{ moneyFormat(sumPrice,0) }}</span>
</div> </div>
<div class="q-mt-md text-right"> <div class="q-mt-md text-right"
<span class="q-mr-lg f12 text-negative" v-if="!p.startDate" > :class="{'row wrap justify-end items-start':$q.platform.is.mobile}">
<span :class="{'col-12 q-mb-sm':$q.platform.is.mobile}">
<span class="f12 text-negative" v-if="!p.startDate"
:class="{'q-mr-lg':$q.platform.is.desktop}">
{{$q.platform.is.mobile?'請選擇上面的出行日期':'請選擇左側的出行日期'}} {{$q.platform.is.mobile?'請選擇上面的出行日期':'請選擇左側的出行日期'}}
</span> </span>
<span class="q-mr-lg f12 text-negative" <span class="f12 text-negative"
:class="{'q-mr-lg':$q.platform.is.desktop}"
v-if="(p.startDate&&!selectedCarObj) v-if="(p.startDate&&!selectedCarObj)
||(p.startDate&&dataList.CarType==1&&(!selectedAirportObj||!unCarObj)) ||(p.startDate&&dataList.CarType==1&&(!selectedAirportObj||!unCarObj))
||(p.startDate&&dataList.CarType==2&&(!selectedAirportObj||!onCarObj)) ||(p.startDate&&dataList.CarType==2&&(!selectedAirportObj||!onCarObj))
||(p.startDate&&dataList.CarType==3&&(!onCarObj||!unCarObj))" > ||(p.startDate&&dataList.CarType==3&&(!onCarObj||!unCarObj))" >
{{`請選擇上面的${dataList.CarType==3?'車類型、上車下車點':dataList.CarType==1?'機場、車類型、下車點':'機場、車類型、上車點'}`}} {{`請選擇上面的${dataList.CarType==3?'車類型、上車下車點':dataList.CarType==1?'機場、車類型、下車點':'機場、車類型、上車點'}`}}
</span> </span>
</span>
<q-btn color="primary" label="立即訂購" unelevated class="q-px-lg" <q-btn color="primary" label="立即訂購" unelevated class="q-px-lg"
:disable="sumPrice==0||!selectedCarObj :disable="sumPrice==0||!selectedCarObj
||(dataList.CarType!=3&&!selectedAirportObj) ||(dataList.CarType!=3&&!selectedAirportObj)
||(dataList.CarType==1&&!unCarObj)||(dataList.CarType==2&&!onCarObj) ||(dataList.CarType==1&&!unCarObj)||(dataList.CarType==2&&!onCarObj)
||(dataList.CarType==3&&(!onCarObj||!unCarObj))" ||(dataList.CarType==3&&(!onCarObj||!unCarObj))"
@click="goOrderHandler"/> @click="goOrderHandler"/>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { date } from "quasar";
export default { export default {
props: ["dataList","PlaceList","price","CarTypeList","AirportList","configId","Month"], props: ["dataList","price","configId","Month"],
watch: { watch: {
price: { price: {
handler(n, o) { handler(n, o) {
this.p = n; this.p = n;
if(n&&n.startDate){ if(n&&n.startDate){
this.chosenObj.startDate = n.startDate; this.chosenObj.startDate = n.startDate;
// this.selectedCar = this.CarTypeList[0].Id // this.selectedCar = this.dataList.CarTypeList[0].Id
// this.selectedCarObj = this.CarTypeList[0] // this.selectedCarObj = this.dataList.CarTypeList[0]
} }
this.calcMoney() this.calcMoney()
...@@ -168,9 +159,9 @@ export default { ...@@ -168,9 +159,9 @@ export default {
deep: true, deep: true,
immediate: false immediate: false
}, },
CarTypeList: { dataList: {
handler(n, o) { handler(n, o) {
this.CarTypeList = n; this.dataList = n;
}, },
deep: true, deep: true,
...@@ -191,6 +182,7 @@ export default { ...@@ -191,6 +182,7 @@ export default {
}, },
created() { created() {
this.initModel(); this.initModel();
console.log(this.p,'=======')
if(this.p.startDate){ if(this.p.startDate){
this.chosenObj.startDate = this.p.startDate; this.chosenObj.startDate = this.p.startDate;
this.calcMoney() this.calcMoney()
...@@ -208,8 +200,8 @@ export default { ...@@ -208,8 +200,8 @@ export default {
orderInfo: this.chosenObj, orderInfo: this.chosenObj,
sumPrice: this.sumPrice, sumPrice: this.sumPrice,
Id: this.dataList.Id, Id: this.dataList.Id,
onCarId: this.onCarObj.Id, onCarId: this.onCarObj?this.onCarObj.Id:'',
unCarId: this.unCarObj.Id, unCarId: this.unCarObj?this.unCarObj.Id:'',
} }
let key = this.$md5(JSON.stringify(order)) let key = this.$md5(JSON.stringify(order))
let pickuporderCars = localStorage.getItem('pickuporderCars') let pickuporderCars = localStorage.getItem('pickuporderCars')
...@@ -221,7 +213,7 @@ export default { ...@@ -221,7 +213,7 @@ export default {
localStorage.setItem("pickuporderCars",JSON.stringify(pickuporderCars)) localStorage.setItem("pickuporderCars",JSON.stringify(pickuporderCars))
this.CommonJump('/PickuporderForm/'+key, {}); this.CommonJump('/PickuporderForm/'+key, {});
}, },
// 获取车的详情 // 获取车的详情
getCarPriceData2() { getCarPriceData2() {
this.priceList = [] this.priceList = []
this.apipost( this.apipost(
...@@ -248,7 +240,9 @@ export default { ...@@ -248,7 +240,9 @@ export default {
isSupportChildren: 1, isSupportChildren: 1,
safeMoney: 0, safeMoney: 0,
} }
arr.push(dataObj) if(date.formatDate(Date.now(), 'YYYY-MM-DD')!=x.Date){
arr.push(dataObj)
}
} }
}) })
const temp= JSON.parse(JSON.stringify(r.data.data)) const temp= JSON.parse(JSON.stringify(r.data.data))
......
...@@ -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"
......
...@@ -644,7 +644,7 @@ export default { ...@@ -644,7 +644,7 @@ export default {
var companyId = -1; var companyId = -1;
if (localStorage.groupinfo) { if (localStorage.groupinfo) {
var groupinfo = JSON.parse(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) { if (localStorage.b2bUser) {
var b2bUser = JSON.parse(window.localStorage.getItem("b2bUser")); var b2bUser = JSON.parse(window.localStorage.getItem("b2bUser"));
......
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
<p class="day"><span v-if='item.dayNum<10'>0</span>{{item.dayNum}}</p> <p class="day"><span v-if='item.dayNum<10'>0</span>{{item.dayNum}}</p>
<!-- <p>{{item.dateTime}}</p> --> <!-- <p>{{item.dateTime}}</p> -->
</div> </div>
<div class="desc" v-html="item.title"></div> <div class="desc" v-html="item.title!='null'?item.title:''"></div>
</div> </div>
<oneday v-if="item.details && item.details.length==1" :day='item' :isDirect="isDirect"></oneday> <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> <twoday v-if="item.details && item.details.length==2" :day='item' :isDirect="isDirect"></twoday>
......
...@@ -53,43 +53,41 @@ ...@@ -53,43 +53,41 @@
></q-img> ></q-img>
</template> </template>
</div> </div>
<div class="row items-end" style="border: 1px solid #ccc; left: 0"> <div class="row items-end col" style="border: 1px solid #ccc; left: 0">
<div class="q-pb-lg"> <div class="down q-pa-lg q-mb-lg" :class="{ col: index == 0 }">
<div class="down q-pa-lg" :class="{ col: index == 0 }"> <div
<div v-if="item.title != ''"
v-if="item.title != ''" class="text-h6 text-bold q-pb-sm"
class="text-h6 text-bold q-pb-sm" v-html="item.title"
v-html="item.title" @click.stop="goUrl(item.url)"
@click.stop="goUrl(item.url)" style="
style=" cursor: pointer;
cursor: pointer; white-space: nowrap;
white-space: nowrap; text-overflow: ellipsis;
text-overflow: ellipsis; overflow: hidden;
overflow: hidden; "
" ></div>
></div> <div
<div class="playInfo"
class="playInfo" v-if="item.playTimeHour || item.playTimeMinutes"
>
<span class="playInfo-item" v-if="item.ticketName != ''">
</span>
<span
class="playInfo-item"
v-if="item.playTimeHour || item.playTimeMinutes" v-if="item.playTimeHour || item.playTimeMinutes"
> >
<span class="playInfo-item" v-if="item.ticketName != ''"> <i class="iconfont icon-shijian1"></i>
<span v-if="item.playTimeHour"
>{{ item.playTimeHour }}小时
</span> </span>
<span <span v-if="item.playTimeMinutes"
class="playInfo-item" >{{ item.playTimeMinutes }}分钟
v-if="item.playTimeHour || item.playTimeMinutes"
>
<i class="iconfont icon-shijian1"></i>
<span v-if="item.playTimeHour"
>{{ item.playTimeHour }}小时
</span>
<span v-if="item.playTimeMinutes"
>{{ item.playTimeMinutes }}分钟
</span>
</span> </span>
</div> </span>
<span v-html="item.content"></span>
</div> </div>
<span v-html="item.content"></span>
</div> </div>
</div> </div>
</div> </div>
......
<template> <template>
<div class="column full-height"> <div class="column full-height" v-if="p">
<div class="col"> <div class="col">
<div class="text-right" v-if="$q.platform.is.desktop"> <div class="text-right" v-if="$q.platform.is.desktop">
<q-btn <q-btn
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
flat flat
/> />
</div> </div>
<div v-if="p && p.unionCityList"> <div v-if="p && p.unionCityList && p.unionCityList.length>0">
<div class="text-grey-6 f12 q-my-md">出發城市</div> <div class="text-grey-6 f12 q-my-md">出發城市</div>
<div class="row q-col-gutter-sm"> <div class="row q-col-gutter-sm">
<div v-for="(x,i) in p.unionCityList" :key="i"> <div v-for="(x,i) in p.unionCityList" :key="i">
...@@ -376,7 +376,6 @@ export default { ...@@ -376,7 +376,6 @@ export default {
watch: { watch: {
price: { price: {
handler(n, o) { handler(n, o) {
console.log(n)
this.p = n?n:{}; this.p = n?n:{};
if (this.p.startDate) { if (this.p.startDate) {
this.chosenObj.startDate = this.p.startDate; this.chosenObj.startDate = this.p.startDate;
......
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
.margin { .margin {
margin: 10px; margin: 10px;
} }
.mr0 {
margin-right: 0 !important;
}
.mt { .mt {
margin-top: 10px; margin-top: 10px;
} }
...@@ -96,6 +99,9 @@ ...@@ -96,6 +99,9 @@
.f20 { .f20 {
font-size: 20px; font-size: 20px;
} }
.f22 {
font-size: 22px;
}
.f26 { .f26 {
font-size: 26px; font-size: 26px;
} }
...@@ -130,4 +136,9 @@ ...@@ -130,4 +136,9 @@
} }
.white { .white {
color: #fff; color: #fff;
}
.user-edit {
color: #2D90FF;
margin:0 20px;
cursor: pointer;
} }
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
...@@ -308,7 +308,7 @@ ...@@ -308,7 +308,7 @@
</div> </div>
<div class="text-grey f12"> <div class="text-grey f12">
<ul class="q-pl-md no-margin"> <ul class="q-pl-md no-margin">
<li v-for="(x, i) in warnBuy" class="q-mt-md" :key="i"> <li v-for="(x, i) in warnBuy" :class="{'q-mt-md':$q.platform.is.desktop|(i!=0&&$q.platform.is.mobile)}" :key="i">
{{ x }} {{ x }}
</li> </li>
</ul> </ul>
...@@ -777,7 +777,13 @@ export default { ...@@ -777,7 +777,13 @@ export default {
changeShowOrderPreviewHandler(){ changeShowOrderPreviewHandler(){
this.showOrderPreview=!this.showOrderPreview this.showOrderPreview=!this.showOrderPreview
if(!this.showOrderPreview){ if(!this.showOrderPreview){
this.currentPrice=null // this.currentPrice=null
if(this.currentPrice){
this.currentPrice.isSupportChildren=null
this.currentPrice.unionCityList=null
this.currentPrice.singleRoomPrice=0
this.currentPrice.originalB2CPrice=0
}
this.changeTripShowHandler() this.changeTripShowHandler()
} }
}, },
...@@ -871,7 +877,13 @@ export default { ...@@ -871,7 +877,13 @@ export default {
//console.log(e) //console.log(e)
}, },
resetHandler() { resetHandler() {
this.currentPrice=null; // this.currentPrice=null;
if(this.currentPrice){
this.currentPrice.isSupportChildren=null
this.currentPrice.unionCityList=null
this.currentPrice.singleRoomPrice=0
this.currentPrice.originalB2CPrice=0
}
if(this.$q.platform.is.mobile) if(this.$q.platform.is.mobile)
this.$refs.calendarMobile.reset() this.$refs.calendarMobile.reset()
else else
...@@ -882,7 +894,7 @@ export default { ...@@ -882,7 +894,7 @@ export default {
this.currentPrice = JSON.parse(JSON.stringify(val.price)); this.currentPrice = JSON.parse(JSON.stringify(val.price));
this.currentPrice.RealPrice = this.currentPrice.RealPrice?this.currentPrice.RealPrice:this.currentPrice.originalB2CPrice this.currentPrice.RealPrice = this.currentPrice.RealPrice?this.currentPrice.RealPrice:this.currentPrice.originalB2CPrice
this.currentPrice.originalB2CPrice = this.currentPrice.RealPrice this.currentPrice.originalB2CPrice = this.currentPrice.RealPrice
if(this.currentPrice.unionCityList && this.currentPrice.unionCityList.length>0){ if(this.currentPrice.unionCityList && this.currentPrice.unionCityList.length>0 && this.dataList.startCityId!=0){
this.currentPrice.unionCityList.splice(0,0,{ this.currentPrice.unionCityList.splice(0,0,{
cityId:this.dataList.startCityId, cityId:this.dataList.startCityId,
cityName:this.dataList.startCityName cityName:this.dataList.startCityName
......
<style lang="scss" scoped>
</style>
<template>
<div>
<q-checkbox
v-for="item in checkboxList"
:key="item.label"
v-model="checkedValue"
:val="item.value"
@input="changeValue(item)"
>{{ item.label }}</q-checkbox
>
</div>
</template>
<script>
export default {
props: {
checkboxList: {
type: Array,
default: () => [],
},
radio: {
type: Boolean,
default: true,
},
value: {
default: "",
},
},
data() {
return {
checkedValue: [],
};
},
mounted() {
this.prevVal = JSON.parse(JSON.stringify(this.checkedValue));
},
watch: {
value: function () {
if (this.value) {
this.checkedValue = [this.value];
}
},
},
methods: {
changeValue(item) {
console.log("changeValue", item, this.checkedValue, this.prevVal);
const index = this.prevVal.findIndex((el) => item.value === el);
if (this.radio) {
if (index > -1) {
this.checkedValue = [];
} else {
this.checkedValue = [item.value];
}
}
this.$emit(
"input",
this.radio ? this.checkedValue[0] : this.checkedValue
);
this.prevVal = JSON.parse(JSON.stringify(this.checkedValue));
},
},
};
</script>
\ No newline at end of file
<style>
.login-box {
width: 436px;
padding: 30px 40px;
background-clip: padding-box;
background: #ffffff;
border-radius: 18px;
}
.login-box .tw_logo {
margin: 0 auto 20px;
display: block;
height: 45px;
width: auto;
}
.login-box .tip-text {
font-size: 16px;
margin-bottom: 15px;
color: #999;
text-align: center;
}
.login-box .tip-text a {
color: #00afff;
}
.login_row {
width: 100%;
}
.form-group {
position: relative;
margin-bottom: 15px;
}
.login_labelName {
margin-top: 34px;
font-size: 16px;
margin-bottom: 16px;
}
.form-group i {
position: absolute;
right: 6px;
bottom: 0;
z-index: 2;
width: 46px;
height: 46px;
text-align: center;
line-height: 46px;
color: #999;
font-size: 28px;
cursor: pointer;
}
.login-box .q-field__control {
height: 46px;
}
.type-item {
width: 50px;
height: 50px;
background: #f5f5f5;
border-radius: 25px;
}
.type-item img {
width: 28px;
height: 28px;
}
</style>
<template>
<div class="login">
<div class="login-box">
<div class="f34 bold">注销账户</div>
<div class="login_row">
<div class="form-group">
<div class="login_labelName">輸入郵箱</div>
<q-input outlined v-model="loginMsg.EMail" />
<div class="primary q-mt-sm" v-show="tips">邮箱格式有误,请核实</div>
</div>
<div>
<q-btn
v-if="!isSend" class="q-mb-lg"
unelevated
color="grey-3"
style="width: 100%; color: #8B8B8B !important; height: 50px; margin-top: 20px"
filled
label="发送验证码"
@click="sendVerify"
/>
<div v-else class="mt q-mb-sm">
<q-input outlined v-model="loginMsg.Code" type="text" />
<div class="q-mt-sm" :class="cutDown ? 'text-grey-6' : ''">
{{ cutDown ? cutDown + "秒后可重新发送" : "重新發送驗證碼" }}
</div>
</div>
</div>
<div class="q-mb-xl">
<q-btn
color="primary"
unelevated
style="width: 100%; height: 50px; margin-top: 20px"
filled
:label="mylabel"
@click="login"
/>
</div>
</div>
</div>
</div>
</template>
<script>
import QrcodeVue from "qrcode.vue";
export default {
name: "Login",
components: {
QrcodeVue,
},
data() {
return {
isSend: false,
tips: false,
cutDown: 0,
isAgree: false,
isLogin: true,
loginMsg: {
EMail: "",
Code: "",
},
// , 'google', 'facebook', 'apple'
typeList: ["wechat"],
logo: "",
flag: 2,
mylabel: "注销账户",
};
},
created() {},
mounted() {
},
methods: {
sendVerify() {
if(this.inSending) return
this.inSending = true
if (this.verifyEmail()) {
this.apipost('directCustomer_post_SendMail', {Mailbox: this.loginMsg.EMail, SendType: 4}, (res) => {
this.inSending = false
if (res.data.resultCode == 1) {
this.isSend = true;
this.cutDown = 60;
this.startCutDown();
} else {
this.$q.notify({
type: "negative",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
}, null)
} else {
this.inSending = false
}
},
startCutDown() {
this.timer = setTimeout(() => {
this.cutDown--;
if (this.cutDown) {
this.startCutDown();
}
}, 1000);
},
verifyEmail() {
if (/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(this.loginMsg.EMail)) {
this.tips = false;
return true;
} else {
// 提示用户邮箱格式有误
this.tips = true;
return false;
}
},
login() {
if(this.mylabel === "提交中...") {
return
}
if (this.loginMsg.EMail == "") {
this.$q.notify({
type: "negative",
message: "请输入账号",
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
return;
}
if (this.loginMsg.Code == "") {
this.$q.notify({
type: "negative",
message: "请输入邮箱验证码",
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
return;
}
this.mylabel = "提交中...";
this.apipost(
'b2c_post_SetAccountCancel',
this.loginMsg,
(res) => {
this.mylabel = "注销账户";
if (res.data.resultCode == 1) {
this.CommonJump("/login", {});
} else {
this.$q.notify({
type: "negative",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
},
(err) => {}
);
},
},
};
</script>
<style>
.login-box {
width: 436px;
padding: 30px 40px;
background-clip: padding-box;
background: #ffffff;
border-radius: 18px;
}
.login-box .tw_logo {
margin: 0 auto 20px;
display: block;
height: 45px;
width: auto;
}
.login-box .tip-text {
font-size: 16px;
margin-bottom: 15px;
color: #999;
text-align: center;
}
.login-box .tip-text a {
color: #00afff;
}
.login_row {
width: 100%;
}
.form-group {
position: relative;
margin-bottom: 15px;
}
.login_labelName {
margin-top: 34px;
font-size: 16px;
margin-bottom: 16px;
}
.form-group i {
position: absolute;
right: 6px;
bottom: 0;
z-index: 2;
width: 46px;
height: 46px;
text-align: center;
line-height: 46px;
color: #999;
font-size: 28px;
cursor: pointer;
}
.login-box .q-field__control {
height: 46px;
}
.type-item {
width: 50px;
height: 50px;
background: #f5f5f5;
border-radius: 25px;
}
.type-item img {
width: 28px;
height: 28px;
}
</style>
<template>
<div class="login">
<div class="login-box">
<div class="f34 bold">修改邮箱</div>
<div class="login_row">
<div class="form-group">
<div class="login_labelName">輸入郵箱</div>
<q-input outlined v-model="loginMsg.EMail" />
<div class="primary q-mt-sm" v-show="tips">邮箱格式有误,请核实</div>
</div>
<div>
<q-btn
v-if="!isSend" class="q-mb-lg"
unelevated
color="grey-3"
style="width: 100%; color: #8B8B8B !important; height: 50px; margin-top: 20px"
filled
label="发送验证码"
@click="sendVerify"
/>
<div v-else class="mt q-mb-sm">
<q-input outlined v-model="loginMsg.Code" type="text" />
<div class="q-mt-sm" :class="cutDown ? 'text-grey-6' : ''">
{{ cutDown ? cutDown + "秒后可重新发送" : "重新發送驗證碼" }}
</div>
</div>
</div>
<div class="q-mb-xl">
<q-btn
color="primary"
unelevated
style="width: 100%; height: 50px; margin-top: 20px"
filled
:label="mylabel"
@click="login"
/>
</div>
</div>
</div>
</div>
</template>
<script>
import QrcodeVue from "qrcode.vue";
export default {
name: "Login",
components: {
QrcodeVue,
},
data() {
return {
isSend: false,
tips: false,
cutDown: 0,
isAgree: false,
isLogin: true,
loginMsg: {
EMail: "",
Code: "",
},
// , 'google', 'facebook', 'apple'
typeList: ["wechat"],
logo: "",
flag: 2,
mylabel: "修改邮箱",
};
},
created() {},
mounted() {
},
methods: {
sendVerify() {
if(this.inSending) return
this.inSending = true
if (this.verifyEmail()) {
this.apipost('directCustomer_post_SendMail', {Mailbox: this.loginMsg.EMail, SendType: 5}, (res) => {
this.inSending = false
if (res.data.resultCode == 1) {
this.isSend = true;
this.cutDown = 60;
this.startCutDown();
} else {
this.$q.notify({
type: "negative",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
}, null)
} else {
this.inSending = false
}
},
startCutDown() {
this.timer = setTimeout(() => {
this.cutDown--;
if (this.cutDown) {
this.startCutDown();
}
}, 1000);
},
verifyEmail() {
if (/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(this.loginMsg.EMail)) {
this.tips = false;
return true;
} else {
// 提示用户邮箱格式有误
this.tips = true;
return false;
}
},
login() {
if(this.mylabel === "提交中...") {
return
}
if (this.loginMsg.EMail == "") {
this.$q.notify({
type: "negative",
message: "请输入账号",
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
return;
}
if (this.loginMsg.Code == "") {
this.$q.notify({
type: "negative",
message: "请输入邮箱验证码",
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
return;
}
this.mylabel = "提交中...";
this.apipost(
'b2c_post_UpdateCustomerEMail',
this.loginMsg,
(res) => {
this.mylabel = "修改邮箱";
if (res.data.resultCode == 1) {
// this.CommonJump("/login", {});
this.$emit('change')
this.$q.notify({
type: "positive",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
} else {
this.$q.notify({
type: "negative",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
},
(err) => {}
);
},
},
};
</script>
...@@ -33,14 +33,15 @@ ...@@ -33,14 +33,15 @@
} }
.img-box { .img-box {
width: 50px; width: 50px;
height: 50px; height: 50px;
background: #F5F5F5; background: #f5f5f5;
border-radius: 25px; border-radius: 25px;
}.img { }
.img {
width: 50px; width: 50px;
height: 50px; height: 50px;
display: block; display: block;
padding: 11px; padding: 11px;
} }
</style> </style>
<template> <template>
...@@ -49,50 +50,135 @@ padding: 11px; ...@@ -49,50 +50,135 @@ padding: 11px;
<div class="tips">登陸方式管理</div> <div class="tips">登陸方式管理</div>
<div class="card"> <div class="card">
<div class="flex justify-between"> <div class="flex justify-between">
<div>郵箱<span class="text-grey-6">(默認地址)</span></div> <div>
<div><span>修改</span><span>删除</span></div> <span class="f18 bold">郵箱</span
><span class="text-grey-6">(默認地址)</span>
<div class="text-grey-7">{{ form.Mailbox }}</div>
</div>
<div>
<span class="user-edit mr0" @click="changeEmail">修改</span>
<!-- <span class="text-grey-6 cursor-pointer" @click="deleteUser(item)">删除</span> -->
</div>
</div> </div>
</div> </div>
<div class="card flex justify-between"> <div class="card flex justify-between">
<div class="img-box">
<img class="img" src="../../assets/img/wechat.png" />
</div>
<div class="flex justify-between"> <div class="flex justify-between">
<div>郵箱<span class="text-grey-6">(默認地址)</span></div> <div class="img-box">
<div><span>修改</span><span>删除</span></div> <img class="img" src="../../assets/img/wechat.png" />
</div>
<div class="q-ml-sm">
<div class="f18 bold">微信</div>
<div class="text-grey-7">{{ form.WXNickName }}</div></div>
</div>
<div>
<span class="user-edit mr0" @click="changeWechat">修改</span>
<!-- <span class="text-grey-6 cursor-pointer" @click="deleteUser(item)">删除</span> -->
</div> </div>
</div> </div>
<div></div> <q-dialog content-style="width: 900px" v-model="showReset">
<resetEmail @change="resetEmailSuccess"></resetEmail>
</q-dialog>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import resetEmail from "./components/resetEmail.vue";
export default { export default {
components: { resetEmail },
data() { data() {
return { return {
form: { showReset: false,
lastName: "", form: {},
firstName: "",
},
model: "",
date: "",
options: [],
}; };
}, },
mounted() {
const { code, state } = this.$route.query;
if (code) {
this.reSetWechat(code, state);
}
this.getUserInfo();
this.getOpenInfo();
this.userInfo = this.$user.userInfo;
console.log("let u = this.$user.userInfo;", this.userInfo);
},
methods: { methods: {
submit() { getUserInfo() {
const verifyArr = ["fastName", "lastName"]; this.apipost(
verifyArr.forEach((item) => { "GetCustomerInfo_post",
this.$refs[item].validate(); {
}); Id: this.userInfo?.id,
verifyArr.forEach((item) => { },
if (item.$refs[item].hasError) { (res) => {
this.formHasError = true; if (res.data.resultCode == 1) {
} this.form = res.data.data;
}); } else {
if ((this.formHasError = true)) { // this.$notify(res.data.message);
return; this.$q.notify({
} type: "negative",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
},
getOpenInfo() {
this.apipost(
"GetOpenInfo_post",
{},
(r) => {
if (r.data.resultCode == 1) {
this.openInfo = r.data.data;
} else {
this.$q.notify({
type: "negative",
message: r.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
},
changeWechat() {
const { AppID, State, OpenRedirectUri } = this.openInfo;
let redirect_uri = OpenRedirectUri;
const url = `https://open.weixin.qq.com/connect/qrconnect?appid=${AppID}&redirect_uri=${redirect_uri}/loginInfo&response_type=code&scope=snsapi_login&state=${State}&wechat_redirect=${redirect_uri}`;
window.location.href = url;
},
changeEmail() {
this.showReset = true;
},
resetEmailSuccess() {
this.showReset = false;
this.getUserInfo();
},
reSetWechat(code, state) {
this.apipost(
"GetOpenInfo_post",
{ code, state },
(r) => {
if (r.data.resultCode == 1) {
this.$q.notify({
type: "positive",
message: r.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
} else {
this.$q.notify({
type: "negative",
message: r.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
}, },
}, },
}; };
......
This diff is collapsed.
...@@ -4,6 +4,26 @@ ...@@ -4,6 +4,26 @@
height: 40px; height: 40px;
margin: 10px; margin: 10px;
} }
.form-group {
width: 320px;
}
.form-group {
position: relative;
margin-bottom: 15px;
}
.form-group i {
position: absolute;
right: 12px;
bottom: 0;
z-index: 2;
width: 40px;
height: 40px;
text-align: center;
line-height: 40px;
color: #999;
font-size: 28px;
cursor: pointer;
}
.content { .content {
width: 900px; width: 900px;
} }
...@@ -33,25 +53,53 @@ ...@@ -33,25 +53,53 @@
设置密码(8 - 20个字符,须至少包含1个数字、1个字母及1个特殊符号) 设置密码(8 - 20个字符,须至少包含1个数字、1个字母及1个特殊符号)
</div> </div>
<div class="text-grey-6">高强度密码能提高账号安全性</div> <div class="text-grey-6">高强度密码能提高账号安全性</div>
<q-input <form @submit.prevent.stop="submit">
class="form-item" <div class="form-group">
v-model="form.firstName" <q-input
outlined class="form-item"
placeholder="姓" v-model="form.OldPassword"
ref="firstName" outlined
:rules="[(val) => val !== '' || '请输入姓氏']" placeholder="旧密码"
></q-input> ref="OldPassword"
<q-input :type="isPasswordOld === 2 ? 'PassWord' : 'text'"
class="form-item" :rules="[(val) => val !== '' || '请输入旧密码']"
v-model="form.firstName" ></q-input
outlined ><i
placeholder="姓" class="iconfont iconyanjing_xianshi"
ref="firstName" v-if="isPasswordOld == 1"
:rules="[(val) => val !== '' || '请输入姓氏']" @click="isPasswordOld = 2"
></q-input> ></i>
<div> <i
<q-btn color="primary" unelevated label="确认" @click="submit" /> class="iconfont iconbiyan"
</div> v-if="isPasswordOld == 2"
@click="isPasswordOld = 1"
></i>
</div>
<div class="form-group">
<q-input
class="form-item"
v-model="form.NewPassword"
outlined
placeholder="新密码"
ref="NewPassword"
:type="isPassword === 2 ? 'PassWord' : 'text'"
:rules="[(val) => val !== '' || '请输入新密码']"
></q-input
><i
class="iconfont iconyanjing_xianshi"
v-if="isPassword == 1"
@click="isPassword = 2"
></i>
<i
class="iconfont iconbiyan"
v-if="isPassword == 2"
@click="isPassword = 1"
></i>
</div>
<div>
<q-btn color="primary" type="submit" unelevated label="确认" />
</div>
</form>
</div> </div>
</div> </div>
</div> </div>
...@@ -64,66 +112,205 @@ ...@@ -64,66 +112,205 @@
<div class="text-grey-6"> <div class="text-grey-6">
抢先获取印象最新优惠活动、优惠码、折扣信息及最新动向 抢先获取印象最新优惠活动、优惠码、折扣信息及最新动向
</div> </div>
<q-checkbox>电子邮件</q-checkbox> <checkboxGroupVue
<q-checkbox>短信</q-checkbox> :checkboxList="emailType"
v-model="setInfoForm.DiscountsNoticeWay"
></checkboxGroupVue>
</div> </div>
<div> <div>
<div>消息提醒</div> <div>消息提醒</div>
<div class="text-grey-6"> <div class="text-grey-6">
获取购物车内活动及支付状态、评价提醒、推荐好友获取优惠等信息 获取购物车内活动及支付状态、评价提醒、推荐好友获取优惠等信息
</div> </div>
<q-checkbox>电子邮件</q-checkbox> <checkboxGroupVue
<q-checkbox>短信</q-checkbox> :checkboxList="emailType"
v-model="setInfoForm.MessageNoticeWay"
></checkboxGroupVue>
</div> </div>
<div> <div>
<div>賬戶通知</div> <div>賬戶通知</div>
<div class="text-grey-6"> <div class="text-grey-6">
接收重要通知,如订单摘要、凭证及活动取消 接收重要通知,如订单摘要、凭证及活动取消
</div> </div>
<q-checkbox>电子邮件</q-checkbox> <checkboxGroupVue
<q-checkbox>短信</q-checkbox> :checkboxList="emailType"
v-model="setInfoForm.AccountNoticeWay"
></checkboxGroupVue>
</div> </div>
<div> <div>
<q-btn <q-btn
color="primary" color="primary"
unelevated unelevated
label="更改偏好設置" label="更改偏好設置"
@click="submit" @click="changeNoticeType"
/> />
</div> </div>
<div class="tips q-mt-lg">註銷賬戶</div> <div class="tips q-mt-lg">註銷賬戶</div>
<div class="q-mt-sm">删除您的Klook客路帐户及个人数据</div> <q-btn color="primary" class="q-mt-sm" @click="removeAccount">删除您的帐户及个人数据</q-btn>
</div> </div>
</div> </div>
<q-dialog content-style="width: 900px" v-model="showRemove">
<removeAccount></removeAccount>
</q-dialog>
</div> </div>
</template> </template>
<script> <script>
import checkboxGroupVue from "./components/checkboxGroup.vue";
import removeAccount from './components/removeAccount.vue'
export default { export default {
components: { checkboxGroupVue, removeAccount },
data() { data() {
return { return {
isPasswordOld: 2,
isPassword: 2,
emailType: [
{ label: "电子邮件", value: 1 },
{ label: "短信", value: 2 },
],
setInfoForm: {
DiscountsNoticeWay: 1,
MessageNoticeWay: 1,
AccountNoticeWay: 1,
},
form: { form: {
lastName: "", OldPassword: "",
firstName: "", NewPassword: "",
}, },
model: "", model: "",
date: "", date: "",
options: [], options: [],
showRemove: false,
}; };
}, },
mounted() {
this.getUserInfo();
},
methods: { methods: {
removeAccount() {
this.showRemove = true
},
getUserInfo() {
this.apipost(
"GetCustomerInfo_post",
{
Id: this.userInfo?.id,
},
(res) => {
if (res.data.resultCode == 1) {
const { DiscountsNoticeWay, MessageNoticeWay, AccountNoticeWay } =
res.data.data;
this.setInfoForm = {
DiscountsNoticeWay,
MessageNoticeWay,
AccountNoticeWay,
};
} else {
// this.$notify(res.data.message);
this.$q.notify({
type: "negative",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
},
changeNoticeType() {
let arr = ["DiscountsNoticeWay", "MessageNoticeWay", "AccountNoticeWay"];
let notify = {
DiscountsNoticeWay: "请选择優惠及更新信息偏好",
MessageNoticeWay: "请选择消息提醒偏好",
AccountNoticeWay: "请选择賬戶通知偏好",
};
let item = "";
for (let i = 0; i < arr.length; i++) {
item = arr[i];
if (!this.setInfoForm[item]) {
// this.$notify(res.data.message);
this.$q.notify({
type: "negative",
message: notify[item],
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
return;
}
}
this.submitChangeNotice();
},
submitChangeNotice() {
this.apipost(
"b2c_post_SetCustomerNotice",
this.setInfoForm,
(res) => {
if (res.data.resultCode == 1) {
// this.$notify(res.data.message);
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
);
},
resetPassword() {
console.log("resetPassword");
this.apipost(
"b2c_post_UpdateCustomerPassWord",
this.form,
(res) => {
if (res.data.resultCode == 1) {
// this.$notify(res.data.message);
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
);
},
submit() { submit() {
const verifyArr = ["fastName", "lastName"]; this.formHasError = false;
const verifyArr = ["OldPassword", "NewPassword"];
console.log("submit");
verifyArr.forEach((item) => { verifyArr.forEach((item) => {
console.log("submit", this.$refs[item]);
this.$refs[item].validate(); this.$refs[item].validate();
}); });
verifyArr.forEach((item) => { verifyArr.forEach((item) => {
if (item.$refs[item].hasError) { if (this.$refs[item].hasError) {
this.formHasError = true; this.formHasError = true;
} }
}); });
if ((this.formHasError = true)) { console.log("this.formHasError", this.formHasError);
if (this.formHasError) {
return; return;
} }
this.resetPassword();
}, },
}, },
}; };
......
...@@ -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
......
This diff is collapsed.
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