diff --git a/miniapp/pages/food/food-order-detail.vue b/miniapp/pages/food/food-order-detail.vue index b6691ea..984f720 100644 --- a/miniapp/pages/food/food-order-detail.vue +++ b/miniapp/pages/food/food-order-detail.vue @@ -33,6 +33,7 @@ + {{ shop.shopName }} @@ -131,6 +132,7 @@ export default { map[key] = { shopId: item.shopId, shopName: item.shopName || `门店${item.shopId}`, + shopPhoto: item.shopPhoto || '', items: [] } } @@ -195,7 +197,12 @@ export default { } }, - /** 提交跑腿认证 */ + /** 预览图片 */ + previewImage(url) { + if (!url) return + uni.previewImage({ urls: [url] }) + }, + async submitCert() { if (!this.certForm.realName.trim()) { uni.showToast({ title: '请输入姓名', icon: 'none' }) @@ -305,11 +312,21 @@ export default { } .shop-header { + display: flex; + align-items: center; padding-bottom: 16rpx; border-bottom: 1rpx solid #f0f0f0; margin-bottom: 16rpx; } +.shop-photo { + width: 164rpx; + height: 164rpx; + border-radius: 10rpx; + margin-right: 16rpx; + flex-shrink: 0; +} + .shop-name { font-size: 30rpx; font-weight: bold; diff --git a/miniapp/pages/food/food-order.vue b/miniapp/pages/food/food-order.vue index 64f0cfa..c0e793e 100644 --- a/miniapp/pages/food/food-order.vue +++ b/miniapp/pages/food/food-order.vue @@ -15,7 +15,10 @@ 订单商品 - {{ shopGroup.shopInfo.name }} + + + {{ shopGroup.shopInfo.name }} + {{ item.dish.name }} × {{ item.quantity }} @@ -315,12 +318,24 @@ export default { margin-bottom: 12rpx; } +.shop-group-header { + display: flex; + align-items: center; + padding: 8rpx 0; +} + +.shop-group-photo { + width: 56rpx; + height: 56rpx; + border-radius: 10rpx; + margin-right: 12rpx; + flex-shrink: 0; +} + .shop-group-name { font-size: 28rpx; font-weight: bold; color: #333; - padding: 8rpx 0; - display: block; } .summary-item { diff --git a/miniapp/pages/food/shop-detail.vue b/miniapp/pages/food/shop-detail.vue index 03c4095..0039db6 100644 --- a/miniapp/pages/food/shop-detail.vue +++ b/miniapp/pages/food/shop-detail.vue @@ -150,6 +150,7 @@ this.cartStore.setShopInfo({ id: this.shop.id, name: this.shop.name, + photo: this.shop.photo, packingFeeType: this.shop.packingFeeType, packingFeeAmount: this.shop.packingFeeAmount }) @@ -165,7 +166,15 @@ this.cartStore.removeItem(dish.id) }, clearCart() { - this.cartStore.clearCart(); + this.cartStore.clearCart() + // 清空后重新设置当前门店信息,确保可以继续加购 + this.cartStore.setShopInfo({ + id: this.shop.id, + name: this.shop.name, + photo: this.shop.photo, + packingFeeType: this.shop.packingFeeType, + packingFeeAmount: this.shop.packingFeeAmount + }) this.showCartPopup = false }, /** 弹窗中减少指定门店的菜品 */ diff --git a/miniapp/pages/order-hall/order-hall.vue b/miniapp/pages/order-hall/order-hall.vue index a0166e1..debdbf7 100644 --- a/miniapp/pages/order-hall/order-hall.vue +++ b/miniapp/pages/order-hall/order-hall.vue @@ -469,7 +469,8 @@ } .tab-text { - font-size: 28rpx; + font-size: 35rpx; + font-weight: 600; color: #585858; } diff --git a/miniapp/pages/order/order-detail.vue b/miniapp/pages/order/order-detail.vue index c6ea7e1..903c0f3 100644 --- a/miniapp/pages/order/order-detail.vue +++ b/miniapp/pages/order/order-detail.vue @@ -280,6 +280,10 @@ export default { this.orderId = options.id this.loadDetail() }, + onShow() { + // 每次页面显示时刷新订单数据,确保状态同步 + if (this.orderId) this.loadDetail() + }, methods: { goBack() { uni.navigateBack() }, /** 加载订单详情 */ diff --git a/miniapp/stores/cart.js b/miniapp/stores/cart.js index 0b6b7d3..e20cb2a 100644 --- a/miniapp/stores/cart.js +++ b/miniapp/stores/cart.js @@ -100,8 +100,11 @@ export const useCartStore = defineStore('cart', () => { /** 添加菜品到当前门店购物车 */ function addItem(dish) { if (!currentShopId.value) return + // 门店被清空后自动重建 + if (!shops.value[currentShopId.value]) { + shops.value[currentShopId.value] = { shopInfo: { id: currentShopId.value }, items: [] } + } const shop = shops.value[currentShopId.value] - if (!shop) return const existing = shop.items.find(i => i.dish.id === dish.id) if (existing) { existing.quantity += 1 @@ -126,7 +129,6 @@ export const useCartStore = defineStore('cart', () => { /** 清空所有购物车 */ function clearCart() { shops.value = {} - currentShopId.value = null } /** 获取所有门店的 foodItems(下单用) */ diff --git a/server/Endpoints/OrderEndpoints.cs b/server/Endpoints/OrderEndpoints.cs index 2f87012..c3b7a95 100644 --- a/server/Endpoints/OrderEndpoints.cs +++ b/server/Endpoints/OrderEndpoints.cs @@ -369,6 +369,7 @@ public static class OrderEndpoints Id = fi.Id, ShopId = fi.ShopId, ShopName = fi.Shop?.Name ?? "未知门店", + ShopPhoto = fi.Shop?.Photo, DishId = fi.DishId, DishName = fi.Dish?.Name ?? "未知菜品", DishPhoto = fi.Dish?.Photo, diff --git a/server/Models/Dtos/OrderDtos.cs b/server/Models/Dtos/OrderDtos.cs index 86f3c59..2786b26 100644 --- a/server/Models/Dtos/OrderDtos.cs +++ b/server/Models/Dtos/OrderDtos.cs @@ -106,6 +106,7 @@ public class FoodOrderItemResponse public int Id { get; set; } public int ShopId { get; set; } public string ShopName { get; set; } = string.Empty; + public string? ShopPhoto { get; set; } public int DishId { get; set; } public string DishName { get; set; } = string.Empty; public string? DishPhoto { get; set; }