宴席2.1
Some checks failed
deploy / deploy (push) Has been cancelled

This commit is contained in:
sjeam 2025-08-13 11:00:58 +08:00
parent cf8b8842a5
commit 192a365e06
6 changed files with 391 additions and 194 deletions

View File

@ -75,6 +75,7 @@
"uview-plus": "^3.4.28", "uview-plus": "^3.4.28",
"vue": "3.4.21", "vue": "3.4.21",
"vue-i18n": "9.1.9", "vue-i18n": "9.1.9",
"weixin-js-sdk": "^1.6.5",
"wot-design-uni": "^1.11.1", "wot-design-uni": "^1.11.1",
"z-paging": "^2.8.4" "z-paging": "^2.8.4"
}, },

8
pnpm-lock.yaml generated
View File

@ -44,6 +44,9 @@ importers:
vue-i18n: vue-i18n:
specifier: 9.1.9 specifier: 9.1.9
version: 9.1.9(vue@3.4.21(typescript@5.8.3)) version: 9.1.9(vue@3.4.21(typescript@5.8.3))
weixin-js-sdk:
specifier: ^1.6.5
version: 1.6.5
wot-design-uni: wot-design-uni:
specifier: ^1.11.1 specifier: ^1.11.1
version: 1.11.1(vue@3.4.21(typescript@5.8.3)) version: 1.11.1(vue@3.4.21(typescript@5.8.3))
@ -5963,6 +5966,9 @@ packages:
webpack-virtual-modules@0.6.2: webpack-virtual-modules@0.6.2:
resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==} resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==}
weixin-js-sdk@1.6.5:
resolution: {integrity: sha512-Gph1WAWB2YN/lMOFB/ymb+hbU/wYazzJgu6PMMktCy9cSCeW5wA6Zwt0dpahJbJ+RJEwtTv2x9iIu0U4enuVSQ==}
whatwg-encoding@1.0.5: whatwg-encoding@1.0.5:
resolution: {integrity: sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==} resolution: {integrity: sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==}
@ -13178,6 +13184,8 @@ snapshots:
webpack-virtual-modules@0.6.2: {} webpack-virtual-modules@0.6.2: {}
weixin-js-sdk@1.6.5: {}
whatwg-encoding@1.0.5: whatwg-encoding@1.0.5:
dependencies: dependencies:
iconv-lite: 0.4.24 iconv-lite: 0.4.24

View File

@ -21,16 +21,14 @@ body {
<scroll-view style="height: 1000rpx;" scroll-y="true"> <scroll-view style="height: 1000rpx;" scroll-y="true">
<u-alert :show-icon="true" title="温馨提示:确定前请检查日期时间段" type="" effect="dark" description=" "></u-alert> <u-alert :show-icon="true" title="温馨提示:确定前请检查日期时间段" type="" effect="dark" description=" "></u-alert>
<view class="pb-4" /> <view class="pb-4" />
<wd-calendar label="做宴日期" placeholder="请选择日期" prop="date" :formatter="formatter" :min-date="min_data"
v-model="orderInfo.date" :rules="[{ required: false, pattern: /^\d{13}$/, message: '请选择日期' }]"
<wd-calendar label="做宴日期" placeholder="请选择日期" prop="time" :formatter="formatter" :min-date="min_data"
v-model="orderInfo.time" :rules="[{ required: false, pattern: /^\d{13}$/, message: '请选择日期' }]"
@confirm="handleTimeConfirm" /> @confirm="handleTimeConfirm" />
<wd-select-picker label="做宴时段" v-model="orderInfo.columns" :columns="columns" <wd-select-picker label="做宴时段" v-model="orderInfo.columns" :columns="columns"
type="radio"></wd-select-picker> type="radio"></wd-select-picker>
<wd-input label="做宴桌数" placeholder="请输做宴桌数" prop="total_num" type="number" clearable <wd-input label="做宴桌数" placeholder="请输做宴桌数" prop="number" type="number" clearable
v-model="orderInfo.total_num" :rules="[{ required: false, pattern: /^[1-9]\d*$/, message: '请输入有效的桌数' }]" v-model="orderInfo.number" :rules="[{ required: false, pattern: /^[1-9]\d*$/, message: '请输入有效的桌数' }]"
placeholder-style="color: #999999; font-size: 14px;" /> placeholder-style="color: #999999; font-size: 14px;" />
</scroll-view> </scroll-view>
@ -55,41 +53,28 @@ body {
searchIconColor="#909399" color="#606266" placeholderColor="#909399" searchIcon="search" margin="10rpx" searchIconColor="#909399" color="#606266" placeholderColor="#909399" searchIcon="search" margin="10rpx"
maxlength="-1" height="60rpx" @change="searchSP()"> maxlength="-1" height="60rpx" @change="searchSP()">
</up-search> </up-search>
<view style="width: calc(100vw - 180rpx);display: inline-block;"> <!-- <view style="width: calc(100vw - 180rpx);display: inline-block;"> -->
<wd-tabs v-model="currentTab" @change="handleChange" auto-line-width color="#59CB56" lineWidth="80rpx"> <!-- <view > -->
<block v-for="(item, index) in menu_list" :key="item"> <wd-tabs v-model="currentTab" @change="handleChange" auto-line-width color="#59CB56" lineWidth="80rpx">
<wd-tab :title="`第${index + 1}餐`" :name="index" setActive="item.name"> <block v-for="(item, index) in menu_list" :key="item">
</wd-tab> <wd-tab :title="`第${index + 1}餐`" :name="index" setActive="item.name" :badge-props="
</block> item.orderInfo.is_set===1 ? { modelValue: '已选', max: 99, right: '-20rpx' } : { modelValue: '', max: 99, right: '-20rpx' }"></wd-tab>
</wd-tabs>
</view> </block>
<wd-button plain @click="handleSubmit" type="error" </wd-tabs>
<!-- </view> -->
<!-- <wd-button plain @click="handleSubmit" :type="orderInfo.is_set ? 'primary' : 'error'" icon-position="right"
custom-style="width:160rpx;float:right;margin-left:0rpx;margin:10rpx" size="small"> custom-style="width:160rpx;float:right;margin-left:0rpx;margin:10rpx" size="small">
<wd-icon name="edit" size="24rpx"></wd-icon>设置餐标</wd-button> <wd-icon name="edit" size="24rpx"></wd-icon> {{ orderInfo.is_set ? '修改餐标' : '设置餐标' }}</wd-button> -->
<!-- <wd-button type="text" icon="plus" icon-position="right">+加餐</wd-button> --> <!-- <wd-button type="text" icon="plus" icon-position="right">+加餐</wd-button> -->
<z-paging :fixed="false" height="calc(100vh - 440rpx)" width="200rpx" loading-more-default-text="" <z-paging :fixed="false" height="calc(100vh - 440rpx)" width="200rpx" loading-more-default-text=""
style=" left:0; padding: 0px; position: fixed;" class="fv-page flex-col px-4"> style=" left:0; padding: 0px; position: fixed;" class="fv-page flex-col px-4">
<wd-sidebar v-model="childrenIndex"> <wd-sidebar v-model="childrenIndex">
<view v-for="(item, index) in tabList" :key="index" @click="handleChildrenClick(index)"> <view v-for="(item, index) in tabList" :key="index" @click="handleChildrenClick(index)">
<wd-sidebar-item :value="index" :label="item.name" :badge="item.num" customStyle="font-size:24rpx;" /> <wd-sidebar-item :value="index" :label="item.name" :badge="item.cart_count" customStyle="font-size:24rpx;" />
</view> </view>
</wd-sidebar> </wd-sidebar>
<!-- <u-scroll-list :indicator="false">
<view class="scroll-list" style="flex-direction: column;">
<view class="scroll-list__goods-item-column " v-for="(item, index) in tabList" :key="index"
:class="(index === childrenIndex) ? 'column-active' : 'column-active-false'"
@click="handleChildrenClick(index)">
<slot name="tabItem">
</slot>
<text class="scroll-list__goods-item__text">
<wd-badge :modelValue="item.num ? item.num : 1" top="-8rpx" right="-8rpx" bg-color="#59CB56 ">
{{ item.name }}
</wd-badge>
</text>
</view>
</view>
</u-scroll-list> -->
</z-paging> </z-paging>
<z-paging ref="pagingRefSP" v-model="matchedItems_sp" @query="changeSP" :fixed="false" height="calc(100vh - 440rpx)" <z-paging ref="pagingRefSP" v-model="matchedItems_sp" @query="changeSP" :fixed="false" height="calc(100vh - 440rpx)"
width="calc(100vw - 200rpx)" style="right: 0; background-color: #FFFFFFFF; position: fixed;" width="calc(100vw - 200rpx)" style="right: 0; background-color: #FFFFFFFF; position: fixed;"
@ -114,12 +99,16 @@ body {
</up-text> </up-text>
</view> </view>
<view class="h-50 flex ellipsis_text"> <view class="h-50 flex ellipsis_text">
<up-text color="#fa4e62" size="28rpx" :text="`¥36.00 元${item.intro}`" :flex1="true" align="left" <up-text color="#fa4e62" size="28rpx" :text="`¥${item.price}元`" :flex1="true" align="left"
wordWrap="normal" :show="true" prefixIcon="" wordWrap="normal" :show="true" prefixIcon=""
iconStyle="font-size:26rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none"> iconStyle="font-size:26rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
</up-text> </up-text>
<view @click.stop="addCart(item.id)"> <view @click.stop="" v-if="item.type === 2">
<wd-input-number v-model="totalNum" @change="addCart" input-width="60rpx" /> <wd-input-number v-model="item.cart_count" @change="addCart(item)" input-width="60rpx" :min="0"
:max="1" />
</view>
<view @click.stop="" v-else>
<wd-input-number v-model="item.cart_count" @change="addCart(item)" input-width="60rpx" :min="0" />
</view> </view>
</view> </view>
</template> </template>
@ -128,17 +117,24 @@ body {
</z-paging> </z-paging>
<!-- // --> <!-- // -->
<wd-fab :draggable="true" position="right-center" inactiveIcon="edit"> <wd-button plain @click="handleSubmit" :type="orderInfo.is_set ? 'primary' : 'error'" icon-position="right"
custom-style="width:160rpx;float:right;margin-left:0rpx;margin:10rpx" size="small">
<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;"> <view style="width: 200rpx;padding: 10x;">
<wd-button plain @click="addGoods" custom-style="width:180rpx;float:right;margin:10rpx;" size="small"> <wd-icon <wd-button plain @click="addGoods" custom-style="width:180rpx;float:right;margin:10rpx;" size="small"> <wd-icon
name="add" size="22rpx"></wd-icon> 添加餐次</wd-button> name="add" size="22rpx"></wd-icon> 添加餐次</wd-button>
<wd-button plain @click="delGoods" custom-style="width:180rpx;float:right;margin:10rpx;" type="error" <wd-button plain @click="delGoods" custom-style="width:180rpx;float:right;margin:10rpx;" type="error"
size="small"><wd-icon name="delete" size="22rpx"></wd-icon>删除餐次</wd-button> size="small"><wd-icon name="delete" size="22rpx"></wd-icon>删除餐次</wd-button>
</view> </view>
</wd-fab> </wd-fab> -->
<view class="flex-sub box-border flex" style="bottom: 10rpx;padding: 10rpx;"> <view class="flex-sub box-border flex" style="bottom: 10rpx;padding: 10rpx;">
<view style="width:calc(100vw - 180rpx); margin: 0rpx 0rpx 0rpx 20rpx;" width=""> <view style="width:calc(100vw - 180rpx); margin: 0rpx 0rpx 0rpx 20rpx;" width="">
<text>已选{{this.menu_list.length}},合计<text color-red>213213</text></text> <text>已选{{ this.set_num }},合计<text color-red>{{ totalPrice }}</text></text>
</view> </view>
<up-button class="" style="" text="选好了" type="primary" color="#59CB56" shape="circle" size="small" <up-button class="" style="" text="选好了" type="primary" color="#59CB56" shape="circle" size="small"
@ -151,39 +147,52 @@ body {
// useColPickerData // useColPickerData
// //
import { useColPickerData,useModal } from '@/hooks' import { useColPickerData, useModal } from '@/hooks'
import { defineComponent } from "vue"; import { defineComponent } from "vue";
import { CommonApi, UserApi } from "@/api"; import { CommonApi, UserApi } from "@/api";
import { get } from 'http'; import { get } from 'http';
// import { badgeProps } from '@/uni_modules/wot-design-uni/components/wd-badge/types';
// import { setToken, getToken, isLogin } from '@/utils/auth'; // import { setToken, getToken, isLogin } from '@/utils/auth';
// const { colPickerData, findChildrenByCode } = useColPickerData() // const { colPickerData, findChildrenByCode } = useColPickerData()
export default defineComponent({ export default defineComponent({
data () { data () {
return { return {
badgeProps: {
title: '普通数值',
badgeProps: {
modelValue: 10,
right: '-8px'
}
}, //
search: { search: {
category_id: '', category_id: '',
keyword: '', keyword: '',
server_user_id: 0,
index: 0, //
page: 1, page: 1,
limit: 10, limit: 10,
}, },
tpl: '确定前检查日期时间段', tpl: '确定前检查日期时间段',
propShowOrder: false, propShowOrder: false,
set_num: 0, //
value: [], value: [],
totalNum: 0, totalNum: 0,
orderInfo: { orderInfo: {
time: '', id: 0,
is_set: 0,
date: '',
columns: '早上', columns: '早上',
total_num: 1, number: 1,
total_price: 0,
}, },
newOrderInfo: { newOrderInfo: {
time: '', id: 0,
is_set: 0,
date: '',
columns: '早上', columns: '早上',
total_num: 1, number: 1,
total_price: 0,
}, },
totalPrice: 0, totalPrice: 0,
currentTab: 0, // tab currentTab: 0, // tab
@ -191,29 +200,132 @@ export default defineComponent({
isDisabledDate: [1754755200000, 1754755200000], isDisabledDate: [1754755200000, 1754755200000],
// time_list: [], // time_list: [],
menu_name: '第1餐', menu_name: '第1餐',
menu_list: [{ menu_list: [
id: 0, is_set: 0, name: '第1餐', orderInfo: { {
time: '', name: '第1餐', orderInfo: {
columns: '早上', id: 0,
total_num: 1, is_set: 0,
total_price: 0, date: '',
columns: '早上',
number: 1,
}
}, },
}], {
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
columns: '早上',
number: 1,
}
},
{
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
columns: '早上',
number: 1,
}
},
{
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
columns: '早上',
number: 1,
}
},
{
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
columns: '早上',
number: 1,
}
},
{
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
columns: '早上',
number: 1,
}
},
{
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
columns: '早上',
number: 1,
}
},
{
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
columns: '早上',
number: 1,
}
},
{
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
columns: '早上',
number: 1,
}
},
{
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
columns: '早上',
number: 1,
}
},
{
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
columns: '早上',
number: 1,
}
},
{
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
columns: '早上',
number: 1,
}
},
],
columns: [{ value: '早上', label: '早上' }, { value: '中午', label: '中午' }, { value: '晚上', label: '晚上' }], columns: [{ value: '早上', label: '早上' }, { value: '中午', label: '中午' }, { value: '晚上', label: '晚上' }],
// keyword_sp: '', // keyword_sp: '',
categoryIndex: 0, // categoryIndex: 0,
childrenIndex: 0, childrenIndex: 0,
categoryList: [], // categoryList: [],
tabList: [], tabList: [],
good_list: [], good_list: [],
matchedItems_sp: [], matchedItems_sp: [],
}; };
}, },
onLoad () { onLoad (option) {
// if (isLogin()) { // console.log(option);
this.search.server_user_id = option.id;
this.getCategoryList() this.getCategoryList()
// }
}, },
created () { created () {
@ -223,41 +335,42 @@ export default defineComponent({
addGoods () { addGoods () {
// //
var new_menu_name = '第' + parseInt(this.menu_list.length + 1) + '餐'; var new_menu_name = '第' + parseInt(this.menu_list.length + 1) + '餐';
this.menu_list.push({ id: 0, is_set: 0, name: new_menu_name , orderInfo: this.newOrderInfo }); this.menu_list.push({ name: new_menu_name, orderInfo: this.newOrderInfo });
}, },
delGoods () { delGoods () {
if (this.menu_list.length === 1) { if (this.menu_list.length === 1) {
return uni.$u.toast('至少要保留一个餐项'); return uni.$u.toast('至少要保留一个餐项');
} }
useModal().showModal('success', { useModal().showModal('success', {
title: '删除提示', title: '删除提示',
content: '确定删除'+this.menu_name+'吗?', content: '确定删除' + this.menu_name + '吗?',
showCancel: true, showCancel: true,
confirmText: '确定', confirmText: '确定',
cancelText: '取消', cancelText: '取消',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
// //
const index = this.currentTab; // currentTab const index = this.currentTab; // currentTab
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) => { // CommonApi.commonPost('/api/user/deleteAddress', { id: id }).catch((res) => {
// if (res.code === 1) { // if (res.code === 1) {
// // this.propShowAddress = false; // // this.propShowAddress = false;
// this.getAddressInfoListData(); // this.getAddressInfoListData();
// } else { // } else {
// uni.$u.toast(res.msg); // uni.$u.toast(res.msg);
// } // }
// }); // });
} }
else if (res.cancel) { else if (res.cancel) {
// console.log(''); // console.log('');
} }
}, },
}); });
}, },
@ -266,7 +379,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.orderInfo = this.menu_list[this.currentTab].orderInfo; // orderInfo // this.orderInfo = this.menu_list[this.currentTab].orderInfo; // orderInfo
}); });
}, },
@ -277,8 +390,8 @@ export default defineComponent({
if (valid) { if (valid) {
this.menu_list[this.currentTab].is_set = 1; this.menu_list[this.currentTab].is_set = 1;
this.menu_list[this.currentTab].orderInfo = this.orderInfo; this.menu_list[this.currentTab].orderInfo = this.orderInfo;
this.editCart()
// this.menu_list[this.currentTab].orderInfo.columns = this.columns[this.currentTab].value; // 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.close();
} }
@ -297,10 +410,13 @@ export default defineComponent({
// //
handleConfirm () { handleConfirm () {
// console.log(value) // console.log(value)
var id = 1;
uni.navigateTo({ console.log(this.set_num);
url: `/pages/banquet/combo/detail?id=${id}`
}); // var id = 1;
// uni.navigateTo({
// url: `/pages/banquet/combo/detail?id=${id}`
// });
}, },
@ -328,30 +444,74 @@ export default defineComponent({
}, },
handleTimeConfirm (res) { handleTimeConfirm (res) {
console.log(res.value) // console.log(res.value)
this.orderInfo.time = res.value this.orderInfo.date = res.value
}, },
// //
handleClickCategory (index: number) { handleClickCategory (index: number) {
// console.log(index);
// this.categoryIndex = index;
// this.tabList = this.categoryList[index].children;
// this.handleChildrenClick(0);
this.getCategoryList();
console.log(index);
this.categoryIndex = index;
this.tabList = this.categoryList[index].children;
this.handleChildrenClick(0);
}, },
handleChildrenClick (index: number) { handleChildrenClick (index: number) {
this.childrenIndex = index; this.childrenIndex = index;
this.search.category_id = this.tabList[index].id; // this.search.category_id = this.tabList[this.childrenIndex].id;
this.$refs.pagingRefSP?.reload(); 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 is_set_cart = 0;
var newCartList = [];
this.set_num = 0;
if (res.code === 1) {
for (let val in res.data.cart_list) {
// console.log(res.data.cart_list[val][0]);
num++;
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;
}
//--
if (num > 0 && newCartList[this.currentTab]) {
this.orderInfo = newCartList[this.currentTab].orderInfo; // orderInfo --
} else {
this.orderInfo = this.menu_list[this.currentTab].orderInfo; // orderInfo --
}
this.totalPrice = res.data.total_price;
} else {
// uni.$u.toast(res.msg);
}
});
},
getCategoryList () { getCategoryList () {
CommonApi.commonGet('/api/dishes/category').catch((res) => { CommonApi.commonGet('/api/banquet/dishes/category', {
server_user_id: this.search.server_user_id,
index: this.currentTab
}).catch((res) => {
if (res.code === 1) { if (res.code === 1) {
this.categoryList = res.data; // this.categoryList = res.data;
this.handleClickCategory(0) this.tabList = res.data;
this.search.category_id = this.tabList[0].id;
this.getCartCheck() //
} else { } else {
uni.$u.toast(res.msg); uni.$u.toast(res.msg);
} }
@ -364,9 +524,11 @@ export default defineComponent({
}, },
// //
changeSP (pageNo: number) { changeSP (pageNo: number) {
this.search.category_id = this.tabList[this.childrenIndex] ? this.tabList[this.childrenIndex].id : 0;
// console.log(pageNo); // console.log(pageNo);
this.search.page = pageNo; this.search.page = pageNo;
CommonApi.commonGet('/api/dishes/dishes', this.search).catch((res) => { this.search.index = this.currentTab;
CommonApi.commonGet('/api/banquet/dishes/list', this.search).catch((res) => {
if (res.code === 1) { if (res.code === 1) {
// this.matchedItems_sp = res.data; // this.matchedItems_sp = res.data;
this.$refs.pagingRefSP?.complete(res.data); this.$refs.pagingRefSP?.complete(res.data);
@ -386,18 +548,66 @@ export default defineComponent({
}, },
// //
addCart (id) { addCart (e) {
CommonApi.commonPost('/api/cart/add', { console.log(e);
buy_now: false, CommonApi.commonPost('/api/banquet/cart/add', {
dishes_id: id, server_user_id: this.search.server_user_id,
index: this.currentTab,
dishes_id: e.id,
number: e.cart_count,
}).catch((res) => { }).catch((res) => {
if (res.code === 1) { if (res.code === 1) {
uni.$u.toast('加入购物车成功'); //0
if (e.cart_count === 0) {
this.delCart(e.cart_id)
}
this.getCategoryList() //
this.searchSP() //
} else { } else {
uni.$u.toast(res.msg); uni.$u.toast(res.msg);
} }
}); });
} },
delCart (id) {
CommonApi.commonPost('/api/banquet/cart/delete', {
id: id,
}).catch((res) => {
if (res.code === 1) {
uni.$u.toast('删除成功');
this.getCartCheck() //
} else {
uni.$u.toast(res.msg);
}
});
},
editCart () {
CommonApi.commonPost('/api/banquet/cart/edit', {
server_user_id: this.search.server_user_id,
index: this.currentTab,
date: this.formatDate(this.orderInfo.date),
time: this.orderInfo.columns,
number: this.orderInfo.number,
}).catch((res) => {
if (res.code === 1) {
uni.$u.toast('设置餐标成功');
this.getCartCheck() //
} else {
uni.$u.toast(res.msg);
}
});
},
// Y-m-d
formatDate (timestamp: number) {
const date = new Date(timestamp);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const formattedDate = `${year}-${month}-${day}`;
console.log('格式化后的日期:', formattedDate);
return formattedDate;
},
}, },

View File

@ -1,9 +1,5 @@
<template> <template>
<view class="fv-page flex-col" style=""> <view class="fv-page flex-col" style="">
<!-- <up-navbar class="" style="" :autoBack="true" bgColor="#00000000" :fixed="true" titleColor="#595757FF"
leftIconColor="#FFFFFFFF">
</up-navbar> -->
<up-navbar :autoBack="true" style="font-weight: bold;" leftIcon="arrow-left" :title="`厨师详情`" titleColor="#303133" <up-navbar :autoBack="true" style="font-weight: bold;" leftIcon="arrow-left" :title="`厨师详情`" titleColor="#303133"
bgColor="#FFFFFFFF" titleWidth="600rpx" height="80rpx" leftIconSize="40rpx" leftIconColor="#303133" bgColor="#FFFFFFFF" titleWidth="600rpx" height="80rpx" leftIconSize="40rpx" leftIconColor="#303133"
:safeAreaInsetTop="true" :placeholder="true" :fixed="true"> :safeAreaInsetTop="true" :placeholder="true" :fixed="true">
@ -14,12 +10,12 @@
<view class=""> <view class="">
<u-cell :border="false"> <u-cell :border="false">
<template #icon> <template #icon>
<wd-img :width="120" :height="120" :src="matchedItems_sc.image" :enable-preview="false" :radius="8" <wd-img :width="120" :height="120" :src="matchedItems_sc.avatar" :enable-preview="false" :radius="8"
:round=false 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="32rpx" :text="`${matchedItems_sc.name}大厨师`" :flex1="true" align="left" wordWrap="normal" <up-text size="32rpx" :text="`${matchedItems_sc.nickname}`" :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>
@ -28,32 +24,24 @@
</template> </template>
<template #label> <template #label>
<view class="h-50 flex color-gray"> <view class="h-50 flex color-gray">
<wd-tag custom-class="space">家常菜</wd-tag> <wd-tag custom-class="space">{{ matchedItems_sc.district_name }}</wd-tag>
<wd-tag custom-class="space" type="primary">川菜</wd-tag>
<wd-tag custom-class="space" type="danger">粤菜</wd-tag>
<wd-tag custom-class="space" type="warning">湘菜</wd-tag>
<wd-tag custom-class="space" type="success">特色菜</wd-tag>
<!-- <u-text size="" :text="`${matchedItems_sc.intro}川菜 家常菜`" :flex1="true" align="left"
wordWrap="normal" :show="true" prefixIcon="" customStyle="font-size:24rpx"
iconStyle="font-size:24rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
</u-text> -->
<!-- <u-icon slot="right" label-color="red" :label="`X30`"></u-icon> -->
</view> </view>
<view class="h-50 flex color-gray"> <view class="h-50 flex color-gray">
<up-text size="" :text="`${matchedItems_sc.intro}最大承载人数6000人`" :flex1="true" align="left" <up-text size="" :text="`联系电话:${matchedItems_sc.phone}`" :flex1="true" align="left" wordWrap="normal"
wordWrap="normal" :show="true" prefixIcon="" customStyle="font-size:24rpx" :show="true" prefixIcon="" customStyle="font-size:24rpx"
iconStyle="font-size:24rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none"> iconStyle="font-size:24rpx;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="`X30`"></u-icon> -->
</view> </view>
<view class="h-50 flex color-gray"> <view class="h-50 flex color-gray">
<up-text size="" :text="`${matchedItems_sc.intro}四川省泸州市龙马潭区`" :flex1="true" align="left" <up-text size="" :text="`${matchedItems_sc.district_name}${matchedItems_sc.street_name}`" :flex1="true"
wordWrap="normal" :show="true" prefixIcon="" customStyle="font-size:24rpx" align="left" wordWrap="normal" :show="true" prefixIcon="" customStyle="font-size:24rpx"
iconStyle="font-size:24rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none"> iconStyle="font-size:24rpx;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="`X30`"></u-icon> -->
</view> </view>
<wd-button size="small" @click="addCart(1)" >下单预定</wd-button> <wd-button size="small" @click="addCart(matchedItems_sc.id)">下单预定</wd-button>
</template> </template>
</u-cell> </u-cell>
</view> </view>
@ -62,14 +50,13 @@
</wd-card> </wd-card>
<wd-card title="厨师展示视频" type="rectangle"> <wd-card title="厨师展示视频" type="rectangle">
<up-swiper v-if="imageList" height="320rpx" :list="imageList" keyName="url" :autoplay="false"></up-swiper> <up-swiper v-if="imageList" height="360rpx" :list="imageList" keyName="url" :autoplay="false"></up-swiper>
</wd-card> </wd-card>
<wd-card title="档期日历" type="rectangle"> <wd-card title="档期日历" type="rectangle">
<wd-calendar-view v-model="time_value" :formatter="formatter" :min-date="min_data" :max_data="max_data" @change="handleChange" /> <wd-calendar-view v-model="time_value" :formatter="formatter" :min-date="min_data" :max_data="max_data"
@change="handleChange" />
</wd-card> </wd-card>
<view class="flex box-border flex-sub-cart" v-if="is_add"> <view class="flex box-border flex-sub-cart" v-if="is_add">
@ -97,10 +84,10 @@ export default defineComponent({
id: 0, id: 0,
}, },
is_add: 0, // is_add: 0, //
time_value:[], time_value: [],
min_data: new Date().getTime(), min_data: new Date().getTime(),
max_data: this.calculateMaxDate(), max_data: this.calculateMaxDate(),
isDisabledDate: [1754755200000, 1754755200000], isDisabledDate: [],
matchedItems_sc: [], matchedItems_sc: [],
matchedItems_sp: [], matchedItems_sp: [],
imageList: [], imageList: [],
@ -110,15 +97,15 @@ export default defineComponent({
// console.log(option); // console.log(option);
this.search.id = option.id; this.search.id = option.id;
this.is_add = option.is_add | 0; this.is_add = option.is_add | 0;
this.getCategoryList() this.getChefDetail()
this.changeSP() // this.changeSP()
}, },
created () { created () {
}, },
methods: { methods: {
// //
calculateMaxDate() { calculateMaxDate () {
const currentDate = new Date(); const currentDate = new Date();
const futureDate = new Date(currentDate.setMonth(currentDate.getMonth() + 1)); const futureDate = new Date(currentDate.setMonth(currentDate.getMonth() + 1));
return futureDate.getTime(); return futureDate.getTime();
@ -146,42 +133,48 @@ export default defineComponent({
} }
return day return day
}, },
getCategoryList () { handleChange () {
CommonApi.commonGet('/api/dishes/detail', this.search).catch((res) => { },
getChefDetail () {
CommonApi.commonGet('/api/banquet/chef/detail', this.search).catch((res) => {
if (res.code === 1) { if (res.code === 1) {
this.matchedItems_sc = res.data; this.matchedItems_sc = res.data;
this.matchedItems_sc.street_name = this.matchedItems_sc.street_name.join('')
this.matchedItems_sc.phone = this.matchedItems_sc.certification.phone
//
this.isDisabledDate = this.matchedItems_sc.calendar;
this.time_value = [0]
// //
this.imageList = res.data.image ? [{ this.imageList = res.data.certification.video ? [{
url: res.data.image, url: res.data.certification.video,
title: res.data.name, title: res.data.certification.public_name,
poster: res.data.image poster: res.data.certification.public_image
}] : []; }] : [];
} else { } else {
uni.$u.toast(res.msg); uni.$u.toast(res.msg);
} }
}); });
}, },
// // //
changeSP () { // changeSP () {
// console.log(pageNo); // // console.log(pageNo);
// this.search.page = pageNo; // // this.search.page = pageNo;
CommonApi.commonGet('/api/dishes/dishes', this.search).catch((res) => { // 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;
// this.$refs.pagingRefSP?.complete(res.data); // // this.$refs.pagingRefSP?.complete(res.data);
} else { // } else {
uni.$u.toast(res.msg); // uni.$u.toast(res.msg);
} // }
}); // });
},
// },
// //
addCart (id) { addCart (id) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/banquet/combo/index??id=${id}` url: `/pages/banquet/combo/index??id=${id}`
}); });
// CommonApi.commonPost('/api/cart/add', { // CommonApi.commonPost('/api/cart/add', {
// buy_now: false, // buy_now: false,
// dishes_id: this.search.id, // dishes_id: this.search.id,

View File

@ -19,12 +19,12 @@
<view class="detail-box" v-for="(item, index) in matchedItems_sp" :key="index"> <view class="detail-box" v-for="(item, index) in matchedItems_sp" :key="index">
<u-cell :border="false" @click="goodsDetail(item.id)"> <u-cell :border="false" @click="goodsDetail(item.id)">
<template #icon> <template #icon>
<wd-img :width="100" :height="100" :src="item.image" :enable-preview="false" :radius="8" :round=false <wd-img :width="100" :height="100" :src="item.avatar" :enable-preview="false" :radius="8" :round=false
custom-class="margin-right-24" /> custom-class="margin-right-24" />
</template> </template>
<template #title> <template #title>
<view class="h-60 flex"> <view class="h-60 flex">
<up-text size="32rpx" :text="`${item.name}大厨师`" :flex1="true" align="left" wordWrap="normal" <up-text size="32rpx" :text="`${item.nickname}`" :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>
@ -33,26 +33,21 @@
</template> </template>
<template #label> <template #label>
<view class="h-50 flex color-gray"> <view class="h-50 flex color-gray">
<wd-tag custom-class="space">家常菜</wd-tag> <wd-tag custom-class="space">{{item.district_name}}</wd-tag>
<wd-tag custom-class="space" type="primary">川菜</wd-tag> <!-- <wd-tag custom-class="space" type="primary">川菜</wd-tag>
<wd-tag custom-class="space" type="danger">粤菜</wd-tag> <wd-tag custom-class="space" type="danger">粤菜</wd-tag>
<wd-tag custom-class="space" type="warning">湘菜</wd-tag> <wd-tag custom-class="space" type="warning">湘菜</wd-tag>
<wd-tag custom-class="space" type="success">特色菜</wd-tag> <wd-tag custom-class="space" type="success">特色菜</wd-tag> -->
<!-- <u-text size="" :text="`${item.intro}川菜 家常菜`" :flex1="true" align="left"
wordWrap="normal" :show="true" prefixIcon="" customStyle="font-size:24rpx"
iconStyle="font-size:24rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
</u-text> -->
<!-- <u-icon slot="right" label-color="red" :label="`X30`"></u-icon> -->
</view> </view>
<view class="h-50 flex color-gray"> <view class="h-50 flex color-gray">
<up-text size="" :text="`${item.intro}最大承载人数6000人`" :flex1="true" align="left" <up-text size="" :text="`联系电话:${item.certification.phone}`" :flex1="true" align="left"
wordWrap="normal" :show="true" prefixIcon="" customStyle="font-size:24rpx" wordWrap="normal" :show="true" prefixIcon="" customStyle="font-size:24rpx"
iconStyle="font-size:24rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none"> iconStyle="font-size:24rpx;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="`X30`"></u-icon> -->
</view> </view>
<view class="h-50 flex color-gray"> <view class="h-50 flex color-gray">
<up-text size="" :text="`${item.intro}四川省泸州市龙马潭区`" :flex1="true" align="left" <up-text size="" :text="`${item.district_name}${item.street_name.join('')}`" :flex1="true" align="left"
wordWrap="normal" :show="true" prefixIcon="" customStyle="font-size:24rpx" wordWrap="normal" :show="true" prefixIcon="" customStyle="font-size:24rpx"
iconStyle="font-size:24rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none"> iconStyle="font-size:24rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
</up-text> </up-text>
@ -85,7 +80,7 @@ export default defineComponent({
data () { data () {
return { return {
search: { search: {
category_id: '', // category_id: '',
keyword: '', keyword: '',
page: 1, page: 1,
limit: 10, limit: 10,
@ -233,7 +228,7 @@ export default defineComponent({
changeSP (pageNo: number) { changeSP (pageNo: number) {
// console.log(pageNo); // console.log(pageNo);
this.search.page = pageNo; this.search.page = pageNo;
CommonApi.commonGet('/api/dishes/dishes', this.search).catch((res) => { CommonApi.commonGet('/api/banquet/chef/list', this.search).catch((res) => {
if (res.code === 1) { if (res.code === 1) {
// this.matchedItems_sp = res.data; // this.matchedItems_sp = res.data;
this.$refs.pagingRefSP?.complete(res.data); this.$refs.pagingRefSP?.complete(res.data);

View File

@ -180,16 +180,6 @@ export default defineComponent({
day.disabled = true; // day.disabled = true; //
day.disabled_class = 'disabled-date'; // day.disabled_class = 'disabled-date'; //
} }
// if (day.type === 'start') {
// day.bottomInfo = ''
// }
// if (day.type === 'end') {
// day.bottomInfo = ''
// }
// if (day.type === 'same') {
// day.bottomInfo = '/'
// }
return day return day
}, },
@ -233,7 +223,7 @@ export default defineComponent({
changeSP (pageNo: number) { changeSP (pageNo: number) {
// console.log(pageNo); // console.log(pageNo);
this.search.page = pageNo; this.search.page = pageNo;
CommonApi.commonGet('/api/dishes/dishes', this.search).catch((res) => { CommonApi.commonGet('/api/banquet/chef/list', this.search).catch((res) => {
if (res.code === 1) { if (res.code === 1) {
// this.matchedItems_sp = res.data; // this.matchedItems_sp = res.data;
this.$refs.pagingRefSP?.complete(res.data); this.$refs.pagingRefSP?.complete(res.data);