宴席2.1页面修改
Some checks are pending
deploy / deploy (push) Waiting to run

This commit is contained in:
sjeam 2025-08-13 16:38:33 +08:00
parent 192a365e06
commit 26d97d8461
4 changed files with 268 additions and 274 deletions

View File

@ -182,9 +182,9 @@
"needLogin": true "needLogin": true
}, },
{ {
"path": "order/pay", "path": "order/list",
"style": { "style": {
"navigationBarTitleText": "付款详情", "navigationBarTitleText": "付款列表",
"navigationStyle": "custom" "navigationStyle": "custom"
}, },
"needLogin": true "needLogin": true

View File

@ -33,7 +33,7 @@
</up-navbar> </up-navbar>
<u-popup :show="propShowOrder" :round="10" mode="bottom" @close="close" customStyle="height:800rpx;"> <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> <wd-cell-group border>
<view style="padding: 20rpx;"> <view style="padding: 20rpx;">
<u-cell class="" style="line-height: 60rpx;" :border="true"> <u-cell class="" style="line-height: 60rpx;" :border="true">
@ -46,7 +46,8 @@
<view style="display: inline-block;"> <view style="display: inline-block;">
<wd-count-down :time="(30 * 60 * 60 * 1000)"> <wd-count-down :time="(30 * 60 * 60 * 1000)">
<template #default="{ current }"> <template #default="{ current }">
<span class="custom-count-down">{{ current.hours > 10 ? current.hours : '0' + current.hours }}</span> <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-colon">:</span>
<span class="custom-count-down">{{ current.minutes }}</span> <span class="custom-count-down">{{ current.minutes }}</span>
<span class="custom-count-down-colon">:</span> <span class="custom-count-down-colon">:</span>
@ -59,87 +60,72 @@
</template> </template>
</u-cell> </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"> <u-radio-group v-model="value">
<view class="h-60 flex"> <view class="h-60 flex" style="width: 100%; padding: 20rpx;">
<up-text size="28rpx" :text="` 680套餐`" :flex1="true" align="left" wordWrap="normal" :show="true" <up-text size="36rpx" :text="`微信支付`" :flex1="true" align="left" wordWrap="normal" :show="true"
prefixIcon="" customStyle="font-weight:bold" prefixIcon="weixin-fill" customStyle="font-weight:bold"
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none"> iconStyle="font-size:64rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
</up-text> </up-text>
<!-- <u-icon slot="right" label-color="red" :label="`¥2000.00元`"></u-icon> --> <!-- <u-icon size="48rpx" slot="right" label-color="red" :label="`¥2000.00元`"></u-icon> -->
<view style="display: inline-block; float:right"> <view style="display: inline-block; float:right">
<u-radio activeColor="#59CB56" label=""></u-radio> <u-radio iconSize="36rpx" size="36rpx" activeColor="#59CB56" label=""></u-radio>
</view> </view>
</view> </view>
</u-radio-group> </u-radio-group>
</view> </view>
<view class="prop-flex-bottom"> <view class="prop-flex-bottom">
<up-button class="" style="" text="确认支付" type="primary" color="#59CB56" shape="circle" size="normal" <up-button class="" style="" text="确认支付" type="primary" color="#59CB56" shape="circle" size="normal"
custom-style="width: calc(100vw - 100rpx);" @click="addOrder"> custom-style="width: calc(100vw - 100rpx);" @click="payOrder">
</up-button> </up-button>
</view> </view>
</wd-cell-group> </wd-cell-group>
</wd-form>
</u-popup>
</u-popup>
<view v-for="(matchedItems, index) in matchedItems_sp" :key="index">
<wd-card> <wd-card>
<template #title> <template #title>
<view class="title font-size-32 font-bold"> <view class="title font-size-32 font-bold">
<view></view> <view>{{ parseInt(index) + 1 }}</view>
<view class="title-tip"> <view class="title-tip">
<text class="font-size-32 color-red font-bold ">213213.00</text> <!-- <text class="font-size-32 color-red font-bold ">213213.00</text> -->
</view> </view>
</view> </view>
<view class="title font-size-28 pt-4"> <view class="title font-size-28 pt-4">
<view>做宴时段2025-11-12</view> <view>做宴时段{{ matchedItems[0].banquet_date }}</view>
<view class="title-tip font-size-28"> <view class="title-tip font-size-28">
做宴时段早上 做宴时段{{ matchedItems[0].banquet_time }}
</view> </view>
</view> </view>
</template> </template>
<view class="content "> <view class="content ">
<up-cell-group :border="false"> <up-cell-group :border="false">
<view class="detail-box" v-for="(item, index) in matchedItems_sp" :key="index"> <view class="detail-box" style="border: none;padding: 0px;" v-for="(item, index) in matchedItems"
:key="index">
<u-cell :border="false"> <u-cell :border="false">
<template #icon> <template #icon>
<wd-img :width="60" :height="60" :src="item.image" :enable-preview="true" :radius="8" :round=false <wd-img :width="60" :height="60" :src="item.dishes.images[0]" :enable-preview="true" :radius="8"
custom-class="margin-right-24" /> :round=false custom-class="margin-right-24" />
</template> </template>
<template #title> <template #title>
<view class="h-60 flex"> <view class="h-60 flex">
<up-text size="28rpx" :text="`${item.name}680套餐`" :flex1="true" align="left" wordWrap="normal" <up-text size="28rpx" :text="`${item.dishes.name}`" :flex1="true" align="left" wordWrap="normal"
:show="true" prefixIcon="" customStyle="font-weight:bold" :show="true" prefixIcon="" customStyle="font-weight:bold"
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none"> iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
</up-text> </up-text>
<u-icon slot="right" label-color="red" :label="`¥2000.00元`"></u-icon> <u-icon slot="right" label-color="red" :label="`¥${item.dishes.price}元`"></u-icon>
</view> </view>
</template> </template>
<template #label> <template #label>
<view class="h-60 flex color-gray"> <view class="h-60 flex color-gray">
<up-text size="26rpx" :text="`${item.intro}高级版-快速吸粉 | 周期一年`" :flex1="true" align="left" <up-text size="26rpx" :text="`${item.dishes.intro}`" :flex1="true" align="left" wordWrap="normal"
wordWrap="normal" :show="true" prefixIcon="" customStyle="" :show="true" prefixIcon="" customStyle=""
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none"> iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
</up-text> </up-text>
<u-icon slot="right" label-color="red" :label="`X30`"></u-icon> <u-icon slot="right" label-color="red" :label="`X${item.number}`"></u-icon>
</view> </view>
</template> </template>
</u-cell> </u-cell>
@ -147,71 +133,106 @@
</up-cell-group> </up-cell-group>
</view> </view>
<template #footer> <!-- <template #footer>
<!-- <view> <view>
<wd-button size="small" style="margin-right: 8px;">评价</wd-button> <wd-button size="small" style="margin-right: 8px;">评价</wd-button>
<wd-button size="small" plain>立即使用</wd-button> <wd-button size="small" plain>立即使用</wd-button>
</view> --> </view>
</template> </template> -->
</wd-card> </wd-card>
</view>
<wd-card> <wd-card>
<template #title> <template #title>
<view class="title font-size-32"> <view class="title font-size-32">
<view>费用合计</view> <view>费用合计</view>
<view class="title-tip"> <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>
</view> </view>
</template> </template>
</wd-card> </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> <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-form ref="form" :model="orderInfo" errorType="message">
<wd-cell-group border> <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" /> <view class="pb-4" />
<wd-input label="联系姓名" prop="name" clearable v-model="orderInfo.name" placeholder="请填写联系姓名" :rules="[ <wd-input label="联系姓名" prop="customer_name" clearable v-model="orderInfo.customer_name" placeholder="请填写联系姓名"
:rules="[
{ {
required: false, required: false,
validator: (value: string) => { validator: (value: string) => {
return /^[a-zA-Z0-9]+$/.test(value) return /^[\u4e00-\u9fa5a-zA-Z0-9_]+$/.test(value)
}, },
message: '请输入姓名' message: '请输入姓名'
} }
]" /> ]" />
<wd-input label="联系电话" prop="phone" clearable v-model="orderInfo.phone" placeholder="请填写联系电话" <wd-input label="联系电话" prop="phone" clearable v-model="orderInfo.phone" placeholder="请填写联系电话"
:rules="[{ required: false, pattern: /^1[3-9]\d{9}$/, message: '请输入有效手机号码' }]" /> :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" <wd-col-picker label="做宴地址" v-model="orderInfo.district_name" prop="district_name" :columns="area"
:column-change="columnChange" placeholder="请填写做宴地址" @confirm="handleConfirm" :rules="[ :column-change="columnChange" placeholder="请填写做宴地址" @confirm="handleConfirm" :rules="[
{ {
required: false, required: false,
validator: (value: string) => { validator: (value: string) => {
return /^[a-zA-Z0-9]+$/.test(value) if (value.length > 0) {
return true;
}
return false;
}, },
message: '请填写做宴地址' message: '做宴地址不能为空,请填写'
} }
]"></wd-col-picker> ]"></wd-col-picker>
<wd-input label="详细地址" prop="street_name" clearable v-model="orderInfo.street_name" placeholder="请填写详细地址" <wd-input label="详细地址" prop="street_name" clearable v-model="orderInfo.street_name" placeholder="请填写详细地址"
:rules="[ :rules="[
{ {
required: false, required: false,
validator: (value: string) => { 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);" <wd-button plain 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">付定金锁定订单</wd-button> <wd-button hairline custom-style="width: calc(100vw - 100rpx);" @click="handleSubmit(1)">付定金锁定订单</wd-button>
</wd-cell-group> </wd-cell-group>
</wd-form> </wd-form>
@ -233,37 +254,40 @@ const { colPickerData, findChildrenByCode } = useColPickerData()
export default defineComponent({ export default defineComponent({
data () { data () {
return { return {
search: { totalPrice: 0,
category_id: '', server_user: {
keyword: '', phone: '',
page: 1, public_name: '',
limit: 10,
}, },
server_user_id: 0,
address_string: '',
banquetType: this.getBanquetType(),
propShowOrder: false, propShowOrder: false,
area: [], area: [],
value: [], value: [],
orderInfo: { orderInfo: {
name: '',
phone: '',
district_name: [], district_name: [],
street_name: '', street_name: '',
// cart_ids: [],
customer_name: '',
phone: '',
address: '',
remark: '', 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: [], matchedItems_sp: [],
}; };
}, },
onLoad () { onLoad (option) {
// if (isLogin()) { this.server_user_id = option.id;;
this.getCategoryList() this.orderInfo.server_user_id = option.id;
// } this.getCartCheck()
this.changeSP(1)
this.getArea() this.getArea()
}, },
created () { created () {
@ -273,38 +297,51 @@ export default defineComponent({
close () { close () {
this.propShowOrder = false; this.propShowOrder = false;
}, },
handleSubmit () { //
this.propShowOrder = true; handleSubmit (reservation_type) {
}, // console.log(this.orderInfo);
// this.orderInfo.reservation_type = reservation_type; //
addOrder () {
this.$refs.form.validate() this.$refs.form.validate()
.then(({ valid, errors }) => { .then(({ valid, errors }) => {
if (valid) { if (valid) {
this.menu_list[this.currentTab].is_set = 1; this.orderInfo.address = this.address_string+this.orderInfo.street_name;
this.menu_list[this.currentTab].orderInfo = this.orderInfo; console.log(this.orderInfo);
// this.menu_list[this.currentTab].orderInfo.columns = this.columns[this.currentTab].value; this.addOrder();
// this.menu_list[this.currentTab].orderInfo.total_price = this.totalPrice;
this.close();
} }
}) })
.catch((error) => { .catch((error) => {
console.log(error, '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 () { getArea () {
this.area = [colPickerData.map(item => ({ this.area = [colPickerData.map(item => ({
value: item.value, value: item.value,
label: item.text label: item.text
}))]; }))];
}, },
//--
handleConfirm (value) { handleConfirm (value) {
console.log(value) this.address_string = value.selectedItems.map(item => item.label).join('')
console.log(this.value)
}, },
//
columnChange ({ selectedItem, resolve, finish }) { columnChange ({ selectedItem, resolve, finish }) {
try { try {
const areaData = findChildrenByCode(colPickerData, selectedItem.value); const areaData = findChildrenByCode(colPickerData, selectedItem.value);
@ -321,69 +358,36 @@ export default defineComponent({
finish(); // finish(); //
} }
}, },
//
handleClickCategory (index: number) { getBanquetType () {
this.categoryIndex = index; CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => {
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) => {
if (res.code === 1) { if (res.code === 1) {
this.categoryList = res.data; this.banquetType = res.data;
this.handleClickCategory(0) res.data.forEach(item => {
item.label = item.name;
});
} else { } else {
uni.$u.toast(res.msg); uni.$u.toast(res.msg);
} }
}); });
}, },
// // //
searchSP () { getCartCheck () {
this.$refs.pagingRefSP?.reload(); CommonApi.commonPost('/api/banquet/order/check', { server_user_id: this.server_user_id }).catch((res) => {
// this.changeSP(1);
},
//
changeSP (pageNo: number) {
console.log(pageNo);
this.search.page = pageNo;
CommonApi.commonGet('/api/dishes/dishes', this.search).catch((res) => {
if (res.code === 1) { 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); this.$refs.pagingRefSP?.complete(res.data);
// console.log(res); // console.log(res);
} else { } else {
uni.$u.toast(res.msg); 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);
}
});
}
}, },

View File

@ -57,8 +57,8 @@ body {
<!-- <view > --> <!-- <view > -->
<wd-tabs v-model="currentTab" @change="handleChange" auto-line-width color="#59CB56" lineWidth="80rpx"> <wd-tabs v-model="currentTab" @change="handleChange" auto-line-width color="#59CB56" lineWidth="80rpx">
<block v-for="(item, index) in menu_list" :key="item"> <block v-for="(item, index) in menu_list" :key="item">
<wd-tab :title="`第${index + 1}餐`" :name="index" setActive="item.name" :badge-props=" <wd-tab :title="`第${index + 1}餐`" :name="index" setActive="item.name"
item.orderInfo.is_set===1 ? { modelValue: '已选', max: 99, right: '-20rpx' } : { modelValue: '', max: 99, right: '-20rpx' }"></wd-tab> :badge-props="item.orderInfo.is_set === 1 ? { modelValue: '已选', max: 99, right: '-20rpx' } : { modelValue: '', max: 99, right: '-20rpx' }"></wd-tab>
</block> </block>
</wd-tabs> </wd-tabs>
@ -182,14 +182,14 @@ export default defineComponent({
orderInfo: { orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: '', date: [],
columns: '早上', columns: '早上',
number: 1, number: 1,
}, },
newOrderInfo: { newOrderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: '', date: [],
columns: '早上', columns: '早上',
number: 1, number: 1,
@ -205,7 +205,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: '', date: [],
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -214,7 +214,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: '', date: [],
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -223,7 +223,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: '', date: [],
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -232,7 +232,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: '', date: [],
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -241,7 +241,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: '', date: [],
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -250,7 +250,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: '', date: [],
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -259,7 +259,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: '', date: [],
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -268,7 +268,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: '', date: [],
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -277,7 +277,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: '', date: [],
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -286,7 +286,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: '', date: [],
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -295,7 +295,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: '', date: [],
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -304,7 +304,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: '', date: [],
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -339,7 +339,6 @@ export default defineComponent({
}, },
delGoods () { delGoods () {
if (this.menu_list.length === 1) { if (this.menu_list.length === 1) {
return uni.$u.toast('至少要保留一个餐项'); return uni.$u.toast('至少要保留一个餐项');
} }
@ -356,15 +355,6 @@ export default defineComponent({
if (index !== undefined && index >= 0 && index < this.menu_list.length) { if (index !== undefined && index >= 0 && index < this.menu_list.length) {
this.menu_list.splice(index, 1); 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) { else if (res.cancel) {
// console.log(''); // console.log('');
@ -379,6 +369,7 @@ export default defineComponent({
this.$nextTick(() => { this.$nextTick(() => {
this.handleClickCategory(this.currentTab) this.handleClickCategory(this.currentTab)
this.menu_name = this.menu_list[this.currentTab].name; // menu_name this.menu_name = this.menu_list[this.currentTab].name; // menu_name
this.searchSP()
// this.orderInfo = this.menu_list[this.currentTab].orderInfo; // orderInfo // this.orderInfo = this.menu_list[this.currentTab].orderInfo; // orderInfo
}); });
}, },
@ -409,17 +400,11 @@ export default defineComponent({
// //
handleConfirm () { handleConfirm () {
// console.log(value) uni.navigateTo({
url: `/pages/banquet/combo/detail?id=${this.search.server_user_id}`
console.log(this.set_num); });
// var id = 1;
// uni.navigateTo({
// url: `/pages/banquet/combo/detail?id=${id}`
// });
}, },
formatter (day) { formatter (day) {
const date = new Date(day.date) const date = new Date(day.date)
const now = new Date() const now = new Date()
@ -451,50 +436,56 @@ export default defineComponent({
// //
handleClickCategory (index: number) { handleClickCategory (index: number) {
// console.log(index);
// this.categoryIndex = index;
// this.tabList = this.categoryList[index].children;
// this.handleChildrenClick(0);
this.getCategoryList(); this.getCategoryList();
}, },
handleChildrenClick (index: number) { handleChildrenClick (index: number) {
this.childrenIndex = index; this.childrenIndex = index;
// this.search.category_id = this.tabList[this.childrenIndex].id;
this.$refs.pagingRefSP?.reload(); this.$refs.pagingRefSP?.reload();
}, },
// //
getCartCheck () { getCartCheck () {
CommonApi.commonPost('/api/banquet/order/check', { server_user_id: this.search.server_user_id }).catch((res) => { CommonApi.commonPost('/api/banquet/order/check', { server_user_id: this.search.server_user_id }).catch((res) => {
var num = 0; var num = 0;
// var index = -1;
var is_set_cart = 0; var is_set_cart = 0;
var newCartList = []; var newCartList = [];
this.set_num = 0; this.set_num = 0;
for (let val in this.menu_list) { //
this.menu_list[val].orderInfo.is_set = 0;
}
//--
if (res.code === 1) { if (res.code === 1) {
for (let val in res.data.cart_list) { for (let val in res.data.cart_list) {
// console.log(res.data.cart_list[val][0]);
num++; num++;
// index++;
is_set_cart = res.data.cart_list[val][0].banquet_date ? 1 : 0; // is_set_cart = res.data.cart_list[val][0].banquet_date ? 1 : 0; //
if (is_set_cart) { if (is_set_cart) {
this.set_num += 1; this.set_num += 1;
} }
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({ newCartList.push({
name: '第' + num + '餐', orderInfo: { name: '第' + num + '餐', orderInfo: {
id: 0, id: 0,
is_set: is_set_cart, is_set: is_set_cart,
date: new Date(res.data.cart_list[val][0].banquet_date).getTime(), 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 : '早上', 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, 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;
} }
//-- }
if (num > 0 && newCartList[this.currentTab]) {
this.orderInfo = newCartList[this.currentTab].orderInfo; // orderInfo -- if (newCartList.length > 0) {
this.orderInfo = newCartList[0].orderInfo; // orderInfo --
} else { } else {
this.orderInfo = this.menu_list[this.currentTab].orderInfo; // orderInfo -- this.orderInfo = this.menu_list[this.currentTab].orderInfo; // orderInfo --
} }
// console.log(this.orderInfo);
this.totalPrice = res.data.total_price; this.totalPrice = res.data.total_price;
} else { } else {
// uni.$u.toast(res.msg); // uni.$u.toast(res.msg);
@ -520,7 +511,6 @@ export default defineComponent({
// //
searchSP () { searchSP () {
this.$refs.pagingRefSP?.reload(); this.$refs.pagingRefSP?.reload();
// this.changeSP(1);
}, },
// //
changeSP (pageNo: number) { changeSP (pageNo: number) {
@ -580,7 +570,7 @@ export default defineComponent({
} }
}); });
}, },
// --
editCart () { editCart () {
CommonApi.commonPost('/api/banquet/cart/edit', { CommonApi.commonPost('/api/banquet/cart/edit', {
server_user_id: this.search.server_user_id, server_user_id: this.search.server_user_id,