diff --git a/pages/home/home.vue b/pages/home/home.vue
index a9dec25..bc0ff0f 100644
--- a/pages/home/home.vue
+++ b/pages/home/home.vue
@@ -66,7 +66,7 @@
@@ -113,7 +113,7 @@
-
+
-
+
+
{{ item.count }}
{{ item.title }}
@@ -388,6 +394,23 @@ import { registerImageCompressPopup } from '@/utils/image-compress-modal.js';
import { setGuestMode, isGuestMode, isLoggedIn } from '@/common/utils/auth.js';
import {silentLogin} from "@/utils/login";
+/** 待办入口默认图:后台未上传时用本地精致矢量透明 PNG */
+const REMIND_FALLBACK_ICON = {
+ unpaid_register: '/static/home/remind/unpaid_register.png',
+ unpaid_product: '/static/home/remind/unpaid_product.png',
+ shipped: '/static/home/remind/shipped.png',
+ arrived: '/static/home/remind/arrived.png',
+};
+/** 药品专区默认入口图:专区未配 icon 时按 type 回落 */
+const ZONE_FALLBACK_ICON = {
+ otc: '/static/home/zones/otc.png',
+ prescription: '/static/home/zones/prescription.png',
+ health_food: '/static/home/zones/health_food.png',
+ service_package: '/static/home/zones/service_package.png',
+ non_drug: '/static/home/zones/non_drug.png',
+ medical_device: '/static/home/zones/medical_device.png',
+};
+
export default {
components: {
MessageNotification,
@@ -424,9 +447,9 @@ export default {
statusBarHeight: 20,
isSticky: false,
- // 金刚区布局:scroll 横滑 / wrap 一行五个 / wrap2 一行两个(后台可配)
+ // 待办入口排布:scroll 横滑 / wrap 一行五个 / wrap2 一行两个(后台可配)
zoneLayoutMode: 'scroll',
- // 订单提醒:grid 一行两列 / zone 金刚区(后台可配)
+ // 订单待办:grid 一行两列 / zone 图标入口(后台可配)
orderRemindStyle: 'grid',
orderRemindItems: [],
@@ -510,7 +533,7 @@ export default {
},
methods: {
/**
- * 拉取首页展示样式(游客/登录都要,金刚区布局跟配置走)
+ * 拉取首页展示样式(游客/登录都要,待办入口排布跟配置走)
*/
async fetchHomeDisplayConfig() {
try {
@@ -551,7 +574,14 @@ export default {
if (payload.order_remind_style === 'grid' || payload.order_remind_style === 'zone') {
this.orderRemindStyle = payload.order_remind_style;
}
- this.orderRemindItems = payload.items || [];
+ this.orderRemindItems = (payload.items || []).map((item) => {
+ const key = item && item.key ? item.key : '';
+ const uploaded = item && item.icon_url ? item.icon_url : '';
+ return {
+ ...item,
+ display_icon: uploaded || REMIND_FALLBACK_ICON[key] || '',
+ };
+ });
} catch (e) {
console.error('fetchOrderReminds', e);
this.orderRemindItems = [];
@@ -891,7 +921,15 @@ export default {
store_id: uni.getStorageSync('store_id') || '11001',
}).then((res) => {
if (res.data.code == 0) {
- this.homeZones = res.data.result || res.data.data || [];
+ const list = res.data.result || [];
+ this.homeZones = list.map((z) => {
+ const type = z && z.type ? z.type : '';
+ const icon = z && z.icon ? z.icon : '';
+ return {
+ ...z,
+ display_icon: icon || ZONE_FALLBACK_ICON[type] || ZONE_FALLBACK_ICON.otc,
+ };
+ });
}
}).catch(() => {
// 仅尚无数据时清空,避免刷新失败抹掉已有专区
@@ -903,7 +941,7 @@ export default {
})
},
/**
- * 下拉刷新:清空金刚区与卡片,重新走骨架后再拉数
+ * 下拉刷新:清空待办入口与卡片,重新走骨架后再拉数
* 为什么:用户期望刷新时看到加载态,而不是短暂保留旧数据
*/
refreshHomeContent() {
diff --git a/request/api/product.js b/request/api/product.js
index aaa40a5..1332cc3 100644
--- a/request/api/product.js
+++ b/request/api/product.js
@@ -41,7 +41,7 @@ export async function getHomeZonesApi(params) {
return await get('/product/home-zones', params, 3)
}
/**
- * 首页展示样式(金刚区布局 + 订单提醒样式)
+ * 首页展示样式(待办入口排布 + 订单待办样式)
* xk-api GET /product/home-display-config;游客态 request.js 会改写到 guest
*/
export async function getHomeDisplayConfigApi() {