|
|
|
@ -66,12 +66,33 @@ |
|
|
|
|
<view class="width90 height40 mart10" style="border: 1px solid #f2f2f2;"> |
|
|
|
|
<view class="width8 flleft">¥</view> |
|
|
|
|
<input type="digit" class="font16 width60 flleft height40" placeholder="输入金额(保留2位小数)" v-model="inputMoney" |
|
|
|
|
@blur="Listeningfocus" /> |
|
|
|
|
@input="Listeningfocus" /> |
|
|
|
|
<view class="width30 height40 flright font14 fcor999 fotct" |
|
|
|
|
style="border-left: 1px solid #f2f2f2;line-height: 40px;"> |
|
|
|
|
约{{litre}}L |
|
|
|
|
约{{oilLiters}}L |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- 详情描述--> |
|
|
|
|
<view class="line10 mart15"></view> |
|
|
|
|
<view class="width90 height40 mart10"> |
|
|
|
|
<view class="flleft width50 font15 fcor666">加油升数:<text class="fcoreb5 margle"> |
|
|
|
|
{{oilLiters}}L</text></view> |
|
|
|
|
<view class="flright width50 font15 fcor666">平台折扣:<text class="fcoreb5 margle"> |
|
|
|
|
{{discount}}折</text></view> |
|
|
|
|
</view> |
|
|
|
|
<view class="width90 height40"> |
|
|
|
|
<view class="flleft width50 font15 fcor666">优惠价格:<text class="fcoreb5 margle"> |
|
|
|
|
¥{{pricePreferences}}</text></view> |
|
|
|
|
<view class="flright width50 font15 fcor666">加油补贴:<text class="fcoreb5 margle"> |
|
|
|
|
¥{{oilSubsidy}}</text></view> |
|
|
|
|
</view> |
|
|
|
|
<view class="width90 height40"> |
|
|
|
|
<view class="flleft width50 font15 fcor666">每升优惠:<text class="fcoreb5 margle"> |
|
|
|
|
¥{{litersPreferences}}</text></view> |
|
|
|
|
<view class="flright width50 font15 fcor666">本次优惠:<text class="fcoreb5 margle"> |
|
|
|
|
¥{{totalPreferences}}</text></view> |
|
|
|
|
</view> |
|
|
|
|
<view class="line10 mart15"></view> |
|
|
|
|
<!-- <view class="list width90"> |
|
|
|
|
<view class="box" v-for="(amount,index) in amountList" :key="index" @click="select(amount)" |
|
|
|
|
:class="{'on':amount.price == inputMoney}"> |
|
|
|
@ -94,7 +115,6 @@ |
|
|
|
|
<button class="reBtn flright" v-if="user.phone == null" @click="jumpH5Bding">去支付</button> |
|
|
|
|
<button class="reBtn flright" v-else @click="postionIng">去支付</button> |
|
|
|
|
<!-- #endif --> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
<!-- 底部弹窗 --> |
|
|
|
|
<wybPopup ref="popup" type="bottom" height="600" width="500" radius="6" :showCloseIcon="true"> |
|
|
|
@ -125,7 +145,7 @@ |
|
|
|
|
getGasDetailByStoreKey, |
|
|
|
|
addOrder, |
|
|
|
|
getDictionaryByCodeTypeOl, |
|
|
|
|
oilPriceCompute |
|
|
|
|
oilPriceDiscountCompute |
|
|
|
|
} from '../../../Utils/Api.js'; |
|
|
|
|
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; |
|
|
|
|
let app = getApp(); |
|
|
|
@ -179,7 +199,14 @@ |
|
|
|
|
oilType: '', |
|
|
|
|
distance: 9999, //距离限制 |
|
|
|
|
xzMoney: '300', //金额限制 |
|
|
|
|
isTyAgent: false //是否是代理商 |
|
|
|
|
isTyAgent: false, //是否是代理商 |
|
|
|
|
oilLiters: '0', //加油升数 |
|
|
|
|
discount: '0', //平台折扣 |
|
|
|
|
oilSubsidy: '0', //加油补贴 |
|
|
|
|
litersPreferences: '0', //每升优惠 |
|
|
|
|
pricePreferences: '0', //优惠价格 |
|
|
|
|
totalPreferences: '0', //本次优惠 |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad(options) { |
|
|
|
@ -333,6 +360,12 @@ |
|
|
|
|
this.discountPrice = '0.00'; |
|
|
|
|
this.litre = ''; |
|
|
|
|
this.inputMoney = ''; |
|
|
|
|
this.oilLiters = '0'; |
|
|
|
|
this.discount = '0'; |
|
|
|
|
this.oilSubsidy = '0'; |
|
|
|
|
this.litersPreferences = '0'; |
|
|
|
|
this.pricePreferences = '0'; |
|
|
|
|
this.totalPreferences = '0'; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -356,10 +389,10 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//原来计算方式 |
|
|
|
|
this.litre = parseFloat(this.inputMoney / this.priceGun).toFixed(2); |
|
|
|
|
// this.litre = parseFloat(this.inputMoney / this.priceGun).toFixed(2); |
|
|
|
|
// var arr1 = parseFloat(this.inputMoney / this.priceOfficial * this.priceVip).toFixed(4); |
|
|
|
|
// this.totalPrice = this.numFilter(arr1); |
|
|
|
|
this.oilPriceCompute(); |
|
|
|
|
this.oilPriceDiscountCompute(); |
|
|
|
|
//目前计算方式 |
|
|
|
|
// this.litre = parseFloat(this.inputMoney / this.priceGun).toFixed(2); |
|
|
|
|
// this.totalPrice = parseFloat(this.inputMoney / this.priceGun * this.priceVip).toFixed(2); |
|
|
|
@ -369,21 +402,35 @@ |
|
|
|
|
// } |
|
|
|
|
}, |
|
|
|
|
//计算价格 |
|
|
|
|
oilPriceCompute() { |
|
|
|
|
oilPriceDiscountCompute() { |
|
|
|
|
let datas = { |
|
|
|
|
"price": this.inputMoney, |
|
|
|
|
"goodsId": this.counId, |
|
|
|
|
"oilNo": this.gasOilNo, |
|
|
|
|
"isTyAgent": this.isTyAgent |
|
|
|
|
} |
|
|
|
|
oilPriceCompute(datas).then(res => { |
|
|
|
|
oilPriceDiscountCompute(datas).then(res => { |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
this.totalPrice = res.return_data; |
|
|
|
|
this.totalPrice = res.return_data.payPrice; |
|
|
|
|
this.oilLiters = res.return_data.oilLiters; |
|
|
|
|
this.discount = res.return_data.discount; |
|
|
|
|
this.oilSubsidy = res.return_data.oilSubsidy; |
|
|
|
|
this.litersPreferences = res.return_data.litersPreferences; |
|
|
|
|
this.pricePreferences = res.return_data.pricePreferences; |
|
|
|
|
this.totalPreferences = res.return_data.totalPreferences; |
|
|
|
|
if (this.priceVip != this.priceOfficial) { |
|
|
|
|
// let gbprice = parseFloat(this.litre * this.priceOfficial).toFixed(2); |
|
|
|
|
// this.discountPrice = parseFloat(gbprice - this.totalPrice).toFixed(2); |
|
|
|
|
this.discountPrice = parseFloat(this.inputMoney - this.totalPrice).toFixed(2); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.totalPrice = '0'; |
|
|
|
|
this.oilLiters = '0'; |
|
|
|
|
this.discount = '0'; |
|
|
|
|
this.oilSubsidy = '0'; |
|
|
|
|
this.litersPreferences = '0'; |
|
|
|
|
this.pricePreferences = '0'; |
|
|
|
|
this.totalPreferences = '0'; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|