修复bug

This commit is contained in:
2026-04-14 17:45:41 +08:00
parent d2077f5844
commit a89610c245
12 changed files with 454 additions and 125 deletions
@@ -48,6 +48,13 @@ function getDishPromoLabel(item: Record<string, unknown>): string {
return typeof raw === 'string' && raw.trim() ? raw.trim() : ''
}
function getFeaturedDishDisplayPrice(item: Record<string, any>) {
const firstSpecPrice = item?.merchantSideDishVoList?.[0]?.merchantSideDishItemVoList?.[0]?.price
if (firstSpecPrice != null && String(firstSpecPrice) !== '') return firstSpecPrice
if (item?.actualSalePrice != null && String(item.actualSalePrice) !== '') return item.actualSalePrice
return item?.discountPrice ?? 0
}
function navigateTo(url: string) {
if(userStore.checkLogin()) {
uni.navigateTo({
@@ -445,7 +452,7 @@ const debouncedEmit = debounce(1300, (isCollected: boolean, id: string, type: Co
<view class="featured-dish-body">
<view class="featured-dish-meta flex items-start justify-between gap-12rpx mb-14rpx">
<view class="min-w-0 flex-1">
<text class="featured-dish-price">US${{ item?.discountPrice }}</text>
<text class="featured-dish-price">US${{ getFeaturedDishDisplayPrice(item) }}</text>
<!-- <text
v-if="Number(item?.originalPrice) > Number(item?.discountPrice)"
class="featured-dish-original"