Commit 1e1c0599 authored by 黄奎's avatar 黄奎

页面修改

parent dcb9b670
......@@ -96,19 +96,19 @@
<view class="jz_ReseOrder">
<view class="jz_ReDix">
<view class="jz_RedixTitle">成人:</view>
<u-number-box v-model="orderMsg.crCount" :input-width="300" :input-height="60" @change="calccrCount()"></u-number-box>
<u-number-box v-model="orderMsg.ManNum" :input-width="300" :input-height="60" @change="changeMan()"></u-number-box>
</view>
<view class="jz_ReDix">
<view class="jz_RedixTitle">儿童不占床:</view>
<u-number-box v-model="orderMsg.etbzcCount" :input-width="300" :input-height="60" @change="etbzcChange()"></u-number-box>
<u-number-box v-model="orderMsg.ChirdNoBedNum" :input-width="300" :input-height="60" @change="changeChirdNoBedNum()"></u-number-box>
</view>
<view class="jz_ReDix">
<view class="jz_RedixTitle">儿童占床:</view>
<u-number-box v-model="orderMsg.etzc" :input-width="300" :input-height="60" @change="etzcChange()"></u-number-box>
<u-number-box v-model="orderMsg.ChirdNeedBedNum" :input-width="300" :input-height="60" @change="changeChirdNeedBedNum()"></u-number-box>
</view>
<view class="jz_ReDix">
<view class="jz_RedixTitle">婴儿:</view>
<u-number-box v-model="orderMsg.yeCount" :input-width="300" :input-height="60" @change="yeChange()"></u-number-box>
<u-number-box v-model="orderMsg.BabyNum" :input-width="300" :input-height="60" @change="changeBabyNum()"></u-number-box>
</view>
</view>
<view class="jz_OrderDiv">
......@@ -133,66 +133,59 @@
return {
pageTitle: '订单填写',
orderMsg: {
crCount: 0, //成人
etbzcCount: 0, //儿童不占床
etzc: 0, //儿童占床
yeCount: 0, //婴儿
etCount:0
ManNum: 0, //成人
ChirdNoBedNum: 0, //儿童不占床
ChirdNeedBedNum: 0, //儿童占床
BabyNum: 0, //婴儿
ChirdNum: 0, //儿童数量
},
zaoniao:0,
price:0,
price: 0,
currentPriceInfo: {}
};
},
created() {
},
created() {},
onLoad(option) {
if (option.currentPriceInfo) {
this.currentPriceInfo = JSON.parse(option.currentPriceInfo);
this.calcMoney();
}
},
methods: {
//改变成人
calccrCount(e){
console.log(e);
this.orderMsg.crCount = e.value;
changeMan(e) {
this.orderMsg.ManNum = e.value;
this.calcMoney();
},
//改变儿童不占床
etbzcChange(e){
this.orderMsg.etbzcCount = e.value;
changeChirdNoBedNum(e) {
this.orderMsg.ChirdNoBedNum = e.value;
this.calcMoney();
},
//改变儿童占床
etzcChange(e){
this.orderMsg.etzc = e.value;
changeChirdNeedBedNum(e) {
this.orderMsg.ChirdNeedBedNum = e.value;
this.calcMoney();
},
//改变婴儿
yeChange(e){
this.orderMsg.yeCount = e.value;
changeBabyNum(e) {
this.orderMsg.BabyNum = e.value;
this.calcMoney();
},
//计算价格
calcMoney() {
this.orderMsg.etCount = parseInt(this.orderMsg.etbzcCount) + parseInt(this.orderMsg.etzc);
let money = this.currentPriceInfo.b2BMemberPrice * this.orderMsg.crCount
money += this.currentPriceInfo.b2BMemberPrice * this.orderMsg.etCount
money += this.currentPriceInfo.babyChargePrice * this.orderMsg.etCount
money += this.currentPriceInfo.childNeedPrice * this.orderMsg.etzc
if (this.orderMsg.etbzcCount > 0)
money -= this.currentPriceInfo.childNoNeedPrice * this.orderMsg.etbzcCount
money += this.currentPriceInfo.babyPrice * this.orderMsg.yeCount
let sumCount = parseInt(this.orderMsg.crCount) + parseInt(this.orderMsg.etCount)
money += this.currentPriceInfo.visaPrice * sumCount
money += this.currentPriceInfo.otherPrice * sumCount
if (this.currentPriceInfo.discountPric && this.currentPriceInfo.discountPric > 0) {
this.zaoniao = this.currentPriceInfo.discountPrice * sumCount
console.log("orderMsg", this.orderMsg)
var price = this.currentPriceInfo.b2BMemberPrice;
this.orderMsg.ChirdNum = parseInt(this.orderMsg.ChirdNoBedNum) + parseInt(this.orderMsg.ChirdNeedBedNum);
let money = price * this.orderMsg.ManNum
money += price * this.orderMsg.ChirdNum
money += this.currentPriceInfo.babyChargePrice * this.orderMsg.ChirdNeedBedNum
money += this.currentPriceInfo.babyPrice * this.orderMsg.BabyNum
money += this.currentPriceInfo.childNeedPrice * this.orderMsg.ChirdNeedBedNum
if (this.orderMsg.ChirdNoBedNum > 0) {
money -= this.currentPriceInfo.childNoNeedPrice * this.orderMsg.ChirdNoBedNum
}
money -= this.zaoniao
this.price = money
},
//去支付
goPay() {
......
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