parent
cf8b8842a5
commit
192a365e06
@ -75,6 +75,7 @@
|
||||
"uview-plus": "^3.4.28",
|
||||
"vue": "3.4.21",
|
||||
"vue-i18n": "9.1.9",
|
||||
"weixin-js-sdk": "^1.6.5",
|
||||
"wot-design-uni": "^1.11.1",
|
||||
"z-paging": "^2.8.4"
|
||||
},
|
||||
|
8
pnpm-lock.yaml
generated
8
pnpm-lock.yaml
generated
@ -44,6 +44,9 @@ importers:
|
||||
vue-i18n:
|
||||
specifier: 9.1.9
|
||||
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:
|
||||
specifier: ^1.11.1
|
||||
version: 1.11.1(vue@3.4.21(typescript@5.8.3))
|
||||
@ -5963,6 +5966,9 @@ packages:
|
||||
webpack-virtual-modules@0.6.2:
|
||||
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:
|
||||
resolution: {integrity: sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==}
|
||||
|
||||
@ -13178,6 +13184,8 @@ snapshots:
|
||||
|
||||
webpack-virtual-modules@0.6.2: {}
|
||||
|
||||
weixin-js-sdk@1.6.5: {}
|
||||
|
||||
whatwg-encoding@1.0.5:
|
||||
dependencies:
|
||||
iconv-lite: 0.4.24
|
||||
|
@ -21,16 +21,14 @@ body {
|
||||
<scroll-view style="height: 1000rpx;" scroll-y="true">
|
||||
<u-alert :show-icon="true" title="温馨提示:确定前请检查日期时间段" type="" effect="dark" description=" "></u-alert>
|
||||
<view class="pb-4" />
|
||||
|
||||
|
||||
<wd-calendar label="做宴日期" placeholder="请选择日期" prop="time" :formatter="formatter" :min-date="min_data"
|
||||
v-model="orderInfo.time" :rules="[{ required: false, pattern: /^\d{13}$/, message: '请选择日期' }]"
|
||||
<wd-calendar label="做宴日期" placeholder="请选择日期" prop="date" :formatter="formatter" :min-date="min_data"
|
||||
v-model="orderInfo.date" :rules="[{ required: false, pattern: /^\d{13}$/, message: '请选择日期' }]"
|
||||
@confirm="handleTimeConfirm" />
|
||||
<wd-select-picker label="做宴时段" v-model="orderInfo.columns" :columns="columns"
|
||||
type="radio"></wd-select-picker>
|
||||
|
||||
<wd-input label="做宴桌数" placeholder="请输做宴桌数" prop="total_num" type="number" clearable
|
||||
v-model="orderInfo.total_num" :rules="[{ required: false, pattern: /^[1-9]\d*$/, message: '请输入有效的桌数' }]"
|
||||
<wd-input label="做宴桌数" placeholder="请输做宴桌数" prop="number" type="number" clearable
|
||||
v-model="orderInfo.number" :rules="[{ required: false, pattern: /^[1-9]\d*$/, message: '请输入有效的桌数' }]"
|
||||
placeholder-style="color: #999999; font-size: 14px;" />
|
||||
|
||||
</scroll-view>
|
||||
@ -55,41 +53,28 @@ body {
|
||||
searchIconColor="#909399" color="#606266" placeholderColor="#909399" searchIcon="search" margin="10rpx"
|
||||
maxlength="-1" height="60rpx" @change="searchSP()">
|
||||
</up-search>
|
||||
<view style="width: calc(100vw - 180rpx);display: inline-block;">
|
||||
<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">
|
||||
</wd-tab>
|
||||
</block>
|
||||
</wd-tabs>
|
||||
</view>
|
||||
<wd-button plain @click="handleSubmit" type="error"
|
||||
<!-- <view style="width: calc(100vw - 180rpx);display: inline-block;"> -->
|
||||
<!-- <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>
|
||||
|
||||
</block>
|
||||
</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">
|
||||
<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> -->
|
||||
<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">
|
||||
<wd-sidebar v-model="childrenIndex">
|
||||
<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;" />
|
||||
<view v-for="(item, index) in tabList" :key="index" @click="handleChildrenClick(index)">
|
||||
<wd-sidebar-item :value="index" :label="item.name" :badge="item.cart_count" customStyle="font-size:24rpx;" />
|
||||
</view>
|
||||
</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 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;"
|
||||
@ -114,12 +99,16 @@ body {
|
||||
</up-text>
|
||||
</view>
|
||||
<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=""
|
||||
iconStyle="font-size:26rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
|
||||
</up-text>
|
||||
<view @click.stop="addCart(item.id)">
|
||||
<wd-input-number v-model="totalNum" @change="addCart" input-width="60rpx" />
|
||||
<view @click.stop="" v-if="item.type === 2">
|
||||
<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>
|
||||
</template>
|
||||
@ -128,17 +117,24 @@ body {
|
||||
</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;">
|
||||
<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>
|
||||
<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>
|
||||
</view>
|
||||
</wd-fab>
|
||||
</wd-fab> -->
|
||||
<view class="flex-sub box-border flex" style="bottom: 10rpx;padding: 10rpx;">
|
||||
<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>
|
||||
|
||||
<up-button class="" style="" text="选好了" type="primary" color="#59CB56" shape="circle" size="small"
|
||||
@ -151,39 +147,52 @@ body {
|
||||
// useColPickerData可以参考本章节顶部的介绍
|
||||
// 导入路径根据自己实际情况调整,万不可一贴了之
|
||||
|
||||
import { useColPickerData,useModal } from '@/hooks'
|
||||
import { useColPickerData, useModal } from '@/hooks'
|
||||
|
||||
import { defineComponent } from "vue";
|
||||
import { CommonApi, UserApi } from "@/api";
|
||||
import { get } from 'http';
|
||||
// import { badgeProps } from '@/uni_modules/wot-design-uni/components/wd-badge/types';
|
||||
// import { setToken, getToken, isLogin } from '@/utils/auth';
|
||||
// const { colPickerData, findChildrenByCode } = useColPickerData()
|
||||
|
||||
export default defineComponent({
|
||||
data () {
|
||||
return {
|
||||
badgeProps: {
|
||||
title: '普通数值',
|
||||
badgeProps: {
|
||||
modelValue: 10,
|
||||
right: '-8px'
|
||||
}
|
||||
}, // 徽标
|
||||
search: {
|
||||
category_id: '',
|
||||
keyword: '',
|
||||
server_user_id: 0,
|
||||
index: 0, //第几餐
|
||||
page: 1,
|
||||
limit: 10,
|
||||
},
|
||||
tpl: '确定前检查日期时间段',
|
||||
propShowOrder: false,
|
||||
|
||||
set_num: 0, //设置餐标数量
|
||||
value: [],
|
||||
totalNum: 0,
|
||||
orderInfo: {
|
||||
time: '',
|
||||
id: 0,
|
||||
is_set: 0,
|
||||
date: '',
|
||||
columns: '早上',
|
||||
total_num: 1,
|
||||
total_price: 0,
|
||||
number: 1,
|
||||
},
|
||||
newOrderInfo: {
|
||||
time: '',
|
||||
id: 0,
|
||||
is_set: 0,
|
||||
date: '',
|
||||
columns: '早上',
|
||||
total_num: 1,
|
||||
total_price: 0,
|
||||
number: 1,
|
||||
|
||||
},
|
||||
totalPrice: 0,
|
||||
currentTab: 0, // tab索引
|
||||
@ -191,29 +200,132 @@ export default defineComponent({
|
||||
isDisabledDate: [1754755200000, 1754755200000],
|
||||
// time_list: [],
|
||||
menu_name: '第1餐',
|
||||
menu_list: [{
|
||||
id: 0, is_set: 0, name: '第1餐', orderInfo: {
|
||||
time: '',
|
||||
columns: '早上',
|
||||
total_num: 1,
|
||||
total_price: 0,
|
||||
menu_list: [
|
||||
{
|
||||
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,
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '第1餐', orderInfo: {
|
||||
id: 0,
|
||||
is_set: 0,
|
||||
date: '',
|
||||
columns: '早上',
|
||||
number: 1,
|
||||
}
|
||||
},
|
||||
],
|
||||
columns: [{ value: '早上', label: '早上' }, { value: '中午', label: '中午' }, { value: '晚上', label: '晚上' }],
|
||||
// keyword_sp: '',
|
||||
categoryIndex: 0,
|
||||
// categoryIndex: 0,
|
||||
childrenIndex: 0,
|
||||
categoryList: [],
|
||||
// categoryList: [],
|
||||
tabList: [],
|
||||
good_list: [],
|
||||
matchedItems_sp: [],
|
||||
|
||||
};
|
||||
},
|
||||
onLoad () {
|
||||
// if (isLogin()) {
|
||||
onLoad (option) {
|
||||
// console.log(option);
|
||||
this.search.server_user_id = option.id;
|
||||
this.getCategoryList()
|
||||
// }
|
||||
|
||||
|
||||
},
|
||||
created () {
|
||||
@ -223,41 +335,42 @@ export default defineComponent({
|
||||
addGoods () {
|
||||
// 插入数组
|
||||
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 () {
|
||||
|
||||
if (this.menu_list.length === 1) {
|
||||
return uni.$u.toast('至少要保留一个餐项');
|
||||
}
|
||||
useModal().showModal('success', {
|
||||
title: '删除提示',
|
||||
content: '确定删除'+this.menu_name+'吗?',
|
||||
showCancel: true,
|
||||
confirmText: '确定',
|
||||
cancelText: '取消',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
// 删除数组
|
||||
const index = this.currentTab; // 假设 currentTab 是您想要删除的餐项的索引
|
||||
if (index !== undefined && index >= 0 && index < this.menu_list.length) {
|
||||
this.menu_list.splice(index, 1);
|
||||
}
|
||||
useModal().showModal('success', {
|
||||
title: '删除提示',
|
||||
content: '确定删除' + this.menu_name + '吗?',
|
||||
showCancel: true,
|
||||
confirmText: '确定',
|
||||
cancelText: '取消',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
// 删除数组
|
||||
const index = this.currentTab; // 假设 currentTab 是您想要删除的餐项的索引
|
||||
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('用户点击取消');
|
||||
}
|
||||
},
|
||||
});
|
||||
// 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('用户点击取消');
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
@ -266,7 +379,7 @@ export default defineComponent({
|
||||
this.$nextTick(() => {
|
||||
this.handleClickCategory(this.currentTab)
|
||||
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) {
|
||||
this.menu_list[this.currentTab].is_set = 1;
|
||||
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.total_price = this.totalPrice;
|
||||
this.close();
|
||||
|
||||
}
|
||||
@ -297,10 +410,13 @@ export default defineComponent({
|
||||
//提交订单
|
||||
handleConfirm () {
|
||||
// console.log(value)
|
||||
var id = 1;
|
||||
uni.navigateTo({
|
||||
url: `/pages/banquet/combo/detail?id=${id}`
|
||||
});
|
||||
|
||||
console.log(this.set_num);
|
||||
|
||||
// var id = 1;
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/banquet/combo/detail?id=${id}`
|
||||
// });
|
||||
},
|
||||
|
||||
|
||||
@ -328,30 +444,74 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
handleTimeConfirm (res) {
|
||||
console.log(res.value)
|
||||
this.orderInfo.time = res.value
|
||||
// console.log(res.value)
|
||||
this.orderInfo.date = res.value
|
||||
|
||||
},
|
||||
|
||||
//分类切换
|
||||
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) {
|
||||
this.childrenIndex = index;
|
||||
this.search.category_id = this.tabList[index].id;
|
||||
// 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 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 () {
|
||||
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) {
|
||||
this.categoryList = res.data;
|
||||
this.handleClickCategory(0)
|
||||
// this.categoryList = res.data;
|
||||
this.tabList = res.data;
|
||||
this.search.category_id = this.tabList[0].id;
|
||||
this.getCartCheck() // 检查购物车
|
||||
} else {
|
||||
uni.$u.toast(res.msg);
|
||||
}
|
||||
@ -364,9 +524,11 @@ export default defineComponent({
|
||||
},
|
||||
//列表分页
|
||||
changeSP (pageNo: number) {
|
||||
this.search.category_id = this.tabList[this.childrenIndex] ? this.tabList[this.childrenIndex].id : 0;
|
||||
// console.log(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) {
|
||||
// this.matchedItems_sp = res.data;
|
||||
this.$refs.pagingRefSP?.complete(res.data);
|
||||
@ -386,18 +548,66 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
//加入购物车
|
||||
addCart (id) {
|
||||
CommonApi.commonPost('/api/cart/add', {
|
||||
buy_now: false,
|
||||
dishes_id: id,
|
||||
addCart (e) {
|
||||
console.log(e);
|
||||
CommonApi.commonPost('/api/banquet/cart/add', {
|
||||
server_user_id: this.search.server_user_id,
|
||||
index: this.currentTab,
|
||||
dishes_id: e.id,
|
||||
number: e.cart_count,
|
||||
}).catch((res) => {
|
||||
if (res.code === 1) {
|
||||
uni.$u.toast('加入购物车成功');
|
||||
//等于0 删除商品
|
||||
if (e.cart_count === 0) {
|
||||
this.delCart(e.cart_id)
|
||||
}
|
||||
this.getCategoryList() // 更新购物车
|
||||
this.searchSP() // 更新列表
|
||||
} else {
|
||||
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;
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
|
@ -1,9 +1,5 @@
|
||||
<template>
|
||||
<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"
|
||||
bgColor="#FFFFFFFF" titleWidth="600rpx" height="80rpx" leftIconSize="40rpx" leftIconColor="#303133"
|
||||
:safeAreaInsetTop="true" :placeholder="true" :fixed="true">
|
||||
@ -14,12 +10,12 @@
|
||||
<view class="">
|
||||
<u-cell :border="false">
|
||||
<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" />
|
||||
</template>
|
||||
<template #title>
|
||||
<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"
|
||||
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
|
||||
</up-text>
|
||||
@ -28,32 +24,24 @@
|
||||
</template>
|
||||
<template #label>
|
||||
<view class="h-50 flex color-gray">
|
||||
<wd-tag custom-class="space">家常菜</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> -->
|
||||
<wd-tag custom-class="space">{{ matchedItems_sc.district_name }}</wd-tag>
|
||||
|
||||
</view>
|
||||
<view class="h-50 flex color-gray">
|
||||
<up-text size="" :text="`${matchedItems_sc.intro}最大承载人数:6000人`" :flex1="true" align="left"
|
||||
wordWrap="normal" :show="true" prefixIcon="" customStyle="font-size:24rpx"
|
||||
<up-text size="" :text="`联系电话:${matchedItems_sc.phone}`" :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">
|
||||
</up-text>
|
||||
<!-- <u-icon slot="right" label-color="red" :label="`X30`"></u-icon> -->
|
||||
</view>
|
||||
<view class="h-50 flex color-gray">
|
||||
<up-text size="" :text="`${matchedItems_sc.intro}四川省泸州市龙马潭区`" :flex1="true" align="left"
|
||||
wordWrap="normal" :show="true" prefixIcon="" customStyle="font-size:24rpx"
|
||||
<up-text size="" :text="`${matchedItems_sc.district_name}${matchedItems_sc.street_name}`" :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">
|
||||
</up-text>
|
||||
<!-- <u-icon slot="right" label-color="red" :label="`X30`"></u-icon> -->
|
||||
</view>
|
||||
<wd-button size="small" @click="addCart(1)" >下单预定</wd-button>
|
||||
<wd-button size="small" @click="addCart(matchedItems_sc.id)">下单预定</wd-button>
|
||||
</template>
|
||||
</u-cell>
|
||||
</view>
|
||||
@ -62,14 +50,13 @@
|
||||
|
||||
</wd-card>
|
||||
|
||||
|
||||
|
||||
<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 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>
|
||||
|
||||
<view class="flex box-border flex-sub-cart" v-if="is_add">
|
||||
@ -97,10 +84,10 @@ export default defineComponent({
|
||||
id: 0,
|
||||
},
|
||||
is_add: 0, //是否显示购物车
|
||||
time_value:[],
|
||||
time_value: [],
|
||||
min_data: new Date().getTime(),
|
||||
max_data: this.calculateMaxDate(),
|
||||
isDisabledDate: [1754755200000, 1754755200000],
|
||||
isDisabledDate: [],
|
||||
matchedItems_sc: [],
|
||||
matchedItems_sp: [],
|
||||
imageList: [],
|
||||
@ -110,15 +97,15 @@ export default defineComponent({
|
||||
// console.log(option);
|
||||
this.search.id = option.id;
|
||||
this.is_add = option.is_add | 0;
|
||||
this.getCategoryList()
|
||||
this.changeSP()
|
||||
this.getChefDetail()
|
||||
// this.changeSP()
|
||||
},
|
||||
created () {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 最多显示下个月档期
|
||||
calculateMaxDate() {
|
||||
calculateMaxDate () {
|
||||
const currentDate = new Date();
|
||||
const futureDate = new Date(currentDate.setMonth(currentDate.getMonth() + 1));
|
||||
return futureDate.getTime();
|
||||
@ -146,42 +133,48 @@ export default defineComponent({
|
||||
}
|
||||
return day
|
||||
},
|
||||
getCategoryList () {
|
||||
CommonApi.commonGet('/api/dishes/detail', this.search).catch((res) => {
|
||||
handleChange () {
|
||||
},
|
||||
getChefDetail () {
|
||||
CommonApi.commonGet('/api/banquet/chef/detail', this.search).catch((res) => {
|
||||
if (res.code === 1) {
|
||||
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 ? [{
|
||||
url: res.data.image,
|
||||
title: res.data.name,
|
||||
poster: res.data.image
|
||||
this.imageList = res.data.certification.video ? [{
|
||||
url: res.data.certification.video,
|
||||
title: res.data.certification.public_name,
|
||||
poster: res.data.certification.public_image
|
||||
}] : [];
|
||||
} else {
|
||||
uni.$u.toast(res.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
//列表分页
|
||||
changeSP () {
|
||||
// console.log(pageNo);
|
||||
// this.search.page = pageNo;
|
||||
CommonApi.commonGet('/api/dishes/dishes', this.search).catch((res) => {
|
||||
if (res.code === 1) {
|
||||
this.matchedItems_sp = res.data;
|
||||
// this.$refs.pagingRefSP?.complete(res.data);
|
||||
} else {
|
||||
uni.$u.toast(res.msg);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
// //列表分页
|
||||
// changeSP () {
|
||||
// // console.log(pageNo);
|
||||
// // this.search.page = pageNo;
|
||||
// CommonApi.commonGet('/api/dishes/dishes', this.search).catch((res) => {
|
||||
// if (res.code === 1) {
|
||||
// this.matchedItems_sp = res.data;
|
||||
// // this.$refs.pagingRefSP?.complete(res.data);
|
||||
// } else {
|
||||
// uni.$u.toast(res.msg);
|
||||
// }
|
||||
// });
|
||||
|
||||
// },
|
||||
//加入购物车
|
||||
addCart (id) {
|
||||
|
||||
uni.navigateTo({
|
||||
url: `/pages/banquet/combo/index??id=${id}`
|
||||
});
|
||||
url: `/pages/banquet/combo/index??id=${id}`
|
||||
});
|
||||
// CommonApi.commonPost('/api/cart/add', {
|
||||
// buy_now: false,
|
||||
// dishes_id: this.search.id,
|
||||
|
@ -19,12 +19,12 @@
|
||||
<view class="detail-box" v-for="(item, index) in matchedItems_sp" :key="index">
|
||||
<u-cell :border="false" @click="goodsDetail(item.id)">
|
||||
<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" />
|
||||
</template>
|
||||
<template #title>
|
||||
<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"
|
||||
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
|
||||
</up-text>
|
||||
@ -33,26 +33,21 @@
|
||||
</template>
|
||||
<template #label>
|
||||
<view class="h-50 flex color-gray">
|
||||
<wd-tag custom-class="space">家常菜</wd-tag>
|
||||
<wd-tag custom-class="space" type="primary">川菜</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="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="`${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> -->
|
||||
<wd-tag custom-class="space" type="success">特色菜</wd-tag> -->
|
||||
</view>
|
||||
<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"
|
||||
iconStyle="font-size:24rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
|
||||
</up-text>
|
||||
<!-- <u-icon slot="right" label-color="red" :label="`X30`"></u-icon> -->
|
||||
</view>
|
||||
<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"
|
||||
iconStyle="font-size:24rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
|
||||
</up-text>
|
||||
@ -85,7 +80,7 @@ export default defineComponent({
|
||||
data () {
|
||||
return {
|
||||
search: {
|
||||
category_id: '',
|
||||
// category_id: '',
|
||||
keyword: '',
|
||||
page: 1,
|
||||
limit: 10,
|
||||
@ -233,7 +228,7 @@ export default defineComponent({
|
||||
changeSP (pageNo: number) {
|
||||
// console.log(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) {
|
||||
// this.matchedItems_sp = res.data;
|
||||
this.$refs.pagingRefSP?.complete(res.data);
|
||||
|
@ -180,16 +180,6 @@ export default defineComponent({
|
||||
day.disabled = true; // 禁用日期
|
||||
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
|
||||
},
|
||||
|
||||
@ -233,7 +223,7 @@ export default defineComponent({
|
||||
changeSP (pageNo: number) {
|
||||
// console.log(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) {
|
||||
// this.matchedItems_sp = res.data;
|
||||
this.$refs.pagingRefSP?.complete(res.data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user