diff --git a/pkg_product/views/healthFoods.vue b/pkg_product/views/healthFoods.vue index b1c5114..43f5971 100644 --- a/pkg_product/views/healthFoods.vue +++ b/pkg_product/views/healthFoods.vue @@ -57,14 +57,14 @@ - + - + @@ -196,6 +196,31 @@ export default { ProductWindow }, mixins: [goCartMixin], + computed: { + hasRankData() { + if (!Array.isArray(this.rank)) return false; + const hasText = (v) => typeof v === "string" && v.trim() !== ""; + const hasValue = (v) => v !== null && v !== undefined && v !== ""; + return this.rank.some((item) => { + if (!item) return false; + if (hasText(item.title) || hasText(item.backgroundImage)) { + return true; + } + if (Array.isArray(item.products)) { + return item.products.some((p) => { + if (!p) return false; + return ( + hasText(p.productTitle) || + hasText(p.productDesc) || + hasValue(p.productImage) || + hasValue(p.productId) + ); + }); + } + return false; + }); + } + }, data() { return { webUrl: this.$VUE_APP_RESOURCES_URL,