fix:修复bug

This commit is contained in:
2026-02-27 11:35:45 +08:00
parent 36a8e4c51b
commit a1d4e16d83
11 changed files with 72 additions and 24 deletions
+1 -1
View File
@@ -5,6 +5,6 @@ VITE_DELETE_CONSOLE=false
#本地环境 #本地环境
#VITE_SERVER_BASEURL=https://howhowfresh.com/prod-api #VITE_SERVER_BASEURL=https://howhowfresh.com/prod-api
VITE_SERVER_BASEURL=http://192.168.5.23:8889 VITE_SERVER_BASEURL=http://192.168.5.33:8889
#VITE_SERVER_BASEURL=http://192.168.0.148:8888 #VITE_SERVER_BASEURL=http://192.168.0.148:8888
#VITE_SERVER_BASEURL=http://liuyao.nat100.top/meiguowaimai #VITE_SERVER_BASEURL=http://liuyao.nat100.top/meiguowaimai
+5 -3
View File
@@ -1,5 +1,5 @@
<script setup lang="ts"> <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 FoodBox from "@/pages/home/components/tabbar-home/components/food-box/index.vue";
import {useUserStore} from "@/store"; import {useUserStore} from "@/store";
@@ -11,10 +11,11 @@ const props = defineProps<{
function getList(pageNum: number, pageSize: number) { function getList(pageNum: number, pageSize: number) {
return new Promise(resolve => { return new Promise(resolve => {
appMerchantRecommendListPost({ getDishListByCategoryId({
params: { params: {
pageNum, pageNum,
pageSize, pageSize,
recipeCategoryId:props.id
}, },
body: { body: {
lat: userStore.userLocation.latitude, lat: userStore.userLocation.latitude,
@@ -24,7 +25,8 @@ function getList(pageNum: number, pageSize: number) {
scoreRange: null, // 评分范围 比如 3-4 scoreRange: null, // 评分范围 比如 3-4
priceRange: null, // 价格范围 比如 10-30 priceRange: null, // 价格范围 比如 10-30
merchantCategoryIds: [], merchantCategoryIds: [],
merchantLabelIds: props.id ? [props.id] : [] merchantLabelIds: props.id ? [props.id] : [],
recipeCategoryId:props.id
}, },
}).then(res => { }).then(res => {
resolve(res) resolve(res)
+2
View File
@@ -95,6 +95,8 @@ function toggleDeliveryTimeType(type: number) {
deliveryTimeType.value = type; deliveryTimeType.value = type;
} }
// 跳转到时间选择页面 // 跳转到时间选择页面
console.log(storeDetail.value.merch);
uni.navigateTo({ uni.navigateTo({
url: "/pages/address/reservation-time?storeBusinessHours=" + storeDetail.value.businessHours, url: "/pages/address/reservation-time?storeBusinessHours=" + storeDetail.value.businessHours,
}); });
+4
View File
@@ -10,3 +10,7 @@ export const getMarketingDishList = (marketActivityId: string) =>
// 查询精选菜品列表 // 查询精选菜品列表
export const getFeaturedDishList = (data: Record<string, any>) => export const getFeaturedDishList = (data: Record<string, any>) =>
http.post<any[]>('/app/merchantDish/featuredDishList', data, data); http.post<any[]>('/app/merchantDish/featuredDishList', data, data);
//获取店铺详情
export const getStoreDetailById = (storeId: string) =>
http.post<any>('/app/merchant/detail/' + storeId);
+3 -2
View File
@@ -67,8 +67,9 @@ function appMembershipRechargeItem() {
<view class="text-32rpx lh-32rpx text-#999 font-500 tracking-[.04em] mt-24rpx"> <view class="text-32rpx lh-32rpx text-#999 font-500 tracking-[.04em] mt-24rpx">
<text>(${{ membershipRechargeItem.rechargeAmount || 0 }}/{{ membershipRechargeItem.name || 0 }})</text> <text>(${{ membershipRechargeItem.rechargeAmount || 0 }}/{{ membershipRechargeItem.name || 0 }})</text>
<template v-if="!userStore.userInfo.userMembershipVo"> <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">{{ 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">{{ t('pages-user.member.free') }}</text> -->
<text class="ml-20rpx text-#CE7138">Free for 7 days</text>
</template> </template>
</view> </view>
</view> </view>
@@ -23,7 +23,7 @@
@click="handleItemClick(item)" @click="handleItemClick(item)"
> >
<image :src="item.logoUrl" class="category-icon" mode="aspectFit" /> <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>
<!-- 第二份重复内容用于无缝循环 --> <!-- 第二份重复内容用于无缝循环 -->
<view <view
@@ -32,8 +32,8 @@
class="category-item" class="category-item"
@click="handleItemClick(item)" @click="handleItemClick(item)"
> >
<image :src="item.logoUrl" class="category-icon" mode="aspectFit" /> <image :src="item.categoryImage" class="category-icon" mode="aspectFit" />
<text class="category-text">{{ item.name }}</text> <text class="category-text">{{ item.categoryName }}</text>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@@ -61,7 +61,7 @@
@click="handleItemClick(item)" @click="handleItemClick(item)"
> >
<image :src="item.logoUrl" class="category-icon" mode="aspectFit" /> <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>
<view <view
v-for="(item, idx) in categoriesReversed" v-for="(item, idx) in categoriesReversed"
@@ -69,8 +69,8 @@
class="category-item" class="category-item"
@click="handleItemClick(item)" @click="handleItemClick(item)"
> >
<image :src="item.logoUrl" class="category-icon" mode="aspectFit" /> <image :src="item.categoryImage" class="category-icon" mode="aspectFit" />
<text class="category-text">{{ item.name }}</text> <text class="category-text">{{ item.categoryName }}</text>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@@ -85,8 +85,9 @@ import { computed, ref, onMounted, nextTick, getCurrentInstance } from 'vue'
// 定义分类项接口(与模板字段一致) // 定义分类项接口(与模板字段一致)
interface CategoryItem { interface CategoryItem {
id: number id: number
logoUrl: string categoryImage: string
name: string name: string,
categoryName:any
} }
// 定义组件属性 // 定义组件属性
@@ -8,8 +8,12 @@ const props = defineProps<{
}>(); }>();
function handleClickFood() { function handleClickFood() {
// uni.navigateTo({
// url: '/pages-store/pages/store/index?id=' + props.item.id
// })
uni.navigateTo({ 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> <template>
<view @click="handleClickFood" class="mb-52rpx"> <view @click="handleClickFood" class="mb-52rpx">
<image <image
:src="item?.shopImages?.split(',')[0]" :src="item?.dishImage?.split(',')[0]"
mode="aspectFill" mode="aspectFill"
class="w-100% h-636rpx rounded-24rpx bg-common" class="w-100% h-400rpx rounded-24rpx bg-common"
></image> ></image>
<view class="flex justify-between items-start mt-14rpx"> <view class="flex justify-between items-start mt-14rpx">
<view> <view>
<text class="text-30rpx lh-30rpx text-#333 font-500 line-clamp-1" <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"> <view class="text-24rpx lh-24rpx flex items-center mt-12rpx">
<text class="text-#333 font-500">{{ item.rating }}</text>
<image <image
src="@img/chef/124.png" src="@img/chef/124.png"
class="w-24rpx h-24rpx mx-4rpx mt-2rpx" class="w-24rpx h-24rpx mx-4rpx mt-2rpx"
></image> ></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>
</view> </view>
<collection :is-collected="item.isCollect" @collectionChange="handleCollectionChange" /> <collection :is-collected="item.isCollect" @collectionChange="handleCollectionChange" />
@@ -18,7 +18,7 @@ const props = defineProps({
}, },
imgKey: { imgKey: {
type: String, type: String,
default: 'logoUrl', default: 'categoryImage',
}, },
}) })
const emit = defineEmits(['changeType']); const emit = defineEmits(['changeType']);
@@ -20,7 +20,8 @@ import {
appMerchantFeaturedListPost, appMerchantFeaturedListPost,
appMerchantLabelListGet, appMerchantLabelListGet,
appMerchantNearbyListPost, appMerchantRecommendListPost, appMerchantNearbyListPost, appMerchantRecommendListPost,
appCollectCollectPost appCollectCollectPost,
appRecipeCategoryListGet
} from "@/service"; } from "@/service";
import usePage from "@/hooks/usePage"; import usePage from "@/hooks/usePage";
import {getFeaturedDishList} from "@/pages-store/service"; import {getFeaturedDishList} from "@/pages-store/service";
@@ -94,10 +95,14 @@ function appMarketActivityList() {
// 滚动信息获取 APP-商家标签分类控制器(用户端首页上面左右滚动的) // 滚动信息获取 APP-商家标签分类控制器(用户端首页上面左右滚动的)
const appMerchantLabelList = ref([]) const appMerchantLabelList = ref([])
function getAppMerchantLabelList() { function getAppMerchantLabelList() {
appMerchantLabelListGet({}).then(res => { appRecipeCategoryListGet({}).then(res => {
console.log('滚动信息获取 APP-商家标签分类控制器(用户端首页上面左右滚动的)', res) console.log('滚动信息获取 APP-商家标签分类控制器(用户端首页上面左右滚动的)', res)
appMerchantLabelList.value = res.data || [] appMerchantLabelList.value = res.data || []
}) })
// appMerchantLabelListGet({}).then(res => {
// console.log('滚动信息获取 APP-商家标签分类控制器(用户端首页上面左右滚动的)', res)
// appMerchantLabelList.value = res.data || []
// })
} }
// 查询所有商家分类数据 // 查询所有商家分类数据
const appMerchantCategoryList = ref([]) const appMerchantCategoryList = ref([])
+26
View File
@@ -262,3 +262,29 @@ export async function xjpmjMerchantDishListPost({
...(options || {}), ...(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 || {}),
});
}
+2
View File
@@ -368,6 +368,7 @@
'orderByColumn'?: string; 'orderByColumn'?: string;
/** 排序的方向desc或者asc */ /** 排序的方向desc或者asc */
'isAsc'?: string; 'isAsc'?: string;
'recipeCategoryId'?:any;
} }
@@ -4234,6 +4235,7 @@
'sortType'?: number; 'sortType'?: number;
/** 关键词 */ /** 关键词 */
'keyword'?: string; 'keyword'?: string;
'recipeCategoryId'?:any
} }