This commit is contained in:
parent
192a365e06
commit
26d97d8461
@ -182,9 +182,9 @@
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "order/pay",
|
||||
"path": "order/list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "付款详情",
|
||||
"navigationBarTitleText": "付款列表",
|
||||
"navigationStyle": "custom"
|
||||
},
|
||||
"needLogin": true
|
||||
|
@ -33,185 +33,206 @@
|
||||
</up-navbar>
|
||||
|
||||
<u-popup :show="propShowOrder" :round="10" mode="bottom" @close="close" customStyle="height:800rpx;">
|
||||
<wd-form ref="form" :model="orderInfo" errorType="message">
|
||||
<wd-cell-group border>
|
||||
<view style="padding: 20rpx;">
|
||||
<u-cell class="" style="line-height: 60rpx;" :border="true">
|
||||
<template #title>
|
||||
<view class="h-50 p-2 align-center font-blod" @click="close">
|
||||
支付金额 <wd-text size="36rpx" bold text="16354.156" mode="price" type="error" prefix="¥" suffix="元" />
|
||||
|
||||
<wd-cell-group border>
|
||||
<view style="padding: 20rpx;">
|
||||
<u-cell class="" style="line-height: 60rpx;" :border="true">
|
||||
<template #title>
|
||||
<view class="h-50 p-2 align-center font-blod" @click="close">
|
||||
支付金额 <wd-text size="36rpx" bold text="16354.156" mode="price" type="error" prefix="¥" suffix="元" />
|
||||
</view>
|
||||
<view class="h-50 p-2 align-center">
|
||||
剩余时间
|
||||
<view style="display: inline-block;">
|
||||
<wd-count-down :time="(30 * 60 * 60 * 1000)">
|
||||
<template #default="{ current }">
|
||||
<span class="custom-count-down">{{ current.hours > 10 ? current.hours : '0' + current.hours
|
||||
}}</span>
|
||||
<span class="custom-count-down-colon">:</span>
|
||||
<span class="custom-count-down">{{ current.minutes }}</span>
|
||||
<span class="custom-count-down-colon">:</span>
|
||||
<span class="custom-count-down">{{ current.seconds }}</span>
|
||||
</template>
|
||||
</wd-count-down>
|
||||
</view>
|
||||
<view class="h-50 p-2 align-center">
|
||||
剩余时间
|
||||
<view style="display: inline-block;">
|
||||
<wd-count-down :time="(30 * 60 * 60 * 1000)">
|
||||
<template #default="{ current }">
|
||||
<span class="custom-count-down">{{ current.hours > 10 ? current.hours : '0' + current.hours }}</span>
|
||||
<span class="custom-count-down-colon">:</span>
|
||||
<span class="custom-count-down">{{ current.minutes }}</span>
|
||||
<span class="custom-count-down-colon">:</span>
|
||||
<span class="custom-count-down">{{ current.seconds }}</span>
|
||||
</template>
|
||||
</wd-count-down>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
</u-cell>
|
||||
|
||||
<wd-cell-group>
|
||||
|
||||
<!-- <wd-cell title="微信支付" value="内容">
|
||||
<template #icon>
|
||||
<view class="cell-icon"></view>
|
||||
12321
|
||||
</template>
|
||||
</wd-cell> -->
|
||||
|
||||
|
||||
</wd-cell-group>
|
||||
<u-alert :show-icon="true" title="微信支付" type="" effect="dark" description=""></u-alert>
|
||||
|
||||
|
||||
<u-radio-group v-model="value">
|
||||
<view class="h-60 flex">
|
||||
<up-text size="28rpx" :text="` 680套餐`" :flex1="true" align="left" wordWrap="normal" :show="true"
|
||||
prefixIcon="" customStyle="font-weight:bold"
|
||||
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
|
||||
</up-text>
|
||||
<!-- <u-icon slot="right" label-color="red" :label="`¥2000.00元`"></u-icon> -->
|
||||
<view style="display: inline-block; float:right">
|
||||
<u-radio activeColor="#59CB56" label=""></u-radio>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
</u-cell>
|
||||
|
||||
</u-radio-group>
|
||||
<u-radio-group v-model="value">
|
||||
<view class="h-60 flex" style="width: 100%; padding: 20rpx;">
|
||||
<up-text size="36rpx" :text="`微信支付`" :flex1="true" align="left" wordWrap="normal" :show="true"
|
||||
prefixIcon="weixin-fill" customStyle="font-weight:bold"
|
||||
iconStyle="font-size:64rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
|
||||
</up-text>
|
||||
<!-- <u-icon size="48rpx" slot="right" label-color="red" :label="`¥2000.00元`"></u-icon> -->
|
||||
<view style="display: inline-block; float:right">
|
||||
<u-radio iconSize="36rpx" size="36rpx" activeColor="#59CB56" label=""></u-radio>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</u-radio-group>
|
||||
|
||||
|
||||
</view>
|
||||
<view class="prop-flex-bottom">
|
||||
<up-button class="" style="" text="确认支付" type="primary" color="#59CB56" shape="circle" size="normal"
|
||||
custom-style="width: calc(100vw - 100rpx);" @click="addOrder">
|
||||
</up-button>
|
||||
</view>
|
||||
</wd-cell-group>
|
||||
</wd-form>
|
||||
</view>
|
||||
<view class="prop-flex-bottom">
|
||||
<up-button class="" style="" text="确认支付" type="primary" color="#59CB56" shape="circle" size="normal"
|
||||
custom-style="width: calc(100vw - 100rpx);" @click="payOrder">
|
||||
</up-button>
|
||||
</view>
|
||||
</wd-cell-group>
|
||||
|
||||
</u-popup>
|
||||
|
||||
<wd-card>
|
||||
<template #title>
|
||||
<view class="title font-size-32 font-bold">
|
||||
<view>第一餐</view>
|
||||
<view class="title-tip">
|
||||
<text class="font-size-32 color-red font-bold ">¥213213.00元</text>
|
||||
<view v-for="(matchedItems, index) in matchedItems_sp" :key="index">
|
||||
<wd-card>
|
||||
<template #title>
|
||||
<view class="title font-size-32 font-bold">
|
||||
<view>第{{ parseInt(index) + 1 }}餐</view>
|
||||
<view class="title-tip">
|
||||
<!-- <text class="font-size-32 color-red font-bold ">¥213213.00元</text> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="title font-size-28 pt-4">
|
||||
<view>做宴时段:{{ matchedItems[0].banquet_date }}</view>
|
||||
<view class="title-tip font-size-28">
|
||||
做宴时段:{{ matchedItems[0].banquet_time }}
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<view class="content ">
|
||||
<up-cell-group :border="false">
|
||||
<view class="detail-box" style="border: none;padding: 0px;" v-for="(item, index) in matchedItems"
|
||||
:key="index">
|
||||
<u-cell :border="false">
|
||||
<template #icon>
|
||||
<wd-img :width="60" :height="60" :src="item.dishes.images[0]" :enable-preview="true" :radius="8"
|
||||
:round=false custom-class="margin-right-24" />
|
||||
</template>
|
||||
<template #title>
|
||||
<view class="h-60 flex">
|
||||
<up-text size="28rpx" :text="`${item.dishes.name}`" :flex1="true" align="left" wordWrap="normal"
|
||||
:show="true" prefixIcon="" customStyle="font-weight:bold"
|
||||
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
|
||||
</up-text>
|
||||
<u-icon slot="right" label-color="red" :label="`¥${item.dishes.price}元`"></u-icon>
|
||||
</view>
|
||||
</template>
|
||||
<template #label>
|
||||
<view class="h-60 flex color-gray">
|
||||
|
||||
<up-text size="26rpx" :text="`${item.dishes.intro}`" :flex1="true" align="left" wordWrap="normal"
|
||||
:show="true" prefixIcon="" customStyle=""
|
||||
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
|
||||
</up-text>
|
||||
<u-icon slot="right" label-color="red" :label="`X${item.number}`"></u-icon>
|
||||
</view>
|
||||
</template>
|
||||
</u-cell>
|
||||
</view>
|
||||
</up-cell-group>
|
||||
|
||||
</view>
|
||||
<view class="title font-size-28 pt-4">
|
||||
<view>做宴时段:2025-11-12</view>
|
||||
<view class="title-tip font-size-28">
|
||||
做宴时段:早上
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<view class="content ">
|
||||
<up-cell-group :border="false">
|
||||
<view class="detail-box" v-for="(item, index) in matchedItems_sp" :key="index">
|
||||
<u-cell :border="false">
|
||||
<template #icon>
|
||||
<wd-img :width="60" :height="60" :src="item.image" :enable-preview="true" :radius="8" :round=false
|
||||
custom-class="margin-right-24" />
|
||||
</template>
|
||||
<template #title>
|
||||
<view class="h-60 flex">
|
||||
<up-text size="28rpx" :text="`${item.name}680套餐`" :flex1="true" align="left" wordWrap="normal"
|
||||
:show="true" prefixIcon="" customStyle="font-weight:bold"
|
||||
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
|
||||
</up-text>
|
||||
<u-icon slot="right" label-color="red" :label="`¥2000.00元`"></u-icon>
|
||||
</view>
|
||||
</template>
|
||||
<template #label>
|
||||
<view class="h-60 flex color-gray">
|
||||
|
||||
<up-text size="26rpx" :text="`${item.intro}高级版-快速吸粉 | 周期一年`" :flex1="true" align="left"
|
||||
wordWrap="normal" :show="true" prefixIcon="" customStyle=""
|
||||
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
|
||||
</up-text>
|
||||
<u-icon slot="right" label-color="red" :label="`X30`"></u-icon>
|
||||
</view>
|
||||
</template>
|
||||
</u-cell>
|
||||
</view>
|
||||
</up-cell-group>
|
||||
|
||||
</view>
|
||||
<template #footer>
|
||||
<!-- <view>
|
||||
<!-- <template #footer>
|
||||
<view>
|
||||
<wd-button size="small" style="margin-right: 8px;">评价</wd-button>
|
||||
<wd-button size="small" plain>立即使用</wd-button>
|
||||
</view> -->
|
||||
</template>
|
||||
</wd-card>
|
||||
</view>
|
||||
</template> -->
|
||||
</wd-card>
|
||||
|
||||
</view>
|
||||
|
||||
<wd-card>
|
||||
<template #title>
|
||||
<view class="title font-size-32">
|
||||
<view>费用合计:</view>
|
||||
<view class="title-tip">
|
||||
<text class="font-size-32 color-red ">¥213213.00元</text>
|
||||
<text class="font-size-32 color-red ">¥{{ totalPrice }}元</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</wd-card>
|
||||
|
||||
<wd-card title="厨师信息">
|
||||
<view>厨师姓名:{{ server_user.public_name }}</view>
|
||||
<view>厨师联系方式:{{ server_user.phone }}</view>
|
||||
<template #footer>
|
||||
<wd-button size="small" plain>查看详情</wd-button>
|
||||
</template>
|
||||
</wd-card>
|
||||
|
||||
<wd-card>
|
||||
<template #title>
|
||||
<u-alert :show-icon="true" title="温馨提示:请确认酒席需求" type="" effect="dark" description=" "></u-alert>
|
||||
</template>
|
||||
<view>1.(不交定金)如若厨师接到更高价订单,可能会将您的订单取消。</view>
|
||||
<view>2.(付定金)如若厨师的做席档期存在冲突,可能会致电与您沟通,并推荐您更换厨师。</view>
|
||||
<view>3.如若档期冲突订单被厨师取消,定金将原路返回,请放心下单。</view>
|
||||
<view>4.在此,感谢您对此平台以及厨师们的支持,您的支持就是我们前进的最大动力。</view>
|
||||
|
||||
<wd-form ref="form" :model="orderInfo" errorType="message">
|
||||
<wd-cell-group border>
|
||||
|
||||
<u-cell class="" style="line-height: 60rpx;" :border="true">
|
||||
<template #title>
|
||||
|
||||
</template>
|
||||
</u-cell>
|
||||
|
||||
<u-alert :show-icon="true" title="温馨提示:请确认酒席需求" type="" effect="dark" description=" "></u-alert>
|
||||
<view class="pb-4" />
|
||||
<wd-input label="联系姓名" prop="name" clearable v-model="orderInfo.name" placeholder="请填写联系姓名" :rules="[
|
||||
{
|
||||
required: false,
|
||||
validator: (value: string) => {
|
||||
return /^[a-zA-Z0-9]+$/.test(value)
|
||||
},
|
||||
message: '请输入姓名'
|
||||
}
|
||||
]" />
|
||||
<wd-input label="联系姓名" prop="customer_name" clearable v-model="orderInfo.customer_name" placeholder="请填写联系姓名"
|
||||
:rules="[
|
||||
{
|
||||
required: false,
|
||||
validator: (value: string) => {
|
||||
return /^[\u4e00-\u9fa5a-zA-Z0-9_]+$/.test(value)
|
||||
},
|
||||
message: '请输入姓名'
|
||||
}
|
||||
]" />
|
||||
<wd-input label="联系电话" prop="phone" clearable v-model="orderInfo.phone" placeholder="请填写联系电话"
|
||||
:rules="[{ required: false, pattern: /^1[3-9]\d{9}$/, message: '请输入有效手机号码' }]" />
|
||||
|
||||
<wd-select-picker label="宴席类型" prop="banquet_type" v-model="orderInfo.banquet_type" :columns="banquetType"
|
||||
type="radio"
|
||||
:rules="[
|
||||
{
|
||||
required: false,
|
||||
validator: (value: string) => {
|
||||
return /^[\u4e00-\u9fa5a-zA-Z0-9_]+$/.test(value)
|
||||
},
|
||||
message: '请选择宴席类型'
|
||||
}
|
||||
]"
|
||||
></wd-select-picker>
|
||||
|
||||
<wd-col-picker label="做宴地址" v-model="orderInfo.district_name" prop="district_name" :columns="area"
|
||||
:column-change="columnChange" placeholder="请填写做宴地址" @confirm="handleConfirm" :rules="[
|
||||
{
|
||||
required: false,
|
||||
validator: (value: string) => {
|
||||
return /^[a-zA-Z0-9]+$/.test(value)
|
||||
if (value.length > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
},
|
||||
message: '请填写做宴地址'
|
||||
message: '做宴地址不能为空,请填写'
|
||||
}
|
||||
]"></wd-col-picker>
|
||||
|
||||
|
||||
|
||||
<wd-input label="详细地址" prop="street_name" clearable v-model="orderInfo.street_name" placeholder="请填写详细地址"
|
||||
:rules="[
|
||||
{
|
||||
required: false,
|
||||
validator: (value: string) => {
|
||||
return /^[a-zA-Z0-9]+$/.test(value)
|
||||
return /^[\u4e00-\u9fa5a-zA-Z0-9_]+$/.test(value)
|
||||
},
|
||||
message: '请输入正确的玛卡巴卡'
|
||||
message: '请输入详细地址'
|
||||
}
|
||||
]" />
|
||||
<wd-textarea label="备注" v-model="orderInfo.total_num" placeholder="请填写备注" />
|
||||
<wd-textarea label="备注" v-model="orderInfo.remark" placeholder="请填写备注" />
|
||||
|
||||
<wd-button plain hairline custom-style="width: calc(100vw - 100rpx);"
|
||||
@click="handleSubmit">确定预定(做席后再支付)</wd-button>
|
||||
<wd-button hairline custom-style="width: calc(100vw - 100rpx);" @click="handleSubmit">付定金锁定订单</wd-button>
|
||||
@click="handleSubmit(1)">确定预定(做席后再支付)</wd-button>
|
||||
<wd-button hairline custom-style="width: calc(100vw - 100rpx);" @click="handleSubmit(1)">付定金锁定订单</wd-button>
|
||||
|
||||
</wd-cell-group>
|
||||
</wd-form>
|
||||
@ -233,37 +254,40 @@ const { colPickerData, findChildrenByCode } = useColPickerData()
|
||||
export default defineComponent({
|
||||
data () {
|
||||
return {
|
||||
search: {
|
||||
category_id: '',
|
||||
keyword: '',
|
||||
page: 1,
|
||||
limit: 10,
|
||||
totalPrice: 0,
|
||||
server_user: {
|
||||
phone: '',
|
||||
public_name: '',
|
||||
},
|
||||
server_user_id: 0,
|
||||
|
||||
address_string: '',
|
||||
banquetType: this.getBanquetType(),
|
||||
propShowOrder: false,
|
||||
area: [],
|
||||
value: [],
|
||||
orderInfo: {
|
||||
name: '',
|
||||
phone: '',
|
||||
district_name: [],
|
||||
street_name: '',
|
||||
// cart_ids: [], 酒店
|
||||
customer_name: '',
|
||||
phone: '',
|
||||
address: '',
|
||||
remark: '',
|
||||
banquet_type: '',
|
||||
reservation_type: 1,
|
||||
server_user_id: 0,
|
||||
// table_number: 0, 酒店
|
||||
// banquet_date: '', 酒店
|
||||
},
|
||||
// keyword_sp: '',
|
||||
categoryIndex: 0,
|
||||
childrenIndex: 0,
|
||||
categoryList: [],
|
||||
tabList: [],
|
||||
good_list: [],
|
||||
matchedItems_sp: [],
|
||||
|
||||
};
|
||||
},
|
||||
onLoad () {
|
||||
// if (isLogin()) {
|
||||
this.getCategoryList()
|
||||
// }
|
||||
this.changeSP(1)
|
||||
onLoad (option) {
|
||||
this.server_user_id = option.id;;
|
||||
this.orderInfo.server_user_id = option.id;
|
||||
this.getCartCheck()
|
||||
this.getArea()
|
||||
},
|
||||
created () {
|
||||
@ -273,38 +297,51 @@ export default defineComponent({
|
||||
close () {
|
||||
this.propShowOrder = false;
|
||||
},
|
||||
handleSubmit () {
|
||||
this.propShowOrder = true;
|
||||
},
|
||||
//确认当餐信息
|
||||
addOrder () {
|
||||
//表单验证
|
||||
handleSubmit (reservation_type) {
|
||||
// console.log(this.orderInfo);
|
||||
this.orderInfo.reservation_type = reservation_type; //付款类型
|
||||
this.$refs.form.validate()
|
||||
.then(({ valid, errors }) => {
|
||||
if (valid) {
|
||||
this.menu_list[this.currentTab].is_set = 1;
|
||||
this.menu_list[this.currentTab].orderInfo = this.orderInfo;
|
||||
// this.menu_list[this.currentTab].orderInfo.columns = this.columns[this.currentTab].value;
|
||||
// this.menu_list[this.currentTab].orderInfo.total_price = this.totalPrice;
|
||||
this.close();
|
||||
|
||||
this.orderInfo.address = this.address_string+this.orderInfo.street_name;
|
||||
console.log(this.orderInfo);
|
||||
this.addOrder();
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error, 'error')
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
//提交订单
|
||||
addOrder () {
|
||||
CommonApi.commonPost('/api/banquet/order/createOrder', this.orderInfo).catch((res) => {
|
||||
if (res.code === 1) {
|
||||
this.propShowOrder = true;
|
||||
} else {
|
||||
uni.$u.toast(res.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 微信支付
|
||||
payOrder() {
|
||||
this.close();
|
||||
},
|
||||
//获取地址
|
||||
getArea () {
|
||||
this.area = [colPickerData.map(item => ({
|
||||
value: item.value,
|
||||
label: item.text
|
||||
}))];
|
||||
},
|
||||
|
||||
//选择地址后--记录地址字符串
|
||||
handleConfirm (value) {
|
||||
console.log(value)
|
||||
console.log(this.value)
|
||||
this.address_string = value.selectedItems.map(item => item.label).join('')
|
||||
},
|
||||
//地址改版事件
|
||||
columnChange ({ selectedItem, resolve, finish }) {
|
||||
try {
|
||||
const areaData = findChildrenByCode(colPickerData, selectedItem.value);
|
||||
@ -321,69 +358,36 @@ export default defineComponent({
|
||||
finish(); // 确保在发生错误时也能完成操作以避免卡顿
|
||||
}
|
||||
},
|
||||
|
||||
handleClickCategory (index: number) {
|
||||
this.categoryIndex = index;
|
||||
this.tabList = this.categoryList[index].children;
|
||||
this.handleChildrenClick(0);
|
||||
},
|
||||
handleChildrenClick (index: number) {
|
||||
this.childrenIndex = index;
|
||||
this.search.category_id = this.tabList[index].id;
|
||||
this.$refs.pagingRefSP?.reload();
|
||||
},
|
||||
|
||||
getCategoryList () {
|
||||
CommonApi.commonGet('/api/dishes/category').catch((res) => {
|
||||
//宴席类型
|
||||
getBanquetType () {
|
||||
CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => {
|
||||
if (res.code === 1) {
|
||||
this.categoryList = res.data;
|
||||
this.handleClickCategory(0)
|
||||
this.banquetType = res.data;
|
||||
res.data.forEach(item => {
|
||||
item.label = item.name;
|
||||
|
||||
});
|
||||
} else {
|
||||
uni.$u.toast(res.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
//搜索事件
|
||||
searchSP () {
|
||||
this.$refs.pagingRefSP?.reload();
|
||||
// this.changeSP(1);
|
||||
},
|
||||
//列表分页
|
||||
changeSP (pageNo: number) {
|
||||
console.log(pageNo);
|
||||
this.search.page = pageNo;
|
||||
CommonApi.commonGet('/api/dishes/dishes', this.search).catch((res) => {
|
||||
// //购物车验证
|
||||
getCartCheck () {
|
||||
CommonApi.commonPost('/api/banquet/order/check', { server_user_id: this.server_user_id }).catch((res) => {
|
||||
if (res.code === 1) {
|
||||
this.matchedItems_sp = res.data;
|
||||
this.matchedItems_sp = res.data.cart_list;
|
||||
this.totalPrice = res.data.total_price;
|
||||
this.server_user.phone = res.data.server_user.certification.phone;
|
||||
this.server_user.public_name = res.data.server_user.certification.public_name;
|
||||
this.$refs.pagingRefSP?.complete(res.data);
|
||||
// console.log(res);
|
||||
} else {
|
||||
uni.$u.toast(res.msg);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
//点击详情
|
||||
goodsDetail (id: number) {
|
||||
console.log(id);
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/goods/detail?id=${id}&is_add=1`
|
||||
});
|
||||
},
|
||||
|
||||
//加入购物车
|
||||
addCart (id) {
|
||||
CommonApi.commonPost('/api/cart/add', {
|
||||
buy_now: false,
|
||||
dishes_id: id,
|
||||
}).catch((res) => {
|
||||
if (res.code === 1) {
|
||||
uni.$u.toast('加入购物车成功');
|
||||
} else {
|
||||
uni.$u.toast(res.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
@ -57,9 +57,9 @@ body {
|
||||
<!-- <view > -->
|
||||
<wd-tabs v-model="currentTab" @change="handleChange" auto-line-width color="#59CB56" lineWidth="80rpx">
|
||||
<block v-for="(item, index) in menu_list" :key="item">
|
||||
<wd-tab :title="`第${index + 1}餐`" :name="index" setActive="item.name" :badge-props="
|
||||
item.orderInfo.is_set===1 ? { modelValue: '已选', max: 99, right: '-20rpx' } : { modelValue: '', max: 99, right: '-20rpx' }"></wd-tab>
|
||||
|
||||
<wd-tab :title="`第${index + 1}餐`" :name="index" setActive="item.name"
|
||||
:badge-props="item.orderInfo.is_set === 1 ? { modelValue: '已选', max: 99, right: '-20rpx' } : { modelValue: '', max: 99, right: '-20rpx' }"></wd-tab>
|
||||
|
||||
</block>
|
||||
</wd-tabs>
|
||||
<!-- </view> -->
|
||||
@ -122,7 +122,7 @@ body {
|
||||
<wd-icon name="edit" size="24rpx"></wd-icon> {{ orderInfo.is_set ? '修改餐标' : '设置餐标' }}</wd-button>
|
||||
<!-- <wd-fab :draggable="true" position="right-center" inactiveIcon="edit" :type="orderInfo.is_set ? 'primary' : 'error'" ></wd-fab> -->
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <wd-fab :draggable="true" position="right-center" inactiveIcon="edit">
|
||||
<view style="width: 200rpx;padding: 10x;">
|
||||
@ -182,14 +182,14 @@ export default defineComponent({
|
||||
orderInfo: {
|
||||
id: 0,
|
||||
is_set: 0,
|
||||
date: '',
|
||||
date: [],
|
||||
columns: '早上',
|
||||
number: 1,
|
||||
},
|
||||
newOrderInfo: {
|
||||
id: 0,
|
||||
is_set: 0,
|
||||
date: '',
|
||||
date: [],
|
||||
columns: '早上',
|
||||
number: 1,
|
||||
|
||||
@ -205,7 +205,7 @@ export default defineComponent({
|
||||
name: '第1餐', orderInfo: {
|
||||
id: 0,
|
||||
is_set: 0,
|
||||
date: '',
|
||||
date: [],
|
||||
columns: '早上',
|
||||
number: 1,
|
||||
}
|
||||
@ -214,7 +214,7 @@ export default defineComponent({
|
||||
name: '第1餐', orderInfo: {
|
||||
id: 0,
|
||||
is_set: 0,
|
||||
date: '',
|
||||
date: [],
|
||||
columns: '早上',
|
||||
number: 1,
|
||||
}
|
||||
@ -223,7 +223,7 @@ export default defineComponent({
|
||||
name: '第1餐', orderInfo: {
|
||||
id: 0,
|
||||
is_set: 0,
|
||||
date: '',
|
||||
date: [],
|
||||
columns: '早上',
|
||||
number: 1,
|
||||
}
|
||||
@ -232,7 +232,7 @@ export default defineComponent({
|
||||
name: '第1餐', orderInfo: {
|
||||
id: 0,
|
||||
is_set: 0,
|
||||
date: '',
|
||||
date: [],
|
||||
columns: '早上',
|
||||
number: 1,
|
||||
}
|
||||
@ -241,7 +241,7 @@ export default defineComponent({
|
||||
name: '第1餐', orderInfo: {
|
||||
id: 0,
|
||||
is_set: 0,
|
||||
date: '',
|
||||
date: [],
|
||||
columns: '早上',
|
||||
number: 1,
|
||||
}
|
||||
@ -250,7 +250,7 @@ export default defineComponent({
|
||||
name: '第1餐', orderInfo: {
|
||||
id: 0,
|
||||
is_set: 0,
|
||||
date: '',
|
||||
date: [],
|
||||
columns: '早上',
|
||||
number: 1,
|
||||
}
|
||||
@ -259,7 +259,7 @@ export default defineComponent({
|
||||
name: '第1餐', orderInfo: {
|
||||
id: 0,
|
||||
is_set: 0,
|
||||
date: '',
|
||||
date: [],
|
||||
columns: '早上',
|
||||
number: 1,
|
||||
}
|
||||
@ -268,7 +268,7 @@ export default defineComponent({
|
||||
name: '第1餐', orderInfo: {
|
||||
id: 0,
|
||||
is_set: 0,
|
||||
date: '',
|
||||
date: [],
|
||||
columns: '早上',
|
||||
number: 1,
|
||||
}
|
||||
@ -277,7 +277,7 @@ export default defineComponent({
|
||||
name: '第1餐', orderInfo: {
|
||||
id: 0,
|
||||
is_set: 0,
|
||||
date: '',
|
||||
date: [],
|
||||
columns: '早上',
|
||||
number: 1,
|
||||
}
|
||||
@ -286,7 +286,7 @@ export default defineComponent({
|
||||
name: '第1餐', orderInfo: {
|
||||
id: 0,
|
||||
is_set: 0,
|
||||
date: '',
|
||||
date: [],
|
||||
columns: '早上',
|
||||
number: 1,
|
||||
}
|
||||
@ -295,7 +295,7 @@ export default defineComponent({
|
||||
name: '第1餐', orderInfo: {
|
||||
id: 0,
|
||||
is_set: 0,
|
||||
date: '',
|
||||
date: [],
|
||||
columns: '早上',
|
||||
number: 1,
|
||||
}
|
||||
@ -304,7 +304,7 @@ export default defineComponent({
|
||||
name: '第1餐', orderInfo: {
|
||||
id: 0,
|
||||
is_set: 0,
|
||||
date: '',
|
||||
date: [],
|
||||
columns: '早上',
|
||||
number: 1,
|
||||
}
|
||||
@ -339,7 +339,6 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
delGoods () {
|
||||
|
||||
if (this.menu_list.length === 1) {
|
||||
return uni.$u.toast('至少要保留一个餐项');
|
||||
}
|
||||
@ -356,15 +355,6 @@ export default defineComponent({
|
||||
if (index !== undefined && index >= 0 && index < this.menu_list.length) {
|
||||
this.menu_list.splice(index, 1);
|
||||
}
|
||||
|
||||
// CommonApi.commonPost('/api/user/deleteAddress', { id: id }).catch((res) => {
|
||||
// if (res.code === 1) {
|
||||
// // this.propShowAddress = false;
|
||||
// this.getAddressInfoListData();
|
||||
// } else {
|
||||
// uni.$u.toast(res.msg);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
else if (res.cancel) {
|
||||
// console.log('用户点击取消');
|
||||
@ -379,6 +369,7 @@ export default defineComponent({
|
||||
this.$nextTick(() => {
|
||||
this.handleClickCategory(this.currentTab)
|
||||
this.menu_name = this.menu_list[this.currentTab].name; // 更新 menu_name
|
||||
this.searchSP()
|
||||
// this.orderInfo = this.menu_list[this.currentTab].orderInfo; // 更新 orderInfo
|
||||
});
|
||||
},
|
||||
@ -409,17 +400,11 @@ export default defineComponent({
|
||||
|
||||
//提交订单
|
||||
handleConfirm () {
|
||||
// console.log(value)
|
||||
|
||||
console.log(this.set_num);
|
||||
|
||||
// var id = 1;
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/banquet/combo/detail?id=${id}`
|
||||
// });
|
||||
uni.navigateTo({
|
||||
url: `/pages/banquet/combo/detail?id=${this.search.server_user_id}`
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
formatter (day) {
|
||||
const date = new Date(day.date)
|
||||
const now = new Date()
|
||||
@ -451,50 +436,56 @@ export default defineComponent({
|
||||
|
||||
//分类切换
|
||||
handleClickCategory (index: number) {
|
||||
// console.log(index);
|
||||
// this.categoryIndex = index;
|
||||
// this.tabList = this.categoryList[index].children;
|
||||
// this.handleChildrenClick(0);
|
||||
this.getCategoryList();
|
||||
|
||||
},
|
||||
handleChildrenClick (index: number) {
|
||||
this.childrenIndex = index;
|
||||
// this.search.category_id = this.tabList[this.childrenIndex].id;
|
||||
this.$refs.pagingRefSP?.reload();
|
||||
},
|
||||
//购物车验证
|
||||
getCartCheck () {
|
||||
CommonApi.commonPost('/api/banquet/order/check', { server_user_id: this.search.server_user_id }).catch((res) => {
|
||||
var num = 0;
|
||||
// var index = -1;
|
||||
var is_set_cart = 0;
|
||||
var newCartList = [];
|
||||
this.set_num = 0;
|
||||
|
||||
for (let val in this.menu_list) { //遍历购物车
|
||||
this.menu_list[val].orderInfo.is_set = 0;
|
||||
}
|
||||
//更新购物车餐标--获取已填数据
|
||||
if (res.code === 1) {
|
||||
for (let val in res.data.cart_list) {
|
||||
// console.log(res.data.cart_list[val][0]);
|
||||
num++;
|
||||
// index++;
|
||||
is_set_cart = res.data.cart_list[val][0].banquet_date ? 1 : 0; // 餐标已设置 日期
|
||||
if (is_set_cart) {
|
||||
this.set_num += 1;
|
||||
}
|
||||
newCartList.push({
|
||||
name: '第' + num + '餐', orderInfo: {
|
||||
id: 0,
|
||||
is_set: is_set_cart,
|
||||
date: new Date(res.data.cart_list[val][0].banquet_date).getTime(),
|
||||
columns: res.data.cart_list[val][0].banquet_time ? res.data.cart_list[val][0].banquet_time : '早上',
|
||||
number: res.data.cart_list[val][0].table_number ? res.data.cart_list[val][0].table_number : 1,
|
||||
}
|
||||
})
|
||||
this.menu_list[val].orderInfo.is_set = is_set_cart;
|
||||
|
||||
this.menu_list[res.data.cart_list[val][0].index].orderInfo.is_set = is_set_cart;
|
||||
// 如果菜已存在
|
||||
if (this.currentTab === res.data.cart_list[val][0].index) {
|
||||
newCartList.push({
|
||||
name: '第' + num + '餐', orderInfo: {
|
||||
id: 0,
|
||||
is_set: is_set_cart,
|
||||
date: res.data.cart_list[val][0].banquet_date ? new Date(res.data.cart_list[val][0].banquet_date).getTime() : [],
|
||||
columns: res.data.cart_list[val][0].banquet_time ? res.data.cart_list[val][0].banquet_time : '早上',
|
||||
number: res.data.cart_list[val][0].table_number ? res.data.cart_list[val][0].table_number : 1,
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
//更新购物车餐标--获取已填数据
|
||||
if (num > 0 && newCartList[this.currentTab]) {
|
||||
this.orderInfo = newCartList[this.currentTab].orderInfo; // 更新 orderInfo --已填值
|
||||
|
||||
if (newCartList.length > 0) {
|
||||
this.orderInfo = newCartList[0].orderInfo; // 更新 orderInfo --默认值
|
||||
} else {
|
||||
this.orderInfo = this.menu_list[this.currentTab].orderInfo; // 更新 orderInfo --默认值
|
||||
}
|
||||
// console.log(this.orderInfo);
|
||||
this.totalPrice = res.data.total_price;
|
||||
} else {
|
||||
// uni.$u.toast(res.msg);
|
||||
@ -520,7 +511,6 @@ export default defineComponent({
|
||||
//搜索事件
|
||||
searchSP () {
|
||||
this.$refs.pagingRefSP?.reload();
|
||||
// this.changeSP(1);
|
||||
},
|
||||
//列表分页
|
||||
changeSP (pageNo: number) {
|
||||
@ -580,7 +570,7 @@ export default defineComponent({
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 编辑购物车--餐标信息
|
||||
editCart () {
|
||||
CommonApi.commonPost('/api/banquet/cart/edit', {
|
||||
server_user_id: this.search.server_user_id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user