Commit 6576f968 authored by 罗超's avatar 罗超

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

# Conflicts:
#	src/boot/utils.js
parents afccc9d9 53b0f3d3
......@@ -49,6 +49,27 @@ body {
font-family: "Noto Sans SC", 微软雅黑, "Microsoft YaHei", sans-serif !important;
font-weight: 400 !important;
}
.fz14{
font-size: 14px;
}
.fz15{
font-size: 15px;
}
.fz16{
font-size: 16px;
}
.fz17{
font-size: 17px;
}
.fz18{
font-size: 18px;
}
.fz20{
font-size: 20px;
}
.fz28{
font-size: 28px;
}
.text-middle{
display: flex;
align-items: center;
......
<style scoped>
.card {width: 100vm;
height: 320px;
border: 1px solid #F0EFEF;
border-radius: 8px;}
</style>
<template>
<div class="card" :id="`baidu-map_${center.Id}`"></div>
</template>
<script>
export default {
props:["AddressObj"],
data() {
return {
center:{
Lng: 116.294625,
Lat: 39.961627
}
}
},
watch: {
AddressObj:{
handler(newValue,onldValue) {
this.center = newValue
},
deep:true,
immediate:true
}
},
mounted() {
this.createMap();
this.addMarker();
this.addLabel()
if(this.center.Range&&this.center.Range>0){
this.addCircle()
}
},
methods: {
createMap() {
if (!BMapGL) {
return;
}
let map = new BMapGL.Map(`baidu-map_${this.center.Id}`); // 创建地图实例
let point = new BMapGL.Point(this.center.Lng, this.center.Lat); // 创建点坐标
map.centerAndZoom(point, 15); // 初始化地图,设置中心点坐标和地图级别
this.map = map;
},
addMarker() {
let icon = require(`../../assets/img/marker.png`);
var myIcon = new BMapGL.Icon(icon, new BMapGL.Size(23, 25), {
// 指定定位位置。
// 当标注显示在地图上时,其所指向的地理位置距离图标左上
// 角各偏移10像素和25像素。您可以看到在本例中该位置即是
// 图标中央下端的尖角位置。
anchor: new BMapGL.Size(10, 25),
// 设置图片偏移。
// 当您需要从一幅较大的图片中截取某部分作为标注图标时,您
// 需要指定大图的偏移位置,此做法与css sprites技术类似。
// imageOffset: new BMapGL.Size(0, 0 - 25) // 设置图片偏移
});
let point = new BMapGL.Point(this.center.Lng, this.center.Lat); // 创建点坐标
// 创建标注对象并添加到地图
var marker = new BMapGL.Marker(point, { icon: myIcon });
this.map.addOverlay(marker);
},
addLabel() {
var point = new BMapGL.Point(this.center.Lng, this.center.Lat);
var content = this.center.Address;
var label = new BMapGL.Label(content, {
// 创建文本标注
position: point, // 设置标注的地理位置
offset: new BMapGL.Size(10, -60), // 设置标注的偏移量
});
this.map.addOverlay(label); // 将标注添加到地图中
label.addEventListener("click", function () {
// alert("您点击了标注");
});
label.setStyle({
// 设置label的样式
color: "#000",
fontSize: "18px",
border: "0 solid #1E90FF",
padding: '0 5px',
borderRadius: '3px',
});
},
addCircle(){
var mPoint = new BMapGL.Point(this.center.Lng, this.center.Lat);
var circle = new BMapGL.Circle(mPoint,this.center.Range,{fillColor:"blue", strokeWeight: 1 ,fillOpacity: 0.3, strokeOpacity: 0.3});
this.map.addOverlay(circle);
}
},
}
</script>
\ No newline at end of file
......@@ -10,7 +10,21 @@
flat
/>
</div>
<div class="text-grey-6 f12 q-my-md">選擇類型</div>
<template v-if="dataList.CarType!=3">
<div class="text-grey-6 f12 q-my-md">選擇機場</div>
<div class="row wrap">
<q-btn @click="handleSelectAirport(item)"
:color="item.Id === selectedAirport?'primary':'grey-5'"
unelevated
class="car-tag mr"
v-for="item in AirportList"
:key="item.Id"
>
{{ item.AirportName }}
</q-btn>
</div>
</template>
<div class="text-grey-6 f12 q-my-md">選擇車類型</div>
<div class="row wrap">
<q-btn @click="handleSelect(item)"
:color="item.Id === selectedCar?'primary':'grey-5'"
......@@ -94,7 +108,13 @@
<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" >{{$q.platform.is.mobile?'請選擇上面的出行日期':'請選擇左側的出行日期'}} </span>
<span class="q-mr-lg f12 text-negative" v-if="!p.startDate" >
{{$q.platform.is.mobile?'請選擇上面的出行日期':'請選擇左側的出行日期'}}
</span>
<span class="q-mr-lg f12 text-negative"
v-if="(p.startDate&&!selectedCar)||(p.startDate&&dataList.CarType!=3&&!selectedAirportObj)" >
{{`請選擇上面的${dataList.CarType==3?'車類型':'機場、車類型'}`}}
</span>
<q-btn color="primary" label="立即訂購" unelevated class="q-px-lg" :disable="sumPrice==0"/>
</div>
</div>
......@@ -103,22 +123,26 @@
<script>
export default {
props: ["price","CarTypeList","configId","Month"],
props: ["dataList","price","CarTypeList","AirportList","configId","Month"],
watch: {
price: {
handler(n, o) {
this.p = n;
console.log(n,'-----')
this.chosenObj.startDate = n.startDate;
if(n&&n.startDate){
this.chosenObj.startDate = n.startDate;
// this.selectedCar = this.CarTypeList[0].Id
// this.selectedObj = this.CarTypeList[0]
}
this.calcMoney()
},
deep: true,
immediate: true
immediate: false
},
CarTypeList: {
handler(n, o) {
this.CarTypeList = n;
this.selectedCar = this.CarTypeList[0].Id
},
deep: true,
immediate: true
......@@ -129,9 +153,11 @@ export default {
p: {},
chosenObj: null,
sumPrice:0,
selectedCar: 0,
selectedObj: null,
priceList: [],
selectedCar: 0
selectedAirport: 0,
selectedAirportObj: null,
};
},
created() {
......@@ -140,7 +166,8 @@ export default {
this.chosenObj.startDate = this.p.startDate;
this.calcMoney()
this.getCarPriceData2()
this.selectedCar = this.CarTypeList[0].Id
// this.selectedCar = this.CarTypeList[0].Id
// this.selectedObj = this.CarTypeList[0]
}
},
......@@ -158,21 +185,49 @@ export default {
},
(r) => {
if (r.data.resultCode == 1) {
let arr = []
r.data.data.forEach(x=>{
x.startDate = x.Date
x.originalB2CPrice = x.Price
x.remainNum =1
x.Count = 1
x.isSupportChildren = 1
x.safeMoney = 0
this.p.originalB2CPrice = x.Price
if(x.Price){
if(this.chosenObj.startDate==x.startDate){
this.p.originalB2CPrice = x.Price
}
let dataObj = {
startDate: x.Date,
originalB2CPrice: x.Price,
remainNum: 1,
Count: 1,
isSupportChildren: 1,
safeMoney: 0,
}
arr.push(dataObj)
}
})
this.$emit('getPriceList',JSON.stringify(r.data.data),this.selectedCar)
const temp= JSON.parse(JSON.stringify(r.data.data))
let PriceArr = temp.filter(x=>{ return x.Price>0 })
if(PriceArr.length>0){
this.$emit('getPriceList',JSON.stringify(arr),this.selectedCar)
}else{
let dataObj = {
startDate: '',
originalB2CPrice: '',
remainNum: 0,
Count: 0,
isSupportChildren: 0,
safeMoney: 0,
}
this.priceList.push(dataObj)
this.$emit('getPriceList',JSON.stringify(this.priceList),this.selectedCar)
this.p.originalB2CPrice = 0
this.resetHandler()
}
}
},null)
},
handleSelectAirport(item){
this.selectedAirportObj = item
this.selectedAirport = item.Id
},
handleSelect(item){
this.selectedObj = item
this.selectedCar = item.Id
......@@ -186,9 +241,17 @@ export default {
remark: "",
};
},
resetHandler() {
this.p = {};
this.initModel()
resetHandler(type) {
if(type&&type!=1){
this.selectedCar = 0
this.selectedObj = null
this.selectedAirportObj = null
this.selectedAirport = 0
}
setTimeout(()=>{
this.p = {};
this.initModel()
},100)
this.$emit("reset");
},
changePeople(val) {},
......
......@@ -265,15 +265,18 @@ color: #EE4454;
</q-menu>
</q-btn>
<q-btn label="帮助中心" flat></q-btn>
<q-btn v-if="LoginUser.accountId <= 0" label="注册" flat></q-btn>
<template v-if="LoginUser.accountId > 0">
<q-btn v-if="LoginUser.id <= 0" label="注册" flat></q-btn>
<template v-if="LoginUser.id > 0">
<q-btn-dropdown
style="color: #444; font-weight: bold"
class="q-ml-lg"
icon="iconfont iconicon-unlogin"
:label="LoginUser.name"
unelevated
>
<template v-slot:label>
<img class="avatar" v-if="LoginUser.photo" :src="LoginUser.photo" />
<img class="avatar" v-else src="../../assets/img/avatar.png" />
<!-- <span>{{LoginUser.name || LoginUser.mailbox}}</span> -->
</template>
<div class="row no-wrap q-pa-md">
<div class="column">
<q-list>
......@@ -510,6 +513,7 @@ export default {
},
mounted() {
this.isHome = this.$router.history.current.path==='/' || this.$router.history.current.path==='/index'
console.log('JSON.parse(window.localStorage.getItem("b2bUser"))', JSON.parse(window.localStorage.getItem("b2bUser")))
if (localStorage.b2bUser) {
this.LoginUser = JSON.parse(window.localStorage.getItem("b2bUser"));
}
......@@ -710,6 +714,11 @@ export default {
</script>
<style>
.avatar {
width: 38px;
height: 38px;
border-radius: 50%;
}
.nav-items {
position: relative;
}
......
......@@ -747,7 +747,7 @@ this.dayArray = this.dayArray.filter(item => arr.includes(item.id))
return
}
this.CommonJump(
"/detail/" + encodeURIComponent(item.id) + "/" + item.tcid,
"/detail/" + encodeURIComponent(item.id) + "/" + item.tcid + "/" + item.configId,
{}
);
},
......
<style scoped>
@import url('../../../assets/trip/block/index.css');
.fz15{
font-size: 15px;
}
.fz28{
font-size: 28px;
}
</style>
<template>
<div class="trip-box">
......
......@@ -102,6 +102,9 @@
.f30 {
font-size: 30px;
}
.f34 {
font-size: 34px;
}
.f36 {
font-size: 36px;
}
......@@ -121,4 +124,7 @@
display:-webkit-box; /* 盒模型 */
-webkit-line-clamp:2; /* 限制文本行数 */
-webkit-box-orient:vertical; /* 盒内子元素布局方向 */
}
.primary {
color: $primary;
}
\ No newline at end of file
......@@ -20,6 +20,7 @@
<!-- <script async defer crossorigin="anonymous" src="https://connect.facebook.net/zh_CN/sdk.js#xfbml=1&version=v7.0" nonce="bDrSmWhp"></script> -->
<!-- <script type="text/javascript" src="https://api.map.baidu.com/api?v=1.0&type=webgl&ak=OBd2bhrqKUSbQGpniCZ996suti9YG7Bc"></script> -->
<script src="https://api.map.baidu.com/api?type=webgl&v=2.0&ak=OBd2bhrqKUSbQGpniCZ996suti9YG7Bc"></script>
<script src="http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
<script>
function countryCb(r) {
if (!r) {
......
......@@ -190,6 +190,8 @@
tcid: 0,
teamType: 0,
isGetPriceFlight: true,
pType: 1,//类型 1 来源B2C
newConfigId: 0,//列表里的configId
},
isShow: false,
dataList: {},
......@@ -220,6 +222,9 @@
if (this.$route.params.tcid) {
this.msg.tcid = decodeURIComponent(this.$route.params.tcid)
}
if (this.$route.params.newConfigId) {
this.msg.newConfigId = decodeURIComponent(this.$route.params.newConfigId)
}
},
mounted() {
if (localStorage.baseifo) {
......
......@@ -117,7 +117,7 @@
>
<div class="col q-mr-lg">
<div class="text-h6 ellipsis-2-lines">{{ dataList.Name }}</div>
<!-- <div class="text-h6 ellipsis-2-lines">{{ dataList.Description }}</div> -->
<div class="text-grey-7 fz17 ellipsis-1-lines">{{ dataList.Description }}</div>
<div class="q-mt-md f12 text-grey-6">
<q-icon
name="iconfont icondingweixiao"
......@@ -277,9 +277,11 @@
<template v-if="currentPrice && currentPrice.startDate">
<order-preview
class="q-pa-md"
:dataList="dataList"
:configId="msg.configId"
:Month="currentYM.str"
:CarTypeList="dataList.CarTypeList"
:AirportList="dataList.AirportList"
:price="currentPrice"
@reset="resetHandler"
@getPriceList="getPriceList"
......@@ -302,12 +304,13 @@
>
<span class="q-mr-md">行程標準出行方案</span>
<q-chip
v-if="dataList.FreeCancelDay>0"
square
color="orange"
size="sm"
text-color="grey-2"
class="text-light"
label="3天前可免费取消"
:label="`${dataList.FreeCancelDay}天前可免费取消`"
/>
</div>
<!-- <div class="text-grey f12">
......@@ -349,10 +352,11 @@
關於此方案
</div>
<q-chip
v-if="dataList.FreeCancelDay>0"
class="transparent q-mr-xl no-padding"
square
icon="iconfont iconcancel"
label="3天前可免費取消"
:label="`${dataList.FreeCancelDay}天前可免费取消`"
/>
</div>
<div class="q-mt-lg row" v-if="$q.platform.is.desktop">
......@@ -365,9 +369,11 @@
</div>
<div class="col q-ml-xl">
<order-preview
:dataList="dataList"
:configId="msg.configId"
:Month="currentYM.str"
:CarTypeList="dataList.CarTypeList"
:AirportList="dataList.AirportList"
:price="currentPrice"
@reset="resetHandler"
@getPriceList="getPriceList"
......@@ -439,6 +445,60 @@
'q-px-md': $q.screen.width < 1220 && $q.platform.is.mobile,
}"
></div>
<div
id="assemblypoint"
class="text-h5 text-weight-bold text-left q-mt-xl"
ref="assemblypoint"
:class="{
'q-px-md': $q.screen.width < 1220 && $q.platform.is.mobile,
}"
>
接送點範圍
</div>
<div
class="q-mt-lg trip-text rounded-borders q-mb-xl"
style="border: 1px dashed var(--q-color-warning)"
:class="{
'q-mx-md': $q.screen.width < 1220 && $q.platform.is.mobile,
}"
v-for="(x,index) in dataList.PlaceList">
<div class="q-pa-md" style="border-bottom: 1px dashed var(--q-color-warning)">
<div class="text-weight-bold text-h6">地點名稱:{{x.Name}}</div>
<div class="text-grey-9">地址:{{x.Address}}</div>
</div>
<div class="q-pa-md" :class="{
'q-mx-md': $q.screen.width < 1220 && $q.platform.is.mobile,
}">
<componentsMap :AddressObj="x"/>
</div>
</div>
<div
id="experiencelocation"
class="text-h5 text-weight-bold text-left q-mt-xl"
ref="experiencelocation"
:class="{
'q-px-md': $q.screen.width < 1220 && $q.platform.is.mobile,
}"
>
機場地點
</div>
<div
class="q-mt-lg trip-text rounded-borders q-mb-xl"
style="border: 1px dashed var(--q-color-warning)"
:class="{
'q-mx-md': $q.screen.width < 1220 && $q.platform.is.mobile,
}"
v-for="(x,index) in dataList.AirportList">
<div class="q-pa-md" style="border-bottom: 1px dashed var(--q-color-warning)">
<div class="text-weight-bold text-h6">地点名称:{{x.Name}}</div>
<div class="text-grey-9">地址:{{x.Address}}</div>
</div>
<div class="q-pa-md" :class="{
'q-mx-md': $q.screen.width < 1220 && $q.platform.is.mobile,
}">
<componentsMap :AddressObj="x"/>
</div>
</div>
<div
id="warning"
class="text-h5 text-weight-bold text-left q-mt-xl"
......@@ -544,6 +604,8 @@ import OrderPreview from "src/components/car/orderPreview.vue";
import smaple from "src/components/trip/smaple.vue";
import Trip from "src/components/trip/trip.vue";
import block from "src/components/trip/block/index";
import { date } from "quasar";
import componentsMap from "../components/car/Map.vue";
import * as dayjs from "dayjs";
export default {
props: [],
......@@ -626,6 +688,18 @@ export default {
isActive: false,
display: "購買須知",
},
{
id: "#assemblypoint",
top: 0,
isActive: false,
display: "接送點範圍",
},
{
id: "#experiencelocation",
top: 0,
isActive: false,
display: "機場地點",
},
{
id: "#tips",
top: 0,
......@@ -652,6 +726,7 @@ export default {
smaple,
Trip,
block,
componentsMap
},
watch: {
days: {
......@@ -678,6 +753,13 @@ export default {
}
},
mounted() {
const timeStamp = Date.now()
const formattedString = date.formatDate(timeStamp, 'YYYY-MM-DD')
this.currentYM = {
year: date.formatDate(timeStamp, 'YYYY'),
month: date.formatDate(timeStamp, 'MM'),
str: formattedString
}
if (localStorage.baseifo) {
this.TripConfig = JSON.parse(window.localStorage.getItem("baseifo"));
}
......@@ -842,15 +924,21 @@ export default {
},
(r) => {
if (r.data.resultCode == 1) {
let arr = []
r.data.data.forEach(x=>{
x.startDate = x.Date
x.originalB2CPrice = x.Price
x.remainNum = 1
x.Count = 1
x.isSupportChildren = 1
x.safeMoney = 0
if(x.Price){
let dataObj = {
startDate: x.Date,
originalB2CPrice: x.Price,
remainNum: 1,
Count: 1,
isSupportChildren: 1,
safeMoney: 0,
}
arr.push(dataObj)
}
})
this.priceList = JSON.parse(JSON.stringify(r.data.data))
this.priceList = JSON.parse(JSON.stringify(arr))
}
},null)
......
......@@ -23,7 +23,7 @@
class="col product-price text-subtitle1 text-weight-bold f30"
style="text-align: left"
>
<span>CNY {{ moneyFormat(dataList.MinPrice, 0) }}</span>
<span>CNY {{ moneyFormat(MinPrice, 0) }}</span>
<span class="q-ml-sm f16 text-grey-7"></span>
</span>
<q-btn
......@@ -156,9 +156,9 @@
$q.platform.is.mobile,
}"
>
<div class="product-price f30 bold" v-if="dataList.MinPrice > 0">
<div class="product-price f30 bold" v-if="MinPrice > 0">
<!-- CNY:{{ dataList. }} -->
CNY:{{ moneyFormat(dataList.MinPrice, 0) }}
CNY:{{ moneyFormat(MinPrice, 0) }}
<span class="f16 text-grey-6 normal"></span>
</div>
<div v-else class="text-subtitle1 f30 bold text-grey-6">暫無報價</div>
......@@ -309,7 +309,7 @@
</template>
</div> -->
<!--方案选择区 -->
<select-room :detail="dataList"></select-room>
<select-room @change="(value) => MinPrice = value" :detail="dataList"></select-room>
<div class="text-h6 q-pt-lg" v-if="$q.platform.is.mobile">
所選方案詳情
</div>
......@@ -616,6 +616,7 @@ export default {
},
data() {
return {
MinPrice: 0,
selectedCar: "",
tab: "",
searchDate: "",
......@@ -816,8 +817,10 @@ export default {
console.log("getData", r);
this.dataList = r.data.data;
this.dataList.FacilityServices = JSON.parse(this.dataList.FacilityServices)
this.dataList.imgCover = this.dataList.ImageList;
this.dataList.imgCover = this.dataList.List.map(item => {
return item.Path
});
conosle.log(this.dataList.imgCover)
this.isShow = true;
this.isDirect = this.dataList.isDirect;
if (this.dataList.videoStr && this.dataList.videoStr != "") {
......
......@@ -621,6 +621,8 @@ export default {
tcid: 0,
teamType: 0,
isGetPriceFlight: true,
pType: 1,//类型 1 来源B2C
newConfigId: 0,//列表里的configId
},
currentPrice: {},
isShow: false,
......@@ -752,6 +754,9 @@ export default {
if (this.$route.params.tcid) {
this.msg.tcid = decodeURIComponent(this.$route.params.tcid);
}
if (this.$route.params.newConfigId) {
this.msg.newConfigId = decodeURIComponent(this.$route.params.newConfigId)
}
},
mounted() {
window.addEventListener("scroll", this.handleScroll);
......
......@@ -341,6 +341,7 @@ export default {
if(!this.startDate && arr.length) {
this.startDate = day.DateStr
this.minPrice = Math.min(...arr)
this.$emit('change', this.minPrice)
}
return {
min: Math.min(...arr),
......
<style>
.login-box {
max-width: 420px;
padding: 50px 40px;
margin: 40px auto;
background-color: #fff;
border-radius: 5px;
background-clip: padding-box;
box-shadow: 0 2px 4px 0 rgba(10, 8, 8, .5);
}
.login {
background: url('../assets/img/login-bg.png');background-size: cover;
width: 100%;
height: 100%;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.login-box {
max-width: 436px;
padding: 30px 40px;
margin: 100px auto;
position: absolute;
right: 360px;
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 .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 {
font-size: 16px;
margin-bottom: 15px;
color: #999;
text-align: center;
}
.login-box .tip-text a {
color: #00afff;
}
.login-box .tip-text a {
color: #00afff;
}
.login_row {
width: 100%;
}
.login_row {
width: 100%;
}
.form-group {
position: relative;
margin-bottom: 15px;
}
.form-group {
position: relative;
margin-bottom: 15px;
}
.login_labelName {
margin-bottom: 10px;
font-size: 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;
}
.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">
<img :src="logo" class="tw_logo" />
<p class="tip-text">
<!-- <img :src="logo" class="tw_logo" /> -->
<!-- <p class="tip-text">
還沒有帳號嗎?立即<a style="cursor:pointer;" @click="CommonJump('/register',{})">免費加入</a>
</p>
<div class="login_row">
<div class="form-group">
<div class="login_labelName">電子郵件</div>
<q-input outlined v-model="loginMsg.account" class="bg-grey-1" />
</div>
<div class="form-group">
<div class="login_labelName">密碼</div>
<q-input v-if="flag==1" outlined v-model="loginMsg.password" type="text" ref="pwd"
class="bg-grey-1 login_pwd" />
<q-input v-if="flag==2" outlined v-model="loginMsg.password" type="password" ref="pwd"
class="bg-grey-1 login_pwd" />
<i class="iconfont iconyanjing_xianshi" v-if="flag==1" @click="flag=2"></i>
<i class="iconfont iconbiyan" v-if="flag==2" @click="flag=1"></i>
</p> -->
<div v-if="loginType !== 'wechat'">
<div class="flex items-end justify-between">
<div class="f34 bold">{{ isLogin ? "登錄" : "註冊" }}</div>
<div class="f16 bold cursor-pointer" v-if="loginType !== 'bindEmail'" @click="loginToRegister">
{{ isLogin ? "註冊賬號" : "返回登錄" }}
</div>
</div>
<div>
<q-btn color="primary" unelevated style="width:100%;height:50px;margin-top:20px;" filled :label="mylabel"
@click="login" />
<div class="login_row">
<div class="form-group">
<div class="login_labelName">輸入郵箱</div>
<q-input outlined v-model="loginMsg.Mailbox" />
<div class="primary q-mt-sm" v-show="tips">邮箱格式有误,请核实</div>
</div>
<div v-if="loginType === 'MailCode'|| loginType === 'bindEmail'">
<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.MailCode" type="text" />
<div class="q-mt-sm" :class="cutDown ? 'text-grey-6' : ''">
{{ cutDown ? cutDown + "秒后可重新发送" : "重新發送驗證碼" }}
</div>
</div>
</div>
<div v-if="!isLogin || loginType ==='PassWord'" class="form-group">
<div class="login_labelName flex justify-between items-center">
密碼<span class="text-grey-6 cursor-pointer" v-if="loginType === 'PassWord'" @click="resetPassword">忘記密碼</span>
</div>
<q-input
v-if="flag == 1"
outlined
v-model="loginMsg.PassWord"
type="text"
ref="pwd"
/>
<q-input
v-if="flag == 2"
outlined
v-model="loginMsg.PassWord"
type="PassWord"
ref="pwd"
/>
<i
class="iconfont iconyanjing_xianshi"
v-if="flag == 1"
@click="flag = 2"
></i>
<i
class="iconfont iconbiyan"
v-if="flag == 2"
@click="flag = 1"
></i>
</div>
<div
class="text-right f16 text-grey-6 cursor-pointer"
v-if="isLogin"
@click="changeLoginType"
>
{{
loginType === "PassWord" ? "使用郵箱驗證登陸" : "使用賬號密碼登陸"
}}
</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 class="flex flex-center">
<div
class="text-center text-grey-6 q-px-lg inline-block bg-white"
style="z-index: 1; margin: 0 auto"
>
更多登录方式
</div>
</div>
<q-separator style="margin-top: -10px" />
<div class="flex flex-center q-mt-lg q-mb-xl">
<div
@click="useWechatLogin"
class="type-item flex flex-center cursor-pointer"
v-for="item in typeList"
:key="item"
>
<img :src="require(`src/assets/img/${item}.png`)" />
</div>
</div>
<div class="flex items-start no-wrap">
<div><q-checkbox v-model="isAgree"></q-checkbox></div>
<span
>在使用印象的产品和服务前,我已阅读
理解并同意印象的<a>《隐私政策》</a><a>《使用条款》</a></span
>
</div>
</div>
</div>
<!-- 微信扫码页面 -->
<div v-show="loginType === 'wechat'">
<div class="bold f34">微信登錄</div>
<!-- <qrcode-vue></qrcode-vue> -->
<div id="login_container"></div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "Login",
components: {
import QrcodeVue from "qrcode.vue";
export default {
name: "Login",
components: {
QrcodeVue,
},
data() {
return {
isSend: false,
tips: false,
cutDown: 0,
loginType: "PassWord", // PassWord 邮箱密码,verify,邮箱验证码,wechat微信登录 微信登录没有绑定邮箱时跳转绑定邮箱业务逻辑
isAgree: false,
isLogin: true,
loginMsg: {
RB_Group_Id: 0,
Mailbox: "",
PassWord: "",
MailCode: "",
},
// , 'google', 'facebook', 'apple'
typeList: ["wechat"],
logo: "",
flag: 2,
mylabel: "登入",
};
},
created() {},
mounted() {
console.log('login', this.$route.query)
const {code, state} = this.$route.query
if(code) {
this.fetchLoginInfo(code, state)
this.isLogin = false
this.loginType = 'bindEmail'
}
this.getOpenInfo()
var jObj = JSON.parse(localStorage.getItem("groupinfo"));
this.loginMsg.RB_Group_Id = jObj.GroupId;
//获取网站基础配置
if (localStorage.baseifo) {
var jObj = JSON.parse(window.localStorage.getItem("baseifo"));
this.logo = jObj.Config.Logo;
}
},
watch: {
loginType: function () {
this.resetInfo();
},
data() {
return {
loginMsg: {
RB_Group_Id: 0,
account: "",
password: ""
},
methods: {
fetchLoginInfo(code, state) {this.apipost(
'getWXToken_post',
{
code,
state
},
logo: '',
flag: 2,
mylabel:'登入'
};
(res) => {
const {type, id } = res.data.data
if(type === 1) {
this.CommonJump("/index", {});
} else {
this.isLogin = false
// 绑定邮箱
this.loginType = 'bindEmail'
this.userId = id
}
},
(err) => {}
);
},
created() {
getOpenInfo() {
this.apipost(
"GetOpenInfo_post",
{},
(r) => {
this.openInfo = r.data.data;
},
null
);
},
mounted() {
var jObj = JSON.parse(localStorage.getItem('groupinfo'));
this.loginMsg.RB_Group_Id = jObj.GroupId;
//获取网站基础配置
if (localStorage.baseifo) {
var jObj = JSON.parse(window.localStorage.getItem('baseifo'));
this.logo = jObj.Config.Logo;
setWechatCode() {
const { AppID, State, OpenRedirectUri } = this.openInfo;
const obj = new WxLogin({
self_redirect: false,
id: "login_container",
appid: AppID,
scope: "snsapi_login",
redirect_uri: OpenRedirectUri, // 是 重定向地址,需要进行UrlEncode
state: State,
style: "",
href: "",
});
},
loginToRegister() {
this.isLogin = !this.isLogin;
if(!this.isLogin) {
this.mylabel = "注册";
this.loginType = 'MailCode'
} else {
this.mylabel = "登录"
}
},
methods: {
login() {
if (this.loginMsg.account == '') {
this.$q.notify({
type: 'negative',
message: '请输入账号',
position: 'top',
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
})
return;
}
if (this.loginMsg.password == '') {
this.$q.notify({
type: 'negative',
message: '请输入密码',
position: 'top',
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
})
return;
sendVerify() {
if(this.inSending) return
this.inSending = true
if (this.verifyEmail()) {
let SendType = this.userId ? 3 : (this.isLogin ? 1 : 0);
this.apipost('directCustomer_post_SendMail', {Mailbox: this.loginMsg.Mailbox, SendType: SendType, Id: this.userId}, (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();
}
this.mylabel='提交中...';
this.apipost(
"b2b_post_Login", this.loginMsg,
res => {
this.mylabel='登入';
if (res.data.resultCode == 1) {
var jsonData = JSON.stringify(res.data.data);
window.localStorage.setItem("b2bUser", jsonData);
this.CommonJump('/index', {})
} else {
this.$q.notify({
type: 'negative',
message: res.data.message,
position: 'top',
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
})
}
},
err => {}
);
}, 1000);
},
resetInfo() {
this.isSend = false;
this.tips = false;
this.loginMsg = {
RB_Group_Id: 0,
Mailbox: "",
PassWord: "",
MailCode: "",
};
if (this.timer) {
clearTimeout(this.timer);
}
this.cutDown = 0;
},
};
verifyEmail() {
if (/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(this.loginMsg.Mailbox)) {
this.tips = false;
return true;
} else {
// 提示用户邮箱格式有误
this.tips = true;
return false;
}
},
changeLoginType() {
if (this.loginType === "PassWord") {
this.loginType = "MailCode";
} else {
this.loginType = "PassWord";
}
},
useWechatLogin() {
// this.loginType = "wechat";
// this.setWechatCode()
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}&response_type=code&scope=snsapi_login&state=${State}&wechat_redirect=${redirect_uri}`
// this.windowObjectReference = window.open(url, 'wechat', 'left: 20,top: 20,width:200,height:200,')
// console.log('windowObjectReference', this.windowObjectReference)
// setTimeout(() => {console.log(this.windowObjectReference.close())}, 1000)
window.location.href = url
},
login() {
if(this.mylabel === "提交中...") {
return
}
if (!this.isAgree) {
this.$q.notify({
type: "negative",
message: "请先同意平台使用协议",
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
return;
}
if (this.loginMsg.Mailbox == "") {
this.$q.notify({
type: "negative",
message: "请输入账号",
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
return;
}
if (this.loginMsg.PassWord == "" && (this.loginType === 'PassWord')) {
this.$q.notify({
type: "negative",
message: "请输入密码",
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
return;
}
if (this.loginMsg.MailCode == "" && (this.loginType === 'MailCode' || this.loginType === 'bindEmail')) {
this.$q.notify({
type: "negative",
message: "请输入邮箱验证码",
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
return;
}
let params = {...this.loginMsg}
let url = 'MailboxPwdLogin_post' // 密码登录
if(!this.isLogin) {
url = 'directCustomer_post_MailRegister'
} else if(this.loginType === 'MailBox') {
ulr = 'MailboxLogin_post'
}
if(this.loginType === 'bindEmail') {
url = 'BindMailByOpenId_post'
params.Unoinid = this.userId
}
this.mylabel = "提交中...";
this.apipost(
url,
params,
(res) => {
this.mylabel = "登入";
if (res.data.resultCode == 1) {
var jsonData = JSON.stringify(res.data.data);
window.localStorage.setItem("b2bUser", jsonData);
console.log('userInfo',jsonData, res.data.data)
this.CommonJump("/index", {});
} else {
this.$q.notify({
type: "negative",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
},
(err) => {}
);
},
resetPassword() {
this.CommonJump("/resetPassword", {});
}
},
};
</script>
......@@ -1275,7 +1275,9 @@
//请求参数
msg: {
ID: 0,
tcid: 0
tcid: 0,
pType: 1,//类型 1 来源B2C
newConfigId: 0,//列表里的configId
},
dataList: {},
scrollobj: null,
......@@ -1307,6 +1309,7 @@
mounted() {
this.msg.ID = this.$route.query.ID;
this.msg.tcid = this.$route.query.tcid;
this.msg.newConfigId = this.$route.query.ConfigId;
this.crtnav = 'tripLine';
this.getTrip();
......@@ -1317,6 +1320,7 @@
query: {
ID: decodeURIComponent(this.msg.ID),
tcid: decodeURIComponent(this.msg.tcid),
newConfigId: decodeURIComponent(this.msg.newConfigId)
}
});
}
......
<style>
.login {
background: url('../assets/img/login-bg.png');background-size: cover;
width: 100%;
height: 100%;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.login-box {
width: 436px;
padding: 30px 40px;
margin: 100px auto;
position: absolute;
right: 360px;
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.Mailbox" />
<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.MailCode" type="text" />
<div class="q-mt-sm" :class="cutDown ? 'text-grey-6' : ''">
{{ cutDown ? cutDown + "秒后可重新发送" : "重新發送驗證碼" }}
</div>
</div>
</div>
<div class="form-group">
<div class="login_labelName flex justify-between items-center">
密碼
</div>
<q-input
v-if="flag == 1"
outlined
v-model="loginMsg.PassWord"
type="text"
ref="pwd"
/>
<q-input
v-if="flag == 2"
outlined
v-model="loginMsg.PassWord"
type="PassWord"
ref="pwd"
/>
<i
class="iconfont iconyanjing_xianshi"
v-if="flag == 1"
@click="flag = 2"
></i>
<i
class="iconfont iconbiyan"
v-if="flag == 2"
@click="flag = 1"
></i>
</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: {
Mailbox: "",
PassWord: "",
MailCode: "",
},
// , '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.Mailbox, SendType: 2}, (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.Mailbox)) {
this.tips = false;
return true;
} else {
// 提示用户邮箱格式有误
this.tips = true;
return false;
}
},
login() {
if(this.mylabel === "提交中...") {
return
}
if (this.loginMsg.Mailbox == "") {
this.$q.notify({
type: "negative",
message: "请输入账号",
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
return;
}
if (this.loginMsg.PassWord == "") {
this.$q.notify({
type: "negative",
message: "请输入密码",
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
return;
}
if (this.loginMsg.MailCode == "") {
this.$q.notify({
type: "negative",
message: "请输入邮箱验证码",
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
return;
}
this.mylabel = "提交中...";
this.apipost(
'ResettingPwd_post',
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>
......@@ -1010,7 +1010,9 @@
ID: 0,
tcid: 0,
isDes:0,
NewId:''
NewId:'',
pType: 1,//类型 1 来源B2C
newConfigId: 0,//列表里的configId
},
showMapType:0,
dataList: {},
......@@ -1039,13 +1041,15 @@
this.isInChina()
this.msg.ID = this.$route.query.ID;
this.msg.tcid = this.$route.query.tcid;
this.msg.newConfigId = this.$route.query.ConfigId;
//判断为pc端
if(this.$q.platform.is.desktop){
this.$router.push({
path: 'newTrip',
query: {
ID: decodeURIComponent(this.msg.ID),
tcid: decodeURIComponent(this.msg.tcid)
tcid: decodeURIComponent(this.msg.tcid),
newConfigId: decodeURIComponent(this.msg.newConfigId)
}
});
}
......
......@@ -37,7 +37,7 @@ const routes = [{
component: () =>
import ('pages/detailsHotal.vue')
}, { // 旅程
path: '/detail/:id/:tcid',
path: '/detail/:id/:tcid/:newConfigId',
component: () =>
import ('pages/detailsNew.vue')
}, {
......@@ -108,6 +108,16 @@ const routes = [{
import ('pages/login.vue')
}]
},
{
path: '/resetPassword',
component: () =>
import ('pages/resetPassword.vue'),
children: [{
path: '/resetPassword',
component: () =>
import ('pages/resetPassword.vue')
}]
},
{
path: '/newTrip',
component: () =>
......
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