Commit 9f30971b authored by youjie's avatar youjie

优惠金额满足条件

parent a828c9de
...@@ -263,6 +263,7 @@ ...@@ -263,6 +263,7 @@
goVisible:false, goVisible:false,
orderInfo: {}, orderInfo: {},
Mailbox: '', Mailbox: '',
price: 0,
} }
}, },
components: { components: {
...@@ -640,13 +641,13 @@ ...@@ -640,13 +641,13 @@
let discount = 0 let discount = 0
const money = this.price const money = this.price
this.couponList.forEach(x=>{ this.couponList.forEach(x=>{
if(x.couponsType==1 && x.denomination>discount&&(this.guest.length>=x.orderGuestNum||!x.orderGuestNum)) { if(x.couponsType==1 && x.denomination>discount&&(this.guest.length>=x.orderGuestNum||!x.orderGuestNum)&&this.price>=x.useCondition) {
discount=x.denomination discount=x.denomination
maxCouponId = x.id maxCouponId = x.id
} }
if(x.couponsType==2){ if(x.couponsType==2){
let disMoney = money*(1-x.denomination) let disMoney = money*(1-x.denomination)
if(discount<disMoney&&(this.guest.length>=x.orderGuestNum||!x.orderGuestNum)){ if(discount<disMoney&&(this.guest.length>=x.orderGuestNum||!x.orderGuestNum)&&this.price>=x.useCondition){
discount=disMoney discount=disMoney
maxCouponId = x.id maxCouponId = x.id
} }
......
...@@ -26,7 +26,9 @@ ...@@ -26,7 +26,9 @@
<scroll-view :scroll-y="true" style="height: 1px;flex: 1;overflow: hidden;" @scrolltolower="lower"> <scroll-view :scroll-y="true" style="height: 1px;flex: 1;overflow: hidden;" @scrolltolower="lower">
<view class="searchCityCenterBox"> <view class="searchCityCenterBox">
<template v-if="airportList.length>0"> <template v-if="airportList.length>0">
<view class="searchCityCenter column" v-for="(item,index) in airportList" :key="index" <view class="searchCityCenter column" v-for="(item,index) in airportList"
:key="index"
:class="[(busInfor.CarType==1&&busInfor.CountryId==item.Country)||(busInfor.CarType==2&&busInfor.desCountryId==item.Country)?'active':'']"
> >
<view class="searchCityTitle"> <view class="searchCityTitle">
<view>{{ item.CountryName }}</view> <view>{{ item.CountryName }}</view>
...@@ -35,7 +37,8 @@ ...@@ -35,7 +37,8 @@
v-for="(items,i) in item.AirportList" v-for="(items,i) in item.AirportList"
:key="i" :key="i"
@click="currentData(item,items,1)"> @click="currentData(item,items,1)">
<view class="searchCityTextL col"> <view class="searchCityTextL col"
:class="[(busInfor.CarType==1&&busInfor.CityId==items.City)||(busInfor.CarType==2&&busInfor.desCityId==items.City)?'active':'']">
{{ items.AirportName }} {{ items.AirportName }}
</view> </view>
<view class="searchCityTextR"> <view class="searchCityTextR">
...@@ -231,6 +234,9 @@ ...@@ -231,6 +234,9 @@
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
} }
.searchCityCenter.active .searchCityTextL.active{
color: #B99846;
}
.searchCityTextR { .searchCityTextR {
margin-left: 15rpx; margin-left: 15rpx;
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
<view class="visaProductTitle">{{orderMsg.OrderType==1?'接机':orderMsg.OrderType==2?'送机':'包车'}}信息</view> <view class="visaProductTitle">{{orderMsg.OrderType==1?'接机':orderMsg.OrderType==2?'送机':'包车'}}信息</view>
</view> </view>
<view class="row-sbas-n items-center"> <view class="row-sbas-n items-center">
<!---->
<view class="addPnum addPnumL" @click="orderMsg.Num>1?editNum(1):''"> <view class="addPnum addPnumL" @click="orderMsg.Num>1?editNum(1):''">
<image v-if="orderMsg.Num>1" style="width: 27rpx;height: 27rpx;display: block;" <image v-if="orderMsg.Num>1" style="width: 27rpx;height: 27rpx;display: block;"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638751245939665786.png" /> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638751245939665786.png" />
...@@ -630,6 +630,7 @@ ...@@ -630,6 +630,7 @@
//计算总价 //计算总价
CalTotalPrice() { CalTotalPrice() {
this.orderMsg.Money = this.getPrice(this.orderMsg.Unit_Price * this.orderMsg.Num) this.orderMsg.Money = this.getPrice(this.orderMsg.Unit_Price * this.orderMsg.Num)
this.price = this.orderMsg.Money;
}, },
initData() { initData() {
uni.showLoading({ uni.showLoading({
...@@ -705,14 +706,14 @@ ...@@ -705,14 +706,14 @@
const money = this.price const money = this.price
this.couponList.forEach(x => { this.couponList.forEach(x => {
if (x.couponsType == 1 && x.denomination > discount && (this.orderMsg.PeopleNum >= x if (x.couponsType == 1 && x.denomination > discount && (this.orderMsg.PeopleNum >= x
.orderGuestNum || !x.orderGuestNum)) { .orderGuestNum || !x.orderGuestNum)&&this.price>=x.useCondition) {
discount = x.denomination discount = x.denomination
maxCouponId = x.id maxCouponId = x.id
} }
if (x.couponsType == 2) { if (x.couponsType == 2) {
let disMoney = money * (1 - x.denomination) let disMoney = money * (1 - x.denomination)
if (discount < disMoney && (this.orderMsg.PeopleNum >= x.orderGuestNum || !x if (discount < disMoney && (this.orderMsg.PeopleNum >= x.orderGuestNum || !x
.orderGuestNum)) { .orderGuestNum)&&this.price>=x.useCondition) {
discount = disMoney discount = disMoney
maxCouponId = x.id maxCouponId = x.id
} }
...@@ -720,7 +721,6 @@ ...@@ -720,7 +721,6 @@
}) })
if (maxCouponId > 0) this.closeCouponHandler([maxCouponId]) if (maxCouponId > 0) this.closeCouponHandler([maxCouponId])
else this.closeCouponHandler(-1) else this.closeCouponHandler(-1)
this.CalTotalPrice()
} }
}, },
getUserCouponList() { getUserCouponList() {
...@@ -742,7 +742,12 @@ ...@@ -742,7 +742,12 @@
"coupon_post_GetUserCanUseCouponList", couponParams, "coupon_post_GetUserCanUseCouponList", couponParams,
(res) => { (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.couponList = res.data res.data.forEach((x) => {
if(x.useCondition){
this.couponList.push(x)
}
})
// this.couponList = res.data
this.calcMaxCouponHandle() this.calcMaxCouponHandle()
} }
}, },
...@@ -795,8 +800,10 @@ ...@@ -795,8 +800,10 @@
} else { } else {
this.orderMsg.Num++; this.orderMsg.Num++;
} }
if(this.currentCoupon.discountMoney>0) this.calcMaxCouponHandle(); this.CalTotalPrice();
else this.CalTotalPrice(); setTimeout(() => {
this.calcMaxCouponHandle()
},200)
}, },
formatDate(str) { formatDate(str) {
let temp = str.split("-"); let temp = str.split("-");
......
...@@ -671,14 +671,14 @@ ...@@ -671,14 +671,14 @@
const money = this.price const money = this.price
this.couponList.forEach(x => { this.couponList.forEach(x => {
if (x.couponsType == 1 && x.denomination > discount && (this.orderMsg.AdultPeopleNum >= x if (x.couponsType == 1 && x.denomination > discount && (this.orderMsg.AdultPeopleNum >= x
.orderGuestNum || !x.orderGuestNum)) { .orderGuestNum || !x.orderGuestNum)&&this.price>=x.useCondition) {
discount = x.denomination discount = x.denomination
maxCouponId = x.id maxCouponId = x.id
} }
if (x.couponsType == 2) { if (x.couponsType == 2) {
let disMoney = money * (1 - x.denomination) let disMoney = money * (1 - x.denomination)
if (discount < disMoney && (this.orderMsg.AdultPeopleNum >= x.orderGuestNum || !x if (discount < disMoney && (this.orderMsg.AdultPeopleNum >= x.orderGuestNum || !x
.orderGuestNum)) { .orderGuestNum)&&this.price>=x.useCondition) {
discount = disMoney discount = disMoney
maxCouponId = x.id maxCouponId = x.id
} }
......
...@@ -830,13 +830,13 @@ ...@@ -830,13 +830,13 @@
let discount = 0 let discount = 0
const money = this.price const money = this.price
this.couponList.forEach(x=>{ this.couponList.forEach(x=>{
if(x.couponsType==1 && x.denomination>discount&&(this.total>=x.orderGuestNum||!x.orderGuestNum)) { if(x.couponsType==1 && x.denomination>discount&&(this.total>=x.orderGuestNum||!x.orderGuestNum)&&this.price>=x.useCondition) {
discount=x.denomination discount=x.denomination
maxCouponId = x.id maxCouponId = x.id
} }
if(x.couponsType==2){ if(x.couponsType==2){
let disMoney = money*(1-x.denomination) let disMoney = money*(1-x.denomination)
if(discount<disMoney&&(this.total>=x.orderGuestNum||!x.orderGuestNum)){ if(discount<disMoney&&(this.total>=x.orderGuestNum||!x.orderGuestNum)&&this.price>=x.useCondition){
discount=disMoney discount=disMoney
maxCouponId = x.id maxCouponId = x.id
} }
......
...@@ -1163,13 +1163,13 @@ ...@@ -1163,13 +1163,13 @@
let discount = 0 let discount = 0
const money = this.price const money = this.price
this.couponList.forEach(x=>{ this.couponList.forEach(x=>{
if(x.couponsType==1 && x.denomination>discount&&(this.orderMsg.AdultPeopleNum>=x.orderGuestNum||!x.orderGuestNum)) { if(x.couponsType==1 && x.denomination>discount&&(this.orderMsg.AdultPeopleNum>=x.orderGuestNum||!x.orderGuestNum)&&this.price>=x.useCondition) {
discount=x.denomination discount=x.denomination
maxCouponId = x.id maxCouponId = x.id
} }
if(x.couponsType==2){ if(x.couponsType==2){
let disMoney = money*(1-x.denomination) let disMoney = money*(1-x.denomination)
if(discount<disMoney&&(this.orderMsg.AdultPeopleNum>=x.orderGuestNum||!x.orderGuestNum)){ if(discount<disMoney&&(this.orderMsg.AdultPeopleNum>=x.orderGuestNum||!x.orderGuestNum)&&this.price>=x.useCondition){
discount=disMoney discount=disMoney
maxCouponId = x.id maxCouponId = x.id
} }
......
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