会员价,优惠券,打包费相关更新
This commit is contained in:
@@ -43,9 +43,9 @@
|
||||
<view class="panelfiveitemone">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
<view class="panelfiveitemtow">
|
||||
<!-- <view class="panelfiveitemtow">
|
||||
本店回头客第{{index+1}}名
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="panelfiveitemthere flex-start">
|
||||
<text>招牌</text>
|
||||
</view>
|
||||
@@ -1547,7 +1547,7 @@
|
||||
padding: 12rpx 28rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 24upx;
|
||||
margin-left: 56rpx;
|
||||
margin-right: 56rpx;
|
||||
background: #EFEFEF;
|
||||
border: 2rpx solid #EFEFEF;
|
||||
position: relative;
|
||||
|
||||
@@ -1069,7 +1069,7 @@
|
||||
padding: 12rpx 28rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 24upx;
|
||||
margin-left: 56rpx;
|
||||
margin-right: 56rpx;
|
||||
background: #EFEFEF;
|
||||
border: 2rpx solid #EFEFEF;
|
||||
position: relative;
|
||||
|
||||
@@ -135,9 +135,15 @@
|
||||
*/
|
||||
navigatorGo ( item ) {
|
||||
uni.cache.set('shopId',item.shopId)
|
||||
uni.pro.navigateTo('/pages/order_food/order_food', {
|
||||
shopId: item.shopId
|
||||
})
|
||||
if ( this.type == 'confirm_order') {
|
||||
uni.$emit('couponItem', JSON.stringify(item))
|
||||
uni.navigateBack();
|
||||
} else {
|
||||
uni.pro.navigateTo('/pages/order_food/order_food', {
|
||||
shopId: item.shopId
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
@@ -110,12 +110,11 @@
|
||||
console.log(options)
|
||||
if ( options.shopId ) { this.shopId = options.shopId; }
|
||||
if ( options.is_type ) { this.is_type = options.is_type; }
|
||||
if ( options.shareId ) { this.shareId = options.shareId; }
|
||||
if ( options.invitedId ) { this.invitedId = options.invitedId; }
|
||||
this.is_type = 'he'
|
||||
this.invitedId = "113"
|
||||
this.shareId = "1"
|
||||
this.shopId = "11"
|
||||
if ( options.shareId && options.invitedId != uni.cache.get('userInfo').id ) { this.shareId = options.shareId; }
|
||||
if ( options.invitedId && options.invitedId != uni.cache.get('userInfo').id ) { this.invitedId = options.invitedId; }
|
||||
if ( options.invitedId == uni.cache.get('userInfo').id ) {
|
||||
this.is_type == 'me'
|
||||
}
|
||||
if ( this.is_type == 'he') {
|
||||
this.shareHeOpen()
|
||||
}
|
||||
@@ -171,8 +170,7 @@
|
||||
let params = {
|
||||
shareId : this.shareId,
|
||||
invitedId : this.invitedId,
|
||||
// beInvitedId : uni.cache.get('userInfo').id,
|
||||
beInvitedId : 119,
|
||||
beInvitedId : uni.cache.get('userInfo').id,
|
||||
shopId : this.shopId,
|
||||
}
|
||||
let res = await this.api.shareHeOpen(params)
|
||||
|
||||
@@ -91,6 +91,14 @@
|
||||
<view>{{listinfo.orderInfo.seatAmount}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cell-item" v-if="listinfo.orderInfo.pointsDiscountAmount && listinfo.orderInfo.pointsDiscountAmount > 0">
|
||||
<view class="label">积分抵扣</view>
|
||||
<view class="val">
|
||||
<view></view>
|
||||
<view style="font-size: 28rpx;">¥</view>
|
||||
<view>{{listinfo.orderInfo.pointsDiscountAmount.toFixed(2)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="total-wrap">
|
||||
<view>合计:</view>
|
||||
<view class="price"> ¥{{listinfo.payAmount}} </view>
|
||||
@@ -112,7 +120,25 @@
|
||||
<text class="t">下单时间:</text>
|
||||
<text class="info">{{$u.timeFormat(listinfo.time, 'yyyy-mm-dd hh:MM:ss')}}</text>
|
||||
</view>
|
||||
|
||||
<view class="row">
|
||||
<text class="t">下单门店:</text>
|
||||
<text class="info">{{listinfo.name}}</text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<text class="t">订单类型:</text>
|
||||
<text class="info" v-if="listinfo.sendType == 'post'">快递</text>
|
||||
<text class="info" v-if="listinfo.sendType == 'takeaway'">外卖</text>
|
||||
<text class="info" v-if="listinfo.sendType == 'takeself'">自提</text>
|
||||
<text class="info" v-if="listinfo.sendType == 'table'">堂食</text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<text class="t">备注:</text>
|
||||
<text class="info">{{ listinfo.orderInfo.remark||""}}</text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<text class="t">就餐人数:</text>
|
||||
<text class="info">{{ listinfo.orderInfo.seatCount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@@ -281,6 +307,7 @@
|
||||
}
|
||||
.shop-info {
|
||||
margin-top: 32rpx;
|
||||
margin-bottom: 32rpx;
|
||||
.item:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
@@ -341,7 +368,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 32rpx 0;
|
||||
padding: 0 0 32rpx 0;
|
||||
.label{
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
|
||||
@@ -46,10 +46,13 @@
|
||||
|
||||
<view class="tabBox_t " v-if="storeInfo.registerType == 'restaurant'">
|
||||
<view class="shopName">{{ listinfo.name }}</view>
|
||||
<view class="tableName">
|
||||
<view>桌号:</view>
|
||||
<view class="name">{{ shopTableInfo.name }} </view>
|
||||
<view class="num" v-if="shopTableInfo&&shopTableInfo.seatNum">{{ shopTableInfo.seatNum }}人</view>
|
||||
<view class="tableName" style="display: flex;align-items: center;justify-content: space-between;">
|
||||
<view style="display: flex;">
|
||||
<view>桌号:</view>
|
||||
<view class="name" v-if="shopTableInfo.name">{{ shopTableInfo.name || '' }} </view>
|
||||
<view class="num" v-if="shopTableInfo&&shopTableInfo.seatNum">{{ shopTableInfo.seatNum }}人</view>
|
||||
</view>
|
||||
<u-icon v-if="!shopTableInfo.name" @click="scan" name="scan" size="60"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -64,10 +67,18 @@
|
||||
<view class="center" >
|
||||
<text class="center_title"> {{item.name || item.productName || "" }} </text>
|
||||
<text class="type"> {{ item.skuName || item.productSkuName || ""}} </text>
|
||||
<text class="num" > X{{ item.totalNumber || item.num}} </text>
|
||||
<text class="num" > X{{ item.totalNumber || ""}} </text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="price"> ¥{{ item.totalAmount || item.priceAmount || 0}} </view>
|
||||
<view class="price"> ¥{{ item.memberPrice*item.totalNumber || item.salePrice*item.totalNumber || 0}} </view>
|
||||
</view>
|
||||
<view class="cell-item" v-if="packFee && packFee > 0">
|
||||
<view class="label">打包费</view>
|
||||
<view class="val">
|
||||
<view></view>
|
||||
<view style="font-size: 28rpx;">¥</view>
|
||||
<view>{{packFee.toFixed(2)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cell-item" v-if="shopTableInfo&&shopTableInfo.seatNum&&sendType=='table'">
|
||||
<view class="label">餐位费</view>
|
||||
@@ -83,7 +94,7 @@
|
||||
<image class="icon" :src="item.url" mode="aspectFill"/>
|
||||
<text class="name"> {{ item.name }} </text>
|
||||
</view>
|
||||
<view class="favorable_right" ><text class="favorable_right_text"></text> <u-icon name="arrow-right" color="#575B66" size="28"></u-icon></view>
|
||||
<view class="favorable_right" ><text class="favorable_right_text">{{item.value}}</text> <u-icon name="arrow-right" color="#575B66" size="28"></u-icon></view>
|
||||
</view>
|
||||
<view class="favorable" v-else-if="item.type=='points'&&calcUsablePointsData.usable">
|
||||
<view class="favorable_left">
|
||||
@@ -122,9 +133,9 @@
|
||||
</view>
|
||||
|
||||
<!-- 充值免单 -->
|
||||
<rechargeFree v-if="freeDingConfig.enable == 1" 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" :freeDisabled="freeDisabled" :payAmount="listinfo.payAmount" :freeDingConfig="freeDingConfig" :shopUserInfo="amountVIP" @changeFree="changeFree"></rechargeFree>
|
||||
<!-- 充值活动 -->
|
||||
<topUpActivity ref="topUpActivity" :shopUserInfo="amountVIP" ></topUpActivity>
|
||||
<topUpActivity v-if="storeInfo.registerType == 'munchies'" ref="topUpActivity" :shopUserInfo="amountVIP" ></topUpActivity>
|
||||
<!-- 支付方式 -->
|
||||
<view style="padding: 0 20rpx;">
|
||||
<paymentMethod ref="paymentMethod" :freeCheck="freeCheck" :amountVIP="amountVIP" v-if="storeInfo.registerType == 'munchies'" @groupChange="groupChange"></paymentMethod>
|
||||
@@ -195,9 +206,9 @@
|
||||
sendType: "table",
|
||||
eatModel: [],
|
||||
favorable: [
|
||||
{ name: "优惠券", type: "coupon", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/coupon.png"},
|
||||
// { name: "团购优惠", type: "group", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/groupOffer.png"},
|
||||
{ name: "积分抵扣", type: "points", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/points.png" }
|
||||
{ name: "优惠券", type: "coupon",value: "", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/coupon.png"},
|
||||
// { name: "团购优惠", type: "group",value: "", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/groupOffer.png"},
|
||||
{ name: "积分抵扣", type: "points",value: "", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/points.png" }
|
||||
],
|
||||
isPointsChecked: false,
|
||||
rechargeFreeChecked: false,
|
||||
@@ -205,6 +216,7 @@
|
||||
order: {
|
||||
phone: "",
|
||||
},
|
||||
userCouponInfos: null,
|
||||
shopTableInfo: null,
|
||||
freeDingConfig: null,
|
||||
cartLists: [],
|
||||
@@ -226,10 +238,11 @@
|
||||
paymentBtnText: "余额支付",
|
||||
isSocket: false,
|
||||
socketTicket: null,
|
||||
|
||||
orderAMeal: true,
|
||||
shopId: null,
|
||||
storeInfo: {},
|
||||
tableCode: null,
|
||||
packFee: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -270,6 +283,7 @@
|
||||
this.getchoseEatModel();
|
||||
},
|
||||
onShow() {
|
||||
let _this = this;
|
||||
if (this.listinfoid) {
|
||||
uni.$on('message', this.getMessage)
|
||||
this.orderorderInfo()
|
||||
@@ -277,11 +291,32 @@
|
||||
this.handlemessage()
|
||||
}
|
||||
this.is_typeList.map((item)=>{
|
||||
console.log(this.storeInfo.eatModel.indexOf(item.val))
|
||||
if ( this.storeInfo.eatModel.indexOf(item.val) != -1) {
|
||||
item.show = true;
|
||||
}
|
||||
})
|
||||
uni.$on('couponItem',function(data){
|
||||
let couponData = JSON.parse(data)
|
||||
console.log('监听到事件来自返回的参数:' , couponData);
|
||||
_this.userCouponInfos = {
|
||||
userCouponId: couponData.id,
|
||||
discountAmount: couponData.discountAmount,
|
||||
num: 1,
|
||||
}
|
||||
console.log('监听到事件来自返回的参数:' , _this.favorable);
|
||||
if ( couponData.discountAmount < _this.listinfo.payAmount) {
|
||||
_this.listinfo.payAmount = _this.listinfo.payAmount - _this.userCouponInfos.discountAmount
|
||||
_this.favorable[0].value = ('-¥'+couponData.discountAmount)
|
||||
if ( _this.isPointsChecked) {
|
||||
_this.pointsChange()
|
||||
_this.getCalcUsablePoints()
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
// TODO 下面执行刷新的方法
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
setPayAmount ( cartLists ) {
|
||||
@@ -291,6 +326,8 @@
|
||||
} else {
|
||||
this.listinfo.payAmount = (cartLists.amount+(this.shopTableInfo?(this.shopTableInfo.seatNum*this.storeInfo.tableFee):0)).toFixed(2)
|
||||
}
|
||||
this.isPointsChecked = false;
|
||||
this.getCalcUsablePoints()
|
||||
},
|
||||
/**
|
||||
* 免单状态监听
|
||||
@@ -387,14 +424,13 @@
|
||||
uni.pro.navigateTo('/pagesOrder/orderAMeal/index', {
|
||||
tableCode: this.tableCode,
|
||||
shopId: res.data.storeInfo.id,
|
||||
type: 'confirm'
|
||||
})
|
||||
return;
|
||||
}
|
||||
this.freeDingConfig = res.data.freeDingConfig;
|
||||
this.shopTableInfo = res.data.shopTableInfo;
|
||||
this.storeInfo = res.data.storeInfo;
|
||||
this.setPayAmount(this.cartLists)
|
||||
this.getCalcUsablePoints()
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -446,26 +482,22 @@
|
||||
return;
|
||||
}
|
||||
this.isSocket = true;
|
||||
this.isPointsChecked = false;
|
||||
this.listinfoid = msg.data.id
|
||||
this.listinfo.details = msg.data.detailList;
|
||||
this.setPayAmount(msg.data)
|
||||
uni.$off('getMessage')
|
||||
this.orderorderInfo(1)
|
||||
this.getCalcUsablePoints()
|
||||
}
|
||||
break;
|
||||
case 'addCart':
|
||||
this.isSocket = true;
|
||||
if ( this.eatModel == "dine-in" && this.tableCode ) {
|
||||
this.isPointsChecked = false;
|
||||
if (this.listinfoid) {
|
||||
this.orderorderInfo()
|
||||
} else {
|
||||
this.listinfo.details = msg.data;
|
||||
this.setPayAmount(msg)
|
||||
}
|
||||
this.getCalcUsablePoints()
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -478,14 +510,12 @@
|
||||
}, 1000)
|
||||
break;
|
||||
case 'addcart':
|
||||
this.isPointsChecked = false;
|
||||
if (this.listinfoid) {
|
||||
this.orderorderInfo()
|
||||
} else {
|
||||
this.listinfo.details = msg.data;
|
||||
this.setPayAmount(msg)
|
||||
}
|
||||
this.getCalcUsablePoints()
|
||||
this.isSocket = true;
|
||||
break;
|
||||
}
|
||||
@@ -504,6 +534,7 @@
|
||||
this.eatModel = [];
|
||||
this.eatModel.push(item.val);
|
||||
this.getchoseEatModel();
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -518,6 +549,7 @@
|
||||
if ( this.shopTableInfo && this.shopTableInfo.seatNum ) { params.num = this.shopTableInfo.seatNum; }
|
||||
let res = await this.api.choseEatModel(params)
|
||||
this.listinfo.details = res.data.info;
|
||||
this.packFee = res.data.packFee;
|
||||
this.setPayAmount(res.data)
|
||||
},
|
||||
|
||||
@@ -634,6 +666,9 @@
|
||||
}
|
||||
if ( this.isPointsChecked && this.calcUsablePointsData.pointsNum && this.calcUsablePointsData.pointsNum > 0) {
|
||||
params.pointsNum = this.calcUsablePointsData.pointsNum;
|
||||
}
|
||||
if ( this.userCouponInfos ) {
|
||||
params.userCouponInfos = this.userCouponInfos
|
||||
}
|
||||
let res = await this.api.creatOrder(params)
|
||||
console.log(res)
|
||||
|
||||
@@ -36,11 +36,13 @@
|
||||
numIndex: 0,
|
||||
otherNum: '其他',
|
||||
dinersNum: 1,
|
||||
type: ""
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.tableCode = options.tableCode;
|
||||
this.shopId = options.shopId;
|
||||
if ( options.type ) { this.type = options.type}
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
@@ -90,10 +92,15 @@
|
||||
shopId: this.shopId,
|
||||
}) //判断是否支付成功
|
||||
if ( res.code == 0) {
|
||||
uni.pro.redirectTo('order_food/order_food', {
|
||||
// uni.pro.navigateTo('order_food/order_food', {
|
||||
tableCode: this.tableCode,
|
||||
})
|
||||
if( this.type == 'confirm') {
|
||||
uni.pro,navigateBack()
|
||||
} else {
|
||||
uni.pro.redirectTo('order_food/order_food', {
|
||||
// uni.pro.navigateTo('order_food/order_food', {
|
||||
tableCode: this.tableCode,
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user