|
|
|
@ -52,14 +52,44 @@ |
|
|
|
|
</view> |
|
|
|
|
<view class="width90 fotrt height50 font13 fcor999"> |
|
|
|
|
共 <text class="fcor333 fontwig6" style="margin: 0px 5px;"> {{totalnum}} </text> 件 小计: |
|
|
|
|
<text class="font16 colorc3 fontwig6 margle" v-if="typeid == 1"> ¥{{totalprice}}</text> |
|
|
|
|
<text class="font16 color2f6f43 fontwig6 margle" v-if="typeid == 2"> ¥{{totalprice}}</text> |
|
|
|
|
<text class="font16 colorc3 fontwig6 margle" v-if="typeid == 1 && memDiscountId"> |
|
|
|
|
¥{{orderPrice}}</text> |
|
|
|
|
<text class="font16 colorc3 fontwig6 margle" v-if="typeid == 1 && !memDiscountId"> |
|
|
|
|
¥{{totalprice}}</text> |
|
|
|
|
<text class="font12 fcor999 fontwig6 margle" v-if="typeid == 1 && !memDiscountId" |
|
|
|
|
style="text-decoration: line-through;"> ¥{{orderPrice}}</text> |
|
|
|
|
|
|
|
|
|
<text class="font16 color2f6f43 fontwig6 margle" v-if="typeid == 2 && memDiscountId"> |
|
|
|
|
¥{{orderPrice}}</text> |
|
|
|
|
<text class="font16 color2f6f43 fontwig6 margle" v-if="typeid == 2 && !memDiscountId"> |
|
|
|
|
¥{{totalprice}}</text> |
|
|
|
|
<text class="font12 fcor999 fontwig6 margle" v-if="typeid == 2 && !memDiscountId" |
|
|
|
|
style="text-decoration: line-through;"> ¥{{orderPrice}}</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="width94 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 fcor089 paddleft5 paddtright5">{{priceValue[1]}}</text> 分 |
|
|
|
|
选取: <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"> |
|
|
|
@ -123,7 +153,7 @@ |
|
|
|
|
<view class="width94 font12 fcor999 mart5 paddbotm10">经用于接收取餐码,请正确填写</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view class="concont width94 mart20 backcorfff marb100" v-if="typeid == 1"> |
|
|
|
|
<view class="concont width94 mart20 backcorfff marb150" v-if="typeid == 1"> |
|
|
|
|
<view class="width94 paddtop10 font14 fcor333 fontwig6"> |
|
|
|
|
就餐方式 |
|
|
|
|
</view> |
|
|
|
@ -140,7 +170,7 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="concont width94 mart20 backcorfff marb100 font13" v-if="typeid == 2"> |
|
|
|
|
<view class="concont width94 mart20 backcorfff marb150 font13" v-if="typeid == 2"> |
|
|
|
|
<view class="width94 alijusstart paddtop10 font14" @click="radioChange()"> |
|
|
|
|
<view class="width50 fcor333">购买须知</view> |
|
|
|
|
<!-- <view ></view> --> |
|
|
|
@ -179,6 +209,42 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</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="typeid == 1 && items.discountCondition && orderPrice > items.discountCondition" |
|
|
|
|
color="#c72a20" :checked="items.id == memDiscountId" /> |
|
|
|
|
|
|
|
|
|
<radio v-if="typeid == 1 && items.discountCondition && orderPrice < items.discountCondition" |
|
|
|
|
color="#c72a20" disabled="true" :checked="items.id == memDiscountId" /> |
|
|
|
|
|
|
|
|
|
<radio v-if="typeid == 1 && !items.discountCondition" color="#c72a20" |
|
|
|
|
:checked="items.id == memDiscountId" /> |
|
|
|
|
|
|
|
|
|
<radio v-if="typeid == 2 && items.discountCondition && orderPrice > items.discountCondition" |
|
|
|
|
color="#2f6f43" :checked="items.id == memDiscountId" /> |
|
|
|
|
|
|
|
|
|
<radio v-if="typeid == 2 && items.discountCondition && orderPrice < items.discountCondition" |
|
|
|
|
disabled="true" color="#2f6f43" :checked="items.id == memDiscountId" /> |
|
|
|
|
|
|
|
|
|
<radio v-if="typeid == 2 && !items.discountCondition" color="#2f6f43" |
|
|
|
|
:checked="items.id == memDiscountId" /> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</wybPopup> |
|
|
|
|
<ssPaymentPassword ref="paymentPassword" :mode="1" @submit="submitHandle" /> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
@ -186,13 +252,15 @@ |
|
|
|
|
<script> |
|
|
|
|
import cjSlider from '@/components/cj-slider/cj-slider.vue'; |
|
|
|
|
import ssPaymentPassword from '@/components/sanshui-payment-password/index.vue' |
|
|
|
|
import wybPopup from '@/components/wyb-popup/wyb-popup.vue' |
|
|
|
|
import { |
|
|
|
|
xbkaddOrder, |
|
|
|
|
getThirdPartyByDetail, |
|
|
|
|
getHuiLianTongCardBalance, |
|
|
|
|
findUser, |
|
|
|
|
qianzhuorderToPayByWx, |
|
|
|
|
czhltUnionCardPay |
|
|
|
|
czhltUnionCardPay, |
|
|
|
|
getUserOrderPreList |
|
|
|
|
} from '../../Utils/Api.js'; |
|
|
|
|
// #ifdef H5 |
|
|
|
|
var jweixin = require('jweixin-module'); |
|
|
|
@ -201,7 +269,8 @@ |
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
cjSlider, |
|
|
|
|
ssPaymentPassword |
|
|
|
|
ssPaymentPassword, |
|
|
|
|
wybPopup |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
@ -228,7 +297,12 @@ |
|
|
|
|
showType: '', //支付方式 |
|
|
|
|
memDiscountId: '', //优惠券id |
|
|
|
|
PaymentPassword: '', //支付密码 |
|
|
|
|
orderId: '' //订单id |
|
|
|
|
orderId: '', //订单id |
|
|
|
|
deductionPrice: '0.00', //优惠金额 |
|
|
|
|
OrderPreList: [], //优惠券数据 |
|
|
|
|
imageUrl: app.globalData.imgUrl, //图片地址 |
|
|
|
|
orderPrice: 0, //订单价格 |
|
|
|
|
rechargeDes: '', // 支付详情 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
@ -237,6 +311,8 @@ |
|
|
|
|
this.customerMobile = app.globalData.userInfo.phone; |
|
|
|
|
this.getAllPrice(); |
|
|
|
|
this.getAllCount(); |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
this.findUser(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
@ -262,6 +338,7 @@ |
|
|
|
|
} |
|
|
|
|
getThirdPartyByDetail(datas).then(res => { |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
this.rechargeDes = res.return_data; |
|
|
|
|
this.paytypeList = res.return_data.productPayType.split(','); |
|
|
|
|
this.paytypeList = this.paytypeList.slice(0, this.paytypeList.length - 1); |
|
|
|
|
let zkprice = parseFloat(res.return_data.integralDiscount / 100).toFixed(2); |
|
|
|
@ -284,6 +361,7 @@ |
|
|
|
|
this.user = res.return_data; |
|
|
|
|
this.getHuiLianTongCardBalance(); |
|
|
|
|
this.getThirdPartyByDetail(); |
|
|
|
|
this.getUserOrderPreList(); |
|
|
|
|
uni.setStorage({ |
|
|
|
|
key: "user", |
|
|
|
|
data: res.return_data |
|
|
|
@ -310,7 +388,7 @@ |
|
|
|
|
let result = 0; |
|
|
|
|
let result1 = 0; |
|
|
|
|
this.orderList.forEach((good) => { |
|
|
|
|
result1 += this.accMul(good.num, good.price) |
|
|
|
|
result1 += this.accMul(good.num, good.price); |
|
|
|
|
result = result1.toFixed(2); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
@ -321,10 +399,9 @@ |
|
|
|
|
this.disconutprice = (result3 - result).toFixed(2); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
this.orderPrice = result3; |
|
|
|
|
this.totalprice = result; |
|
|
|
|
this.payPrice = result; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
//总数 |
|
|
|
|
getAllCount() { |
|
|
|
@ -356,11 +433,7 @@ |
|
|
|
|
changedissr(item) { |
|
|
|
|
this.sttypeid = item; |
|
|
|
|
}, |
|
|
|
|
//刷新组件 |
|
|
|
|
reload() { |
|
|
|
|
this.isDiscount = false; |
|
|
|
|
this.$nextTick(() => (this.isDiscount = true)) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
//滑动开始 |
|
|
|
|
blockStart() {}, |
|
|
|
|
blockMoving() { |
|
|
|
@ -368,7 +441,16 @@ |
|
|
|
|
}, |
|
|
|
|
//滑动结束 |
|
|
|
|
blockEnd() { |
|
|
|
|
this.payPrice = parseFloat(this.totalprice - parseFloat(this.priceValue[1] / 100).toFixed(2)).toFixed(2); |
|
|
|
|
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 = ''; |
|
|
|
@ -460,18 +542,11 @@ |
|
|
|
|
platformId: this.showType, |
|
|
|
|
orderItems: data2, |
|
|
|
|
eatType: this.sttypeid, |
|
|
|
|
integralNum: this.priceValue[1] |
|
|
|
|
integralNum: this.priceValue[1], |
|
|
|
|
memDiscountId: this.memDiscountId |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (this.typeid == 2) { |
|
|
|
|
// if (this.radiostu != 1) { |
|
|
|
|
// uni.showToast({ |
|
|
|
|
// title: '请勾选协议表示同意', |
|
|
|
|
// icon: 'none', |
|
|
|
|
// duration: 2000 |
|
|
|
|
// }) |
|
|
|
|
// return; |
|
|
|
|
// } |
|
|
|
|
datas = { |
|
|
|
|
customerMobile: this.customerMobile, |
|
|
|
|
regionId: app.globalData.cityId, |
|
|
|
@ -479,10 +554,10 @@ |
|
|
|
|
productType: this.productType, |
|
|
|
|
platformId: this.showType, |
|
|
|
|
orderItems: this.orderList, |
|
|
|
|
integralNum: this.priceValue[1] |
|
|
|
|
integralNum: this.priceValue[1], |
|
|
|
|
memDiscountId: this.memDiscountId |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
xbkaddOrder(datas).then(res => { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
@ -493,9 +568,115 @@ |
|
|
|
|
"openIdType": this.showType |
|
|
|
|
} |
|
|
|
|
this.qianzhuorderToPayByWx(params); |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: res.return_msg, |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//查询优惠券 |
|
|
|
|
getUserOrderPreList() { |
|
|
|
|
let cope; |
|
|
|
|
if (this.productType == 1) { |
|
|
|
|
cope = 5; |
|
|
|
|
} else { |
|
|
|
|
cope = 4; |
|
|
|
|
} |
|
|
|
|
let params = { |
|
|
|
|
useScope: cope |
|
|
|
|
} |
|
|
|
|
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)) |
|
|
|
|
}, |
|
|
|
|
//获取订单数据 |
|
|
|
|
qianzhuorderToPayByWx(item) { |
|
|
|
|
let that = this; |
|
|
|
@ -722,7 +903,8 @@ |
|
|
|
|
title: '支付成功' |
|
|
|
|
}) |
|
|
|
|
uni.reLaunch({ |
|
|
|
|
url: '/qianzhu-KFC/order-details/order-details?id=' + that |
|
|
|
|
url: '/qianzhu-KFC/order-details/order-details?id=' + |
|
|
|
|
that |
|
|
|
|
.orderId |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
@ -783,7 +965,6 @@ |
|
|
|
|
|
|
|
|
|
.footbtn { |
|
|
|
|
bottom: 0px; |
|
|
|
|
z-index: 9999; |
|
|
|
|
position: fixed; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -810,4 +991,36 @@ |
|
|
|
|
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> |
|
|
|
|