优惠券相关更新
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
<view class="listStyle_left">
|
<view class="listStyle_left">
|
||||||
<view class="listrigth">
|
<view class="listrigth">
|
||||||
<view>{{active == 1 ? item.biz_name : item.content}}</view>
|
<view>{{active == 1 ? item.biz_name : item.content}}</view>
|
||||||
<view :class="[item.type == '+'?'colorStyle':'']">
|
<view :class="{colorStyle: (active==1&&item.type == '+') || (active==2&&item.floatType=='add')}">
|
||||||
{{ active == 1 ? item.type : (item.floatType == 'add'?'+':'')}}
|
{{ active == 1 ? item.type : (item.floatType == 'add'?'+':'')}}
|
||||||
{{active == 1 ? item.amount : item.floatPoints}}
|
{{active == 1 ? item.amount : item.floatPoints}}
|
||||||
</view>
|
</view>
|
||||||
@@ -178,7 +178,7 @@
|
|||||||
|
|
||||||
.listrigth {
|
.listrigth {
|
||||||
.colorStyle {
|
.colorStyle {
|
||||||
// color: #FF7127;
|
color: #FF7127;
|
||||||
}
|
}
|
||||||
|
|
||||||
>view {
|
>view {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="containertop">
|
<view class="containertop" :class="{select: type == 'confirm_order_coupon' || type == 'confirm_order_product' || this.type == 'orderInfo_coupon' || this.type == 'orderInfo_product'}">
|
||||||
<view class="containertopbox">
|
<view class="containertopbox">
|
||||||
<view class="containertopboxitem flex-start" v-for="(item,index) in list" :key="index">
|
<view class="containertopboxitem flex-start" v-for="(item,index) in list" :key="index">
|
||||||
<view class="containertopboxitemleft flex-colum"
|
<view class="containertopboxitemleft flex-colum"
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="btnBox" v-if="type == 'confirm_order_coupon' || type == 'confirm_order_product'">
|
<view class="btnBox" v-if="type == 'confirm_order_coupon' || type == 'confirm_order_product' || this.type == 'orderInfo_coupon' || this.type == 'orderInfo_product'">
|
||||||
<view class="btn" @click="cancelCoupon" >暂不使用券</view>
|
<view class="btn" @click="cancelCoupon" >暂不使用券</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -148,9 +148,9 @@
|
|||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
let list = [];
|
let list = [];
|
||||||
if ( this.type == 'confirm_order_coupon') {
|
if ( this.type == 'confirm_order_coupon' || this.type == 'orderInfo_coupon') {
|
||||||
list = res.data.filter(v => v.type == 1);
|
list = res.data.filter(v => v.type == 1);
|
||||||
}else if ( this.type == 'confirm_order_product') {
|
}else if ( this.type == 'confirm_order_product' || this.type == 'orderInfo_product') {
|
||||||
list = res.data.filter(v => v.type == 2);
|
list = res.data.filter(v => v.type == 2);
|
||||||
} else {
|
} else {
|
||||||
list = res.data;
|
list = res.data;
|
||||||
@@ -166,6 +166,7 @@
|
|||||||
* 去使用优惠券
|
* 去使用优惠券
|
||||||
*/
|
*/
|
||||||
navigatorGo ( item ) {
|
navigatorGo ( item ) {
|
||||||
|
|
||||||
uni.cache.set('shopId',item.shopId)
|
uni.cache.set('shopId',item.shopId)
|
||||||
if ( this.type == 'confirm_order_coupon' || this.type == 'confirm_order_product' || this.type == 'orderInfo_coupon' || this.type == 'orderInfo_product' ) {
|
if ( this.type == 'confirm_order_coupon' || this.type == 'confirm_order_product' || this.type == 'orderInfo_coupon' || this.type == 'orderInfo_product' ) {
|
||||||
if ( item.type == 1 ) {
|
if ( item.type == 1 ) {
|
||||||
@@ -176,6 +177,13 @@
|
|||||||
})
|
})
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if( this.payAmount < item.discountAmount) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "当前订单金额不足抵扣金额",
|
||||||
|
icon: "none",
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
uni.$emit('couponItem', JSON.stringify(item))
|
uni.$emit('couponItem', JSON.stringify(item))
|
||||||
let selectCouponData = uni.cache.get('selectCouponData') || [];
|
let selectCouponData = uni.cache.get('selectCouponData') || [];
|
||||||
let couponList = selectCouponData.filter(v => v.type == 1);
|
let couponList = selectCouponData.filter(v => v.type == 1);
|
||||||
@@ -330,6 +338,7 @@
|
|||||||
.towcontent {
|
.towcontent {
|
||||||
padding: 0 28rpx;
|
padding: 0 28rpx;
|
||||||
border-top: 16rpx solid #f7f7f7;
|
border-top: 16rpx solid #f7f7f7;
|
||||||
|
|
||||||
.towcontentlistxitem {
|
.towcontentlistxitem {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 32rpx;
|
margin-top: 32rpx;
|
||||||
@@ -385,6 +394,7 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
border-radius: 18rpx;
|
border-radius: 18rpx;
|
||||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
||||||
|
overflow: hidden;
|
||||||
.containertopboxitemleft {
|
.containertopboxitemleft {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 182rpx;
|
width: 182rpx;
|
||||||
@@ -449,7 +459,7 @@
|
|||||||
width: 40rpx;
|
width: 40rpx;
|
||||||
height: 40rpx;
|
height: 40rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
box-shadow: inset 0rpx -13rpx 7rpx -6rpx rgba(0, 0, 0, 0.1);
|
box-shadow: inset 0rpx 1rpx 9rpx 21rpx rgba(0, 0, 0, 0.04);
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
}
|
}
|
||||||
.containertopboxitemleft::before {
|
.containertopboxitemleft::before {
|
||||||
@@ -462,9 +472,8 @@
|
|||||||
width: 40rpx;
|
width: 40rpx;
|
||||||
height: 40rpx;
|
height: 40rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
box-shadow: inset 0rpx 25rpx 15rpx -4rpx rgba(0, 0, 0, 0.1);
|
box-shadow: inset 0rpx 0rpx 15rpx 1rpx rgba(0, 0, 0, 0.1);
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
|
|
||||||
}
|
}
|
||||||
.containertopboxitemleft_vip{
|
.containertopboxitemleft_vip{
|
||||||
background-color: #E1D4B2;
|
background-color: #E1D4B2;
|
||||||
@@ -543,11 +552,15 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.select{
|
||||||
|
padding-bottom: 180rpx;
|
||||||
|
}
|
||||||
.btnBox{
|
.btnBox{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: absolute;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
z-index: 999;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 30rpx 30rpx 50rpx 30rpx;
|
padding: 30rpx 30rpx 50rpx 30rpx;
|
||||||
.btn{
|
.btn{
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
<view class="tabContent">
|
<view class="tabContent">
|
||||||
<view class="tabContent_item" v-for="(item,index) in shareRecordData.list" :key="index">
|
<view class="tabContent_item" v-for="(item,index) in shareRecordData.list" :key="index">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<view class="name">{{item.invitedName||""}}</view>
|
<view class="name">{{item.invitedName||("用户"+item.id)}}</view>
|
||||||
<view class="status" :style="{color: item.success ? '#333' : '#FF534B'}">{{
|
<view class="status" :style="{color: item.success ? '#333' : '#FF534B'}">{{
|
||||||
item.success ? '邀请成功' : '未邀请成功'
|
item.success ? '邀请成功' : '未邀请成功'
|
||||||
}}</view>
|
}}</view>
|
||||||
|
|||||||
@@ -322,7 +322,7 @@
|
|||||||
|
|
||||||
minCouponList.map((v,indexs) => {
|
minCouponList.map((v,indexs) => {
|
||||||
for (let i = 0; i < v.num; i++){
|
for (let i = 0; i < v.num; i++){
|
||||||
if ( productAllNum < productDetailsNum && productNum < item.num && ((v.memberPrice > 0 ? v.memberPrice : v.price) < (this.listinfo.payAmount - productPayAmount) )) {
|
if ( productAllNum < productDetailsNum && productNum < item.num && ((v.memberPrice > 0 ? v.memberPrice : v.price) <= (this.listinfo.payAmount - productPayAmount) )) {
|
||||||
productNum++
|
productNum++
|
||||||
productAllNum++
|
productAllNum++
|
||||||
productPayAmount += v.memberPrice > 0 ? v.memberPrice : v.price
|
productPayAmount += v.memberPrice > 0 ? v.memberPrice : v.price
|
||||||
|
|||||||
@@ -101,7 +101,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<view class="cell-item column" v-if="listinfo.orderInfo.couponInfoList.productCoupon.length > 0">
|
<view class="cell-item column" v-if="listinfo.orderInfo&&listinfo.orderInfo.couponInfoList && listinfo.orderInfo.couponInfoList.productCoupon.length > 0">
|
||||||
<view class="label">商品券</view>
|
<view class="label">商品券</view>
|
||||||
<view class="val column">
|
<view class="val column">
|
||||||
<view class="productCoupon" v-for="(item,index) in listinfo.orderInfo.couponInfoList.productCoupon" :key="index">
|
<view class="productCoupon" v-for="(item,index) in listinfo.orderInfo.couponInfoList.productCoupon" :key="index">
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-radio activeColor="#E8AD7B" :disabled="freeCheck&&index==0" icon-size="36" size="36" :name="item.type">
|
<u-radio activeColor="#E8AD7B" :disabled="(freeCheck&&index==0) || (index!=0&&payAmount<=0) || (rechargeFreeChecked&&index==0)" icon-size="36" size="36" :name="item.type">
|
||||||
</u-radio>
|
</u-radio>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -55,6 +55,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
props:{
|
props:{
|
||||||
|
rechargeFreeChecked:{
|
||||||
|
type: Boolean
|
||||||
|
},
|
||||||
|
payAmount:{
|
||||||
|
type: Number
|
||||||
|
},
|
||||||
amountVIP:{
|
amountVIP:{
|
||||||
type: Object
|
type: Object
|
||||||
},
|
},
|
||||||
@@ -77,6 +83,31 @@
|
|||||||
// this.$emit("groupChange",{type:this.radiovalue ,name: name })
|
// this.$emit("groupChange",{type:this.radiovalue ,name: name })
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
payAmount:{
|
||||||
|
immediate: true,
|
||||||
|
handler (newVal) {
|
||||||
|
if ( newVal <= 0 ) {
|
||||||
|
this.radiovalue = 1
|
||||||
|
let name = this.paymentMethodName[this.radiovalue-1].name;
|
||||||
|
this.$emit("groupChange",{type:this.radiovalue ,name: name })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
rechargeFreeChecked:{
|
||||||
|
immediate: true,
|
||||||
|
handler (newVal) {
|
||||||
|
if ( newVal ) {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
this.radiovalue = 2
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
this.radiovalue = 3
|
||||||
|
// #endif
|
||||||
|
let name = this.paymentMethodName[this.radiovalue-1].name;
|
||||||
|
this.$emit("groupChange",{type:this.radiovalue ,name: name })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
freeCheck:{
|
freeCheck:{
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler (newVal) {
|
handler (newVal) {
|
||||||
@@ -88,14 +119,13 @@
|
|||||||
this.radiovalue = 3
|
this.radiovalue = 3
|
||||||
// #endif
|
// #endif
|
||||||
let name = this.paymentMethodName[this.radiovalue-1].name;
|
let name = this.paymentMethodName[this.radiovalue-1].name;
|
||||||
console.log({type:this.radiovalue ,name: name })
|
|
||||||
this.$emit("groupChange",{type:this.radiovalue ,name: name })
|
this.$emit("groupChange",{type:this.radiovalue ,name: name })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log(this.amountVIP)
|
// console.log(this.amountVIP)
|
||||||
// this.getAount();
|
// this.getAount();
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -105,10 +135,12 @@
|
|||||||
* @param {Object}
|
* @param {Object}
|
||||||
*/
|
*/
|
||||||
groupChange(type) {
|
groupChange(type) {
|
||||||
console.log(type)
|
|
||||||
if ( this.freeCheck && type == 1 ) {
|
if ( this.freeCheck && type == 1 ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ( this.payAmount<=0 && type != 1 ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.radiovalue = type;
|
this.radiovalue = type;
|
||||||
let name = this.paymentMethodName[type-1].name;
|
let name = this.paymentMethodName[type-1].name;
|
||||||
this.$emit("groupChange",{type:type ,name: name })
|
this.$emit("groupChange",{type:type ,name: name })
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<view class="rechargeFree_bg" @click="changeFree">
|
<view class="rechargeFree_bg" @click="changeFree">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="icon">优惠</view>
|
<view class="icon">优惠</view>
|
||||||
<view class="text">充值消费{{freeDingConfig.rechargeTimes}}倍(订单满¥{{freeDingConfig.rechargeThreshold}}远可用),本单立享免单!</view>
|
<view class="text">充值消费{{freeDingConfig.rechargeTimes}}倍(订单满¥{{freeDingConfig.rechargeThreshold}}元可用),本单立享免单!</view>
|
||||||
</view>
|
</view>
|
||||||
<u-checkbox-group iconPlacement="right" >
|
<u-checkbox-group iconPlacement="right" >
|
||||||
<u-checkbox :disabled="freeDisabled" v-model="rechargeFreeChecked" :checked="rechargeFreeChecked" @change="changeFree" activeColor="#E8AD7B" shape="circle" icon-size="36" size="36">
|
<u-checkbox :disabled="freeDisabled" v-model="rechargeFreeChecked" :checked="rechargeFreeChecked" @change="changeFree" activeColor="#E8AD7B" shape="circle" icon-size="36" size="36">
|
||||||
@@ -18,8 +18,7 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
rechargeFreeChecked: false,
|
freeDisabled: false,
|
||||||
disabled: false,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props:{
|
props:{
|
||||||
@@ -32,26 +31,22 @@
|
|||||||
payAmount: {
|
payAmount: {
|
||||||
type: Number
|
type: Number
|
||||||
},
|
},
|
||||||
freeDisabled: {
|
rechargeFreeChecked: {
|
||||||
type: Boolean
|
type: Boolean
|
||||||
}
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
freeDisabled (newVal) {
|
|
||||||
if ( this.payAmount < this.freeDingConfig.rechargeThreshold ) {
|
|
||||||
this.freeDisabled = true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
payAmount (newVal) {
|
payAmount (newVal) {
|
||||||
if ( this.payAmount < this.freeDingConfig.rechargeThreshold ) {
|
if ( this.payAmount < this.freeDingConfig.rechargeThreshold ) {
|
||||||
this.freeDisabled = true
|
this.freeDisabled = true
|
||||||
|
} else {
|
||||||
|
this.freeDisabled = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if ( this.payAmount < this.freeDingConfig.rechargeThreshold ) {
|
|
||||||
this.freeDisabled = true
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
@@ -62,9 +57,6 @@
|
|||||||
if ( this.freeDisabled ) {
|
if ( this.freeDisabled ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.rechargeFreeChecked = !this.rechargeFreeChecked;
|
|
||||||
|
|
||||||
this.$emit("changeFree",this.rechargeFreeChecked)
|
this.$emit("changeFree",this.rechargeFreeChecked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@
|
|||||||
<view>{{(shopTableInfo.seatNum*storeInfo.tableFee).toFixed(2)}}</view>
|
<view>{{(shopTableInfo.seatNum*storeInfo.tableFee).toFixed(2)}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-for="(item,index) in favorable" :key="index" v-if="storeInfo.registerType == 'munchies'">
|
<view v-for="(item,index) in favorable" :key="index" v-if="storeInfo.registerType == 'munchies'&&!rechargeFreeChecked">
|
||||||
<view class="favorable" :class="{column:item.value.length>0&&item.type=='product'}" @click="goUrl(item)">
|
<view class="favorable" :class="{column:item.value.length>0&&item.type=='product'}" @click="goUrl(item)">
|
||||||
<view class="favorable_left">
|
<view class="favorable_left">
|
||||||
<!-- <image class="icon" :src="item.url" mode="aspectFill"/> -->
|
<!-- <image class="icon" :src="item.url" mode="aspectFill"/> -->
|
||||||
@@ -140,13 +140,13 @@
|
|||||||
|
|
||||||
<!-- 充值免单 -->
|
<!-- 充值免单 -->
|
||||||
<view style="padding: 0 20rpx;">
|
<view style="padding: 0 20rpx;">
|
||||||
<rechargeFree v-if="freeDingConfig.enable == 1&&storeInfo.registerType == 'munchies'" ref="rechargeFree" :freeDisabled="freeDisabled" :payAmount="listinfo.payAmount" :freeDingConfig="freeDingConfig" :shopUserInfo="amountVIP" @changeFree="changeFree"></rechargeFree>
|
<rechargeFree v-if="freeDingConfig.enable == 1&&storeInfo.registerType == 'munchies'" ref="rechargeFree" :rechargeFreeChecked="rechargeFreeChecked" :freeDisabled="freeDisabled" :payAmount="listinfo.payAmount" :freeDingConfig="freeDingConfig" :shopUserInfo="amountVIP" @changeFree="changeFree"></rechargeFree>
|
||||||
</view>
|
</view>
|
||||||
<!-- 充值活动 -->
|
<!-- 充值活动 -->
|
||||||
<topUpActivity v-if="storeInfo.registerType == 'munchies'" ref="topUpActivity" :shopUserInfo="amountVIP" ></topUpActivity>
|
<topUpActivity v-if="storeInfo.registerType == 'munchies'" ref="topUpActivity" :shopUserInfo="amountVIP" ></topUpActivity>
|
||||||
<!-- 支付方式 -->
|
<!-- 支付方式 -->
|
||||||
<view style="padding: 0 20rpx;">
|
<view style="padding: 0 20rpx;">
|
||||||
<paymentMethod ref="paymentMethod" :freeCheck="freeCheck" :amountVIP="amountVIP" v-if="storeInfo.registerType == 'munchies'" @groupChange="groupChange"></paymentMethod>
|
<paymentMethod ref="paymentMethod" :freeCheck="freeCheck" :rechargeFreeChecked="rechargeFreeChecked" :payAmount="listinfo.payAmount" :amountVIP="amountVIP" v-if="storeInfo.registerType == 'munchies'" @groupChange="groupChange"></paymentMethod>
|
||||||
</view>
|
</view>
|
||||||
<view style="width: 100%;height: 200rpx;"> </view>
|
<view style="width: 100%;height: 200rpx;"> </view>
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
@@ -254,6 +254,7 @@
|
|||||||
tableCode: null,
|
tableCode: null,
|
||||||
packFee: null,
|
packFee: null,
|
||||||
isShow: false,
|
isShow: false,
|
||||||
|
rechargeFreeChecked: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -279,9 +280,10 @@
|
|||||||
this.storeInfo = JSON.parse(decodeURIComponent(options.storeInfo));
|
this.storeInfo = JSON.parse(decodeURIComponent(options.storeInfo));
|
||||||
}
|
}
|
||||||
this.shopId = this.storeInfo.id;
|
this.shopId = this.storeInfo.id;
|
||||||
|
this.cartLists = JSON.parse(options.cartLists);
|
||||||
this.listinfo.name = this.storeInfo.shopName;
|
this.listinfo.name = this.storeInfo.shopName;
|
||||||
this.listinfo.details = JSON.parse(options.cartLists).data;
|
this.listinfo.details = JSON.parse(options.cartLists).data;
|
||||||
this.cartLists = JSON.parse(options.cartLists);
|
this.listinfo.payAmount = this.cartLists.memberAmount && this.cartLists.memberAmount > 0 ? this.cartLists.memberAmount : this.cartLists.amount
|
||||||
if ( options.tableCode ) { this.tableCode = options.tableCode;}
|
if ( options.tableCode ) { this.tableCode = options.tableCode;}
|
||||||
if ( this.storeInfo.eatModel.indexOf("dine-in") != -1 ) {
|
if ( this.storeInfo.eatModel.indexOf("dine-in") != -1 ) {
|
||||||
this.eatModel = "dine-in";
|
this.eatModel = "dine-in";
|
||||||
@@ -307,20 +309,14 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
this.userCouponInfos = [];
|
this.getchoseEatModel('index',this.is_type)
|
||||||
this.favorable[0].value = ""
|
|
||||||
this.favorable[1].value = []
|
|
||||||
this.selectCouponData = uni.cache.get('selectCouponData') || []
|
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* 监听优惠券/商品券选择
|
* 监听优惠券/商品券选择
|
||||||
* @param {Object} data
|
* @param {Object} data
|
||||||
*/
|
*/
|
||||||
changeCoupon ( data ) {
|
changeCoupon ( cartLists ) {
|
||||||
|
|
||||||
|
|
||||||
// 优惠券数据
|
// 优惠券数据
|
||||||
let couponList = this.selectCouponData.filter(v => v.type == 1);
|
let couponList = this.selectCouponData.filter(v => v.type == 1);
|
||||||
// 商品券列表
|
// 商品券列表
|
||||||
@@ -331,14 +327,16 @@
|
|||||||
let couponData = couponList[0]
|
let couponData = couponList[0]
|
||||||
//不包含优惠券的金额
|
//不包含优惠券的金额
|
||||||
let currentPayAmount = (this.userCouponInfos.filter(v => v.type == 1).length > 0 ? Number(this.listinfo.payAmount) + couponData.discountAmount : this.listinfo.payAmount)
|
let currentPayAmount = (this.userCouponInfos.filter(v => v.type == 1).length > 0 ? Number(this.listinfo.payAmount) + couponData.discountAmount : this.listinfo.payAmount)
|
||||||
|
console.log(this.listinfo.payAmount)
|
||||||
// 判断优惠金额不能大于支付金额
|
// 判断优惠金额不能大于支付金额
|
||||||
if ( couponData.discountAmount < currentPayAmount) {
|
if ( couponData.discountAmount < currentPayAmount) {
|
||||||
|
console.log(this.calcUsablePointsData)
|
||||||
if ( this.isPointsChecked ) {
|
// if ( this.isPointsChecked && this.calcUsablePointsData) {
|
||||||
this.listinfo.payAmount = (this.listinfo.payAmount-(this.calcUsablePointsData.pointsNum/this.calcUsablePointsData.equivalentPoints)).toFixed(2);
|
// this.listinfo.payAmount = (Number(this.listinfo.payAmount)-(this.calcUsablePointsData.pointsNum/this.calcUsablePointsData.equivalentPoints)).toFixed(2);
|
||||||
} else {
|
// } else {
|
||||||
this.listinfo.payAmount = (Number(this.listinfo.payAmount)+(this.calcUsablePointsData.pointsNum/this.calcUsablePointsData.equivalentPoints)).toFixed(2);
|
// this.listinfo.payAmount = (Number(this.listinfo.payAmount)+(this.calcUsablePointsData.pointsNum/this.calcUsablePointsData.equivalentPoints)).toFixed(2);
|
||||||
}
|
// }
|
||||||
|
console.log(this.listinfo.payAmount)
|
||||||
this.listinfo.payAmount = ( currentPayAmount - couponData.discountAmount).toFixed(2)
|
this.listinfo.payAmount = ( currentPayAmount - couponData.discountAmount).toFixed(2)
|
||||||
this.favorable[0].value = ('-¥'+couponData.discountAmount)
|
this.favorable[0].value = ('-¥'+couponData.discountAmount)
|
||||||
|
|
||||||
@@ -349,7 +347,7 @@
|
|||||||
num: couponData.type == 1 ? 1 : couponData.num,
|
num: couponData.type == 1 ? 1 : couponData.num,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
console.log(this.listinfo.payAmount)
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "优惠券满减金额大于订单金额不可使用",
|
title: "优惠券满减金额大于订单金额不可使用",
|
||||||
@@ -358,6 +356,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
console.log(2)
|
||||||
|
console.log(this.listinfo.payAmount)
|
||||||
// 商品券处理
|
// 商品券处理
|
||||||
if ( productList.length > 0 ) {
|
if ( productList.length > 0 ) {
|
||||||
//商品券使用数量
|
//商品券使用数量
|
||||||
@@ -379,7 +379,10 @@
|
|||||||
|
|
||||||
minCouponList.map((v,indexs) => {
|
minCouponList.map((v,indexs) => {
|
||||||
for (let i = 0; i < v.number; i++){
|
for (let i = 0; i < v.number; i++){
|
||||||
if ( productAllNum < productDetailsNum && productNum < item.num && ((v.memberPrice > 0 ? v.memberPrice : v.salePrice) < (this.listinfo.payAmount - productPayAmount) )) {
|
if ( ((v.memberPrice > 0 ? v.memberPrice : v.salePrice) < (this.listinfo.payAmount - productPayAmount) ) ){
|
||||||
|
|
||||||
|
}
|
||||||
|
if ( productAllNum < productDetailsNum && productNum < item.num && ((v.memberPrice > 0 ? v.memberPrice : v.salePrice) <= (this.listinfo.payAmount - productPayAmount) )) {
|
||||||
productNum++
|
productNum++
|
||||||
productAllNum++
|
productAllNum++
|
||||||
productPayAmount += v.memberPrice > 0 ? v.memberPrice : v.salePrice
|
productPayAmount += v.memberPrice > 0 ? v.memberPrice : v.salePrice
|
||||||
@@ -410,22 +413,22 @@
|
|||||||
if ( this.userCouponInfos.length > 0 ) {
|
if ( this.userCouponInfos.length > 0 ) {
|
||||||
console.log(this.userCouponInfos)
|
console.log(this.userCouponInfos)
|
||||||
this.userCouponInfos.forEach(item => {
|
this.userCouponInfos.forEach(item => {
|
||||||
if ( item.type == 1 ) {
|
// if ( item.type == 1 ) {
|
||||||
if ( item.discountAmount && item.discountAmount > 0 ) {
|
// if ( item.discountAmount && item.discountAmount > 0 ) {
|
||||||
this.listinfo.payAmount = ( this.listinfo.payAmount - item.discountAmount).toFixed(2)
|
// this.listinfo.payAmount = ( this.listinfo.payAmount - item.discountAmount).toFixed(2)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if ( item.type == 2 ) {
|
if ( item.type == 2 ) {
|
||||||
if ( item.discountAmount && item.discountAmount > 0 ) {
|
if ( item.discountAmount && item.discountAmount > 0 ) {
|
||||||
// this.listinfo.payAmount = (this.listinfo.payAmount - item.discountAmount).toFixed(2)
|
this.listinfo.payAmount = (this.listinfo.payAmount - item.discountAmount).toFixed(2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
this.isPointsChecked = false;
|
||||||
|
this.getCalcUsablePoints()
|
||||||
},
|
},
|
||||||
setPayAmount ( cartLists ) {
|
setPayAmount ( cartLists ) {
|
||||||
let tableFee;
|
let tableFee;
|
||||||
@@ -440,39 +443,70 @@
|
|||||||
} else {
|
} else {
|
||||||
this.listinfo.payAmount = (Number(cartLists.amount)+tableFee).toFixed(2)
|
this.listinfo.payAmount = (Number(cartLists.amount)+tableFee).toFixed(2)
|
||||||
}
|
}
|
||||||
if ( this.userCouponInfos.length > 0 ) {
|
console.log(1)
|
||||||
console.log(this.userCouponInfos)
|
// if ( this.userCouponInfos.length > 0 ) {
|
||||||
this.userCouponInfos.forEach(item => {
|
// console.log(this.userCouponInfos)
|
||||||
if ( item.type == 1 ) {
|
// this.userCouponInfos.forEach(item => {
|
||||||
if ( item.discountAmount && item.discountAmount > 0 ) {
|
// if ( item.type == 1 ) {
|
||||||
this.listinfo.payAmount = ( this.listinfo.payAmount - item.discountAmount).toFixed(2)
|
// if ( item.discountAmount && item.discountAmount > 0 ) {
|
||||||
}
|
// this.listinfo.payAmount = ( this.listinfo.payAmount - item.discountAmount).toFixed(2)
|
||||||
}
|
// }
|
||||||
if ( item.type == 2 ) {
|
// }
|
||||||
if ( item.discountAmount && item.discountAmount > 0 ) {
|
// if ( item.type == 2 ) {
|
||||||
this.listinfo.payAmount = (this.listinfo.payAmount - item.discountAmount).toFixed(2)
|
// if ( item.discountAmount && item.discountAmount > 0 ) {
|
||||||
}
|
// this.listinfo.payAmount = (this.listinfo.payAmount - item.discountAmount).toFixed(2)
|
||||||
}
|
// }
|
||||||
})
|
// }
|
||||||
}
|
// })
|
||||||
if ( this.freeDingConfig && this.listinfo.payAmount < this.freeDingConfig.rechargeThreshold ) {
|
// }
|
||||||
this.freeDisabled = true
|
this.userCouponInfos = [];
|
||||||
}
|
this.favorable[0].value = ""
|
||||||
|
this.favorable[1].value = []
|
||||||
|
this.rechargeFreeChecked = false;
|
||||||
|
this.freeDisabled = false;
|
||||||
|
this.selectCouponData = uni.cache.get('selectCouponData') || []
|
||||||
this.changeCoupon()
|
this.changeCoupon()
|
||||||
this.isPointsChecked = false;
|
|
||||||
this.getCalcUsablePoints()
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 免单状态监听
|
* 免单状态监听
|
||||||
* @param {Object} val
|
* @param {Object} val
|
||||||
*/
|
*/
|
||||||
changeFree ( val ) {
|
changeFree ( val ) {
|
||||||
this.freeCheck = val;
|
// this.freeCheck = val;
|
||||||
if ( val ) {
|
this.rechargeFreeChecked = !val;
|
||||||
|
|
||||||
|
|
||||||
|
// let couponList = this.userCouponInfos.filter(v => v.type == 1);
|
||||||
|
let productList = this.userCouponInfos
|
||||||
|
if ( this.rechargeFreeChecked ) {
|
||||||
|
if ( this.isPointsChecked ) {
|
||||||
|
this.isPointsChecked = false;
|
||||||
|
this.listinfo.payAmount = (Number(this.listinfo.payAmount)+(this.calcUsablePointsData.pointsNum/this.calcUsablePointsData.equivalentPoints)).toFixed(2);
|
||||||
|
}
|
||||||
|
if ( productList .length > 0 ) {
|
||||||
|
productList.map(item=> {
|
||||||
|
console.log(Number(this.listinfo.payAmount))
|
||||||
|
console.log(item.discountAmount)
|
||||||
|
this.listinfo.payAmount = Number(this.listinfo.payAmount) + item.discountAmount
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// if ( couponList.length > 0) {
|
||||||
|
// this.listinfo.payAmount = Number(this.listinfo.payAmount) + couponList[0].discountAmount
|
||||||
|
// }
|
||||||
this.listinfo.payAmount = (this.listinfo.payAmount*this.freeDingConfig.rechargeTimes).toFixed(2)
|
this.listinfo.payAmount = (this.listinfo.payAmount*this.freeDingConfig.rechargeTimes).toFixed(2)
|
||||||
} else {
|
} else {
|
||||||
|
this.isPointsChecked = false;
|
||||||
this.listinfo.payAmount = (this.listinfo.payAmount/this.freeDingConfig.rechargeTimes).toFixed(2)
|
this.listinfo.payAmount = (this.listinfo.payAmount/this.freeDingConfig.rechargeTimes).toFixed(2)
|
||||||
|
// if ( couponList.length > 0) {
|
||||||
|
// this.listinfo.payAmount = (couponList.length > 0 ? Number(this.listinfo.payAmount) - couponList[0].discountAmount : this.listinfo.payAmount)
|
||||||
|
// }
|
||||||
|
if ( productList .length > 0 ) {
|
||||||
|
productList.map(item=> {
|
||||||
|
this.listinfo.payAmount = Number(this.listinfo.payAmount) - item.discountAmount
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -538,6 +572,10 @@
|
|||||||
if ( this.calcUsablePointsData && this.calcUsablePointsData.usable && this.listinfo.payAmount >= this.calcUsablePointsData.minPaymentAmount) {
|
if ( this.calcUsablePointsData && this.calcUsablePointsData.usable && this.listinfo.payAmount >= this.calcUsablePointsData.minPaymentAmount) {
|
||||||
this.calcUsablePointsData.pointsNum = this.calcUsablePointsData.accountPoints >= this.calcUsablePointsData.maxUsablePoints ? this.calcUsablePointsData.maxUsablePoints : this.calcUsablePointsData.accountPoints
|
this.calcUsablePointsData.pointsNum = this.calcUsablePointsData.accountPoints >= this.calcUsablePointsData.maxUsablePoints ? this.calcUsablePointsData.maxUsablePoints : this.calcUsablePointsData.accountPoints
|
||||||
}
|
}
|
||||||
|
if ( this.freeDingConfig && this.listinfo.payAmount < this.freeDingConfig.rechargeThreshold ) {
|
||||||
|
this.freeDisabled = true
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -681,7 +719,13 @@
|
|||||||
* @param {Object} val
|
* @param {Object} val
|
||||||
*/
|
*/
|
||||||
tabClick ( index, item ) {
|
tabClick ( index, item ) {
|
||||||
|
this.userCouponInfos = [];
|
||||||
|
this.favorable[0].value = ""
|
||||||
|
this.favorable[1].value = []
|
||||||
|
this.rechargeFreeChecked = false;
|
||||||
|
this.freeDisabled = false;
|
||||||
|
this.selectCouponData = [];
|
||||||
|
uni.cache.set('selectCouponData',[])
|
||||||
this.getchoseEatModel('tabClick', index, item);
|
this.getchoseEatModel('tabClick', index, item);
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -719,9 +763,13 @@
|
|||||||
this.eatModel.push(item.val);
|
this.eatModel.push(item.val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.listinfo = res.data;
|
||||||
this.listinfo.details = res.data.info;
|
this.listinfo.details = res.data.info;
|
||||||
|
this.listinfo.name = this.storeInfo.shopName;
|
||||||
|
this.listinfo.payAmount = res.data.memberAmount && res.data.memberAmount > 0 ? res.data.memberAmount : res.data.amount
|
||||||
this.packFee = res.data.packFee;
|
this.packFee = res.data.packFee;
|
||||||
this.setPayAmount(res.data)
|
this.setPayAmount(this.listinfo)
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -900,7 +948,7 @@
|
|||||||
*/
|
*/
|
||||||
async showpopupclickdds() {
|
async showpopupclickdds() {
|
||||||
let res;
|
let res;
|
||||||
if ( !this.freeCheck ) {
|
if ( !this.rechargeFreeChecked ) {
|
||||||
res = await this.api.orderPay({
|
res = await this.api.orderPay({
|
||||||
orderId: this.listinfoid,
|
orderId: this.listinfoid,
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
|
|||||||
@@ -31,9 +31,15 @@
|
|||||||
<!-- 先支付后下单 -->
|
<!-- 先支付后下单 -->
|
||||||
<orderInfoBefore ref="orderInfoBefore" :listinfo="listinfo" v-else></orderInfoBefore>
|
<orderInfoBefore ref="orderInfoBefore" :listinfo="listinfo" v-else></orderInfoBefore>
|
||||||
<!-- 充值免单 -->
|
<!-- 充值免单 -->
|
||||||
<rechargeFree v-if="listinfo.freeDingConfig.enable == 1&&(listinfo.status == 'unpaid' || listinfo.status == 'paying')" ref="rechargeFree" :freeDisabled="freeDisabled" :payAmount="listinfo.payAmount" :freeDingConfig="listinfo.freeDingConfig" :shopUserInfo="amountVIP" @changeFree="changeFree"></rechargeFree>
|
<rechargeFree
|
||||||
|
:rechargeFreeChecked="rechargeFreeChecked"
|
||||||
|
v-if="listinfo.freeDingConfig.enable == 1&&(!listinfo.orderInfo.couponInfoList&&listinfo.orderInfo.pointsDiscountAmount<=0)&&(listinfo.status == 'unpaid' || listinfo.status == 'paying')"
|
||||||
|
ref="rechargeFree"
|
||||||
|
:freeDisabled="freeDisabled"
|
||||||
|
:payAmount="listinfo.payAmount"
|
||||||
|
:freeDingConfig="listinfo.freeDingConfig" :shopUserInfo="amountVIP" @changeFree="changeFree"></rechargeFree>
|
||||||
|
|
||||||
<paymentMethod ref="paymentMethod" v-if="amountVIP&&listinfo.status == 'unpaid' || listinfo.status == 'paying'" :freeCheck="freeCheck" :amountVIP="amountVIP" @groupChange="groupChange"></paymentMethod>
|
<paymentMethod ref="paymentMethod" :rechargeFreeChecked="rechargeFreeChecked" v-if="amountVIP&&listinfo.status == 'unpaid' || listinfo.status == 'paying'" :freeCheck="freeCheck" :payAmount="listinfo.payAmount" :amountVIP="amountVIP" @groupChange="groupChange"></paymentMethod>
|
||||||
|
|
||||||
<view class="fixedview">
|
<view class="fixedview">
|
||||||
<view class="flex-between" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
<view class="flex-between" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
||||||
@@ -126,7 +132,6 @@
|
|||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
setPayAmount(data) {
|
setPayAmount(data) {
|
||||||
console.log(data)
|
|
||||||
// this.changeFree(this.freeDisabled)
|
// this.changeFree(this.freeDisabled)
|
||||||
this.listinfo.payAmount = data.payAmount
|
this.listinfo.payAmount = data.payAmount
|
||||||
this.couopnInfo = data;
|
this.couopnInfo = data;
|
||||||
@@ -143,9 +148,12 @@
|
|||||||
* @param {Object} val
|
* @param {Object} val
|
||||||
*/
|
*/
|
||||||
changeFree ( val ) {
|
changeFree ( val ) {
|
||||||
this.freeCheck = val;
|
// this.freeCheck = val;
|
||||||
this.rechargeFreeChecked = val
|
this.rechargeFreeChecked = !val
|
||||||
if ( this.couopnInfo && val) {
|
|
||||||
|
|
||||||
|
if ( this.rechargeFreeChecked ) {
|
||||||
|
if ( this.couopnInfo) {
|
||||||
if ( this.couopnInfo.isPointsChecked ) {
|
if ( this.couopnInfo.isPointsChecked ) {
|
||||||
this.listinfo.payAmount = (Number(this.listinfo.payAmount)+(this.couopnInfo.calcUsablePointsData.pointsNum/this.couopnInfo.calcUsablePointsData.equivalentPoints)).toFixed(2);
|
this.listinfo.payAmount = (Number(this.listinfo.payAmount)+(this.couopnInfo.calcUsablePointsData.pointsNum/this.couopnInfo.calcUsablePointsData.equivalentPoints)).toFixed(2);
|
||||||
}
|
}
|
||||||
@@ -162,14 +170,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( val ) {
|
|
||||||
this.listinfo.payAmount = (this.listinfo.payAmount*this.listinfo.freeDingConfig.rechargeTimes).toFixed(2)
|
this.listinfo.payAmount = (this.listinfo.payAmount*this.listinfo.freeDingConfig.rechargeTimes).toFixed(2)
|
||||||
} else {
|
} else {
|
||||||
|
this.couopnInfo.isPointsChecked = false;
|
||||||
this.listinfo.payAmount = (this.listinfo.payAmount/this.listinfo.freeDingConfig.rechargeTimes).toFixed(2)
|
this.listinfo.payAmount = (this.listinfo.payAmount/this.listinfo.freeDingConfig.rechargeTimes).toFixed(2)
|
||||||
}
|
if ( this.couopnInfo) {
|
||||||
|
|
||||||
if ( this.couopnInfo && !val) {
|
|
||||||
|
|
||||||
let couponList = this.couopnInfo.userCouponInfos.filter(v => v.type == 1);
|
let couponList = this.couopnInfo.userCouponInfos.filter(v => v.type == 1);
|
||||||
if ( couponList.length > 0) {
|
if ( couponList.length > 0) {
|
||||||
@@ -183,6 +188,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
console.log(this.freeCheck)
|
console.log(this.freeCheck)
|
||||||
},
|
},
|
||||||
saveImage (url) {
|
saveImage (url) {
|
||||||
@@ -359,8 +367,8 @@
|
|||||||
*/
|
*/
|
||||||
async wechatPay() {
|
async wechatPay() {
|
||||||
let res;
|
let res;
|
||||||
console.log(this.freeCheck)
|
console.log(this.rechargeFreeChecked)
|
||||||
if ( !this.freeCheck ) {
|
if ( !this.rechargeFreeChecked ) {
|
||||||
res = await this.api.orderPay({
|
res = await this.api.orderPay({
|
||||||
orderId: this.orderId,
|
orderId: this.orderId,
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<view class="listItem " v-for="(item,index) in list" :key="index">
|
<view class="listItem " v-for="(item,index) in list" :key="index">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<view class="title">{{item.content}}</view>
|
<view class="title">{{item.content}}</view>
|
||||||
<view class="num">{{item.floatType == 'add' ? '+' : ''}}{{item.floatPoints}}</view>
|
<view class="num" :class="{colorStyle: item.floatType=='add'}">{{item.floatType == 'add' ? '+' : ''}}{{item.floatPoints}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="time">{{item.createTime}}</view>
|
<view class="time">{{item.createTime}}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -112,6 +112,9 @@
|
|||||||
.num{
|
.num{
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
}
|
}
|
||||||
|
.colorStyle {
|
||||||
|
color: #FF7127;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.time{
|
.time{
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
|||||||
Reference in New Issue
Block a user