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>
<div class="column full-height">
<div class="col">
<div class="text-right">
<div class="text-right" v-if="$q.platform.is.desktop">
<q-btn
color="primary"
icon="refresh"
......@@ -13,44 +13,32 @@
<template v-if="dataList.CarType!=3">
<div class="text-grey-6 f12 q-my-md">選擇機場</div>
<div class="row wrap">
<q-btn @click="handleSelect(item,1)"
:color="selectedAirportObj&&item.Id === selectedAirportObj.Id?'primary':'grey-5'"
unelevated
class="car-tag mr"
v-for="item in AirportList"
:key="item.Id"
>
{{ item.AirportName }}
</q-btn>
<div v-for="(x,i) in dataList.AirportList" :key="i">
<q-chip size="14px" clickable @click="handleSelect(x,1)"
:text-color="selectedAirportObj&&selectedAirportObj.Id==x.Id?'white':'dark'"
:color="selectedAirportObj&&selectedAirportObj.Id==x.Id?'primary':'grey-3'" square>{{ x.AirportName }}</q-chip>
</div>
</div>
</template>
<div class="row">
<div v-if="dataList.CarType!=1">
<div class="row no-wrap">
<div v-if="dataList.CarType!=1" :class="{'col':dataList.PlaceList.length>2}">
<div class="text-grey-6 f12 q-my-md">選擇上車範圍</div>
<div class="row wrap">
<q-btn @click="handleSelect(item,3)"
:color="onCarObj&&item.Id === onCarObj.Id?'primary':'grey-5'"
unelevated
class="car-tag mr"
v-for="item in PlaceList"
:key="item.Id"
>
{{ item.Name }}({{ item.Range }}m)
</q-btn>
<div v-for="(x,i) in dataList.PlaceList" :key="i">
<q-chip size="14px" clickable @click="handleSelect(x,3)"
:text-color="onCarObj&&onCarObj.Id==x.Id?'white':'dark'"
:color="onCarObj&&onCarObj.Id==x.Id?'primary':'grey-3'" square>{{ x.Name }}({{ x.Range }}m)</q-chip>
</div>
</div>
</div>
<div v-if="dataList.CarType!=2">
</div>
<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="row wrap">
<q-btn @click="handleSelect(item,4)"
:color="unCarObj&&item.Id === unCarObj.Id?'primary':'grey-5'"
unelevated
class="car-tag mr"
v-for="item in PlaceList"
:key="item.Id"
>
{{ item.Name }}({{ item.Range }}m)
</q-btn>
<div v-for="(x,i) in dataList.PlaceList" :key="i">
<q-chip size="14px" clickable @click="handleSelect(x,4)"
:text-color="unCarObj&&unCarObj.Id==x.Id?'white':'dark'"
:color="unCarObj&&unCarObj.Id==x.Id?'primary':'grey-3'" square>{{ x.Name }}({{ x.Range }}m)</q-chip>
</div>
</div>
</div>
</div>
......@@ -58,15 +46,11 @@
<div class="text-grey-6 f12 q-my-md">選擇車類型</div>
<div class="row wrap">
<q-btn @click="handleSelect(item,2)"
:color="selectedCarObj&&item.Id === selectedCarObj.Id?'primary':'grey-5'"
unelevated
class="car-tag mr"
v-for="item in CarTypeList"
:key="item.Id"
>
{{ item.CarName }}({{ item.PeopleNum }}人)
</q-btn>
<div v-for="(x,i) in dataList.CarTypeList" :key="i">
<q-chip size="14px" clickable @click="handleSelect(x,2)"
:text-color="selectedCarObj&&selectedCarObj.Id==x.Id?'white':'dark'"
:color="selectedCarObj&&selectedCarObj.Id==x.Id?'primary':'grey-3'" square>{{ x.CarName }}({{ x.PeopleNum }}人)</q-chip>
</div>
</div>
<div class="text-grey-6 f12 q-my-md">選擇數量</div>
<div class="row items-end">
......@@ -128,39 +112,46 @@
<span class="text-subtitle2 text-grey-6 col">總金額</span>
<span class="text-h6 text-primary product-price">CNY {{ moneyFormat(sumPrice,0) }}</span>
</div>
<div class="q-mt-md text-right">
<span class="q-mr-lg f12 text-negative" v-if="!p.startDate" >
<div class="q-mt-md text-right"
: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?'請選擇上面的出行日期':'請選擇左側的出行日期'}}
</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)
||(p.startDate&&dataList.CarType==1&&(!selectedAirportObj||!unCarObj))
||(p.startDate&&dataList.CarType==2&&(!selectedAirportObj||!onCarObj))
||(p.startDate&&dataList.CarType==3&&(!onCarObj||!unCarObj))" >
{{`請選擇上面的${dataList.CarType==3?'車類型、上車下車點':dataList.CarType==1?'機場、車類型、下車點':'機場、車類型、上車點'}`}}
</span>
</span>
<q-btn color="primary" label="立即訂購" unelevated class="q-px-lg"
:disable="sumPrice==0||!selectedCarObj
||(dataList.CarType!=3&&!selectedAirportObj)
||(dataList.CarType==1&&!unCarObj)||(dataList.CarType==2&&!onCarObj)
||(dataList.CarType==3&&(!onCarObj||!unCarObj))"
@click="goOrderHandler"/>
</div>
</div>
</div>
</template>
<script>
import { date } from "quasar";
export default {
props: ["dataList","PlaceList","price","CarTypeList","AirportList","configId","Month"],
props: ["dataList","price","configId","Month"],
watch: {
price: {
handler(n, o) {
this.p = n;
if(n&&n.startDate){
this.chosenObj.startDate = n.startDate;
// this.selectedCar = this.CarTypeList[0].Id
// this.selectedCarObj = this.CarTypeList[0]
// this.selectedCar = this.dataList.CarTypeList[0].Id
// this.selectedCarObj = this.dataList.CarTypeList[0]
}
this.calcMoney()
......@@ -168,9 +159,9 @@ export default {
deep: true,
immediate: false
},
CarTypeList: {
dataList: {
handler(n, o) {
this.CarTypeList = n;
this.dataList = n;
},
deep: true,
......@@ -191,6 +182,7 @@ export default {
},
created() {
this.initModel();
console.log(this.p,'=======')
if(this.p.startDate){
this.chosenObj.startDate = this.p.startDate;
this.calcMoney()
......@@ -208,8 +200,8 @@ export default {
orderInfo: this.chosenObj,
sumPrice: this.sumPrice,
Id: this.dataList.Id,
onCarId: this.onCarObj.Id,
unCarId: this.unCarObj.Id,
onCarId: this.onCarObj?this.onCarObj.Id:'',
unCarId: this.unCarObj?this.unCarObj.Id:'',
}
let key = this.$md5(JSON.stringify(order))
let pickuporderCars = localStorage.getItem('pickuporderCars')
......@@ -221,7 +213,7 @@ export default {
localStorage.setItem("pickuporderCars",JSON.stringify(pickuporderCars))
this.CommonJump('/PickuporderForm/'+key, {});
},
// 获取车的详情
// 获取车的详情
getCarPriceData2() {
this.priceList = []
this.apipost(
......@@ -248,7 +240,9 @@ export default {
isSupportChildren: 1,
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))
......
......@@ -266,7 +266,7 @@ color: #EE4454;
</q-btn>
<q-btn 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
style="color: #444; font-weight: bold"
class="q-ml-lg"
......
......@@ -644,7 +644,7 @@ export default {
var companyId = -1;
if (localStorage.groupinfo) {
var groupinfo = JSON.parse(localStorage.groupinfo);
companyId = groupinfo.siteList[0].companyId;
companyId = groupinfo.siteList[0]&&groupinfo.siteList[0].companyId?groupinfo.siteList[0].companyId:-1;
}
if (localStorage.b2bUser) {
var b2bUser = JSON.parse(window.localStorage.getItem("b2bUser"));
......
......@@ -12,7 +12,8 @@
<p class="day"><span v-if='item.dayNum<10'>0</span>{{item.dayNum}}</p>
<!-- <p>{{item.dateTime}}</p> -->
</div>
<div class="desc" v-html="item.title"></div>
<div class="desc" v-html="item.title!='null'?item.title:''"></div>
</div>
<oneday v-if="item.details && item.details.length==1" :day='item' :isDirect="isDirect"></oneday>
<twoday v-if="item.details && item.details.length==2" :day='item' :isDirect="isDirect"></twoday>
......
......@@ -53,43 +53,41 @@
></q-img>
</template>
</div>
<div class="row items-end" style="border: 1px solid #ccc; left: 0">
<div class="q-pb-lg">
<div class="down q-pa-lg" :class="{ col: index == 0 }">
<div
v-if="item.title != ''"
class="text-h6 text-bold q-pb-sm"
v-html="item.title"
@click.stop="goUrl(item.url)"
style="
cursor: pointer;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
"
></div>
<div
class="playInfo"
<div class="row items-end col" style="border: 1px solid #ccc; left: 0">
<div class="down q-pa-lg q-mb-lg" :class="{ col: index == 0 }">
<div
v-if="item.title != ''"
class="text-h6 text-bold q-pb-sm"
v-html="item.title"
@click.stop="goUrl(item.url)"
style="
cursor: pointer;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
"
></div>
<div
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"
>
<span class="playInfo-item" v-if="item.ticketName != ''">
<i class="iconfont icon-shijian1"></i>
<span v-if="item.playTimeHour"
>{{ item.playTimeHour }}小时
</span>
<span
class="playInfo-item"
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 v-if="item.playTimeMinutes"
>{{ item.playTimeMinutes }}分钟
</span>
</div>
<span v-html="item.content"></span>
</span>
</div>
<span v-html="item.content"></span>
</div>
</div>
</div>
......
<template>
<div class="column full-height">
<div class="column full-height" v-if="p">
<div class="col">
<div class="text-right" v-if="$q.platform.is.desktop">
<q-btn
......@@ -11,7 +11,7 @@
flat
/>
</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="row q-col-gutter-sm">
<div v-for="(x,i) in p.unionCityList" :key="i">
......@@ -376,7 +376,6 @@ export default {
watch: {
price: {
handler(n, o) {
console.log(n)
this.p = n?n:{};
if (this.p.startDate) {
this.chosenObj.startDate = this.p.startDate;
......
......@@ -28,6 +28,9 @@
.margin {
margin: 10px;
}
.mr0 {
margin-right: 0 !important;
}
.mt {
margin-top: 10px;
}
......@@ -96,6 +99,9 @@
.f20 {
font-size: 20px;
}
.f22 {
font-size: 22px;
}
.f26 {
font-size: 26px;
}
......@@ -130,4 +136,9 @@
}
.white {
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 @@
</div>
<div class="text-grey f12">
<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 }}
</li>
</ul>
......@@ -777,7 +777,13 @@ export default {
changeShowOrderPreviewHandler(){
this.showOrderPreview=!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()
}
},
......@@ -871,7 +877,13 @@ export default {
//console.log(e)
},
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)
this.$refs.calendarMobile.reset()
else
......@@ -882,7 +894,7 @@ export default {
this.currentPrice = JSON.parse(JSON.stringify(val.price));
this.currentPrice.RealPrice = this.currentPrice.RealPrice?this.currentPrice.RealPrice:this.currentPrice.originalB2CPrice
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,{
cityId:this.dataList.startCityId,
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 @@
}
.img-box {
width: 50px;
height: 50px;
background: #F5F5F5;
border-radius: 25px;
}.img {
height: 50px;
background: #f5f5f5;
border-radius: 25px;
}
.img {
width: 50px;
height: 50px;
display: block;
padding: 11px;
height: 50px;
display: block;
padding: 11px;
}
</style>
<template>
......@@ -49,50 +50,135 @@ padding: 11px;
<div class="tips">登陸方式管理</div>
<div class="card">
<div class="flex justify-between">
<div>郵箱<span class="text-grey-6">(默認地址)</span></div>
<div><span>修改</span><span>删除</span></div>
<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 class="card flex justify-between">
<div class="img-box">
<img class="img" src="../../assets/img/wechat.png" />
</div>
<div class="flex justify-between">
<div>郵箱<span class="text-grey-6">(默認地址)</span></div>
<div><span>修改</span><span>删除</span></div>
<div class="img-box">
<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>
<q-dialog content-style="width: 900px" v-model="showReset">
<resetEmail @change="resetEmailSuccess"></resetEmail>
</q-dialog>
</div>
</div>
</template>
<script>
import resetEmail from "./components/resetEmail.vue";
export default {
components: { resetEmail },
data() {
return {
form: {
lastName: "",
firstName: "",
},
model: "",
date: "",
options: [],
showReset: false,
form: {},
};
},
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: {
submit() {
const verifyArr = ["fastName", "lastName"];
verifyArr.forEach((item) => {
this.$refs[item].validate();
});
verifyArr.forEach((item) => {
if (item.$refs[item].hasError) {
this.formHasError = true;
}
});
if ((this.formHasError = true)) {
return;
}
getUserInfo() {
this.apipost(
"GetCustomerInfo_post",
{
Id: this.userInfo?.id,
},
(res) => {
if (res.data.resultCode == 1) {
this.form = res.data.data;
} else {
// this.$notify(res.data.message);
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 @@
height: 40px;
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 {
width: 900px;
}
......@@ -33,25 +53,53 @@
设置密码(8 - 20个字符,须至少包含1个数字、1个字母及1个特殊符号)
</div>
<div class="text-grey-6">高强度密码能提高账号安全性</div>
<q-input
class="form-item"
v-model="form.firstName"
outlined
placeholder="姓"
ref="firstName"
:rules="[(val) => val !== '' || '请输入姓氏']"
></q-input>
<q-input
class="form-item"
v-model="form.firstName"
outlined
placeholder="姓"
ref="firstName"
:rules="[(val) => val !== '' || '请输入姓氏']"
></q-input>
<div>
<q-btn color="primary" unelevated label="确认" @click="submit" />
</div>
<form @submit.prevent.stop="submit">
<div class="form-group">
<q-input
class="form-item"
v-model="form.OldPassword"
outlined
placeholder="旧密码"
ref="OldPassword"
:type="isPasswordOld === 2 ? 'PassWord' : 'text'"
:rules="[(val) => val !== '' || '请输入旧密码']"
></q-input
><i
class="iconfont iconyanjing_xianshi"
v-if="isPasswordOld == 1"
@click="isPasswordOld = 2"
></i>
<i
class="iconfont iconbiyan"
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>
......@@ -64,66 +112,205 @@
<div class="text-grey-6">
抢先获取印象最新优惠活动、优惠码、折扣信息及最新动向
</div>
<q-checkbox>电子邮件</q-checkbox>
<q-checkbox>短信</q-checkbox>
<checkboxGroupVue
:checkboxList="emailType"
v-model="setInfoForm.DiscountsNoticeWay"
></checkboxGroupVue>
</div>
<div>
<div>消息提醒</div>
<div class="text-grey-6">
获取购物车内活动及支付状态、评价提醒、推荐好友获取优惠等信息
</div>
<q-checkbox>电子邮件</q-checkbox>
<q-checkbox>短信</q-checkbox>
<checkboxGroupVue
:checkboxList="emailType"
v-model="setInfoForm.MessageNoticeWay"
></checkboxGroupVue>
</div>
<div>
<div>賬戶通知</div>
<div class="text-grey-6">
接收重要通知,如订单摘要、凭证及活动取消
</div>
<q-checkbox>电子邮件</q-checkbox>
<q-checkbox>短信</q-checkbox>
<checkboxGroupVue
:checkboxList="emailType"
v-model="setInfoForm.AccountNoticeWay"
></checkboxGroupVue>
</div>
<div>
<q-btn
color="primary"
unelevated
label="更改偏好設置"
@click="submit"
@click="changeNoticeType"
/>
</div>
<div class="tips q-mt-lg">註銷賬戶</div>
<div class="q-mt-sm">删除您的Klook客路帐户及个人数据</div>
<div class="tips q-mt-lg">註銷賬戶</div>
<q-btn color="primary" class="q-mt-sm" @click="removeAccount">删除您的帐户及个人数据</q-btn>
</div>
</div>
<q-dialog content-style="width: 900px" v-model="showRemove">
<removeAccount></removeAccount>
</q-dialog>
</div>
</template>
<script>
import checkboxGroupVue from "./components/checkboxGroup.vue";
import removeAccount from './components/removeAccount.vue'
export default {
components: { checkboxGroupVue, removeAccount },
data() {
return {
isPasswordOld: 2,
isPassword: 2,
emailType: [
{ label: "电子邮件", value: 1 },
{ label: "短信", value: 2 },
],
setInfoForm: {
DiscountsNoticeWay: 1,
MessageNoticeWay: 1,
AccountNoticeWay: 1,
},
form: {
lastName: "",
firstName: "",
OldPassword: "",
NewPassword: "",
},
model: "",
date: "",
options: [],
showRemove: false,
};
},
mounted() {
this.getUserInfo();
},
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() {
const verifyArr = ["fastName", "lastName"];
this.formHasError = false;
const verifyArr = ["OldPassword", "NewPassword"];
console.log("submit");
verifyArr.forEach((item) => {
console.log("submit", this.$refs[item]);
this.$refs[item].validate();
});
verifyArr.forEach((item) => {
if (item.$refs[item].hasError) {
if (this.$refs[item].hasError) {
this.formHasError = true;
}
});
if ((this.formHasError = true)) {
console.log("this.formHasError", this.formHasError);
if (this.formHasError) {
return;
}
this.resetPassword();
},
},
};
......
......@@ -93,6 +93,8 @@
<div class="col">
<div class="title">居住國家/地區</div>
<q-select
emit-value
map-options
ref="Country"
square
outlined
......@@ -108,6 +110,8 @@
<div class="col">
<div class="title">稱謂</div>
<q-select
emit-value
map-options
ref="Appellation"
square
outlined
......@@ -126,6 +130,8 @@
<div class="col">
<div class="title">國家/地區代碼</div>
<q-select
emit-value
map-options
ref="PhoneCountry"
square
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