宴席2.0
Some checks are pending
deploy / deploy (push) Waiting to run

This commit is contained in:
sjeam 2025-08-15 15:38:47 +08:00
parent 77ced33f14
commit c5b11daed3
4 changed files with 127 additions and 113 deletions

View File

@ -10,12 +10,12 @@
<view class="">
<u-cell :border="false">
<template #icon>
<wd-img :width="120" :height="120" :src="matchedItems_sc.avatar" :enable-preview="false" :radius="8"
<wd-img :width="120" :height="120" :src="matchedItems_sc.public_image" :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.nickname}`" :flex1="true" align="left" wordWrap="normal"
<up-text size="32rpx" :text="`${matchedItems_sc.public_name}`" :flex1="true" align="left" wordWrap="normal"
:show="true" prefixIcon="" customStyle="font-weight:bold"
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
</up-text>
@ -72,114 +72,126 @@
</template>
<script lang="ts">
import { defineComponent } from "vue";
import { CommonApi, UserApi } from "@/api";
import { setToken, getToken, isLogin } from '@/utils/auth';
import { image } from "@/uni_modules/uview-plus/libs/function/test";
import { url } from "inspector";
export default defineComponent({
data () {
return {
search: {
id: 0,
import {
defineComponent
} from "vue";
import {
CommonApi,
UserApi
} from "@/api";
import {
setToken,
getToken,
isLogin
} from '@/utils/auth';
import {
image
} from "@/uni_modules/uview-plus/libs/function/test";
import {
url
} from "inspector";
export default defineComponent({
data() {
return {
search: {
id: 0,
},
is_add: 0, //
time_value: [],
min_data: new Date().getTime(),
max_data: this.calculateMaxDate(),
isDisabledDate: [],
matchedItems_sc: [],
matchedItems_sp: [],
imageList: [],
};
},
onLoad(option) {
// console.log(option);
this.search.id = option.id;
this.is_add = option.is_add | 0;
this.getChefDetail()
// this.changeSP()
},
created() {
},
methods: {
//
calculateMaxDate() {
const currentDate = new Date();
const futureDate = new Date(currentDate.setMonth(currentDate.getMonth() + 1));
return futureDate.getTime();
},
is_add: 0, //
time_value: [],
min_data: new Date().getTime(),
max_data: this.calculateMaxDate(),
isDisabledDate: [],
matchedItems_sc: [],
matchedItems_sp: [],
imageList: [],
};
},
onLoad (option) {
// console.log(option);
this.search.id = option.id;
this.is_add = option.is_add | 0;
this.getChefDetail()
// this.changeSP()
},
created () {
},
methods: {
//
calculateMaxDate () {
const currentDate = new Date();
const futureDate = new Date(currentDate.setMonth(currentDate.getMonth() + 1));
return futureDate.getTime();
},
formatter(day) {
const date = new Date(day.date)
const now = new Date()
const year = date.getFullYear()
const month = date.getMonth()
const da = date.getDate()
const nowYear = now.getFullYear()
const nowMonth = now.getMonth()
const nowDa = now.getDate()
formatter (day) {
const date = new Date(day.date)
const now = new Date()
const year = date.getFullYear()
const month = date.getMonth()
const da = date.getDate()
const nowYear = now.getFullYear()
const nowMonth = now.getMonth()
const nowDa = now.getDate()
if (year === nowYear && month === nowMonth && da === nowDa) {
day.topInfo = '今天'
}
// const disabledDates = ['2025-08-05', '2023-08-15'];
// const formattedDate = `${year}-${month}-${da}`;
if (this.isDisabledDate.includes(day.date)) {
day.topInfo = '已预定';
day.disabled = true; //
day.disabled_class = 'disabled-date'; //
}
return day
},
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.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);
if (year === nowYear && month === nowMonth && da === nowDa) {
day.topInfo = '今天'
}
});
// const disabledDates = ['2025-08-05', '2023-08-15'];
// const formattedDate = `${year}-${month}-${da}`;
if (this.isDisabledDate.includes(day.date)) {
day.topInfo = '已预定';
day.disabled = true; //
day.disabled_class = 'disabled-date'; //
}
return day
},
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.matchedItems_sc.public_name = this.matchedItems_sc.certification.public_name
this.matchedItems_sc.public_image = this.matchedItems_sc.certification.public_image
//
this.isDisabledDate = this.matchedItems_sc.calendar;
this.time_value = [0]
//
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);
}
});
},
//
addCart(id) {
uni.navigateTo({
url: `/pages/banquet/combo/index?id=${id}`
});
// CommonApi.commonPost('/api/cart/add', {
// buy_now: false,
// dishes_id: this.search.id,
// }).catch((res) => {
// if (res.code === 1) {
// uni.$u.toast('');
// uni.navigateTo({
// url: '/pages/cart/index'
// });
// } else {
// uni.$u.toast(res.msg);
// }
// });
}
},
//
addCart (id) {
uni.navigateTo({
url: `/pages/banquet/combo/index?id=${id}`
});
// CommonApi.commonPost('/api/cart/add', {
// buy_now: false,
// dishes_id: this.search.id,
// }).catch((res) => {
// if (res.code === 1) {
// uni.$u.toast('');
// uni.navigateTo({
// url: '/pages/cart/index'
// });
// } else {
// uni.$u.toast(res.msg);
// }
// });
}
},
});
});
</script>

View File

@ -44,7 +44,7 @@
<view class="p-[20rpx]">
<view class="u-flex my-[20rpx]" v-for="(item, index) in dishesList" :key="index" @click="gotoDishesDetai(item.id)">
<view class="">
<wd-img width="270rpx" height="270rpx" :src="item.images[0]" :enable-preview="false" :radius="8" :round=false
<wd-img width="200rpx" height="200rpx" :src="item.images[0]" :enable-preview="false" :radius="8" :round=false
custom-class="margin-right-24" />
</view>
<view class="">
@ -61,7 +61,7 @@
<view class="h-50 u-flex color-gray">
<wd-text :text="item.price" mode="price" type="error" prefix="¥" />
</view>
<view class="h-20 u-flex color-gray">
<view class="h-20 u-flex flex color-gray">
<wd-text size="24rpx" :text="item.line_price" mode="price" decoration="line-through" prefix="¥" />
<view style="margin-top: -20rpx;">
<wd-button size="small" @click="addCart(item.id)" @click.stop>下单预定</wd-button>

View File

@ -19,12 +19,12 @@
<view class="detail-box" v-for="(item, index) in matchedItems_sp" :key="index">
<u-cell :border="false" @click="cookDetail(item.id)">
<template #icon>
<wd-img :width="100" :height="100" :src="item.avatar" :enable-preview="false" :radius="8" :round=false
<wd-img :width="100" :height="100" :src="item.certification.public_image" :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.nickname}`" :flex1="true" align="left" wordWrap="normal"
<up-text size="32rpx" :text="`${item.certification.public_name}`" :flex1="true" align="left" wordWrap="normal"
:show="true" prefixIcon="" customStyle="font-weight:bold"
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
</up-text>

View File

@ -3,12 +3,14 @@
width: 100%;
height: 120px;
border-radius: 20rpx;
border: 1px solid #eee;
}
.wd-grid-item-img-cook {
width: 100%;
height: 160px;
border-radius: 20rpx;
border: 1px solid #eee;
}
</style>
<template>
@ -18,7 +20,7 @@
:placeholder="true" :fixed="true"></up-navbar>
<view style="padding:0px 20rpx"> <u-swiper radius="20rpx" height="420rpx" :list="swiperList" indicator
indicatorMode="dot" circular @click="handleClick"></u-swiper></view>
<wd-grid :gutter="10" :column="2" clickable>
<wd-grid :gutter="10" :column="2" clickable bg-color="#fbfbfb" >
<wd-grid-item use-slot @click="goTabCook">
<image class="wd-grid-item-img"
src="https://lihaiim.oss-cn-chengdu.aliyuncs.com/public/uploads/images/20250813/20250813165502085532573.png" />
@ -32,7 +34,7 @@
<view v-for="(item, index) in matchedItems_sp" :key="index" >
<wd-grid-item use-slot :url="`/pages/banquet/cook/detail?id=${item.id}`">
<image class="wd-grid-item-img-cook" :src="`${item.certification.public_image ? item.certification.public_image : item.avatar }`" />
<view class="text font-bold">{{item.certification.public_name}}</view>
<view class="text font-bold p-2 font-size-28">{{item.certification.public_name}}</view>
</wd-grid-item>
</view>
</wd-grid>