下单逻辑修改

This commit is contained in:
GaoHao
2024-09-27 11:43:10 +08:00
parent a77a7ab716
commit a821223a3b
11 changed files with 49 additions and 18 deletions

View File

@@ -73,15 +73,18 @@
</view>
<view class="row">
<text class="t">订单类型</text>
<text class="info">{{$u.timeFormat(listinfo.time, 'yyyy-mm-dd hh:MM:ss')}}</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"></text>
<text class="info">{{ listinfo.orderInfo.remark}}</text>
</view>
<view class="row">
<text class="t">就餐人数</text>
<text class="info">{{$u.timeFormat(listinfo.time, 'yyyy-mm-dd hh:MM:ss')}}</text>
<text class="info">{{ listinfo.orderInfo.seatCount}}</text>
</view>
</view>
</viwe>

View File

@@ -16,7 +16,7 @@
<view class="tabBox" v-if="storeInfo.registerType == 'munchies'">
<view class="tab">
<view :class="is_type==(index+1)?'tab_item'+is_type+' tab_item active ':'tab_item'" v-for="(item,index) in is_typeList" :key="index" @click="tabClick(index+1,item.val)">
<view :class="is_type==(index+1)?'tab_item'+is_type+' tab_item active ':'tab_item'" v-for="(item,index) in is_typeList" :key="index" @click="tabClick(index+1,item)">
<view></view>
<image class="icon" :src="is_type==(index+1)?item.url_active:item.url" mode="aspectFill"/>
<text class="title" :class="{active:is_type==(index+1)}">{{item.title}}</text>
@@ -76,7 +76,7 @@
</view>
<view class="cell_item" v-if="dinersNum">
<view class="label">餐位费</view>
<view class="value"><view>X{{dinersNum}}</view><view>X{{dinersNum*storeInfo.tableFee}}</view></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">
@@ -189,9 +189,10 @@
},
is_type: 1,
is_typeList: [
{ title: "送餐到桌", val: "dine-in", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab1.png" , url_active: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab1_active.png"},
{ title: "打包外带", val: "take-out", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab2.png" , url_active: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab2_active.png"},
{ title: "送餐到桌", type: "table", val: "dine-in", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab1.png" , url_active: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab1_active.png"},
{ title: "打包外带", type: "takeself", val: "take-out", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab2.png" , url_active: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab2_active.png"},
],
sendType: "table",
eatModel: [],
favorable: [
{ name: "优惠券", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/coupon.png"},
@@ -412,10 +413,11 @@
* 监听送餐/打包切换
* @param {Object} val
*/
tabClick ( index,val ) {
tabClick ( index, item ) {
this.is_type = index;
this.sendType = item.type
this.eatModel = [];
this.eatModel.push(val);
this.eatModel.push(item.val);
},
/**
@@ -528,6 +530,7 @@
"isYhq": 0, // 是否使用优惠券( 1 使用, 0 不使用),
"isBuyYhq": 0, // 是否购买优惠券( 1 购买, 0 不够买)
"productId": '', //商品id
"sendType": this.sendType,
"tableId": this.tableCode , //商品id
"dinersNum": this.dinersNum, //就餐人数
"eatModel": this.eatModel, //就餐模式

View File

@@ -42,7 +42,9 @@
};
},
onLoad(options) {
this.tableCode = uni.cache.get('tableCode');
console.log(options)
this.tableCode = options.tableCode;
this.shopId = options.shopId;
},
onShow() {
},
@@ -69,7 +71,7 @@
/**
* 开始点餐
*/
start () {
async start () {
if ( this.numIndex == -1 && (this.otherNum == "其他"||this.otherNum <= 0)) {
uni.showToast({
title: '请选择就餐人数',
@@ -80,6 +82,12 @@
if ( this.numIndex == -1 && this.otherNum != "其他") {
this.dinersNum = this.otherNum
}
let res = await this.api.productChoseCount({
orderId: this.orderId,
dinersNum: this.dinersNum,
shopId: this.shopId,
}) //判断是否支付成功
uni.pro.navigateTo('order_food/order_food', {
tableCode: this.tableCode,
dinersNum: this.dinersNum,

View File

@@ -225,6 +225,12 @@
async wechatPay() {
let res = await this.api.payorderPay({
orderId: this.orderId,
// #ifdef MP-WEIXIN
payType: 'wechatPay',
// #endif
// #ifdef MP-ALIPAY
payType: 'aliPay',
// #endif
}) //判断是否支付成功
if (res.code == 0) {
uni.showLoading({