下单逻辑修改提测
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<viwe>
|
||||
<view>
|
||||
<view class="card_box">
|
||||
<view class="card_head_box">
|
||||
<view class="card_head_item" v-for="(item,index) in 8" :key="index"></view>
|
||||
@@ -19,7 +19,8 @@
|
||||
<view class="shop-info">
|
||||
<view class="item" v-for="(items,indexs) in item.info" :key="indexs">
|
||||
<view class="cover">
|
||||
<u-image width="152" height="152" radius="16" :src='items.productImg'></u-image>
|
||||
<u-image width="152" height="152" radius="16" :src='item.productImg' v-if="item.productId!=-999"></u-image>
|
||||
<u-image width="152" height="152" radius="16" :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png'" mode="heightFix" v-else></u-image>
|
||||
</view>
|
||||
<view class="info">
|
||||
<text class="productName">{{items.productName}}</text>
|
||||
@@ -87,7 +88,7 @@
|
||||
<text class="info">{{ listinfo.orderInfo.seatCount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</viwe>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
@@ -69,7 +69,8 @@
|
||||
<view class="shop-info">
|
||||
<view class="item" v-for="(item,index) in listinfo.details" :key="index">
|
||||
<view class="cover">
|
||||
<u-image width="152" height="152" radius="16" :src='item.productImg'></u-image>
|
||||
<u-image width="152" height="152" radius="16" :src='item.productImg' v-if="item.productId!=-999"></u-image>
|
||||
<u-image width="152" height="152" radius="16" :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png'" mode="heightFix" v-else></u-image>
|
||||
</view>
|
||||
<view class="info">
|
||||
<text class="productName">{{item.productName}}</text>
|
||||
|
||||
@@ -64,20 +64,18 @@
|
||||
<view class="content">
|
||||
<view class="title"> {{ listinfo.name }} </view>
|
||||
<view class="list_item" v-for="(item,index) in listinfo.details" :key="item.id">
|
||||
<view class="left">
|
||||
<image class="img" :src="item.coverImg || item.productImg || ''" mode="aspectFill"/>
|
||||
<view class="center">
|
||||
<view class="left" >
|
||||
<image class="img" v-if="item.productId!=-999" :src="item.coverImg || item.productImg || ''" mode="aspectFill"/>
|
||||
<image class="img" v-else :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png'" mode="heightFix"/>
|
||||
<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 || item.num}} </text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="price"> ¥{{ item.totalAmount || item.priceAmount || 0}} </view>
|
||||
</view>
|
||||
<view class="cell_item" v-if="dinersNum">
|
||||
<view class="label">餐位费</view>
|
||||
<view class="value"><view>X{{dinersNum}}</view><view>¥{{dinersNum*storeInfo.tableFee}}</view></view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="favorable" v-for="(item,index) in favorable" :key="index">
|
||||
<view class="favorable_left">
|
||||
<image class="icon" :src="item.url" mode="aspectFill"/>
|
||||
@@ -254,7 +252,6 @@
|
||||
if ( e.tableCode ) { this.tableCode = e.tableCode; }
|
||||
if ( e.dinersNum ) {
|
||||
this.dinersNum = e.dinersNum;
|
||||
this.listinfo.payAmount = (this.listinfo.payAmount + this.dinersNum * this.storeInfo.tableFee).toFixed(2);
|
||||
}
|
||||
|
||||
if ( this.storeInfo.eatModel.indexOf("dine-in") != -1 ) {
|
||||
@@ -362,9 +359,7 @@
|
||||
this.listinfoid = msg.data.id
|
||||
this.listinfo.details = msg.data.detailList;
|
||||
this.listinfo.payAmount = msg.data.amount;
|
||||
if ( this.dinersNum ) {
|
||||
this.listinfo.payAmount = (this.listinfo.payAmount + this.dinersNum * this.storeInfo.tableFee).toFixed(2);
|
||||
}
|
||||
|
||||
uni.$off('getMessage')
|
||||
this.orderorderInfo(1)
|
||||
break;
|
||||
@@ -375,9 +370,6 @@
|
||||
} else {
|
||||
this.listinfo.details = msg.data;
|
||||
this.listinfo.payAmount = msg.amount;
|
||||
if ( this.dinersNum ) {
|
||||
this.listinfo.payAmount = (this.listinfo.payAmount + this.dinersNum * this.storeInfo.tableFee).toFixed(2);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'order':
|
||||
@@ -394,9 +386,6 @@
|
||||
} else {
|
||||
this.listinfo.details = msg.data;
|
||||
this.listinfo.payAmount = msg.amount;
|
||||
if ( this.dinersNum ) {
|
||||
this.listinfo.payAmount = (this.listinfo.payAmount + this.dinersNum * this.storeInfo.tableFee).toFixed(2);
|
||||
}
|
||||
}
|
||||
this.isSocket = true;
|
||||
break;
|
||||
@@ -626,22 +615,21 @@
|
||||
uni.requestPayment({
|
||||
provider: 'alipay', //支付类型-固定值
|
||||
orderInfo: res.data.tradeNo, // 微信支付商户号
|
||||
|
||||
success: (res) => {
|
||||
let _this = this
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
|
||||
complete() {
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
})
|
||||
// uni.cache.set('shopUser', '') //删除shopUser
|
||||
_this.paymodfiyOrderInfo()
|
||||
uni.redirectTo({
|
||||
url: '/pagesOrder/order_detail/index?orderId=' + _this.listinfoid
|
||||
});
|
||||
},
|
||||
})
|
||||
// uni.requestSubscribeMessage({
|
||||
// tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
|
||||
// complete() {
|
||||
// uni.showToast({
|
||||
// title: "支付成功"
|
||||
// })
|
||||
// // uni.cache.set('shopUser', '') //删除shopUser
|
||||
// },
|
||||
// })
|
||||
_this.paymodfiyOrderInfo()
|
||||
uni.redirectTo({
|
||||
url: '/pagesOrder/order_detail/index?orderId=' + _this.listinfoid
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading()
|
||||
@@ -1005,12 +993,14 @@
|
||||
}
|
||||
.list_item{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 32rpx;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
.left{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
.img{
|
||||
width: 142rpx;
|
||||
height: 142rpx;
|
||||
@@ -1022,6 +1012,7 @@
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
.center_title{
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
@@ -1037,6 +1028,10 @@
|
||||
|
||||
}
|
||||
}
|
||||
.num{
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
.price{
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<view class="num_item" :class="{'active':numIndex==index }">{{index+1}}</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<u--input custom-class="num_item" v-model="otherNum" :class="{'active':numIndex==-1 }" @focus="tabCut(-1)" @blur="blur()" border="none" type="number" maxlength="3"></u--input>
|
||||
<u--input class="num_item" v-model="otherNum" :class="{'active':numIndex==-1 }" @input="isOtherNum" @focus="tabCut(-1)" @blur="blur()" border="none" type="nubmer" maxlength="3"></u--input>
|
||||
</view>
|
||||
<!-- <view class="num_item" v-else :class="{'active':numIndex==-1 }">其</view> -->
|
||||
</view>
|
||||
@@ -22,9 +22,6 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -49,7 +46,13 @@
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
|
||||
|
||||
isOtherNum (e) {
|
||||
this.$nextTick(() => {
|
||||
this.otherNum = this.otherNum.replace(/\D/g, '')
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 切换桌型
|
||||
*/
|
||||
|
||||
@@ -283,23 +283,24 @@
|
||||
// #ifdef MP-ALIPAY
|
||||
uni.requestPayment({
|
||||
provider: 'alipay', //支付类型-固定值
|
||||
orderInfo: res.data.appId, // 微信支付商户号
|
||||
orderInfo: res.data.tradeNo, // 微信支付商户号
|
||||
|
||||
success: (res) => {
|
||||
let _this = this
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
|
||||
complete() {
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
})
|
||||
// uni.cache.set('shopUser', '') //删除shopUser
|
||||
_this.paymodfiyOrderInfo()
|
||||
uni.redirectTo({
|
||||
url: '/pagesOrder/order_detail/index?orderId=' + _this.listinfoid
|
||||
});
|
||||
},
|
||||
})
|
||||
// uni.requestSubscribeMessage({
|
||||
// tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
|
||||
// complete() {
|
||||
// uni.showToast({
|
||||
// title: "支付成功"
|
||||
// })
|
||||
// // uni.cache.set('shopUser', '') //删除shopUser
|
||||
|
||||
// },
|
||||
// })
|
||||
_this.paymodfiyOrderInfo()
|
||||
uni.redirectTo({
|
||||
url: '/pagesOrder/order_detail/index?orderId=' + _this.listinfoid
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading()
|
||||
|
||||
Reference in New Issue
Block a user