parent
77ced33f14
commit
c5b11daed3
@ -10,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.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" />
|
: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.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"
|
: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>
|
||||||
@ -72,114 +72,126 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from "vue";
|
import {
|
||||||
import { CommonApi, UserApi } from "@/api";
|
defineComponent
|
||||||
import { setToken, getToken, isLogin } from '@/utils/auth';
|
} from "vue";
|
||||||
import { image } from "@/uni_modules/uview-plus/libs/function/test";
|
import {
|
||||||
import { url } from "inspector";
|
CommonApi,
|
||||||
export default defineComponent({
|
UserApi
|
||||||
data () {
|
} from "@/api";
|
||||||
return {
|
import {
|
||||||
search: {
|
setToken,
|
||||||
id: 0,
|
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 () {
|
|
||||||
|
|
||||||
},
|
formatter(day) {
|
||||||
methods: {
|
const date = new Date(day.date)
|
||||||
// 最多显示下个月档期
|
const now = new Date()
|
||||||
calculateMaxDate () {
|
const year = date.getFullYear()
|
||||||
const currentDate = new Date();
|
const month = date.getMonth()
|
||||||
const futureDate = new Date(currentDate.setMonth(currentDate.getMonth() + 1));
|
const da = date.getDate()
|
||||||
return futureDate.getTime();
|
const nowYear = now.getFullYear()
|
||||||
},
|
const nowMonth = now.getMonth()
|
||||||
|
const nowDa = now.getDate()
|
||||||
|
|
||||||
formatter (day) {
|
if (year === nowYear && month === nowMonth && da === nowDa) {
|
||||||
const date = new Date(day.date)
|
day.topInfo = '今天'
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
});
|
// 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>
|
</script>
|
@ -44,7 +44,7 @@
|
|||||||
<view class="p-[20rpx]">
|
<view class="p-[20rpx]">
|
||||||
<view class="u-flex my-[20rpx]" v-for="(item, index) in dishesList" :key="index" @click="gotoDishesDetai(item.id)">
|
<view class="u-flex my-[20rpx]" v-for="(item, index) in dishesList" :key="index" @click="gotoDishesDetai(item.id)">
|
||||||
<view class="">
|
<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" />
|
custom-class="margin-right-24" />
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
@ -61,7 +61,7 @@
|
|||||||
<view class="h-50 u-flex color-gray">
|
<view class="h-50 u-flex color-gray">
|
||||||
<wd-text :text="item.price" mode="price" type="error" prefix="¥" />
|
<wd-text :text="item.price" mode="price" type="error" prefix="¥" />
|
||||||
</view>
|
</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="¥" />
|
<wd-text size="24rpx" :text="item.line_price" mode="price" decoration="line-through" prefix="¥" />
|
||||||
<view style="margin-top: -20rpx;">
|
<view style="margin-top: -20rpx;">
|
||||||
<wd-button size="small" @click="addCart(item.id)" @click.stop>下单预定</wd-button>
|
<wd-button size="small" @click="addCart(item.id)" @click.stop>下单预定</wd-button>
|
||||||
|
@ -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="cookDetail(item.id)">
|
<u-cell :border="false" @click="cookDetail(item.id)">
|
||||||
<template #icon>
|
<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" />
|
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.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"
|
: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>
|
||||||
|
@ -3,12 +3,14 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 120px;
|
height: 120px;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
|
border: 1px solid #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wd-grid-item-img-cook {
|
.wd-grid-item-img-cook {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 160px;
|
height: 160px;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
|
border: 1px solid #eee;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<template>
|
<template>
|
||||||
@ -18,7 +20,7 @@
|
|||||||
:placeholder="true" :fixed="true"></up-navbar>
|
:placeholder="true" :fixed="true"></up-navbar>
|
||||||
<view style="padding:0px 20rpx"> <u-swiper radius="20rpx" height="420rpx" :list="swiperList" indicator
|
<view style="padding:0px 20rpx"> <u-swiper radius="20rpx" height="420rpx" :list="swiperList" indicator
|
||||||
indicatorMode="dot" circular @click="handleClick"></u-swiper></view>
|
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">
|
<wd-grid-item use-slot @click="goTabCook">
|
||||||
<image class="wd-grid-item-img"
|
<image class="wd-grid-item-img"
|
||||||
src="https://lihaiim.oss-cn-chengdu.aliyuncs.com/public/uploads/images/20250813/20250813165502085532573.png" />
|
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" >
|
<view v-for="(item, index) in matchedItems_sp" :key="index" >
|
||||||
<wd-grid-item use-slot :url="`/pages/banquet/cook/detail?id=${item.id}`">
|
<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 }`" />
|
<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>
|
</wd-grid-item>
|
||||||
</view>
|
</view>
|
||||||
</wd-grid>
|
</wd-grid>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user