Commit d865a769 authored by 罗超's avatar 罗超

1

parent e9b4b648
<style> <style>
.jz_Reserve{ .jz_Reserve {
padding-bottom: 180rpx; padding-bottom: 180rpx;
} }
.jz_ReserTop { .jz_ReserTop {
width: 100%; width: 100%;
min-height: 300rpx; min-height: 300rpx;
box-shadow: 0px 2px 15px 0px rgba(76, 76, 76, 0.13); box-shadow: 0px 2px 15px 0px rgba(76, 76, 76, 0.13);
...@@ -10,52 +10,52 @@ ...@@ -10,52 +10,52 @@
border-bottom-left-radius: 60rpx; border-bottom-left-radius: 60rpx;
border-bottom-right-radius: 60rpx; border-bottom-right-radius: 60rpx;
padding: 40rpx; padding: 40rpx;
} }
.jz_ReserTitle { .jz_ReserTitle {
color: #111111; color: #111111;
font-weight: 600; font-weight: 600;
font-size: 36rpx; font-size: 36rpx;
} }
.jz_ReserIn { .jz_ReserIn {
color: #111; color: #111;
font-size: 24rpx; font-size: 24rpx;
font-weight: 500; font-weight: 500;
} }
.jz_ReseQue { .jz_ReseQue {
color: #DFBE6E; color: #dfbe6e;
font-size: 24rpx; font-size: 24rpx;
padding-top: 30rpx; padding-top: 30rpx;
border-top: 1px solid #E7E7E7; border-top: 1px solid #e7e7e7;
margin-top: 20px; margin-top: 20px;
} }
.jz_ReseQue img { .jz_ReseQue img {
width: 16px; width: 16px;
height: 14px; height: 14px;
position: relative; position: relative;
top: 2px; top: 2px;
margin-right: 5px; margin-right: 5px;
} }
.jz_ReseOrder { .jz_ReseOrder {
padding: 40rpx; padding: 40rpx;
} }
.jz_ReDix { .jz_ReDix {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 10px; margin-bottom: 10px;
} }
.jz_RedixTitle { .jz_RedixTitle {
width: 90px; width: 90px;
flex-shrink: 0; flex-shrink: 0;
} }
/* .jz_OrderDiv { /* .jz_OrderDiv {
position: fixed; position: fixed;
width: 90%; width: 90%;
height: 100rpx; height: 100rpx;
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
border-radius: 16px; border-radius: 16px;
z-index: 999; z-index: 999;
} */ } */
.jz_orderbox{ .jz_orderbox {
height: 160rpx; height: 160rpx;
position: fixed; position: fixed;
background-color: #fff; background-color: #fff;
...@@ -82,23 +82,22 @@ ...@@ -82,23 +82,22 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
z-index: 99; z-index: 99;
} }
.jz_OrderDiv{ .jz_OrderDiv {
width: 90%;
width:90%; height: 100rpx;
height:100rpx;
background-color: #fff; background-color: #fff;
margin:auto; margin: auto;
padding:20rpx; padding: 20rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
box-shadow: 0px 10rpx 30rpx 0px rgba(36, 36, 36, 0.2); box-shadow: 0px 10rpx 30rpx 0px rgba(36, 36, 36, 0.2);
border-radius: 16px; border-radius: 16px;
z-index:999; z-index: 999;
} }
.jz_OrderReNow { .jz_OrderReNow {
width: 150rpx; width: 150rpx;
height: 80rpx; height: 80rpx;
background-color: #111111; background-color: #111111;
...@@ -108,95 +107,95 @@ ...@@ -108,95 +107,95 @@
font-weight: 600; font-weight: 600;
font-size: 28rpx; font-size: 28rpx;
border-radius: 16rpx; border-radius: 16rpx;
} }
.jz_form{ .jz_form {
margin-top: 60rpx; margin-top: 60rpx;
padding:0 45rpx; padding: 0 45rpx;
} }
.jz_form .form-items{ .jz_form .form-items {
margin-bottom: 20rpx; margin-bottom: 20rpx;
display: flex; display: flex;
align-items: center; align-items: center;
padding-bottom: 20rpx; padding-bottom: 20rpx;
border-bottom:1px solid #f5f5f5; border-bottom: 1px solid #f5f5f5;
font-size: 28px; font-size: 28px;
font-weight: 500; font-weight: 500;
} }
.jz_form .form-items:last-child{ .jz_form .form-items:last-child {
border-bottom: none; border-bottom: none;
} }
.jz_form .form-items .label{ .jz_form .form-items .label {
font-size: 28rpx; font-size: 28rpx;
font-weight: 600; font-weight: 600;
margin-right: 60rpx; margin-right: 60rpx;
flex-shrink: 0; flex-shrink: 0;
} }
.jz_form .form-items .val{ .jz_form .form-items .val {
flex:1; flex: 1;
} }
.jz_ReserTop .o-timer{ .jz_ReserTop .o-timer {
height: 100rpx; height: 100rpx;
background: #ECF1F4; background: #ecf1f4;
border-radius: 20rpx; border-radius: 20rpx;
padding: 0 40rpx; padding: 0 40rpx;
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.jz_ReserTop .o-timer .time-item{ .jz_ReserTop .o-timer .time-item {
font-size: 32rpx; font-size: 32rpx;
font-weight: 800; font-weight: 800;
} }
/* .jz_ReserTop .o-timer .time-item:last-child{ /* .jz_ReserTop .o-timer .time-item:last-child{
text-align: right; text-align: right;
} */ } */
.jz_ReserTop .o-timer .time-split{ .jz_ReserTop .o-timer .time-split {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
text-align: center; text-align: center;
margin:0 20rpx; margin: 0 20rpx;
} }
.jz_ReserTop .o-timer .update{ .jz_ReserTop .o-timer .update {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
text-align: right; text-align: right;
color:#000; color: #000;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.jz_Reserve .flex{ .jz_Reserve .flex {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.jz_Reserve .big-title { .jz_Reserve .big-title {
position: relative; position: relative;
} }
.jz_Reserve .big-title::before { .jz_Reserve .big-title::before {
display: block; display: block;
width: 71rpx; width: 71rpx;
height: 12rpx; height: 12rpx;
background: #DFBE6E; background: #dfbe6e;
border-radius: 4rpx; border-radius: 4rpx;
content: ' '; content: " ";
position: absolute; position: absolute;
left: 0; left: 0;
bottom: 6rpx; bottom: 6rpx;
z-index: 1; z-index: 1;
} }
.jz_Reserve .big-title text { .jz_Reserve .big-title text {
font-size: 34rpx; font-size: 34rpx;
font-weight: bold; font-weight: bold;
color: #1F1F1F; color: #1f1f1f;
position: relative; position: relative;
z-index: 2; z-index: 2;
} }
.jz_Reserve .empty-block{ .jz_Reserve .empty-block {
height: 20rpx; height: 20rpx;
background: #ECF1F4; background: #ecf1f4;
} }
.jz_form .form-items .val input{ .jz_form .form-items .val input {
border:none; border: none;
padding: 0; padding: 0;
margin: 0; margin: 0;
outline: none; outline: none;
...@@ -205,84 +204,101 @@ ...@@ -205,84 +204,101 @@
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
width: 100%; width: 100%;
} }
.jz_Reserve .grey{ .jz_Reserve .grey {
color:#6E6E6E !important color: #6e6e6e !important;
} }
.jz_Reserve .f12 { .jz_Reserve .f12 {
font-size:24rpx !important; font-size: 24rpx !important;
} }
.jz_Reserve .f11 { .jz_Reserve .f11 {
font-size:22rpx !important; font-size: 22rpx !important;
} }
.jz_Reserve .f14 { .jz_Reserve .f14 {
font-size:28rpx !important; font-size: 28rpx !important;
} }
.jz_Reserve .regular { .jz_Reserve .regular {
font-weight: 500 !important; font-weight: 500 !important;
} }
.jz_Reserve .sheshi{ .jz_Reserve .sheshi {
margin-top: 50rpx; margin-top: 50rpx;
} }
.jz_Reserve .sheshi .she-title{ .jz_Reserve .sheshi .she-title {
font-size: 28rpx; font-size: 28rpx;
font-weight: 800; font-weight: 800;
} }
.jz_Reserve .sheshi .she-content{ .jz_Reserve .sheshi .she-content {
margin-top: 24rpx; margin-top: 24rpx;
} }
.jz_Reserve .sheshi .she-content text{ .jz_Reserve .sheshi .she-content text {
font-size: 24rpx; font-size: 24rpx;
font-weight: 500; font-weight: 500;
color: #4A4A4A; color: #4a4a4a;
line-height: 40rpx; line-height: 40rpx;
margin-right: 24rpx; margin-right: 24rpx;
} }
</style> </style>
<template> <template>
<view class="jz_Reserve"> <view class="jz_Reserve">
<view class="jz_ReserTop"> <view class="jz_ReserTop">
<view class="o-timer flex"> <view class="o-timer flex">
<view class="time-item">{{getDate(currentPriceInfo.startDate)}} {{getWeek(currentPriceInfo.startDate)}}</view> <view class="time-item"
>{{ getDate(currentPriceInfo.startDate) }}
{{ getWeek(currentPriceInfo.startDate) }}</view
>
<view class="time-split"> <view class="time-split">
<view>{{currentPriceInfo.dayNum}}</view> <view>{{ currentPriceInfo.dayNum }}</view>
</view> </view>
<view class="time-item" style="font-size: 26rpx;font-weight: 500;flex:1;"> <view
<text v-if="orderMsg.ManNum>0">{{orderMsg.ManNum}}成人</text> class="time-item"
<text v-if="orderMsg.ChirdNoBedNum+orderMsg.ChirdNeedBedNum>0">{{orderMsg.ChirdNoBedNum+orderMsg.ChirdNeedBedNum}}儿童</text> style="font-size: 26rpx; font-weight: 500; flex: 1"
<text v-if="orderMsg.BabyNum>0">{{orderMsg.BabyNum}}婴儿</text> >
<text v-if="orderMsg.ManNum > 0">{{ orderMsg.ManNum }}成人</text>
<text v-if="orderMsg.ChirdNoBedNum + orderMsg.ChirdNeedBedNum > 0"
>{{ orderMsg.ChirdNoBedNum + orderMsg.ChirdNeedBedNum }}儿童</text
>
<text v-if="orderMsg.BabyNum > 0">{{ orderMsg.BabyNum }}婴儿</text>
</view> </view>
<view class="update" @click="updateUser"> <view class="update" @click="updateUser">
<text style="margin-right: 8rpx;">修改</text> <text style="margin-right: 8rpx">修改</text>
<u-icon name="arrow" size="20" /> <u-icon name="arrow" size="20" />
</view> </view>
</view> </view>
<view class="jz_ReserTitle"> <view class="jz_ReserTitle">
{{currentPriceInfo.title}} {{ currentPriceInfo.title }}
</view> </view>
<view class="jz_ReserIn" style="margin:33rpx 0 18rpx 0"> <view class="jz_ReserIn" style="margin: 33rpx 0 18rpx 0">
<!-- {{currentPriceInfo.startCityName}}出发 {{currentPriceInfo.startDate}} --> <!-- {{currentPriceInfo.startCityName}}出发 {{currentPriceInfo.startDate}} -->
{{ltName}} {{ ltName }}
</view> </view>
<view class="big-title"> <view class="big-title">
<text>{{currentPriceInfo.startCityName}}出发</text> <text>{{ currentPriceInfo.startCityName }}出发</text>
</view> </view>
<view class="jz_ReseQue"> <view class="jz_ReseQue">
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/zuanshi.png" />即时确认:本产品付款后可快速确认,放心期待您的旅行 <img
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/zuanshi.png"
/>即时确认:本产品付款后可快速确认,放心期待您的旅行
</view> </view>
</view> </view>
<view class="jz_form"> <view class="jz_form">
<view class="form-items"> <view class="form-items">
<view class="label">游客姓名</view> <view class="label">游客姓名</view>
<view class="val"> <view class="val">
<input type="text" v-model="contactName" placeholder="若是多人,输入代表人员即可" /> <input
type="text"
v-model="contactName"
placeholder="若是多人,输入代表人员即可"
/>
</view> </view>
</view> </view>
<view class="form-items"> <view class="form-items">
<view class="label">联系电话</view> <view class="label">联系电话</view>
<view class="val"> <view class="val">
<input type="text" v-model="contactMobile" placeholder="输入电话号码" /> <input
type="text"
v-model="contactMobile"
placeholder="输入电话号码"
/>
</view> </view>
</view> </view>
</view> </view>
...@@ -305,84 +321,144 @@ ...@@ -305,84 +321,144 @@
<u-number-box v-model="orderMsg.BabyNum" :input-width="300" :input-height="60" @change="changeBabyNum()"></u-number-box> <u-number-box v-model="orderMsg.BabyNum" :input-width="300" :input-height="60" @change="changeBabyNum()"></u-number-box>
</view> </view>
</view> --> </view> -->
<view style="padding:50rpx 40rpx"> <view style="padding: 50rpx 40rpx">
<view class="big-title"> <view class="big-title">
<text>费用明细</text> <text>费用明细</text>
</view> </view>
<view class="jz_form" style="margin:40rpx 0;padding: 0;"> <view class="jz_form" style="margin: 40rpx 0; padding: 0">
<view class="form-items"> <view class="form-items">
<view class="label"> <view class="label"> 在线支付 </view>
在线支付 <view class="val f14 regular" style="text-align: right">
</view> <text style="margin-right: 30rpx">{{ total }}</text>
<view class="val f14 regular" style="text-align: right;"> <text class="red">{{ price }}</text>
<text style="margin-right: 30rpx;">{{total}}</text> </view>
<text class="red">{{price}}</text> </view>
<view class="form-items" style="border-bottom: none">
<view class="label"> 明细 </view>
</view>
<view class="flex f12 grey" style="margin-bottom: 40rpx" :key="index">
<view style="flex: 1">
<text style="margin-right: 30rpx">成人</text>
</view>
<view style="text-align: right"
>{{ orderMsg.ManNum }}人 × ¥{{
$utils.getretailer()
? currentPriceInfo.b2BPrice
: currentPriceInfo.b2CPrice
}}</view
>
</view>
<view
class="flex f12 grey"
style="margin-bottom: 40rpx"
:key="index"
v-if="orderMsg.ChirdNeedBedNum > 0"
>
<view style="flex: 1">
<text style="margin-right: 30rpx">儿童(占床)</text>
</view>
<view style="text-align: right"
>{{ orderMsg.ChirdNeedBedNum }}人 × ¥{{
($utils.getretailer()
? currentPriceInfo.b2BPrice
: currentPriceInfo.b2CPrice) +
(currentPriceInfo.childNeedPrice
? currentPriceInfo.childNeedPrice
: 0)
}}</view
>
</view>
<view
class="flex f12 grey"
style="margin-bottom: 40rpx"
:key="index"
v-if="orderMsg.ChirdNoBedNum > 0"
>
<view style="flex: 1">
<text style="margin-right: 30rpx">儿童(不占床)</text>
</view>
<view style="text-align: right"
>{{ orderMsg.ChirdNoBedNum }}人 × ¥{{
($utils.getretailer()
? currentPriceInfo.b2BPrice
: currentPriceInfo.b2CPrice) -
(currentPriceInfo.childNoNeedPrice
? currentPriceInfo.childNoNeedPrice
: 0)
}}</view
>
</view>
<view
class="flex f12 grey"
style="margin-bottom: 40rpx"
:key="index"
v-if="orderMsg.BabyNum > 0"
>
<view style="flex: 1">
<text style="margin-right: 30rpx">婴儿</text>
</view>
<view style="text-align: right">
{{ orderMsg.BabyNum }}人 × ¥{{
currentPriceInfo.babyPrice ? currentPriceInfo.babyPrice : 0
}}</view
>
</view>
<view
class="flex f12 grey"
style="margin-bottom: 40rpx"
:key="index"
v-if="
orderMsg.ChirdNum > 0 &&
currentPriceInfo.babyChargePrice &&
currentPriceInfo.babyChargePrice > 0
"
>
<view style="flex: 1">
<text style="margin-right: 30rpx">儿童(附加费)</text>
</view>
<view style="text-align: right">
{{ orderMsg.ChirdNum }}人 × ¥{{
currentPriceInfo.babyChargePrice
}}</view
>
</view> </view>
</view> </view>
<view class="form-items" style="border-bottom: none;">
<view class="label">
明细
</view>
</view>
<view class="flex f12 grey" style="margin-bottom:40rpx;" :key="index">
<view style="flex:1">
<text style="margin-right: 30rpx;">成人</text>
</view>
<view style="text-align: right;">{{orderMsg.ManNum}}人 × ¥{{$utils.getretailer()? currentPriceInfo.b2BPrice:currentPriceInfo.b2CPrice}}</view>
</view>
<view class="flex f12 grey" style="margin-bottom:40rpx;" :key="index" v-if="orderMsg.ChirdNeedBedNum>0">
<view style="flex:1">
<text style="margin-right: 30rpx;">儿童(占床)</text>
</view>
<view style="text-align: right;">{{orderMsg.ChirdNeedBedNum}}人 × ¥{{($utils.getretailer()? currentPriceInfo.b2BPrice:currentPriceInfo.b2CPrice)+(currentPriceInfo.childNeedPrice?currentPriceInfo.childNeedPrice:0)}}</view>
</view>
<view class="flex f12 grey" style="margin-bottom:40rpx;" :key="index" v-if="orderMsg.ChirdNoBedNum>0">
<view style="flex:1">
<text style="margin-right: 30rpx;">儿童(不占床)</text>
</view>
<view style="text-align: right;">{{orderMsg.ChirdNoBedNum}}人 × ¥{{($utils.getretailer()? currentPriceInfo.b2BPrice:currentPriceInfo.b2CPrice)-(currentPriceInfo.childNoNeedPrice?currentPriceInfo.childNoNeedPrice:0)}}</view>
</view>
<view class="flex f12 grey" style="margin-bottom:40rpx;" :key="index" v-if="orderMsg.BabyNum>0">
<view style="flex:1">
<text style="margin-right: 30rpx;">婴儿</text>
</view>
<view style="text-align: right;">
{{orderMsg.BabyNum}}人 × ¥{{currentPriceInfo.babyPrice?currentPriceInfo.babyPrice:0}}</view>
</view>
<view class="flex f12 grey" style="margin-bottom:40rpx;" :key="index" v-if="orderMsg.ChirdNum>0&&currentPriceInfo.babyChargePrice&&currentPriceInfo.babyChargePrice>0">
<view style="flex:1">
<text style="margin-right: 30rpx;">儿童(附加费)</text>
</view>
<view style="text-align: right;">
{{orderMsg.ChirdNum}}人 × ¥{{currentPriceInfo.babyChargePrice}}</view>
</view>
</view>
</view> </view>
<view class="empty-block"></view> <view class="empty-block"></view>
<view style="padding:50rpx 40rpx" v-if="tips!=''"> <view style="padding: 50rpx 40rpx" v-if="tips != ''">
<view class="big-title"> <view class="big-title">
<text>重要提醒</text> <text>重要提醒</text>
</view> </view>
<view class="sheshi"> <view class="sheshi">
<view class="she-content"> <view class="she-content">
<text>{{tips}}</text> <text>{{ tips }}</text>
</view> </view>
</view> </view>
</view> </view>
<view class="jz_orderbox"> <view class="jz_orderbox">
<view class="jz_OrderDiv"> <view class="jz_OrderDiv">
<view style="color:#FF3166;font-weight:bold;"> <view style="color: #ff3166; font-weight: bold">
<text style="font-size:22rpx;">¥</text> <text style="font-size: 22rpx">¥</text>
<text style="font-size:40rpx;margin:0 20rpx 0 5rpx;">{{price}}</text> <text style="font-size: 40rpx; margin: 0 20rpx 0 5rpx">{{
<text style="color:#6E6E6E;font-size:24rpx;">共计{{total}}</text> price
</view> }}</text>
<view style="display:flex;margin-top:-2px;"> <text style="color: #6e6e6e; font-size: 24rpx"
>共计{{ total }}</text
>
</view>
<view style="display: flex; margin-top: -2px">
<!-- #ifdef MP-WEIXIN -->
<view class="jz_OrderReNow" @click="goPay()"> <view class="jz_OrderReNow" @click="goPay()">
<text v-if="!submit">立即支付</text> <text v-if="!submit">立即支付</text>
<u-loading v-if="submit" size="32" color="#f5f5f5"></u-loading> <u-loading v-if="submit" size="32" color="#f5f5f5"></u-loading>
</view> </view>
<!-- #endif -->
<!-- #ifdef MP-ALIPAY -->
<view class="jz_OrderReNow" @click="goPayAli()">
<text v-if="!submit">立即支付</text>
<u-loading v-if="submit" size="32" color="#f5f5f5"></u-loading>
</view>
<!-- #endif -->
</view> </view>
</view> </view>
</view> </view>
...@@ -390,14 +466,12 @@ ...@@ -390,14 +466,12 @@
</template> </template>
<script> <script>
export default { export default {
components: { components: {},
},
data() { data() {
return { return {
submit:false, submit: false,
pageTitle: '订单填写', pageTitle: "订单填写",
orderMsg: { orderMsg: {
ManNum: 0, //成人 ManNum: 0, //成人
ChirdNoBedNum: 0, //儿童不占床 ChirdNoBedNum: 0, //儿童不占床
...@@ -408,52 +482,54 @@ ...@@ -408,52 +482,54 @@
price: 0, price: 0,
currentPriceInfo: {}, currentPriceInfo: {},
total: 0, total: 0,
YSeatNum:0, YSeatNum: 0,
ESeatNum: 0, ESeatNum: 0,
FSeatNum: 0, FSeatNum: 0,
sumSeat:0, sumSeat: 0,
userInfo:{}, userInfo: {},
ltName:'', ltName: "",
tips:"", tips: "",
contactMobile:"", contactMobile: "",
contactName:"", contactName: "",
orderInfo:{}, orderInfo: {},
orderData:"" orderData: "",
}; };
}, },
created() { created() {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title:"订单支付预览" title: "订单支付预览",
}) });
}, },
onLoad(option) { onLoad(option) {
if (option.currentPriceInfo) { if (option.currentPriceInfo) {
this.currentPriceInfo = JSON.parse(decodeURIComponent(option.currentPriceInfo)) this.currentPriceInfo = JSON.parse(
let t=JSON.parse(decodeURIComponent(option.seat)) decodeURIComponent(option.currentPriceInfo)
this.orderMsg.ManNum=t.crCount );
this.orderMsg.ChirdNeedBedNum=t.etCount let t = JSON.parse(decodeURIComponent(option.seat));
this.orderMsg.ChirdNoBedNum=t.etbCount this.orderMsg.ManNum = t.crCount;
this.orderMsg.BabyNum=t.yeCount this.orderMsg.ChirdNeedBedNum = t.etCount;
this.tips=decodeURIComponent(option.tips) this.orderMsg.ChirdNoBedNum = t.etbCount;
this.orderMsg.BabyNum = t.yeCount;
this.tips = decodeURIComponent(option.tips);
this.calcMoney(); this.calcMoney();
this.ltName=option.ln this.ltName = option.ln;
} }
}, },
methods: { methods: {
updateUser(){ updateUser() {
uni.navigateBack({ uni.navigateBack({
delta: 1, delta: 1,
}); });
}, },
getWeek(date) { getWeek(date) {
var weekArray = new Array("日", "一", "二", "三", "四", "五", "六"); var weekArray = new Array("日", "一", "二", "三", "四", "五", "六");
var week = weekArray[new Date(date).getDay()];//注意此处必须是先new一个Date var week = weekArray[new Date(date).getDay()]; //注意此处必须是先new一个Date
return '周'+week; return "周" + week;
}, },
getDate(date){ getDate(date) {
if(date){ if (date) {
let arr = date.split('-'); let arr = date.split("-");
return arr[1]+'月'+arr[2]+'日' return arr[1] + "月" + arr[2] + "日";
} }
}, },
//改变成人 //改变成人
...@@ -478,54 +554,69 @@ ...@@ -478,54 +554,69 @@
}, },
//计算价格 //计算价格
calcMoney() { calcMoney() {
var price=0; var price = 0;
if(this.$utils.getretailer()){ if (this.$utils.getretailer()) {
price = this.currentPriceInfo.b2BMemberPrice; price = this.currentPriceInfo.b2BMemberPrice;
}else{ } else {
price = this.currentPriceInfo.b2CMemberPrice; price = this.currentPriceInfo.b2CMemberPrice;
} }
this.orderMsg.ChirdNum = parseInt(this.orderMsg.ChirdNoBedNum) + parseInt(this.orderMsg.ChirdNeedBedNum); this.orderMsg.ChirdNum =
parseInt(this.orderMsg.ChirdNoBedNum) +
parseInt(this.orderMsg.ChirdNeedBedNum);
//计算总人数 //计算总人数
this.total = parseInt(this.orderMsg.ManNum) + parseInt(this.orderMsg.ChirdNum); this.total =
parseInt(this.orderMsg.ManNum) + parseInt(this.orderMsg.ChirdNum);
this.sumSeat = this.total; this.sumSeat = this.total;
let money = price * this.orderMsg.ManNum let money = price * this.orderMsg.ManNum;
money += price * this.orderMsg.ChirdNum money += price * this.orderMsg.ChirdNum;
money += (this.currentPriceInfo.babyChargePrice?this.currentPriceInfo.babyChargePrice:0) * this.orderMsg.ChirdNum money +=
money += (this.currentPriceInfo.babyPrice?this.currentPriceInfo.babyPrice:0) * this.orderMsg.BabyNum (this.currentPriceInfo.babyChargePrice
money += (this.currentPriceInfo.childNeedPrice?this.currentPriceInfo.childNeedPrice:0) * this.orderMsg.ChirdNeedBedNum ? this.currentPriceInfo.babyChargePrice
: 0) * this.orderMsg.ChirdNum;
money +=
(this.currentPriceInfo.babyPrice
? this.currentPriceInfo.babyPrice
: 0) * this.orderMsg.BabyNum;
money +=
(this.currentPriceInfo.childNeedPrice
? this.currentPriceInfo.childNeedPrice
: 0) * this.orderMsg.ChirdNeedBedNum;
if (this.orderMsg.ChirdNoBedNum > 0) { if (this.orderMsg.ChirdNoBedNum > 0) {
money -= (this.currentPriceInfo.childNoNeedPrice?this.currentPriceInfo.childNoNeedPrice:0) * this.orderMsg.ChirdNoBedNum money -=
(this.currentPriceInfo.childNoNeedPrice
? this.currentPriceInfo.childNoNeedPrice
: 0) * this.orderMsg.ChirdNoBedNum;
} }
this.price = money this.price = money;
}, },
//去支付 //去支付
// #ifdef MP-WEIXIN
goPay() { goPay() {
if(this.contactName==''){ if (this.contactName == "") {
uni.showToast({ uni.showToast({
title: '请输入联系人姓名', title: "请输入联系人姓名",
icon: 'none' icon: "none",
}); });
}else if(this.contactMobile==''){ } else if (this.contactMobile == "") {
uni.showToast({ uni.showToast({
title: '请输入联系人电话', title: "请输入联系人电话",
icon: 'none' icon: "none",
}); });
}else{ } else {
this.submit=true this.submit = true;
this.userInfo = uni.getStorageSync('mall_UserInfo'); this.userInfo = uni.getStorageSync("mall_UserInfo");
this.basedataObj = uni.getStorageSync('basedata').mall; this.basedataObj = uni.getStorageSync("basedata").mall;
var CustomerId = 0; var CustomerId = 0;
var ContactName = this.contactName; var ContactName = this.contactName;
var ContactMobile = this.contactMobile; var ContactMobile = this.contactMobile;
var CustomerType = 3; var CustomerType = 3;
var price=0; var price = 0;
if(this.$utils.getretailer()){ if (this.$utils.getretailer()) {
CustomerId = this.basedataObj.virtualB2BCustomerId; CustomerId = this.basedataObj.virtualB2BCustomerId;
CustomerType = 1; CustomerType = 1;
price = this.currentPriceInfo.b2BMemberPrice; price = this.currentPriceInfo.b2BMemberPrice;
}else{ } else {
price = this.currentPriceInfo.b2CMemberPrice; price = this.currentPriceInfo.b2CMemberPrice;
} }
let msg = { let msg = {
...@@ -554,8 +645,11 @@ ...@@ -554,8 +645,11 @@
ClientSource: 2, ClientSource: 2,
BrandId: 0, BrandId: 0,
TradeWay: 0, TradeWay: 0,
PlatformOrder: '', PlatformOrder: "",
GuestNum: this.orderMsg.ManNum + this.orderMsg.ChirdNum+this.orderMsg.BabyNum, GuestNum:
this.orderMsg.ManNum +
this.orderMsg.ChirdNum +
this.orderMsg.BabyNum,
IsChildrenTour: this.currentPriceInfo.isSupportChildren, IsChildrenTour: this.currentPriceInfo.isSupportChildren,
IsBirdDiscount: this.zaoniao > 0 ? 1 : 2, IsBirdDiscount: this.zaoniao > 0 ? 1 : 2,
PredictRoomNum: 1, PredictRoomNum: 1,
...@@ -564,93 +658,252 @@ ...@@ -564,93 +658,252 @@
TradeDate: this.currentPriceInfo.startDate, TradeDate: this.currentPriceInfo.startDate,
CostType: 0, CostType: 0,
MinOrderPrice: 0, MinOrderPrice: 0,
Remarks: '', Remarks: "",
VisaNum: this.orderMsg.ManNum + this.orderMsg.ChirdNum, VisaNum: this.orderMsg.ManNum + this.orderMsg.ChirdNum,
SafeNum: this.orderMsg.ManNum + this.orderMsg.ChirdNum, SafeNum: this.orderMsg.ManNum + this.orderMsg.ChirdNum,
AirticketNum: 0, AirticketNum: 0,
ReturnArriveCityId: 262, ReturnArriveCityId: 262,
IsReturnIntermodal: 2, IsReturnIntermodal: 2,
GoCityTime: '', GoCityTime: "",
BackCityTime: '', BackCityTime: "",
ScenicRefundArr: [], ScenicRefundArr: [],
CommissionSharePeople: 0, CommissionSharePeople: 0,
CommissionShareMoney: 0, CommissionShareMoney: 0,
OrderSource: 2, OrderSource: 5,
MiniAppUserId:this.userInfo.UserId MiniAppUserId: this.userInfo.UserId,
} };
this.apipost("sellorder_post_SetOrderInfoForB2B", msg, this.apipost(
res => { "sellorder_post_SetOrderInfoForB2B",
msg,
(res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
let data = res.data; let data = res.data;
data.CoverImg = this.currentPriceInfo.CoverImg; data.CoverImg = this.currentPriceInfo.CoverImg;
let myData = JSON.stringify(data); let myData = JSON.stringify(data);
this.orderData=encodeURIComponent(myData) this.orderData = encodeURIComponent(myData);
this.queren(data.OrderId) this.queren(data.OrderId);
} else { } else {
} }
this.submit=false this.submit = false;
}, },
e=>{ (e) => {
this.submit=false this.submit = false;
} }
); );
} }
}, },
queren(OrderId){ queren(OrderId) {
let url='/api/WeChatPay/GetTravlePayInfo' let url = "/api/WeChatPay/GetTravlePayInfo";
let GoodsName = this.currentPriceInfo.title; let GoodsName = this.currentPriceInfo.title;
GoodsName = GoodsName.slice(0, 10) GoodsName = GoodsName.slice(0, 10);
this.request2({ this.request2(
{
url: url, url: url,
data: { data: {
OrderId:OrderId, OrderId: OrderId,
GoodsName:GoodsName, GoodsName: GoodsName,
OrderPayType:1, OrderPayType: 1,
OpenId:uni.getStorageSync('mall_UserInfo').OpenId, OpenId: uni.getStorageSync("mall_UserInfo").OpenId,
} },
}, },
res => { (res) => {
this.orderInfo = JSON.parse(res.data); this.orderInfo = JSON.parse(res.data);
this.Pay(OrderId) this.Pay(OrderId);
} }
); );
}, },
Pay(OrderId){ Pay(OrderId) {
let that=this; let that = this;
uni.requestPayment({ uni.requestPayment({
provider: 'wxpay', provider: "wxpay",
timeStamp: this.orderInfo.timeStamp, timeStamp: this.orderInfo.timeStamp,
nonceStr: this.orderInfo.nonceStr, nonceStr: this.orderInfo.nonceStr,
package: this.orderInfo.package, package: this.orderInfo.package,
signType: this.orderInfo.signType, signType: this.orderInfo.signType,
paySign: this.orderInfo.sign, paySign: this.orderInfo.sign,
success: function(res) { success: function (res) {
console.log('success', res); console.log("success", res);
uni.showToast({ uni.showToast({
title: "支付成功" title: "支付成功",
}) });
setTimeout(()=>{ setTimeout(() => {
uni.redirectTo({ uni.redirectTo({
url: '/pages/jiuzhai/paysuccess?PreferPrice='+price url: "/pages/jiuzhai/paysuccess?PreferPrice=" + price,
}); });
}, 100 ) }, 100);
}, },
fail: function(err) { fail: function (err) {
console.log('fail:', err); console.log("fail:", err);
uni.showToast({ uni.showToast({
title: "支付失败", title: "支付失败",
icon:"none" icon: "none",
}) });
setTimeout(()=>{ setTimeout(() => {
uni.redirectTo({ uni.redirectTo({
url: "/pages/jiuzhai/jz_SureOrder?orderId="+OrderId url: "/pages/jiuzhai/jz_SureOrder?orderId=" + OrderId,
}); });
}, 100 ) }, 100);
} },
}); });
},
// #endif
// #ifdef MP-ALIPAY
goPayAli() {
if (this.contactName == "") {
uni.showToast({
title: "请输入联系人姓名",
icon: "none",
});
} else if (this.contactMobile == "") {
uni.showToast({
title: "请输入联系人电话",
icon: "none",
});
} else {
this.submit = true;
this.userInfo = uni.getStorageSync("mall_UserInfo");
this.basedataObj = uni.getStorageSync("basedata").mall;
var CustomerId = 0;
var ContactName = this.contactName;
var ContactMobile = this.contactMobile;
var CustomerType = 3;
var price = 0;
if (this.$utils.getretailer()) {
CustomerId = this.basedataObj.virtualB2BCustomerId;
CustomerType = 1;
price = this.currentPriceInfo.b2BMemberPrice;
} else {
price = this.currentPriceInfo.b2CMemberPrice;
} }
} let msg = {
OrderId: 0,
TCID: this.currentPriceInfo.tcid,
CustomerType: CustomerType,
GroupType: 1,
ContactName: ContactName,
ContactMobile: ContactMobile,
CustomerId: CustomerId,
DepartureCityId: 262,
IsIntermodal: 2,
Unit_Price: price,
TC_Price: price,
ManNum: this.orderMsg.ManNum,
ChirdNum: this.orderMsg.ChirdNum,
ChirdNeedBedNum: this.orderMsg.ChirdNeedBedNum,
BabyNum: this.orderMsg.BabyNum,
OldPeopleNum: 0,
SingleRoomNum: 0,
PreferPrice: this.price,
YSeatNum: this.total,
ESeatNum: 0,
FSeatNum: 0,
Commission: 0, //todo 提成
ClientSource: 2,
BrandId: 0,
TradeWay: 0,
PlatformOrder: "",
GuestNum:
this.orderMsg.ManNum +
this.orderMsg.ChirdNum +
this.orderMsg.BabyNum,
IsChildrenTour: this.currentPriceInfo.isSupportChildren,
IsBirdDiscount: this.zaoniao > 0 ? 1 : 2,
PredictRoomNum: 1,
BigRoomNum: 0,
TripleRoomNum: 0,
TradeDate: this.currentPriceInfo.startDate,
CostType: 0,
MinOrderPrice: 0,
Remarks: "",
VisaNum: this.orderMsg.ManNum + this.orderMsg.ChirdNum,
SafeNum: this.orderMsg.ManNum + this.orderMsg.ChirdNum,
AirticketNum: 0,
ReturnArriveCityId: 262,
IsReturnIntermodal: 2,
GoCityTime: "",
BackCityTime: "",
ScenicRefundArr: [],
CommissionSharePeople: 0,
CommissionShareMoney: 0,
OrderSource: 6,
MiniAppUserId: this.userInfo.UserId,
}; };
this.apipost(
"sellorder_post_SetOrderInfoForB2B",
msg,
(res) => {
if (res.resultCode == 1) {
let data = res.data;
data.CoverImg = this.currentPriceInfo.CoverImg;
let myData = JSON.stringify(data);
this.orderData = encodeURIComponent(myData);
this.querenAli(data.OrderId);
} else {
}
this.submit = false;
},
(e) => {
this.submit = false;
}
);
}
},
querenAli(OrderId) {
let url = "/api/WeChatPay/GetTravlePayInfo";
let GoodsName = this.currentPriceInfo.title;
GoodsName = GoodsName.slice(0, 10);
this.request2(
{
url: url,
data: {
OrderId: OrderId,
GoodsName: GoodsName,
OrderPayType: 2,
OpenId: uni.getStorageSync("mall_UserInfo").OpenId,
},
},
(res) => {
this.orderInfo = JSON.parse(res.data);
// this.PayAli(OrderId);
console.log(873, res);
}
);
},
PayAli(OrderId) {
let that = this;
uni.requestPayment({
provider: "wxpay",
timeStamp: this.orderInfo.timeStamp,
nonceStr: this.orderInfo.nonceStr,
package: this.orderInfo.package,
signType: this.orderInfo.signType,
paySign: this.orderInfo.sign,
success: function (res) {
console.log("success", res);
uni.showToast({
title: "支付成功",
});
setTimeout(() => {
uni.redirectTo({
url: "/pages/jiuzhai/paysuccess?PreferPrice=" + price,
});
}, 100);
},
fail: function (err) {
console.log("fail:", err);
uni.showToast({
title: "支付失败",
icon: "none",
});
setTimeout(() => {
uni.redirectTo({
url: "/pages/jiuzhai/jz_SureOrder?orderId=" + OrderId,
});
}, 100);
},
});
},
// #endif
},
};
</script> </script>
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