Commit 59bd7dfd authored by 沈良进's avatar 沈良进

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

parents 6349bb0b 4f8de789
......@@ -170,7 +170,8 @@ module.exports = function( /* ctx */ ) {
'QStep',
'QToggle',
'QTime',
'QSpace'
'QSpace',
'QInnerLoading'
],
directives: [
......
......@@ -10,7 +10,7 @@ export default {
};
</script>
<style>
@import url("//at.alicdn.com/t/c/font_1890699_l4zj0bx0p69.css");
@import url("//at.alicdn.com/t/c/font_1890699_sm7qminrp2.css");
@font-face {
font-family: "oswald";
src: url("https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/smallapp/Oswald-Regular.ttf");
......
......@@ -135,7 +135,7 @@ Vue.prototype.apiJavaPost = function(cmd, msg, successCall, faildCall) {
var GroupId = 0;
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().token;
key = this.getLocalStorage().secretKey;
key = '' //this.getLocalStorage().secretKey;
}
if (localStorage.groupinfo && localStorage.groupinfo != 'undefined') {
var groupJson = JSON.parse(localStorage.groupinfo);
......
<template>
<div class="column full-height">
<div class="col">
<div class="text-right" v-if="$q.platform.is.desktop">
<q-btn
color="primary"
icon="refresh"
label="全部重選"
@click="resetHandler"
flat
/>
</div>
<div class="text-grey-6 f12 q-my-md">選擇門票類型</div>
<div class="row wrap">
<div v-for="(x,i) in dataList.TicketList" :key="i">
<q-chip size="14px" clickable @click="handleSelect(x)"
:text-color="selectedObj&&selectedObj.Id==x.Id?'white':'dark'"
:color="selectedObj&&selectedObj.Id==x.Id?'primary':'grey-3'" square>{{ x.TicketName }}</q-chip>
</div>
</div>
<div class="text-grey-6 f12 q-my-md">選擇數量</div>
<div class="row items-end">
<div class="col" :class="{'column':$q.platform.is.mobile}">
<div v-if="selectedObj">
<span class="text-subtitle2 text-weight-bold">{{selectedObj.TicketName}}</span>
<span class="text-grey-6 f12 q-ml-sm"></span>(1人/票)</span>
</div>
<div v-if="$q.platform.is.mobile">
<span class="text-grey-7 product-price" style="font-size: 13px">
CNY {{ moneyFormat(p.originalB2CPrice, 0) }} /每票
</span>
</div>
</div>
<div class="row items-end">
<span v-if="$q.platform.is.desktop" class="text-grey-7 product-price" style="font-size: 13px">
CNY {{ moneyFormat(p.originalB2CPrice, 0) }} /每票
</span>
<q-input
style="width: 150px"
@input="changePeople"
v-model="chosenObj.Count"
class="col"
:class="{
'q-ml-sm q-px-none q-pl-none': $q.platform.is.desktop,
}"
mask="#"
reverse-fill-mask
dense
standout
readonly
>
<template v-slot:prepend>
<q-btn
color="primary"
size="sm"
class="q-px-none"
flat
icon="remove"
@click="addPeople('Count', -1)"
/>
</template>
<template v-slot:append>
<q-btn
color="primary"
size="sm"
class="q-px-none"
flat
icon="add"
@click="addPeople('Count', 1)"
/>
</template>
</q-input>
</div>
</div>
</div>
<div class="q-mt-md q-pt-md" style="border-top: 1px dashed #eee">
<div class="row items-center">
<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"
: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="f12 text-negative"
:class="{'q-mr-lg':$q.platform.is.desktop}"
v-if="p.startDate&&!selectedObj">
{{`請選擇上面的門票類型`}}
</span>
</span>
<q-btn color="primary" label="立即訂購" unelevated class="q-px-lg"
:disable="sumPrice==0||!selectedObj"
@click="goOrderHandler"/>
</div>
</div>
</div>
</template>
<script>
import { date } from "quasar";
export default {
props: ["dataList","price","configId","Month"],
watch: {
price: {
handler(n, o) {
this.p = n;
if(n&&n.startDate){
this.chosenObj.startDate = n.startDate;
}
this.calcMoney()
},
deep: true,
immediate: false
},
dataList: {
handler(n, o) {
this.dataList = n;
},
deep: true,
immediate: true
},
},
data() {
return {
p: {},
chosenObj: null,
sumPrice:0,
selectedObj: null,
priceList: [],
};
},
created() {
this.initModel();
if(this.p.startDate){
this.chosenObj.startDate = this.p.startDate;
this.calcMoney()
this.getCarPriceData2()
}
},
methods: {
goOrderHandler(){
let order = {
CouponsId: this.configId,
TicketId: this.selectedObj.Id,
Month: this.Month,
startDate: this.p.startDate,
originalB2CPrice: this.p.originalB2CPrice,
orderInfo: this.chosenObj,
}
let key = this.$md5(JSON.stringify(order))
let pickuporderScenTickets = localStorage.getItem('pickuporderScenTickets')
pickuporderScenTickets = pickuporderScenTickets?JSON.parse(pickuporderScenTickets):[]
pickuporderScenTickets.push({
key,
order
})
localStorage.setItem("pickuporderScenTickets",JSON.stringify(pickuporderScenTickets))
this.CommonJump('/PickuporderForm/'+key, {});
},
// 获取报价的详情
getCarPriceData2() {
this.priceList = []
this.apipost(
"b2c_get_GetTicketCouponsMonthPrice",
{
CouponsId: this.configId,
TicketId: this.selectedObj.Id,
Month: this.Month,
},
(r) => {
if (r.data.resultCode == 1) {
let arr = []
r.data.data.forEach(x=>{
if(x.Price){
if(this.chosenObj.startDate==x.Date){
this.p.originalB2CPrice = x.Price
}
let dataObj = {
startDate: x.Date,
originalB2CPrice: x.Price,
remainNum: 1,
Count: 1,
isSupportChildren: 1,
safeMoney: 0,
}
if(date.formatDate(Date.now(), 'YYYY-MM-DD')!=x.Date&&x.Date>date.formatDate(Date.now(), 'YYYY-MM-DD')){
arr.push(dataObj)
}
}
})
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.selectedObj.Id)
}else{
let dataObj = {
startDate: '',
originalB2CPrice: '',
remainNum: 0,
Count: 0,
safeMoney: 0,
PeopleNum: 1
}
this.priceList.push(dataObj)
this.$emit('getPriceList',JSON.stringify(this.priceList),this.selectedObj.Id)
this.p.originalB2CPrice = 0
this.resetHandler()
}
}
},null)
},
handleSelect(item){
this.selectedObj = item
setTimeout(()=>{
this.getCarPriceData2()
},100)
},
initModel() {
this.sumPrice=0
this.chosenObj = {
startDate: "",
Count: 1,
remark: "",
};
},
resetHandler(type) {
if(type){
this.selectedObj = null
}
setTimeout(()=>{
this.p = {};
this.initModel()
},100)
this.$emit("reset");
},
changePeople(val) {},
addPeople(m, i, isDf = false) {
this.chosenObj[m] = parseInt(this.chosenObj[m]) + i;
if(m!='Count'){
this.chosenObj[m] = this.chosenObj[m] < 0 ? 0 : this.chosenObj[m]++;
}else{
this.chosenObj[m] = this.chosenObj[m] < 1 ? 1 : this.chosenObj[m]++;
}
this.calcMoney()
},
calcMoney() {
if (!this.p) return;
let money = this.p.originalB2CPrice * this.chosenObj.Count;
this.sumPrice = money;
},
},
};
</script>
<style></style>
<template>
<q-card flat class="q-pa-md q-mt-lg">
<q-card flat class="q-pa-md q-mt-lg" v-if="coupons">
<div class="row items-center">
<div class="text-subtitle1 text-weight-bolder q-mb-md col">
<span>優惠券</span>
<span class="text-weight-regular q-ml-sm text-body2">(可用優惠券 0 張)</span>
<span class="text-weight-regular q-ml-sm text-body2">(可用優惠券 {{ coupons.length }} 張)</span>
</div>
<q-toggle v-model="showDisable" label="顯示不可用優惠券" style="zoom:0.8;margin-top: -24px;" v-if="isExplends"/>
<!-- <q-toggle v-model="showDisable" label="顯示不可用優惠券" style="zoom:0.8;margin-top: -24px;" v-if="isExplends"/> -->
<q-icon :name="isExplends?'keyboard_arrow_up':'keyboard_arrow_down'" @click="$event=>isExplends=!isExplends" size="32px" color="grey-9" class="q-ml-md cursor-pointer" style="margin-top:-10px;"/>
</div>
<div v-if="isExplends">
<div class="row q-col-gutter-md">
<div :class="filedWidth">
<div class="cursor-pointer">
<div :class="filedWidth" v-for="(x,i) in coupons" :key="i">
<div class="cursor-pointer" :class="{'unUsed':currentPrice<x.useCondition}">
<div class="coupon-head">
<div class="check-tools">
<q-checkbox v-model="chosenCouponId" :value="1" dense color="teal" />
<div class="check-tools" v-if="currentPrice>=x.useCondition">
<q-checkbox v-model="chosenCouponId" :val="x.couponId" @input="changeDiscountHandler" label="" dense color="teal" />
</div>
<div class="q-pa-lg q-mt-lg">
<div class="row items-center">
<div class="text-h4 text-weight-bold text-white col">
{{ moneyFormat(500,2) }}
<div class="text-h4 text-weight-bold text-white col" v-if="x.couponsType==1">
{{ moneyFormat(x.denomination,2) }}
</div>
<div class=" f12 text-white">滿 2000 可用</div>
<div class="text-h4 text-weight-bold text-white col" v-if="x.couponsType==2">
{{ x.denomination }}
<span class="q-ml-sm text-weight-thin text-subtitle1"></span>
</div>
<div class=" f12 text-white">滿 {{ x.useCondition }} 可用</div>
</div>
<div class="q-mt-sm f12" style="color:#195954">有效期至:2023.02.30</div>
<div class="q-mt-sm f12" style="color:#195954">有效期至:{{ x.expirationDate}}</div>
</div>
</div>
<div class="q-px-lg q-py-md coupon-content">
......@@ -34,12 +38,12 @@
</div>
<div class="row q-mt-sm">
<div class="col-5">使用品類:</div>
<div class="">多日遊行程適用</div>
<div class="">{{ x.rangeName }}</div>
</div>
</div>
</div>
</div>
<div :class="filedWidth">
<!-- <div :class="filedWidth">
<div class="unUsed">
<div class="coupon-head">
<div class="q-pa-lg q-mt-lg">
......@@ -63,9 +67,9 @@
</div>
</div>
</div>
</div>
</div> -->
</div>
<div class="text-center q-mt-lg" v-if="1==2">
<div class="text-center q-mt-lg" v-if="coupons.length==0">
<p>
<img src="~assets/sad.svg" style="width: 50px" />
</p>
......@@ -76,8 +80,21 @@
</template>
<script>
import EnumHelper from 'src/utils/enumhelper';
import ProductTypeEnum from 'src/utils/producttypeenum';
import {date} from 'quasar'
export default {
props:["goodsInfo"],
props:{
productType:{
type:Number,
required:true
},
currentPrice:{
type:Number,
required:false,
default:0
}
},
computed: {
filedWidth() {
return {
......@@ -90,13 +107,56 @@ export default {
return {
showDisable:false,
isExplends:false,
chosenCouponId:false
chosenCouponId:[],
couponsUseScope:1,
coupons:null
};
},
created() {
this.couponsUseScope = this.productType+1
this.getProductCouponHandler()
},
methods: {
changeDiscountHandler(){
}
changeDiscountHandler(x){
if(this.chosenCouponId.length>1){
this.chosenCouponId.splice(0,1)
}
let t= null
if(this.chosenCouponId.length==1){
t=this.coupons.find(x=>x.couponId==this.chosenCouponId[0])
if(t.couponsType==1){
t.discountMoney=t.denomination
}else{
t.discountMoney=((1-parseFloat(t.denomination)/10.0)*parseFloat(this.currentPrice)).toFixed(2)
}
}
console.log(t)
this.$emit("change",t)
},
getProductCouponHandler(){
this.apiJavaPost(
"/api/b2b/user/getUserCanUseCouponList",
{
lineId:0,
lineteamId:0,
CouponsUseScope:this.couponsUseScope
},
res => {
this.coupons = res.data.data
if(this.coupons && this.coupons.length>0){
this.coupons.forEach(x=>{
x.rangeName = EnumHelper.ParseToEnum(ProductTypeEnum,this.couponsUseScope,'value').desc
x.expirationDate = date.formatDate(x.expirationDate,'YYYY.MM.DD')
})
this.isExplends = this.coupons.length>0
}else{
this.coupons = []
}
},
null
);
},
},
}
</script>
......
......@@ -703,7 +703,7 @@ export default {
this.$nextTick(() => {
this.isPic =
document.URL.indexOf("localhost") != -1 ||
document.URL.indexOf("t.oytour.com") != -1;
document.URL.indexOf("www.oytour.com") != -1;
});
},
err => {}
......
<template>
<div class="text-center">
<q-inner-loading :showing="loading" label="正在加載中"></q-inner-loading>
<div v-if="$q.platform.is.desktop && orderNo && payUrl!='' && !loading" class="q-my-xl">
<QrcodeVue level="H" size="256" :value="payUrl"></QrcodeVue>
<div class="text-body2 q-mt-lg">請打開微信(WeChat),使用 [掃一掃],掃描上方二維碼進行支付</div>
</div>
<div class="q-my-xl" v-if="!orderNo && !loading">
創建付款連接失敗,請刷新頁面重試
</div>
</div>
</template>
<script>
import QrcodeVue from 'qrcode.vue'
export default {
data() {
return {
loading:true,
payUrl:'weixin://wxpay/bizpayurl?pr=CDXqaD1zz'
}
},
props:{
orderNo:{
type:String,
required:true
}
},
components:{QrcodeVue},
created () {
if(this.orderNo){
this.initPayInfo()
}else{
this.loading=false
}
},
methods: {
initPayInfo(){
this.apipost("GetCodeByOrderNo_post",{OrderNo:this.orderNo},r=>{
if(r.data.resultCode==1){
this.payUrl = r.data.data.code_url
if(this.$q.platform.is.mobile){
location.href=this.payUrl
}
}
this.loading=false
})
}
},
}
</script>
<style>
</style>
\ No newline at end of file
......@@ -745,6 +745,12 @@ this.dayArray = this.dayArray.filter(item => arr.includes(item.id))
{}
);
return
}else if(item.productType === 2) { // 景区门票
this.CommonJump(
"/detailsScenicSpotTicket/"+item.configId,
{}
);
return
}
this.CommonJump(
"/detail/" + encodeURIComponent(item.id) + "/" + item.tcid + "/" + item.configId,
......
......@@ -117,15 +117,18 @@ export default {
},
created() {
this.prices = this.priceList;
console.log(this.prices)
this.init();
},
methods: {
init() {
this.createChosenDateHandler();
let firstMonth = date.formatDate(
new Date(this.prices[0].startDate),
"YYYY/MM"
);
console.log(firstMonth)
let current = this.months.findIndex((x) => x.monthValue == firstMonth)
this.currentMonth = current>-1?current:0;
this.changeMonthHandler();
......
......@@ -381,7 +381,8 @@ export default {
this.chosenObj.startDate = this.p.startDate;
this.calcMoney();
if(this.p.unionCityList && this.p.unionCityList.length>0 && this.p.originalB2CPrice==this.p.RealPrice){
this.currentUnionCity = this.p.unionCityList[0]
this.changeCityHandler(this.p.unionCityList[0])
}
}
......@@ -405,7 +406,9 @@ export default {
this.chosenObj.startDate = this.p.startDate;
this.calcMoney()
if(this.p.unionCityList && this.p.unionCityList.length>0){
this.currentUnionCity = this.p.unionCityList[0]
//this.currentUnionCity = this.p.unionCityList[0]
this.changeCityHandler(this.p.unionCityList[0])
}
}
},
......@@ -487,7 +490,7 @@ export default {
this.chosenObj.etzcCount;
money += this.p.babyPrice * this.chosenObj.yeCount;
money += this.p.singleRoomPrice * this.chosenObj.df;
this.chosenObj.etCount = this.chosenObj.etbzcCount + this.chosenObj.etzcCount
let sumCount =
this.chosenObj.crCount +
this.chosenObj.etCount +
......@@ -504,9 +507,10 @@ export default {
let order = {
configId:this.travel.id,
tcid:this.p.tcid,
startCityId:this.currentUnionCity?this.currentUnionCity.cityId:this.travel.startCityId,
startCityId:this.currentUnionCity && this.currentUnionCity.cityId ?this.currentUnionCity.cityId:this.travel.startCityId,
orderInfo:this.chosenObj
}
let key = this.$md5(JSON.stringify(order))
let lineCars = localStorage.getItem('lineCars')
lineCars = lineCars?JSON.parse(lineCars):[]
......
......@@ -72,6 +72,7 @@ export default {
methods: {
formatTeam(){
let p = this.trip.priceList[0]
if(!p) return
let t = p.priceTeamType??1
t=t==0?1:t
if(t==1){
......@@ -98,16 +99,19 @@ export default {
}
},
formatTraffic() {
let z = this.trip.trafficList[0].subTraffic[0]
if (z&&z.arrivalType&&z.arrivalType == 1) {
this.traffic = '飛機往返';
} else if (z&&z.arrivalType&&z.arrivalType == 2) {
this.traffic = '巴士往返';
} else if (z&&z.arrivalType&&z.arrivalType == 3) {
this.traffic = '郵輪往返';
} else {
this.traffic = '高鐵往返';
if(this.trip.trafficList && this.trip.trafficList.length>0 && this.trip.trafficList[0].subTraffic && this.trip.trafficList[0].subTraffic.length>0){
let z = this.trip.trafficList[0].subTraffic[0]
if (z&&z.arrivalType&&z.arrivalType == 1) {
this.traffic = '飛機往返';
} else if (z&&z.arrivalType&&z.arrivalType == 2) {
this.traffic = '巴士往返';
} else if (z&&z.arrivalType&&z.arrivalType == 3) {
this.traffic = '郵輪往返';
} else {
this.traffic = '高鐵往返';
}
}
},
formatHotel(){
let h = []
......
......@@ -109,6 +109,7 @@ export default {
}
},
formatTraffice(tras) {
console.log(tras)
let txt = "從" + tras.length>0&&tras[0].startCityName;
tras.forEach((z, i) => {
if (i > 0) {
......
......@@ -11,6 +11,7 @@
}}</span>
</q-timeline-entry>
<template v-for="(y, yi) in x.dayArray">
{{ y.title }}
<q-timeline-entry
:title="y.title"
:subtitle="y.subtitle"
......@@ -38,6 +39,7 @@
<div
class="row items-center rounded-borders"
style="overflow: hidden"
v-if="y.childItem.playTimeHour > 0 || y.childItem.playTimeMinutes > 0"
>
<div
class="bg-dark text-white"
......@@ -233,6 +235,7 @@
text-color="grey-2"
dense
label="或同級別酒店"
v-else
>
<q-tooltip class="bg-dark"
>我們會儘量保證入住行程所示酒店,不排除突發的意外情況造成無法入住,我們將會為您安排同級別的酒店,請您放心選購</q-tooltip
......@@ -352,10 +355,10 @@ export default {
}
},
formatTraffice(tras) {
let txt = "從" + tras.length>0&&tras[0].startCityName;
let txt = "從" + (tras.length>0?tras[0].startCityName:'');
tras.forEach((z, i) => {
if (i > 0) {
txt = ";再";
if (i > 0 && txt!='') {
txt += ";再";
}
if (z.arrivalType == 1) {
txt += "搭乘航班";
......
......@@ -439,7 +439,7 @@ export default {
}
}
this.$nextTick(()=>{
this.isPic = document.URL.indexOf("localhost")!=-1||document.URL.indexOf("t.oytour.com")!=-1
this.isPic = document.URL.indexOf("localhost")!=-1||document.URL.indexOf("www.oytour.com")!=-1
});
},
(err) => {}
......
This diff is collapsed.
This diff is collapsed.
......@@ -132,11 +132,10 @@
class="q-mr-sm"
/>
<span
>日本 -
<span v-for="(x, i) in citys" :key="i">
<span class="cursor-pointer">{{ x }} </span>
<span v-if="i + 1 != citys.length" class="q-mr-sm">,</span>
v-for="(x, i) in dataList.CityList2" :key="i">{{x.CountryName}} -
<span>
<span class="cursor-pointer">{{ x.CityName }} </span>
<span v-if="i + 1 != dataList.CityList2.length" class="q-mr-sm">,</span>
</span>
</span>
</div>
......@@ -1011,7 +1010,6 @@ export default {
originalB2CPrice: x.Price,
remainNum: 1,
Count: 1,
isSupportChildren: 1,
safeMoney: 0,
}
if(date.formatDate(Date.now(), 'YYYY-MM-DD')!=x.Date){
......@@ -1025,69 +1023,6 @@ export default {
},null)
},
getCarPriceData() {
this.$q.loading.show();
this.apipost(
"b2c_get_GetCarSingleProductMonthPriceAll",
{ ProductId: this.msg.configId, Month: this.currentYM.str },
(r) => {
let list = [[]];
let y = 0; // 元素纵向下标
let day = 0;
if (r.data.resultCode == 1) {
let week = dayjs(this.currentYM.str + "-01").day();
console.log("week", week);
list[0].length = week;
const isCurrent =
this.currentYM.year === dayjs().year() &&
this.currentYM.month === dayjs().month() + 1;
this.isCurrent = isCurrent;
this.isLast = this.currentYM.year === dayjs().year() +1 &&
this.currentYM.month === dayjs().month() + 1;
// 如果是当前月
if (isCurrent) {
let days = dayjs(r.data.data[0].Date).date();
day = days;
for (let i = 1; i <= days; i++) {
list[y].push({
day: i,
disabled: true,
});
week++;
if (week === 7) {
week = 0;
y++;
list[y] = [];
}
}
}
r.data.data.forEach((item) => {
list[y].push({
...item,
day: ++day,
});
week++;
if (week === 7) {
week = 0;
y++;
list[y] = [];
}
});
this.daysList = list;
console.log("list", list);
} else {
this.$q.notify({
type: "negative",
message: r.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
this.$q.loading.hide();
},
null
);
},
menu() {
this.scroll =
document.documentElement.scrollTop || document.body.scrollTop;
......
......@@ -196,7 +196,7 @@
/>
</div>
</div>
<div class="q-mt-lg">
<div class="q-mt-lg" v-if="dataList.productRecommend">
<div
class="q-mt-sm"
v-for="(x, i) in dataList.productRecommend.split('\n')"
......@@ -388,7 +388,7 @@
<div
class="col q-ml-xl position-relative"
v-if="
dayList.length > 3 &&
dataList.priceList.length>0&&(!(dataList.priceList && dataList.priceList[0].teamType==2)&&!(dataList.currentPrice && dataList.currentPrice.teamType==2)) &&
currentHeight > days[0].top - 60 &&
currentHeight < navs[2].top &&
$q.platform.is.desktop
......@@ -446,12 +446,13 @@
</div>
<div class="q-pb-xl">
<smaple
v-if="dataList"
:trip="dataList"
:class="{
'q-px-md': $q.screen.width < 1220 && $q.platform.is.desktop,
}"
></smaple>
<template v-if="dataList.dayList.length <= 3">
<template v-if="dataList.priceList.length>0&&(dataList.priceList && dataList.priceList[0].teamType==2)||(dataList.currentPrice && dataList.currentPrice.teamType==2)">
<trip :trip="dataList" @change="changeTripShowHandler"></trip>
</template>
<template v-else>
......
This diff is collapsed.
<template>
<div class="content-page order-preview">
<q-stepper
v-model="step"
ref="stepper"
color="primary"
inactive-color="grey-5 "
done-color="primary"
class="bg-transparent"
flat
animated
>
<q-step
:name="1"
title="確認訂單"
icon="settings"
:done="step > 1"
></q-step>
<q-step
:name="2"
title="付款"
icon="iconfont iconPayment-1"
:done="step > 2"
></q-step>
<q-step
:name="3"
title="訂購完成"
icon="iconfont iconicon_finish_R"
:done="step == 3"
></q-step>
</q-stepper>
</div>
</template>
<script>
export default {
data() {
return {
step:2
}
},
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<div class="content-page order-preview order-pay-page" style="min-height:80vh;">
<q-stepper
v-model="step"
ref="stepper"
color="primary"
inactive-color="grey-5 "
done-color="primary"
class="bg-transparent"
flat
animated
>
<q-step
:name="1"
title="確認訂單"
icon="settings"
:done="step > 1"
></q-step>
<q-step
:name="2"
title="付款"
icon="iconfont iconPayment-1"
:done="step > 2"
></q-step>
<q-step
:name="3"
title="訂購完成"
icon="iconfont iconicon_finish_R"
:done="step == 3"
></q-step>
</q-stepper>
<q-inner-loading :showing="loading" label="正在加載中"></q-inner-loading>
<div v-if="!loading && orderInfo" :class="{ 'q-mx-md': $q.platform.is.mobile }">
<q-banner
class="bg-orange-2 text-orange"
rounded
dense
>我們將會在您下單後為您鎖定空位。若您未能在半小時內完成支付,我們將自動取消訂單並且釋放位置。</q-banner
>
<div class="q-my-xl text-center" v-if="orderInfo.OrderStatus==1">
<span class="text-body1">待支付金額:</span>
<span class="text-h3 q-ml-sm text-dark text-weight-bold">{{(moneyFormat(orderInfo.TotalPrice,2))}}</span>
</div>
<div class="q-my-xl text-center" v-else>
<span class="text-h3 q-ml-sm text-dark text-weight-bold">
{{ orderInfo.OrderStatus==2||orderInfo.OrderStatus==3?'已支付成功':'訂單已取消' }}
</span>
</div>
<q-card flat class="q-pa-md" v-if="orderInfo.OrderStatus==1">
<div class="row q-mb-md items-center">
<div class="col text-h6 text-weight-bolder">支付方式</div>
</div>
<div class="row q-gutter-md">
<div
class="rounded-borders q-pa-sm bg-grey-2 cursor-pointer"
:class="{
'pay-active': showPay == 'wechat',
'pay-un-active': showPay != 'wechat',
}"
@click="showPayFormHandler('wechat')"
>
<q-img
src="../assets/img/pay/wepay.png"
spinner-color="white"
style="width: 100px"
/>
</div>
<!-- <div class="rounded-borders q-pa-sm bg-grey-2 cursor-pointer">
<q-img src="../assets/img/pay/alipay.png" spinner-color="white" style="height:25px;max-width: 150px;min-width: 30px" />
</div> -->
</div>
<div class="q-mt-md" v-if="showPay != ''">
<wechatpay v-if="showPay == 'wechat'" :order-no="orderNo"></wechatpay>
</div>
</q-card>
<q-card flat class="q-pa-md q-my-xl">
<div class="row q-mb-md items-center">
<div class="col text-h6 text-weight-bolder">訂單資訊</div>
<div class="text-grey-5"># {{ orderNo }}</div>
</div>
<div class="row">
<q-img
:src="orderInfo.GoodsPic"
class="rounded-borders q-mr-md"
spinner-color="grey-2"
style="width: 150px"
/>
<div class="col">
<div class="text-body1 ellipsis">{{ orderInfo.GoodsName }}</div>
<div class="q-mt-sm text-grey-6">{{ orderInfo.OrderMake }}</div>
<div class="q-mt-sm text-dark">
聯絡訊息:{{orderInfo.Name}}/{{ orderInfo.SurName }} {{ orderInfo.ContactNumber }} {{ orderInfo.Mailbox }}
</div>
</div>
</div>
</q-card>
</div>
<div v-if="(!orderNo || orderNo == '') && !loading" class="text-center q-my-xl">
<none-data
iconType="order"
title="沒有找到您的訂單信息哦"
subtitle="趕緊去挑選心儀的旅遊產品吧,三秒後自動跳轉到首頁"
></none-data>
</div>
</div>
</template>
<script>
import wechatpay from "../components/pay/wepay";
import NoneData from "src/components/common/noneData.vue";
export default {
data() {
return {
step: 2,
showPay: "",
orderNo: "",
loading:true,
orderInfo:null
};
},
components: { wechatpay,NoneData },
created() {
this.checkParamsHandler()
},
methods: {
showPayFormHandler(payStr) {
this.showPay = payStr;
},
checkParamsHandler() {
if (this.$route.params && this.$route.params.id) {
this.getOrderInfoHandler(this.$route.params.id)
}else{
this.goHomeHandler()
}
},
getOrderInfoHandler(OrderNo){
this.apipost("GetDetailsByOrderNo_post",{OrderNo},r=>{
if(r.data.resultCode==1){
this.orderNo=OrderNo
this.orderInfo=r.data.data
this.loading=false
}else{
this.goHomeHandler()
}
})
},
goHomeHandler(){
this.loading=false
// setTimeout(() => {
// location.href = location.origin;
// }, 3000);
}
},
};
</script>
<style>
.order-pay-page .q-stepper__content {
display: none !important;
}
.pay-active {
border: 2px solid var(--q-color-primary);
}
.pay-un-active {
border: 2px solid #f5f5f5;
}
</style>
......@@ -36,6 +36,14 @@ const routes = [{
path: '/PickuporderForm/:id',
component: () =>
import ('pages/Pickuporder/orderForm.vue')
}, { // 景区门票详情
path: '/detailsScenicSpotTicket/:id',
component: () =>
import ('pages/ScenicSpotTicket/details.vue')
}, { // 景区门票下单
path: '/ScenicSpotTicketOrderForm/:id',
component: () =>
import ('pages/ScenicSpotTicket/orderForm.vue')
}, { // 酒店
path: '/detailHotal/:id',
component: () =>
......@@ -157,7 +165,7 @@ const routes = [{
{
path: '/pay/:id?', //自定义页面
component: () =>
import ('pages/line/pay.vue')
import ('pages/pay.vue')
},
]
......
const EnumHelper = {
ParseToEnum(TEnum, value, comparison = '') {
if (Object.isFrozen) {
let t = Object.values(TEnum)
console.log(t, Symbol(1) == 1)
let r = t.find(x => (comparison != '' && x[comparison] == value) || (comparison == '' && x == value))
return r
} else {
throw new Error("这不是一个枚举类型");
}
}
}
export default EnumHelper
\ No newline at end of file
const ProductTypeEnum = Object.freeze({
/**
* 一日游
*/
ONE_DAY: {
value: 1,
desc: '一日游产品'
},
/**
* 多日游
*/
TEAM_TRIP: {
value: 2,
desc: '多日游产品'
},
/**
* 小包团
*/
UNIT_TRIP: {
value: 3,
desc: '小包团产品'
},
/**
* 景点门票
*/
SCENIC_SPOT: {
value: 4,
desc: '景点门票产品'
},
/**
* 主题乐园
*/
THEME_PART: {
value: 5,
desc: '主题乐园门票'
},
/**
* 博物馆
*/
MUSEUM: {
value: 6,
desc: '博物馆门票'
},
/**
* 历史景点
*/
HISTORY: {
value: 7,
desc: '历史景点门票'
},
/**
* 温泉酒店
*/
HOT_SPRING: {
value: 8,
desc: '温泉酒店产品'
},
/**
* 星级酒店
*/
STAR_HOTEL: {
value: 9,
desc: '星级酒店产品'
},
/**
* 度假酒店
*/
RESORT_HOTEL: {
value: 10,
desc: '度假酒店产品'
},
/**
* 民宿
*/
HOMESTAY: {
value: 11,
desc: '民宿产品'
},
/**
* 包车
*/
CHARTER: {
value: 12,
desc: '包车产品'
},
/**
* 接机
*/
PICK_UP: {
value: 13,
desc: '接机产品'
},
/**
* 送机
*/
DROP_OFF: {
value: 14,
desc: '送机产品'
}
})
export default ProductTypeEnum
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment