套餐详情

This commit is contained in:
sjeam 2025-08-14 14:43:04 +08:00
parent 8ad7ee78ce
commit b7e21304b3
2 changed files with 148 additions and 75 deletions

View File

@ -1,32 +1,35 @@
<style> <style>
.img { .img {
width: 100%; width: 100%;
height: 420rpx; height: 420rpx;
} }
</style> </style>
<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" <up-navbar class="" style="" :autoBack="true" bgColor="#00000000" :fixed="true" titleColor="#595757FF"
leftIconColor="#FFFFFFFF"> leftIconColor="#FFFFFFFF">
</up-navbar> </up-navbar>
<up-swiper v-if="imageList" height="420rpx" :list="imageList" indicator indicatorMode="dot" circular keyName="url" :autoplay="false"></up-swiper> <up-swiper v-if="imageList" height="420rpx" :list="imageList" indicator indicatorMode="dot" circular
keyName="url" :autoplay="false"></up-swiper>
<wd-card type="rectangle"> <wd-card type="rectangle">
<view class="font-size-32 font-bold"> <view class="font-size-32 font-bold">
<wd-text :text="matchedItems_sc.price" mode="price" type="error" prefix="¥" /> <wd-text :text="matchedItems_sc.price" mode="price" type="error" prefix="¥" />
<wd-text size="24rpx" :text="matchedItems_sc.line_price" mode="price" decoration="line-through" prefix="¥" /> <wd-text size="24rpx" :text="matchedItems_sc.line_price" mode="price" decoration="line-through"
prefix="¥" />
</view> </view>
<view class="pt-2 color-black "> {{matchedItems_sc.name}} <wd-tag custom-class="space" type="primary">{{matchedItems_sc.tag_name}}</wd-tag></view> <view class="pt-2 color-black "> {{ matchedItems_sc.name }} <wd-tag custom-class="space" type="primary">{{
matchedItems_sc.tag_name }}</wd-tag></view>
<view class="pt-2 color-coolgray font-size-24"> <view class="pt-2 color-coolgray font-size-24">
销量{{matchedItems_sc.sales}} 销量{{ matchedItems_sc.sales }}
</view> </view>
</wd-card> </wd-card>
<wd-card type="rectangle"> <wd-card type="rectangle">
<view class="color-black font-size-28 text-center"> <view class="color-black font-size-28 text-center">
菜品介绍 套餐介绍
</view> </view>
<view class="color-coolgray font-size-24"> <view class="color-coolgray font-size-24">
{{matchedItems_sc.intro}} {{ matchedItems_sc.intro }}
</view> </view>
</wd-card> </wd-card>
@ -35,39 +38,86 @@
<view class="color-black font-size-28 text-center"> <view class="color-black font-size-28 text-center">
菜品展示 菜品展示
</view> </view>
<wd-grid :column="1"> <!-- <wd-grid :column="1">
<view v-for="(item, index) in imageList"> <view v-for="(item, index) in imageList">
<wd-grid-item use-slot> <wd-grid-item use-slot>
<image class="img" :src="item.url" /> <image class="img" :src="item.url" />
</wd-grid-item> </wd-grid-item>
</view> </view>
</wd-grid> </wd-grid> -->
<up-cell-group :border="false">
<view class="detail-box" v-for="(item, index) in matchedItems_sp" :key="index">
<u-cell :border="false" @click="dishesDetail(item)">
<template #icon>
<wd-img :width="100" :height="100" :src="item.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.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>
<!-- <u-icon slot="right" label-color="red" :label="`¥2000.00元`"></u-icon> -->
</view>
</template>
<template #label>
<view class="h-50 flex color-gray">
<up-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">
</up-text>
<!-- <u-icon slot="right" label-color="red" :label="`X30`"></u-icon> -->
</view>
<view class="h-50 flex color-gray">
<wd-text text="16354.156" mode="price" type="error" prefix="¥" />
</view>
<view class="h-20 flex color-gray">
<wd-text size="24rpx" text="16354.156" mode="price" decoration="line-through"
prefix="¥" />
<view style="margin-top: -20rpx;">
<wd-button size="small" @click.stop="dishesDetail(item)">查看详情</wd-button>
</view>
</view>
</template>
</u-cell>
</view>
</up-cell-group>
</wd-card> </wd-card>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import { import {
defineComponent defineComponent
} from "vue"; } from "vue";
import { import {
CommonApi, CommonApi,
UserApi UserApi
} from "@/api"; } from "@/api";
import { import {
setToken, setToken,
getToken, getToken,
isLogin isLogin
} from '@/utils/auth'; } from '@/utils/auth';
import { import {
image image
} from "@/uni_modules/uview-plus/libs/function/test"; } from "@/uni_modules/uview-plus/libs/function/test";
import { import {
url url
} from "inspector"; } from "inspector";
export default defineComponent({ export default defineComponent({
data() { data () {
return { return {
search: { search: {
id: 0, id: 0,
@ -75,23 +125,47 @@
is_add: 0, // is_add: 0, //
matchedItems_sc: [], matchedItems_sc: [],
imageList: [], imageList: [],
matchedItems_sp: [],
}; };
}, },
onLoad(option) { onLoad (option) {
// 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.getCategoryList()
}, },
created() { created () {
}, },
methods: { methods: {
getCategoryList() { //
dishesDetail (item) {
// console.log(item);
uni.navigateTo({
url: `/pages/banquet/combo/dishes?id=${item.id}&is_add=1`
});
},
//
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);
}
});
},
getCategoryList () {
CommonApi.commonGet('/api/banquet/dishes/detail', this.search).catch((res) => { CommonApi.commonGet('/api/banquet/dishes/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.tag_name = res.data.dishesCategory.name; this.matchedItems_sc.tag_name = res.data.dishesCategory.name;
this.changeSP()
// console.log(res.data.images) // console.log(res.data.images)
res.data.images.forEach(item => { res.data.images.forEach(item => {
this.imageList.push({ this.imageList.push({
@ -110,5 +184,5 @@
}, },
}); });
</script> </script>

View File

@ -81,7 +81,7 @@ body {
class="fv-page flex-col"> class="fv-page flex-col">
<view v-for="(item, index) in matchedItems_sp" :key="index"> <view v-for="(item, index) in matchedItems_sp" :key="index">
<up-cell :border='false' @click="goodsDetail(item)"> <up-cell :border='false' @click="dishesDetail(item)">
<template #icon> <template #icon>
<up-image :src="item.image" width="140rpx" height="140rpx"></up-image> <up-image :src="item.image" width="140rpx" height="140rpx"></up-image>
</template> </template>
@ -530,10 +530,9 @@ export default defineComponent({
}, },
// //
goodsDetail (item) { dishesDetail (item) {
console.log(item); console.log(item);
if (item.type === 1) { if (item.type === 1) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/banquet/combo/dishes?id=${item.id}&is_add=1` url: `/pages/banquet/combo/dishes?id=${item.id}&is_add=1`
}); });