fix:修复bug
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import {appMerchantRecommendListPost} from "@/service";
|
||||
import {appMerchantRecommendListPost,getDishListByCategoryId} from "@/service";
|
||||
import FoodBox from "@/pages/home/components/tabbar-home/components/food-box/index.vue";
|
||||
import {useUserStore} from "@/store";
|
||||
|
||||
@@ -11,10 +11,11 @@ const props = defineProps<{
|
||||
|
||||
function getList(pageNum: number, pageSize: number) {
|
||||
return new Promise(resolve => {
|
||||
appMerchantRecommendListPost({
|
||||
getDishListByCategoryId({
|
||||
params: {
|
||||
pageNum,
|
||||
pageSize,
|
||||
recipeCategoryId:props.id
|
||||
},
|
||||
body: {
|
||||
lat: userStore.userLocation.latitude,
|
||||
@@ -24,7 +25,8 @@ function getList(pageNum: number, pageSize: number) {
|
||||
scoreRange: null, // 评分范围 比如 3-4
|
||||
priceRange: null, // 价格范围 比如 10-30
|
||||
merchantCategoryIds: [],
|
||||
merchantLabelIds: props.id ? [props.id] : []
|
||||
merchantLabelIds: props.id ? [props.id] : [],
|
||||
recipeCategoryId:props.id
|
||||
},
|
||||
}).then(res => {
|
||||
resolve(res)
|
||||
|
||||
@@ -95,6 +95,8 @@ function toggleDeliveryTimeType(type: number) {
|
||||
deliveryTimeType.value = type;
|
||||
}
|
||||
// 跳转到时间选择页面
|
||||
console.log(storeDetail.value.merch);
|
||||
|
||||
uni.navigateTo({
|
||||
url: "/pages/address/reservation-time?storeBusinessHours=" + storeDetail.value.businessHours,
|
||||
});
|
||||
|
||||
@@ -10,3 +10,7 @@ export const getMarketingDishList = (marketActivityId: string) =>
|
||||
// 查询精选菜品列表
|
||||
export const getFeaturedDishList = (data: Record<string, any>) =>
|
||||
http.post<any[]>('/app/merchantDish/featuredDishList', data, data);
|
||||
|
||||
//获取店铺详情
|
||||
export const getStoreDetailById = (storeId: string) =>
|
||||
http.post<any>('/app/merchant/detail/' + storeId);
|
||||
@@ -67,8 +67,9 @@ function appMembershipRechargeItem() {
|
||||
<view class="text-32rpx lh-32rpx text-#999 font-500 tracking-[.04em] mt-24rpx">
|
||||
<text>(${{ membershipRechargeItem.rechargeAmount || 0 }}/{{ membershipRechargeItem.name || 0 }})</text>
|
||||
<template v-if="!userStore.userInfo.userMembershipVo">
|
||||
<text class="ml-20rpx text-#CE7138">{{ membershipRechargeItem.trialWeeksDisplay || 0 }} {{ t('pages-user.member.weeks') }}</text>
|
||||
<text class="ml-20rpx text-#CE7138">{{ t('pages-user.member.free') }}</text>
|
||||
<!-- <text class="ml-20rpx text-#CE7138">{{ membershipRechargeItem.trialWeeksDisplay || 0 }} {{ t('pages-user.member.weeks') }}</text>
|
||||
<text class="ml-20rpx text-#CE7138">{{ t('pages-user.member.free') }}</text> -->
|
||||
<text class="ml-20rpx text-#CE7138">Free for 7 days</text>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
@click="handleItemClick(item)"
|
||||
>
|
||||
<image :src="item.logoUrl" class="category-icon" mode="aspectFit" />
|
||||
<text class="category-text">{{ item.name }}</text>
|
||||
<text class="category-text">{{ item.categoryName }}</text>
|
||||
</view>
|
||||
<!-- 第二份重复内容(用于无缝循环) -->
|
||||
<view
|
||||
@@ -32,8 +32,8 @@
|
||||
class="category-item"
|
||||
@click="handleItemClick(item)"
|
||||
>
|
||||
<image :src="item.logoUrl" class="category-icon" mode="aspectFit" />
|
||||
<text class="category-text">{{ item.name }}</text>
|
||||
<image :src="item.categoryImage" class="category-icon" mode="aspectFit" />
|
||||
<text class="category-text">{{ item.categoryName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@@ -61,7 +61,7 @@
|
||||
@click="handleItemClick(item)"
|
||||
>
|
||||
<image :src="item.logoUrl" class="category-icon" mode="aspectFit" />
|
||||
<text class="category-text">{{ item.name }}</text>
|
||||
<text class="category-text">{{ item.categoryName }}</text>
|
||||
</view>
|
||||
<view
|
||||
v-for="(item, idx) in categoriesReversed"
|
||||
@@ -69,8 +69,8 @@
|
||||
class="category-item"
|
||||
@click="handleItemClick(item)"
|
||||
>
|
||||
<image :src="item.logoUrl" class="category-icon" mode="aspectFit" />
|
||||
<text class="category-text">{{ item.name }}</text>
|
||||
<image :src="item.categoryImage" class="category-icon" mode="aspectFit" />
|
||||
<text class="category-text">{{ item.categoryName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@@ -85,8 +85,9 @@ import { computed, ref, onMounted, nextTick, getCurrentInstance } from 'vue'
|
||||
// 定义分类项接口(与模板字段一致)
|
||||
interface CategoryItem {
|
||||
id: number
|
||||
logoUrl: string
|
||||
name: string
|
||||
categoryImage: string
|
||||
name: string,
|
||||
categoryName:any
|
||||
}
|
||||
|
||||
// 定义组件属性
|
||||
|
||||
@@ -8,8 +8,12 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
function handleClickFood() {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages-store/pages/store/index?id=' + props.item.id
|
||||
// })
|
||||
|
||||
uni.navigateTo({
|
||||
url: '/pages-store/pages/store/index?id=' + props.item.id
|
||||
url: '/pages-store/pages/store/dishes?id=' +props.item.id + '&storeId=' + props.item.merchantId,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -29,23 +33,24 @@ function handleCollectionChange(value: boolean) {
|
||||
<template>
|
||||
<view @click="handleClickFood" class="mb-52rpx">
|
||||
<image
|
||||
:src="item?.shopImages?.split(',')[0]"
|
||||
:src="item?.dishImage?.split(',')[0]"
|
||||
mode="aspectFill"
|
||||
class="w-100% h-636rpx rounded-24rpx bg-common"
|
||||
class="w-100% h-400rpx rounded-24rpx bg-common"
|
||||
></image>
|
||||
<view class="flex justify-between items-start mt-14rpx">
|
||||
<view>
|
||||
<text class="text-30rpx lh-30rpx text-#333 font-500 line-clamp-1"
|
||||
>{{ item.merchantName }}</text
|
||||
>{{ item.dishName }}</text
|
||||
>
|
||||
<view v-if="+item.deliveryService === 1" class="text-#CE7138 text-24rpx lh-24rpx mt-12rpx">${{ item.deliveryFee }} {{ t('pages.home.deliveryFee') }}</view>
|
||||
<!-- <view v-if="+item.deliveryService === 1" class="text-#CE7138 text-24rpx lh-24rpx mt-12rpx">${{ item.deliveryFee }} {{ t('pages.home.deliveryFee') }}</view> -->
|
||||
<view class="text-24rpx lh-24rpx flex items-center mt-12rpx">
|
||||
<text class="text-#333 font-500">{{ item.rating }}</text>
|
||||
|
||||
<image
|
||||
src="@img/chef/124.png"
|
||||
class="w-24rpx h-24rpx mx-4rpx mt-2rpx"
|
||||
></image>
|
||||
<text class="text-#7D7D7D">({{ item.commentCount }}) • {{ item.deliveryTime }}{{ t('common.minutes') }}</text>
|
||||
<text class="text-#333 font-500">$US{{ item.originalPrice }}</text>
|
||||
<!-- <text class="text-#7D7D7D">({{ item.commentCount }}) • {{ item.deliveryTime }}{{ t('common.minutes') }}</text> -->
|
||||
</view>
|
||||
</view>
|
||||
<collection :is-collected="item.isCollect" @collectionChange="handleCollectionChange" />
|
||||
|
||||
@@ -18,7 +18,7 @@ const props = defineProps({
|
||||
},
|
||||
imgKey: {
|
||||
type: String,
|
||||
default: 'logoUrl',
|
||||
default: 'categoryImage',
|
||||
},
|
||||
})
|
||||
const emit = defineEmits(['changeType']);
|
||||
|
||||
@@ -20,7 +20,8 @@ import {
|
||||
appMerchantFeaturedListPost,
|
||||
appMerchantLabelListGet,
|
||||
appMerchantNearbyListPost, appMerchantRecommendListPost,
|
||||
appCollectCollectPost
|
||||
appCollectCollectPost,
|
||||
appRecipeCategoryListGet
|
||||
} from "@/service";
|
||||
import usePage from "@/hooks/usePage";
|
||||
import {getFeaturedDishList} from "@/pages-store/service";
|
||||
@@ -94,10 +95,14 @@ function appMarketActivityList() {
|
||||
// 滚动信息获取 APP-商家标签分类控制器(用户端首页上面左右滚动的)
|
||||
const appMerchantLabelList = ref([])
|
||||
function getAppMerchantLabelList() {
|
||||
appMerchantLabelListGet({}).then(res => {
|
||||
appRecipeCategoryListGet({}).then(res => {
|
||||
console.log('滚动信息获取 APP-商家标签分类控制器(用户端首页上面左右滚动的)', res)
|
||||
appMerchantLabelList.value = res.data || []
|
||||
})
|
||||
// appMerchantLabelListGet({}).then(res => {
|
||||
// console.log('滚动信息获取 APP-商家标签分类控制器(用户端首页上面左右滚动的)', res)
|
||||
// appMerchantLabelList.value = res.data || []
|
||||
// })
|
||||
}
|
||||
// 查询所有商家分类数据
|
||||
const appMerchantCategoryList = ref([])
|
||||
|
||||
@@ -262,3 +262,29 @@ export async function xjpmjMerchantDishListPost({
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**根据分类ID查询菜品列表 POST */
|
||||
export async function getDishListByCategoryId({
|
||||
params,
|
||||
body,
|
||||
options,
|
||||
}: {
|
||||
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
||||
params: API.AppMerchantRecommendListPostParams;
|
||||
body: API.RecommendMerchantBo;
|
||||
options?: CustomRequestOptions;
|
||||
}) {
|
||||
return request<API.TableDataInfoMerchantVo>('/app/merchantDish/merchantsByRecipeCategory', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
params: {
|
||||
...params,
|
||||
recipeCategoryId:body.recipeCategoryId
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
@@ -368,6 +368,7 @@
|
||||
'orderByColumn'?: string;
|
||||
/** 排序的方向desc或者asc */
|
||||
'isAsc'?: string;
|
||||
'recipeCategoryId'?:any;
|
||||
}
|
||||
|
||||
|
||||
@@ -4234,6 +4235,7 @@
|
||||
'sortType'?: number;
|
||||
/** 关键词 */
|
||||
'keyword'?: string;
|
||||
'recipeCategoryId'?:any
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user