|
|
|
@ -83,9 +83,57 @@ |
|
|
|
|
本次优惠 |
|
|
|
|
</view> |
|
|
|
|
<view class="flright width40 fotct"> |
|
|
|
|
¥{{deductionPrice}} |
|
|
|
|
¥{{timedeductionPrice}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<!-- //优惠券,积分抵扣 --> |
|
|
|
|
<view class="width100 concont mart10 backcorfff"> |
|
|
|
|
<view class="height50 width100 paddtop5 backcorfff" @click="showPopup()"> |
|
|
|
|
<view class="width50 flleft fcor333 fontwig6 font16" style="padding-left: 4%;"> |
|
|
|
|
优惠抵扣<text class="yhqky">{{OrderPreList.length}}张可用</text> |
|
|
|
|
</view> |
|
|
|
|
<view class="width40 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun" |
|
|
|
|
style="align-items: center;" v-if="deductionPrice == 0"> |
|
|
|
|
未使用 |
|
|
|
|
<image style="width: 40rpx;height: 40rpx;" src="../../../static/img/jt.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="width40 flright fotrt paddtright10 font15 fontwig6 fcoreb5 alijun" |
|
|
|
|
style="align-items: center;" v-else> |
|
|
|
|
-¥{{deductionPrice}} |
|
|
|
|
<image style="width: 40rpx;height: 40rpx;" src="../../../static/img/jt.png"></image> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="width94 line1 mart5 marb5"></view> |
|
|
|
|
<view class="Bubble alijusstart font14 fcor999"> |
|
|
|
|
选取: <text class="tests fotct font14 colorc3 paddleft5 paddtright5" |
|
|
|
|
v-if="typeid == 1">{{priceValue[1]}}</text><text |
|
|
|
|
class="tests fotct font14 color2f6f43 paddleft5 paddtright5" |
|
|
|
|
v-if="typeid == 2">{{priceValue[1]}}</text> 分 |
|
|
|
|
</view> |
|
|
|
|
<view class="width92 alijusstart paddtop10"> |
|
|
|
|
<view class="width30 fcor333 fontwig6 font16"> |
|
|
|
|
积分抵扣 |
|
|
|
|
</view> |
|
|
|
|
<view class="cj-slider"> |
|
|
|
|
<view class="flleft fotct font14 fcor666" style="width: 15%;">0</view> |
|
|
|
|
<cj-slider style="width: 60%; float:left;" v-if="isDiscount" v-model="priceValue" :min="0" |
|
|
|
|
:max="availIntegal" :step="1" :blockWidth="40" @start="blockStart" @moving="blockMoving" |
|
|
|
|
@end="blockEnd" /> |
|
|
|
|
<view class="flright fotrt font14 fcor666" style="width: 25%;">{{availIntegal}}</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="width94 line1 mart15 marb5"></view> |
|
|
|
|
<view class="height50 width100 backcorfff"> |
|
|
|
|
<view class="width70 flleft fcor666 font16 text1" style="padding-left: 4%;"> |
|
|
|
|
抵扣金额 |
|
|
|
|
</view> |
|
|
|
|
<view class="width20 flright fotrt paddtright10 font15 fcor666 alijun" style="align-items: center;"> |
|
|
|
|
¥{{priceValue[1] / 100}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<!-- //支付方式 --> |
|
|
|
|
<view class="mart10 heightl60 paddleft10 fcor333 fontwig6 font18 width100 backcorfff">支付方式:</view> |
|
|
|
|
<view class="line1"></view> |
|
|
|
@ -156,6 +204,35 @@ |
|
|
|
|
<button class="reBtn flright" @click="orderToPay">去支付</button> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<wybPopup ref="popup" type="bottom" width="500" :scrollY="true" radius="6" :showCloseIcon="true"> |
|
|
|
|
<view class="fotct font18 fontwig6 fcor333 mart10 height30">优惠券选择</view> |
|
|
|
|
<view class="width92 height110 tccs mart10" v-for="(items, index) in OrderPreList" :key="index" |
|
|
|
|
@click="radioChanges(items)"> |
|
|
|
|
<image mode="widthFix" class="mart10" :src="imageUrl+items.discountImg"></image> |
|
|
|
|
<view class="contrig"> |
|
|
|
|
<view class="width80p flleft"> |
|
|
|
|
<view class="font16 fontwig6 fcor333 text1 paddtop25">{{items.discountName}}</view> |
|
|
|
|
<view class="font13 fcor999 mart5">有效期:{{items.useEndTime | timeFormat('yyyy-mm-dd hh:mm:ss')}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="width20 flright"> |
|
|
|
|
<view class="yhprice"> |
|
|
|
|
<radio v-if="items.discountCondition && orderPrice > items.discountCondition" |
|
|
|
|
color="#c72a20" :checked="items.id == memDiscountId" /> |
|
|
|
|
|
|
|
|
|
<radio v-if="items.discountCondition && orderPrice < items.discountCondition" |
|
|
|
|
color="#c72a20" disabled="true" :checked="items.id == memDiscountId" /> |
|
|
|
|
|
|
|
|
|
<radio v-if="!items.discountCondition" color="#c72a20" |
|
|
|
|
:checked="items.id == memDiscountId" /> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</wybPopup> |
|
|
|
|
|
|
|
|
|
<ssPaymentPassword ref="paymentPassword" :mode="1" @submit="submitHandle" /> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
@ -168,16 +245,21 @@ |
|
|
|
|
hltUnionCardPay, |
|
|
|
|
orderToGoldPay, |
|
|
|
|
findUser, |
|
|
|
|
oilCardPay |
|
|
|
|
oilCardPay, |
|
|
|
|
getUserOrderPreList |
|
|
|
|
} from '../../../Utils/Api.js'; |
|
|
|
|
import ssPaymentPassword from '../../../components/sanshui-payment-password/index.vue'; |
|
|
|
|
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; |
|
|
|
|
import cjSlider from '@/components/cj-slider/cj-slider.vue'; |
|
|
|
|
let app = getApp(); |
|
|
|
|
// #ifdef H5 |
|
|
|
|
var jweixin = require('jweixin-module'); |
|
|
|
|
// #endif |
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
ssPaymentPassword |
|
|
|
|
ssPaymentPassword, |
|
|
|
|
wybPopup, |
|
|
|
|
cjSlider |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
@ -190,8 +272,17 @@ |
|
|
|
|
oilPirce: 0, //油卡余额 |
|
|
|
|
user: '', |
|
|
|
|
paytype: '', |
|
|
|
|
PaymentPassword: '', |
|
|
|
|
deductionPrice:'0'//本次优惠金额 |
|
|
|
|
PaymentPassword: '', |
|
|
|
|
timedeductionPrice: '0', //本次优惠金额 |
|
|
|
|
|
|
|
|
|
deductionPrice: '0.00', //优惠金额 |
|
|
|
|
OrderPreList: [], //优惠券数据 |
|
|
|
|
isUse: true, // 是否禁用状态 |
|
|
|
|
payPrice: 0, //支付价格 |
|
|
|
|
isDiscount: true, //刷新组件 |
|
|
|
|
memDiscountId: '', //优惠券id |
|
|
|
|
priceValue: [0, 0], // 积分可以指定默认值 |
|
|
|
|
availIntegal: 0, // 可用积分 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad(e) { |
|
|
|
@ -217,7 +308,8 @@ |
|
|
|
|
this.user = res.return_data; |
|
|
|
|
if (res.return_data.oilCard) { |
|
|
|
|
this.oilPirce = res.return_data.oilCard.amount; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.getUserOrderPreList(); |
|
|
|
|
uni.setStorage({ |
|
|
|
|
key: "user", |
|
|
|
|
data: res.return_data |
|
|
|
@ -225,6 +317,129 @@ |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询优惠券 |
|
|
|
|
getUserOrderPreList() { |
|
|
|
|
let params = { |
|
|
|
|
useScope: 4 |
|
|
|
|
} |
|
|
|
|
getUserOrderPreList(params).then(res => { |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
this.OrderPreList = res.return_data; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//弹出优惠券 |
|
|
|
|
showPopup() { |
|
|
|
|
this.$refs.popup.show(); |
|
|
|
|
}, |
|
|
|
|
//选择优惠券 |
|
|
|
|
radioChanges(item) { |
|
|
|
|
this.rechangeload(); |
|
|
|
|
if (this.memDiscountId == item.id) { // 如果已经选中,则取消选中 |
|
|
|
|
this.memDiscountId = ''; |
|
|
|
|
this.deductionPrice = '0.00'; |
|
|
|
|
this.priceCaluc(this.totalprice); |
|
|
|
|
|
|
|
|
|
} else { // 否则进行选中赋值 |
|
|
|
|
if (item.discountType == 1) { |
|
|
|
|
if (this.orderPrice > item.discountCondition) { |
|
|
|
|
this.memDiscountId = item.id; |
|
|
|
|
//满减价格 |
|
|
|
|
this.deductionPrice = item.discountPrice; |
|
|
|
|
let oldprice = this.orderPrice - this.deductionPrice; |
|
|
|
|
this.priceCaluc(oldprice); |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请满' + item.discountCondition + '使用此券', |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (item.discountType == 2) { |
|
|
|
|
this.memDiscountId = item.id; |
|
|
|
|
//抵扣价格 |
|
|
|
|
this.deductionPrice = item.discountPrice; |
|
|
|
|
let oldprice = this.orderPrice - this.deductionPrice; |
|
|
|
|
this.priceCaluc(oldprice); |
|
|
|
|
} |
|
|
|
|
if (item.discountType == 3) { |
|
|
|
|
this.memDiscountId = item.id; |
|
|
|
|
// 打折 |
|
|
|
|
this.deductionPrice = parseFloat(this.orderPrice - (this.orderPrice * item.discountPrice)) |
|
|
|
|
.toFixed(2); |
|
|
|
|
let oldprice = parseFloat(this.orderPrice * item.discountPrice).toFixed(2); |
|
|
|
|
this.priceCaluc(oldprice); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.$refs.popup.hide(); |
|
|
|
|
}, |
|
|
|
|
//计算价格 |
|
|
|
|
priceCaluc(item) { |
|
|
|
|
let zkprice = parseFloat(this.rechargeDes.integralDiscount / 100).toFixed(2); |
|
|
|
|
let pprice = parseFloat(item * 100).toFixed(0); |
|
|
|
|
let payprice = parseFloat(item * 100 * zkprice).toFixed(0); |
|
|
|
|
if (payprice > this.user.gold) { |
|
|
|
|
this.availIntegal = this.user.gold; |
|
|
|
|
this.priceValue[1] = 0; |
|
|
|
|
} else { |
|
|
|
|
this.availIntegal = payprice; |
|
|
|
|
this.priceValue[1] = 0; |
|
|
|
|
} |
|
|
|
|
this.reload(); |
|
|
|
|
this.calculatepayPrice(); |
|
|
|
|
}, |
|
|
|
|
//计算支付价格 |
|
|
|
|
calculatepayPrice() { |
|
|
|
|
if (this.deductionPrice == 0) { |
|
|
|
|
this.payPrice = Math.abs(parseFloat(this.totalprice - (parseFloat(this.priceValue[1] / 100).toFixed( |
|
|
|
|
2))) |
|
|
|
|
.toFixed(2)); |
|
|
|
|
} else { |
|
|
|
|
this.payPrice = Math.abs(parseFloat(this.orderPrice - (parseFloat(this.priceValue[1] / 100).toFixed( |
|
|
|
|
2)) - this |
|
|
|
|
.deductionPrice).toFixed(2)); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
rechangeload() { |
|
|
|
|
this.isUse = false; |
|
|
|
|
this.$nextTick(() => (this.isUse = true)) |
|
|
|
|
}, |
|
|
|
|
//刷新组件 |
|
|
|
|
reload() { |
|
|
|
|
this.isDiscount = false; |
|
|
|
|
this.$nextTick(() => (this.isDiscount = true)) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
//滑动开始 |
|
|
|
|
blockStart() {}, |
|
|
|
|
blockMoving() { |
|
|
|
|
// console.log('正在滑动中') |
|
|
|
|
}, |
|
|
|
|
//滑动结束 |
|
|
|
|
blockEnd() { |
|
|
|
|
this.isDiscount = 1; |
|
|
|
|
if (this.deductionPrice == 0) { |
|
|
|
|
this.payPrice = Math.abs(parseFloat(this.totalprice - parseFloat(this.priceValue[1] / 100).toFixed(2)) |
|
|
|
|
.toFixed( |
|
|
|
|
2)); |
|
|
|
|
} else { |
|
|
|
|
this.payPrice = Math.abs(parseFloat(this.orderPrice - parseFloat(this.priceValue[1] / 100).toFixed(2) - |
|
|
|
|
this |
|
|
|
|
.deductionPrice).toFixed(2)); |
|
|
|
|
} |
|
|
|
|
if (this.payPrice == 0) { |
|
|
|
|
this.isUse = false; |
|
|
|
|
this.paytype = ''; |
|
|
|
|
} else { |
|
|
|
|
this.isUse = true; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
//密码支付完成 |
|
|
|
|
submitHandle(e) { |
|
|
|
|
this.PaymentPassword = e.value; |
|
|
|
@ -375,8 +590,8 @@ |
|
|
|
|
getOrderById(params).then(res => { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
this.orderList = res.return_data.highChildOrderList[0]; |
|
|
|
|
this.deductionPrice = res.return_data.deductionPrice; |
|
|
|
|
this.orderList = res.return_data.highChildOrderList[0]; |
|
|
|
|
this.timedeductionPrice = res.return_data.deductionPrice; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
@ -632,5 +847,57 @@ |
|
|
|
|
position: absolute; |
|
|
|
|
right: 0px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.concont { |
|
|
|
|
border-radius: 12px; |
|
|
|
|
} |
|
|
|
|
.Bubble { |
|
|
|
|
margin-left: 50%; |
|
|
|
|
padding-top: 15px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.tests { |
|
|
|
|
border-radius: 15px; |
|
|
|
|
height: 22px; |
|
|
|
|
line-height: 22px; |
|
|
|
|
} |
|
|
|
|
.cj-slider { |
|
|
|
|
width: 100%; |
|
|
|
|
align-items: center; |
|
|
|
|
display: flex; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.yhqky { |
|
|
|
|
background: #ff0034; |
|
|
|
|
color: #ffffff; |
|
|
|
|
font-size: 14px; |
|
|
|
|
padding-left: 5px; |
|
|
|
|
padding-right: 5px; |
|
|
|
|
margin-left: 8px; |
|
|
|
|
padding-top: 2px; |
|
|
|
|
padding-bottom: 2px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.yhprice { |
|
|
|
|
margin-top: -30px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.contrig { |
|
|
|
|
margin-left: 180rpx; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.tccs { |
|
|
|
|
box-shadow: 0rpx 0rpx 10rpx rgba(0, 0, 0, 0.2); |
|
|
|
|
border: 1px solid #f6f6f6; |
|
|
|
|
border-radius: 8px; |
|
|
|
|
|
|
|
|
|
image { |
|
|
|
|
float: left; |
|
|
|
|
width: 170rpx; |
|
|
|
|
max-height: 170rpx; |
|
|
|
|
margin-left: 10px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|