Merge branch 'main' of https://gitea.lihaink.cn/sjeam/caipu_uni
Some checks are pending
deploy / deploy (push) Waiting to run
Some checks are pending
deploy / deploy (push) Waiting to run
This commit is contained in:
commit
ac67fd6430
@ -22,3 +22,11 @@ export const logout = () => post<CommonRes>('/api/logout');
|
|||||||
|
|
||||||
export const goodsMenu = () => get<CommonRes>('/api/config');
|
export const goodsMenu = () => get<CommonRes>('/api/config');
|
||||||
// export const goodsMenu = (data:any) => get<CommonRes>('/api/config', { data, custom: { toast: false } });
|
// export const goodsMenu = (data:any) => get<CommonRes>('/api/config', { data, custom: { toast: false } });
|
||||||
|
|
||||||
|
export const hotelListApi = (data: any) => get('/api/banquet/hotel/list', { data, custom: { toast: false } });
|
||||||
|
|
||||||
|
export const hotelDetailApi = (data: any) => get('/api/banquet/hotel/detail', { data, custom: { toast: false } });
|
||||||
|
|
||||||
|
export const hotelScheduleApi = (data: any) => get('/api/banquet/hotel/schedule', { data, custom: { toast: false } });
|
||||||
|
|
||||||
|
export const dishesListApi = (data: any) => get('/api/banquet/dishes/list', { data, custom: { toast: false } });
|
||||||
|
@ -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,126 +10,72 @@
|
|||||||
<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="hotel.certification?.public_image" :enable-preview="false"
|
||||||
:round=false custom-class="margin-right-24" />
|
:radius="8" :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="`${hotel.certification?.public_name}`" :flex1="true" align="left"
|
||||||
:show="true" prefixIcon="" customStyle="font-weight:bold"
|
wordWrap="normal" :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>
|
||||||
<!-- <u-icon slot="right" label-color="red" :label="`¥2000.00元`"></u-icon> -->
|
|
||||||
</view>
|
</view>
|
||||||
</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>
|
<up-text size="" :text="`${hotel.certification?.address}`" :flex1="true" align="left" wordWrap="normal"
|
||||||
<wd-tag custom-class="space" type="primary">川菜</wd-tag>
|
:show="true" prefixIcon="" customStyle="font-size:24rpx"
|
||||||
<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 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"
|
|
||||||
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> -->
|
|
||||||
</view>
|
</view>
|
||||||
<view class="h-50 flex color-gray">
|
<wd-button size="small" @click="gotoDishesList(hotel.id)">下单预定</wd-button>
|
||||||
<up-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">
|
|
||||||
</up-text>
|
|
||||||
<!-- <u-icon slot="right" label-color="red" :label="`X30`"></u-icon> -->
|
|
||||||
</view>
|
|
||||||
<wd-button size="small" @click="addCart(1)">下单预定</wd-button>
|
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</view>
|
</view>
|
||||||
</up-cell-group>
|
</up-cell-group>
|
||||||
|
|
||||||
|
|
||||||
</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="320rpx" :list="imageList" keyName="url" :autoplay="false"></up-swiper>
|
||||||
</wd-card>
|
</wd-card>
|
||||||
|
|
||||||
<wd-card title="推荐酒席套餐" type="rectangle">
|
<wd-card title="推荐酒席套餐" type="rectangle">
|
||||||
<up-cell-group :border="false">
|
<up-cell-group :border="false">
|
||||||
<view class="detail-box" v-for="(item, index) in matchedItems_sp" :key="index">
|
<view class="detail-box" v-for="(item, index) in dishesList" :key="index">
|
||||||
<u-cell :border="false" @click="goodsDetail(item.id)">
|
<u-cell :border="false" @click="gotoDishesDetai(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.images[0]" :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.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>
|
||||||
<!-- <u-icon slot="right" label-color="red" :label="`¥2000.00元`"></u-icon> -->
|
|
||||||
</view>
|
</view>
|
||||||
</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>
|
<up-text size="" :text="`${item.intro}`" :flex1="true" align="left" wordWrap="normal"
|
||||||
<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>
|
|
||||||
</view>
|
|
||||||
<view class="h-50 flex color-gray">
|
|
||||||
<up-text size="" :text="`最大承载人数:6000人${item.intro}`" :flex1="true" align="left" 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> -->
|
|
||||||
</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" wordWrap="normal"
|
<wd-text :text="item.price" mode="price" type="error" prefix="¥" />
|
||||||
: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>
|
||||||
<view class="h-20 flex color-gray">
|
<view class="h-20 flex color-gray">
|
||||||
<wd-text size="24rpx" text="16354.156" 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(1)">下单预定</wd-button>
|
<wd-button size="small" @click="addCart(1)">下单预定</wd-button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</view>
|
</view>
|
||||||
</up-cell-group>
|
</up-cell-group>
|
||||||
</wd-card>
|
</wd-card>
|
||||||
|
|
||||||
<view class="flex box-border flex-sub-cart" v-if="is_add">
|
|
||||||
<view style="margin: 20rpx;">
|
|
||||||
<!-- <u-text class=""
|
|
||||||
custom-style="width: calc(100vw - 120rpx);text-align:center;display: flex; justify-content: center; align-items: center;height: 70rpx;border: 2px solid #59cb56;border-radius: 40rpx;background-color: #5acb5617;margin: 0rpx 20rpx!important;"
|
|
||||||
color="#59CB56" size="26rpx" :text="'加入食谱清单'" :flex1="true" align="center" wordWrap="normal" :show="true"
|
|
||||||
iconStyle="26rpx" decoration="none">
|
|
||||||
</u-text> -->
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -146,99 +88,58 @@ import { url } from "inspector";
|
|||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
search: {
|
|
||||||
id: 0,
|
id: 0,
|
||||||
},
|
|
||||||
is_add: 0, //是否显示购物车
|
is_add: 0, //是否显示购物车
|
||||||
matchedItems_sc: [],
|
hotel: [],
|
||||||
matchedItems_sp: [],
|
|
||||||
imageList: [],
|
imageList: [],
|
||||||
|
dishesList: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
// console.log(option);
|
// console.log(option);
|
||||||
this.search.id = option.id;
|
this.id = option.id;
|
||||||
this.is_add = option.is_add | 0;
|
this.is_add = option.is_add | 0;
|
||||||
this.getCategoryList()
|
this.getHotelDetail()
|
||||||
this.changeSP()
|
this.getDishesList()
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getCategoryList () {
|
gotoDishesList(id : number) {
|
||||||
CommonApi.commonGet('/api/dishes/detail', this.search).catch((res) => {
|
uni.navigateTo({
|
||||||
|
url: `/pages/banquet/hotel/detail?id=${id}&is_add=1`
|
||||||
|
});
|
||||||
|
},
|
||||||
|
gotoDishesDetai(id) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/banquet/hotel/detail?id=${id}&is_add=1`
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getHotelDetail() {
|
||||||
|
UserApi.hotelDetailApi({ id: this.id }).catch((res) => {
|
||||||
if (res.code === 1) {
|
if (res.code === 1) {
|
||||||
this.matchedItems_sc = res.data;
|
this.hotel = res.data;
|
||||||
//轮播图是数组
|
//轮播图是数组
|
||||||
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: '展示视频',
|
||||||
poster: res.data.image
|
poster: res.data.certification.video
|
||||||
}] : [];
|
}] : [];
|
||||||
} else {
|
} else {
|
||||||
uni.$u.toast(res.msg);
|
uni.$u.toast(res.msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//列表分页
|
getDishesList() {
|
||||||
changeSP () {
|
UserApi.dishesListApi({ server_user_id: this.id, type: 2 }).catch((res) => {
|
||||||
// console.log(pageNo);
|
|
||||||
// this.search.page = pageNo;
|
|
||||||
CommonApi.commonGet('/api/dishes/dishes', this.search).catch((res) => {
|
|
||||||
if (res.code === 1) {
|
if (res.code === 1) {
|
||||||
this.matchedItems_sp = res.data;
|
this.dishesList = res.data
|
||||||
// this.$refs.pagingRefSP?.complete(res.data);
|
|
||||||
} else {
|
} else {
|
||||||
uni.$u.toast(res.msg);
|
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);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
// const imageList = reactive([
|
|
||||||
// {
|
|
||||||
// url: 'https://cdn.uviewui.com/uview/resources/video.mp4',
|
|
||||||
// title: '昨夜星辰昨夜风,画楼西畔桂堂东',
|
|
||||||
// poster: 'https://cdn.uviewui.com/uview/swiper/swiper1.png'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// url: 'https://s3.bmp.ovh/imgs/2024/12/16/35bc6d28ab1c8bc7.png',
|
|
||||||
// title: '身无彩凤双飞翼,心有灵犀一点通',
|
|
||||||
// // 注意:这里看起来有个错误,url 应该是一个视频或图片的URL,但这里却给了一个图片URL
|
|
||||||
// // 如果这是一个视频对象,你需要确保 url 是正确的视频文件URL
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// url: 'https://cdn.uviewui.com/uview/swiper/swiper3.png',
|
|
||||||
// title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳',
|
|
||||||
// // 同样,这里看起来 url 应该是一个视频或图片的URL,但给的是一个图片URL
|
|
||||||
// // 需要根据实际需求修正这个值
|
|
||||||
// },
|
|
||||||
// ]);
|
|
||||||
|
|
||||||
</script>
|
</script>
|
@ -7,257 +7,83 @@
|
|||||||
<up-search v-model="search.keyword" class="flex,flex-row p-1" style="" shape="round" bgColor="#f2f2f2"
|
<up-search v-model="search.keyword" class="flex,flex-row p-1" style="" shape="round" bgColor="#f2f2f2"
|
||||||
placeholder="请输入酒店名称或者区域" :clearabled="true" :showAction="false" inputAlign="left" borderColor="transparent"
|
placeholder="请输入酒店名称或者区域" :clearabled="true" :showAction="false" inputAlign="left" borderColor="transparent"
|
||||||
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="getHotelList(true)">
|
||||||
</up-search>
|
</up-search>
|
||||||
|
|
||||||
|
<view class="p-30rpx">
|
||||||
<z-paging ref="pagingRefSP" v-model="matchedItems_sp" @query="changeSP" :fixed="false" height="calc(100vh - 280rpx)"
|
<view v-if="hotelList.length == 0" class="">
|
||||||
width="calc(100vw)" style="right: 0; background-color: #FFFFFFFF; position: fixed;" class="fv-page flex-col">
|
<up-empty mode="list"></up-empty>
|
||||||
<wd-card type="rectangle">
|
|
||||||
|
|
||||||
<up-cell-group :border="false">
|
|
||||||
<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
|
|
||||||
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>
|
</view>
|
||||||
</template>
|
<view v-else class="detail-box u-flex" v-for="(item, index) in hotelList" :key="index" @click="goto(item.id)">
|
||||||
<template #label>
|
<view class="">
|
||||||
<view class="h-50 flex color-gray">
|
<wd-img :width="100" :height="100" :src="item.certification.public_image" :enable-preview="false" :radius="8"
|
||||||
<wd-tag custom-class="space">家常菜</wd-tag>
|
:round=false custom-class="margin-right-24" />
|
||||||
<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> -->
|
|
||||||
</view>
|
</view>
|
||||||
<view class="h-50 flex color-gray">
|
<view class="u-flex u-flex-column">
|
||||||
<up-text size="" :text="`${item.intro}最大承载人数:6000人`" :flex1="true" align="left"
|
<up-text size="32rpx" :text="`${item.certification.public_name}`" customStyle="font-weight:bold"></up-text>
|
||||||
wordWrap="normal" :show="true" prefixIcon="" customStyle="font-size:24rpx"
|
<up-text :text="`${item.certification.address}`" customStyle="font-size:24rpx"></up-text>
|
||||||
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>
|
||||||
<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>
|
||||||
</template>
|
|
||||||
</u-cell>
|
|
||||||
</view>
|
</view>
|
||||||
</up-cell-group>
|
|
||||||
|
|
||||||
</wd-card>
|
|
||||||
</z-paging>
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// useColPickerData可以参考本章节顶部的介绍
|
|
||||||
// 导入路径根据自己实际情况调整,万不可一贴了之
|
|
||||||
|
|
||||||
import { useColPickerData } from '@/hooks'
|
|
||||||
|
|
||||||
import { defineComponent } from "vue";
|
|
||||||
import { CommonApi, UserApi } from "@/api";
|
import { CommonApi, UserApi } from "@/api";
|
||||||
import { get } from 'http';
|
|
||||||
// import { setToken, getToken, isLogin } from '@/utils/auth';
|
|
||||||
const { colPickerData, findChildrenByCode } = useColPickerData()
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
search: {
|
search: {
|
||||||
category_id: '',
|
|
||||||
keyword: '',
|
keyword: '',
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
},
|
},
|
||||||
// area: useColPickerData().colPickerData.map((item) => {
|
|
||||||
// return {
|
|
||||||
// value: item.value,
|
|
||||||
// label: item.text
|
|
||||||
// }
|
|
||||||
// }),
|
|
||||||
area: [],
|
|
||||||
value: [],
|
value: [],
|
||||||
currentTab: 0, // tab索引
|
hotelList: [],
|
||||||
min_data: new Date().getTime(),
|
loadEnd: false
|
||||||
isDisabledDate: [1754755200000, 1754755200000],
|
|
||||||
time_list: [],
|
|
||||||
menu_list: [{ id: 0, name: '第一餐' }, { id: 1, name: '第二餐' }, { id: 2, name: '第三餐' }],
|
|
||||||
// keyword_sp: '',
|
|
||||||
categoryIndex: 0,
|
|
||||||
childrenIndex: 0,
|
|
||||||
categoryList: [],
|
|
||||||
tabList: [],
|
|
||||||
good_list: [],
|
|
||||||
matchedItems_sp: [],
|
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
// if (isLogin()) {
|
this.getHotelList()
|
||||||
this.getCategoryList()
|
|
||||||
// }
|
|
||||||
|
|
||||||
this.getArea()
|
|
||||||
|
|
||||||
},
|
|
||||||
created () {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getHotelList(force = false) {
|
||||||
handleConfirm ({ value }) {
|
if (force) {
|
||||||
console.log(value)
|
this.hotelList = []
|
||||||
},
|
this.search.page = 1
|
||||||
getArea () {
|
this.loadEnd = false
|
||||||
try {
|
|
||||||
this.area = [colPickerData.map(item => ({
|
|
||||||
value: item.value,
|
|
||||||
label: item.text
|
|
||||||
}))];
|
|
||||||
} catch (error) {
|
|
||||||
console.error('获取区域数据时出错:', error);
|
|
||||||
uni.$u.toast('获取区域数据失败');
|
|
||||||
}
|
}
|
||||||
},
|
UserApi.hotelListApi(this.search).catch(res => {
|
||||||
|
|
||||||
columnChange ({ selectedItem, resolve, finish }) {
|
|
||||||
try {
|
|
||||||
const areaData = findChildrenByCode(colPickerData, selectedItem.value);
|
|
||||||
if (areaData && areaData.length) {
|
|
||||||
|
|
||||||
|
|
||||||
resolve(areaData.map(item => ({
|
|
||||||
value: item.value,
|
|
||||||
label: item.text
|
|
||||||
})));
|
|
||||||
} else {
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error('处理列变更时出错:', error);
|
|
||||||
finish(); // 确保在发生错误时也能完成操作以避免卡顿
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
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
|
|
||||||
},
|
|
||||||
|
|
||||||
handleTimeConfirm (res) {
|
|
||||||
console.log(res.value)
|
|
||||||
this.time_list = res.value
|
|
||||||
|
|
||||||
},
|
|
||||||
handleChange () {
|
|
||||||
this.$nextTick(() => { this.handleClickCategory(this.currentTab) });
|
|
||||||
},
|
|
||||||
handleClickCategory (index: number) {
|
|
||||||
|
|
||||||
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.$refs.pagingRefSP?.reload();
|
|
||||||
},
|
|
||||||
|
|
||||||
getCategoryList () {
|
|
||||||
CommonApi.commonGet('/api/dishes/category').catch((res) => {
|
|
||||||
if (res.code === 1) {
|
if (res.code === 1) {
|
||||||
this.categoryList = res.data;
|
if (this.search.page == 1) {
|
||||||
this.handleClickCategory(0)
|
this.hotelList = res.data
|
||||||
|
} else {
|
||||||
|
this.hotelList.push(...res.data)
|
||||||
|
}
|
||||||
|
if (res.data.length < this.search.limit) {
|
||||||
|
this.loadEnd = true
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
uni.$u.toast(res.msg);
|
uni.$u.toast(res.msg);
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
//搜索事件
|
goto(id : number) {
|
||||||
searchSP () {
|
|
||||||
this.$refs.pagingRefSP?.reload();
|
|
||||||
// this.changeSP(1);
|
|
||||||
},
|
|
||||||
//列表分页
|
|
||||||
changeSP (pageNo: number) {
|
|
||||||
// console.log(pageNo);
|
|
||||||
this.search.page = pageNo;
|
|
||||||
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);
|
|
||||||
// console.log(res);
|
|
||||||
} else {
|
|
||||||
uni.$u.toast(res.msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
|
||||||
//点击详情
|
|
||||||
goodsDetail (id: number) {
|
|
||||||
// console.log(id);
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/banquet/hotel/detail?id=${id}&is_add=1`
|
url: `/pages/banquet/hotel/detail?id=${id}&is_add=1`
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
//加入购物车
|
|
||||||
addCart (id) {
|
|
||||||
CommonApi.commonPost('/api/cart/add', {
|
|
||||||
buy_now: false,
|
|
||||||
dishes_id: id,
|
|
||||||
}).catch((res) => {
|
|
||||||
if (res.code === 1) {
|
|
||||||
uni.$u.toast('加入购物车成功');
|
|
||||||
} else {
|
|
||||||
uni.$u.toast(res.msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if (this.loadEnd) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.search.page++
|
||||||
|
this.getHotelList()
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user