| | |
| | | <view @click="showCoupon" class="u-flex"> |
| | | <block v-if="couponInfo.id"> |
| | | <view v-if="couponInfo.discountType==1" class="tag-pain"> |
| | | 满{{ parseFloat((couponInfo.thresholdValue / 100).toFixed(2)) }}元减{{ parseFloat((couponInfo.discount / 100).toFixed(2)) }}元券 |
| | | 满{{ $utils.fenToYuan(couponInfo.thresholdValue) }}元减{{ $utils.fenToYuan(couponInfo.discount) }}元券 |
| | | </view> |
| | | <view v-if="couponInfo.discountType==2" class="tag-pain"> |
| | | {{ parseFloat(couponInfo.discount * 10).toFixed(1) }}折券 |
| | | {{ $utils.accMul(couponInfo.discount, 10) }}折券 |
| | | </view> |
| | | </block> |
| | | |
| | |
| | | <view class="num-box"> |
| | | <view v-if="item.discountType==1" class="font-bold" style="color: #D31F28;"> |
| | | <text class="u-font-36">¥</text> |
| | | <text class="money">{{ parseFloat(item.discount / 100) }}</text> |
| | | <text class="money">{{ $utils.fenToYuan(item.discount) }}</text> |
| | | </view> |
| | | <view v-if="item.discountType==2" class="font-bold" style="color: #D31F28;"> |
| | | <text class="money">{{ parseFloat(item.discount * 10).toFixed(1) }}</text> |
| | | <text class="money">{{ $utils.accMul(item.discount, 10) }}</text> |
| | | <text class="u-font-36">折</text> |
| | | </view> |
| | | <view v-if="item.orderMax" class="u-font-24 u-m-t-20">低于{{ parseFloat(item.orderMax / 100) }}元可用</view> |
| | | <view v-else-if="item.thresholdValue" class="u-font-24 u-m-t-20">满{{ parseFloat(item.thresholdValue / 100) }}元可用</view> |
| | | <view v-if="item.orderMax" class="u-font-24 u-m-t-20">低于{{ $utils.fenToYuan(item.orderMax) }}元可用</view> |
| | | <view v-else-if="item.thresholdValue" class="u-font-24 u-m-t-20">满{{ $utils.fenToYuan(item.thresholdValue) }}元可用</view> |
| | | <view v-else class="u-font-24 u-m-t-20">无门槛</view> |
| | | </view> |
| | | <view class="butt"></view> |
| | |
| | | saveOrder, |
| | | } from 'common/api/index' |
| | | |
| | | import wx from 'weixin-js-sdk'; // 使用js-sdk |
| | | import wx from 'weixin-js-sdk'; |
| | | import {accMul, fenToYuan} from 'common/util' // 使用js-sdk |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | return 0 |
| | | } |
| | | if (this.checkCoupon.discountType == 1) { |
| | | const num = (this.checkCoupon.discount / 100).toFixed(2) |
| | | const num = this.$utils.fenToYuan(this.couponInfo.discount) |
| | | return parseFloat(num); |
| | | } |
| | | const dis = 1 - parseFloat(this.checkCoupon.discount) |
| | | const dic = Math.floor(Number((this.money || 0) * 100) * dis) |
| | | return (dic / 100).toFixed(2); |
| | | const dic = Math.floor(this.$utils.accMul(this.money,100) * dis) |
| | | return this.$utils.fenToYuan(dic).toFixed(2); |
| | | }, |
| | | discount() { |
| | | if(!(this.money || 0)||!this.couponInfo.id){ |
| | | return 0 |
| | | } |
| | | if (this.couponInfo.discountType == 1) { |
| | | const num = (this.couponInfo.discount / 100).toFixed(2) |
| | | const num = this.$utils.fenToYuan(this.couponInfo.discount) |
| | | return parseFloat(num); |
| | | } |
| | | const dis = 1 - parseFloat(this.couponInfo.discount) |
| | | const dic = Math.floor(Number((this.money || 0) * 100) * dis) |
| | | return (dic / 100).toFixed(2); |
| | | const dic = Math.floor(this.$utils.accMul(this.money,100) * dis) |
| | | return this.$utils.fenToYuan(dic).toFixed(2); |
| | | }, |
| | | payMoney() { |
| | | if(this.discount===0||!Number(this.money || 0)){ |
| | | return 0 |
| | | } |
| | | const num = Number((this.money || 0) * 100) - Number(this.discount*100); |
| | | return (num / 100).toFixed(2); |
| | | const num = this.$utils.accMul(this.money,100) - this.$utils.accMul(this.discount,100); |
| | | return this.$utils.fenToYuan(num).toFixed(2); |
| | | } |
| | | }, |
| | | onLoad(opt) { |
| | |
| | | queryUseSweepPayCoupon() { |
| | | queryUseSweepPayCoupon({ |
| | | params: { |
| | | score: 0, |
| | | applyPayWayStr: this.payWay, |
| | | cusid: this.shopInfo.id, |
| | | money: (this.money * 100).toFixed(0), |
| | | money: this.$utils.accMul(this.money,100), |
| | | } |
| | | }).then(res => { |
| | | this.couponList = res |
| | |
| | | // 金额 this.money |
| | | uni.showLoading() |
| | | const params = { |
| | | money: (this.money * 100).toFixed(0), |
| | | money: this.$utils.accMul(this.money,100), |
| | | shopId: this.shopInfo.id, |
| | | payWay: this.payWay, |
| | | buyerNote: this.buyerNote, |