From 8f8ca96a827451620c254b8b61d39f7c04ed2ce0 Mon Sep 17 00:00:00 2001 From: zoujing Date: Fri, 18 Sep 2026 10:37:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E4=BA=86=E6=9D=83?= =?UTF-8?q?=E7=9B=8A=E7=9A=84=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/build-icons.mjs | 3 +- src/api/benefit.js | 8 +- src/components/BenefitCard/index.vue | 54 ++++-- src/components/BenefitDialog/index.vue | 4 +- src/mock/v1/benefits.json | 222 +++---------------------- src/mock/v1/me-benefits.json | 24 --- src/mock/v1/merchant-details.json | 222 +++---------------------- src/styles/icons.scss | 1 + src/utils/index.js | 9 + 9 files changed, 97 insertions(+), 450 deletions(-) diff --git a/scripts/build-icons.mjs b/scripts/build-icons.mjs index 4f4be6b..10172e5 100644 --- a/scripts/build-icons.mjs +++ b/scripts/build-icons.mjs @@ -20,6 +20,7 @@ const TONES = { brand: "#00B578", brandDeep: "#009A67", accent: "#FF8A3D", + accentDeep: "#C9550C", danger: "#E5484D", }; @@ -67,7 +68,7 @@ const FILL_ICONS = { const MATRIX = { pin: ["ink3", "brand", "white"], arrow: ["white", "brandDeep", "ink"], - chev: ["ink3", "white", "brand", "ink2"], + chev: ["ink3", "white", "brand", "ink2", "accentDeep"], back: ["ink", "white", "brand"], phone: ["white", "brandDeep"], copy: ["brandDeep", "brand"], diff --git a/src/api/benefit.js b/src/api/benefit.js index 3079a69..68edbd9 100644 --- a/src/api/benefit.js +++ b/src/api/benefit.js @@ -106,26 +106,20 @@ const withLocalClaim = (b) => { const mockCatalog = () => (benefitsMock.items || []).map(withLocalClaim); -/** 由模板 + 本地状态合成一条已领取实例(形态同 UserBenefitView) */ +/** 由模板 + 本地状态合成一条已领取实例(字段与 mock/v1/me-benefits.json 同一套) */ const buildInstance = (uid, st) => { const tpl = (benefitsMock.items || []).find((t) => t.id === st.benefit_id) || {}; const expired = isPast(tpl.valid_until); return { id: uid, - user_id: "", - merchant_id: tpl.merchant_id || "", merchant_name: tpl.merchant_name || "", benefit_id: st.benefit_id, - title: tpl.title || "", description: tpl.description || "", image_url: tpl.image_url || "", - usage_limit: null, use_count: st.use_count || 0, - last_used_at: st.last_used_at || null, valid_from: st.claimed_at, valid_until: tpl.valid_until || null, claimed_at: st.claimed_at, - voided_at: null, status: expired ? "expired" : "available", can_use: !expired, unavailable_reason: expired ? "expired" : "", diff --git a/src/components/BenefitCard/index.vue b/src/components/BenefitCard/index.vue index 815d7fc..194571a 100644 --- a/src/components/BenefitCard/index.vue +++ b/src/components/BenefitCard/index.vue @@ -2,12 +2,15 @@ /** * 权益卡(全站唯一组件 · 4 处复用) * 使用位置:权益中心 / 我的权益 / 详情页「到店权益」 - * 四行固定顺序:类型 / 价格 / 规格·适用 / 有效期·名额(v11 价格表达) - * 所有权益元素一律票根橙,不按类型分色;灰化态与 cta 态走「互斥类串」,不复制结构。 + * 四行固定顺序:类型 / 价格 / 规格·适用 / 有效期·名额 + * 价格两形态互斥:金额型 = 优惠价大字 + 划线原价 + 右端折扣标; + * 折扣型(price.rate)= 「门市价」小字 + 折扣大字,不再出划线原价与折扣标。 + * 「进入商家」入口只在权益中心出现(详情页本就在该商家内)。 */ import { computed } from "vue"; import { BENEFIT_STATUS, BENEFIT_TYPE_ICON, BENEFIT_TYPE_LABEL } from "@/constant"; -import { discountLabel, dotDate, priceText } from "@/utils"; +import { discountLabel, dotDate, priceText, rateText } from "@/utils"; +import { goDetail } from "@/utils/nav"; const props = defineProps({ benefit: { type: Object, required: true }, @@ -33,8 +36,10 @@ const typeIcon = computed(() => BENEFIT_TYPE_ICON[typeKey.value] || "gift"); const deal = computed(() => priceText(b.value.price?.deal)); const original = computed(() => priceText(b.value.price?.original)); const pct = computed(() => discountLabel(b.value.price?.deal, b.value.price?.original)); +const rate = computed(() => rateText(b.value.price?.rate)); +const isRate = computed(() => !!rate.value); const spec = computed(() => b.value.price?.spec || ""); -const hasPrice = computed(() => !!deal.value); +const hasPrice = computed(() => isRate.value || !!deal.value); const slogan = computed(() => Array.isArray(b.value.slogan) ? b.value.slogan : b.value.slogan ? [b.value.slogan] : [] @@ -99,6 +104,17 @@ const coverImgCls = computed(() => (isOff.value ? "grayscale-[0.6] brightness-[0 const ctaStateCls = computed(() => isOff.value ? "bg-[#C7CED4]" : "grad-accent shadow-[0_8px_18px_rgba(255,138,61,0.4)]" ); +const goStateCls = computed(() => + isOff.value + ? "bg-[#EDF1F4] border-transparent text-[#9CA3AF]" + : "bg-[rgba(255,138,61,0.14)] border-[rgba(255,138,61,0.3)] text-accent-deep" +); +const goIconTone = computed(() => (isOff.value ? "ink3" : "accentDeep")); + +/** 权益中心专属:跳该权益所属商家详情 */ +const onGoMerchant = () => { + if (b.value.merchant_id) goDetail(b.value.merchant_id); +}; const onTap = () => { emit("tap", b.value); @@ -111,23 +127,35 @@ const onTap = () => { hover-class="opacity-90" @click="onTap"> - + {{ typeLabel }} + + 进入商家 + + - + - ¥ - {{ deal }} - ¥{{ original }} - - {{ pct }} - + + diff --git a/src/components/BenefitDialog/index.vue b/src/components/BenefitDialog/index.vue index 4ce5f41..597d709 100644 --- a/src/components/BenefitDialog/index.vue +++ b/src/components/BenefitDialog/index.vue @@ -5,7 +5,7 @@ */ import { computed } from "vue"; import { BENEFIT_TYPE_LABEL } from "@/constant"; -import { dateRangeText, priceText } from "@/utils"; +import { dateRangeText, priceText, rateText } from "@/utils"; const props = defineProps({ visible: { type: Boolean, default: false }, @@ -20,6 +20,8 @@ const typeKey = computed(() => b.value.section_key || b.value.type || ""); const typeLabel = computed(() => BENEFIT_TYPE_LABEL[typeKey.value] || "权益"); const priceLine = computed(() => { + const rate = rateText(b.value.price?.rate); + if (rate) return `门市价 ${rate}`; const deal = priceText(b.value.price?.deal); const original = priceText(b.value.price?.original); if (!deal) return b.value.scope_desc || ""; diff --git a/src/mock/v1/benefits.json b/src/mock/v1/benefits.json index 714ad70..cdc2a39 100644 --- a/src/mock/v1/benefits.json +++ b/src/mock/v1/benefits.json @@ -3,28 +3,18 @@ { "id": "benefit-001", "merchant_id": "attraction-001", - "title": "龙里水乡单人票权益", + "merchant_name": "龙里水乡旅游生态城", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/attractions/attraction-001/01.jpg", - "status": "published", "total_limit": 200, "claim_count": 113, - "claim_start": null, - "claim_end": null, - "validity_mode": "days", - "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-17T02:00:00Z", - "updated_at": "2026-09-17T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "scenic", - "merchant_name": "龙里水乡旅游生态城", "price": { "original": 128, "deal": 88, @@ -39,31 +29,20 @@ { "id": "benefit-002", "merchant_id": "accommodation-002", - "title": "龙里住宿周末双床房权益", + "merchant_name": "云从朵花温泉度假中心", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/accommodations/accommodation-002/01.jpg", - "status": "published", "total_limit": 120, "claim_count": 74, - "claim_start": null, - "claim_end": null, - "validity_mode": "days", - "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-17T02:00:00Z", - "updated_at": "2026-09-17T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "stay", - "merchant_name": "云从朵花温泉度假中心", "price": { - "original": 468, - "deal": 368, + "rate": 8, "spec": "双床房" }, "slogan": [ @@ -75,28 +54,18 @@ { "id": "benefit-003", "merchant_id": "food-002", - "title": "龙里餐饮 2-3 人餐权益", + "merchant_name": "龙里辣子鸡", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/foods/food-002/01.jpg", - "status": "published", "total_limit": 300, "claim_count": 148, - "claim_start": null, - "claim_end": null, - "validity_mode": "days", - "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-17T02:00:00Z", - "updated_at": "2026-09-17T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "food", - "merchant_name": "龙里辣子鸡", "price": { "original": 125, "deal": 99, @@ -111,31 +80,20 @@ { "id": "benefit-004", "merchant_id": "specialty-001", - "title": "龙里刺梨礼盒特产权益", + "merchant_name": "龙里刺梨干", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/specialties/specialty-001/01.png", - "status": "published", "total_limit": 80, "claim_count": 80, - "claim_start": null, - "claim_end": null, - "validity_mode": "days", - "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-17T02:00:00Z", - "updated_at": "2026-09-17T02:00:00Z", "already_claimed": false, "can_claim": false, "claim_unavailable_reason": "claim_limit_reached", "user_benefit_id": null, "section_key": "specialty", - "merchant_name": "龙里刺梨干", "price": { - "original": 158, - "deal": 108, + "rate": 9, "spec": "刺梨礼盒" }, "slogan": [ @@ -147,28 +105,18 @@ { "id": "benefit-005", "merchant_id": "attraction-001", - "title": "龙里水乡双人票权益", + "merchant_name": "龙里水乡旅游生态城", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/attractions/attraction-001/02.jpg", - "status": "published", "total_limit": 150, "claim_count": 87, - "claim_start": null, - "claim_end": null, - "validity_mode": "days", - "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-17T02:00:00Z", - "updated_at": "2026-09-17T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "scenic", - "merchant_name": "龙里水乡旅游生态城", "price": { "original": 198, "deal": 148, @@ -183,28 +131,18 @@ { "id": "benefit-006", "merchant_id": "food-001", - "title": "龙里餐饮 3-5 人餐权益", + "merchant_name": "野生菌肉饼鸡", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/foods/food-001/01.jpg", - "status": "published", "total_limit": 300, "claim_count": 172, - "claim_start": null, - "claim_end": null, - "validity_mode": "days", - "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-17T02:00:00Z", - "updated_at": "2026-09-17T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "food", - "merchant_name": "野生菌肉饼鸡", "price": { "original": 250, "deal": 199, @@ -219,28 +157,18 @@ { "id": "benefit-007", "merchant_id": "food-002", - "title": "龙里餐饮 5-7 人套餐权益", + "merchant_name": "龙里辣子鸡", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/foods/food-002/02.jpg", - "status": "published", "total_limit": 200, "claim_count": 109, - "claim_start": null, - "claim_end": null, - "validity_mode": "days", - "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-17T02:00:00Z", - "updated_at": "2026-09-17T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "food", - "merchant_name": "龙里辣子鸡", "price": { "original": 375, "deal": 299, @@ -255,28 +183,18 @@ { "id": "benefit-008", "merchant_id": "food-001", - "title": "龙里餐饮 5-9 人套餐权益", + "merchant_name": "野生菌肉饼鸡", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/foods/food-001/02.jpg", - "status": "published", "total_limit": 160, "claim_count": 86, - "claim_start": null, - "claim_end": null, - "validity_mode": "days", - "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-17T02:00:00Z", - "updated_at": "2026-09-17T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "food", - "merchant_name": "野生菌肉饼鸡", "price": { "original": 500, "deal": 399, @@ -291,28 +209,18 @@ { "id": "benefit-009", "merchant_id": "food-002", - "title": "龙里餐饮 7-10 人套餐权益", + "merchant_name": "龙里辣子鸡", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/foods/food-002/01.jpg", - "status": "published", "total_limit": 120, "claim_count": 62, - "claim_start": null, - "claim_end": null, - "validity_mode": "days", - "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-17T02:00:00Z", - "updated_at": "2026-09-17T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "food", - "merchant_name": "龙里辣子鸡", "price": { "original": 625, "deal": 499, @@ -327,28 +235,18 @@ { "id": "benefit-010", "merchant_id": "food-001", - "title": "龙里餐饮 9-12 人套餐权益", + "merchant_name": "野生菌肉饼鸡", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/foods/food-001/01.jpg", - "status": "published", "total_limit": 100, "claim_count": 59, - "claim_start": null, - "claim_end": null, - "validity_mode": "days", - "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-17T02:00:00Z", - "updated_at": "2026-09-17T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "food", - "merchant_name": "野生菌肉饼鸡", "price": { "original": 750, "deal": 599, @@ -363,28 +261,18 @@ { "id": "benefit-011", "merchant_id": "food-002", - "title": "龙里餐饮 10-14 人套餐权益", + "merchant_name": "龙里辣子鸡", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/foods/food-002/02.jpg", - "status": "published", "total_limit": 60, "claim_count": 37, - "claim_start": null, - "claim_end": null, - "validity_mode": "days", - "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-17T02:00:00Z", - "updated_at": "2026-09-17T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "food", - "merchant_name": "龙里辣子鸡", "price": { "original": 1000, "deal": 799, @@ -399,28 +287,18 @@ { "id": "benefit-012", "merchant_id": "food-001", - "title": "龙里餐饮 10-16 人套餐权益", + "merchant_name": "野生菌肉饼鸡", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/foods/food-001/02.jpg", - "status": "published", "total_limit": 40, "claim_count": 28, - "claim_start": null, - "claim_end": null, - "validity_mode": "days", - "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-17T02:00:00Z", - "updated_at": "2026-09-17T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "food", - "merchant_name": "野生菌肉饼鸡", "price": { "original": 1250, "deal": 999, @@ -435,28 +313,18 @@ { "id": "benefit-013", "merchant_id": "specialty-002", - "title": "龙里刺梨原浆特产权益", + "merchant_name": "龙里刺梨汁", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/specialties/specialty-002/01.jpg", - "status": "published", "total_limit": 200, "claim_count": 82, - "claim_start": null, - "claim_end": null, - "validity_mode": "days", - "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-17T02:00:00Z", - "updated_at": "2026-09-17T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "specialty", - "merchant_name": "龙里刺梨汁", "price": { "original": 99, "deal": 69, @@ -471,28 +339,18 @@ { "id": "benefit-101", "merchant_id": "attraction-001", - "title": "龙里水乡单人票权益", + "merchant_name": "龙里水乡旅游生态城", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/attractions/attraction-001/01.jpg", - "status": "published", "total_limit": 200, "claim_count": 113, - "claim_start": null, - "claim_end": null, - "validity_mode": "days", - "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-17T02:00:00Z", - "updated_at": "2026-09-17T02:00:00Z", "already_claimed": true, "can_claim": false, "claim_unavailable_reason": "already_claimed", "user_benefit_id": "user-benefit-101", "section_key": "scenic", - "merchant_name": "龙里水乡旅游生态城", "price": { "original": 128, "deal": 88, @@ -507,28 +365,18 @@ { "id": "benefit-102", "merchant_id": "accommodation-001", - "title": "龙里住宿双床房权益", + "merchant_name": "云河酒店", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/accommodations/accommodation-001/01.jpg", - "status": "published", "total_limit": 120, "claim_count": 88, - "claim_start": null, - "claim_end": null, - "validity_mode": "days", - "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-17T02:00:00Z", - "updated_at": "2026-09-17T02:00:00Z", "already_claimed": true, "can_claim": false, "claim_unavailable_reason": "already_claimed", "user_benefit_id": "user-benefit-102", "section_key": "stay", - "merchant_name": "云河酒店", "price": { "original": 468, "deal": 368, @@ -543,28 +391,18 @@ { "id": "benefit-103", "merchant_id": "food-002", - "title": "龙里餐饮 3-5 人餐权益", + "merchant_name": "龙里辣子鸡", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/foods/food-001/01.jpg", - "status": "published", "total_limit": 300, "claim_count": 204, - "claim_start": null, - "claim_end": null, - "validity_mode": "days", - "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-17T02:00:00Z", - "updated_at": "2026-09-17T02:00:00Z", "already_claimed": true, "can_claim": false, "claim_unavailable_reason": "already_claimed", "user_benefit_id": "user-benefit-103", "section_key": "food", - "merchant_name": "龙里辣子鸡", "price": { "original": 250, "deal": 199, @@ -579,28 +417,18 @@ { "id": "benefit-104", "merchant_id": "accommodation-005", - "title": "龙里住宿大床房权益", + "merchant_name": "龙里伯爵钻石酒店", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/accommodations/accommodation-005/01.jpg", - "status": "published", "total_limit": 60, "claim_count": 60, - "claim_start": null, - "claim_end": null, - "validity_mode": "days", - "valid_from": "2026-08-01T00:00:00Z", "valid_until": "2026-08-31T00:00:00Z", "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-17T02:00:00Z", - "updated_at": "2026-09-17T02:00:00Z", "already_claimed": true, "can_claim": false, "claim_unavailable_reason": "already_claimed", "user_benefit_id": "user-benefit-104", "section_key": "stay", - "merchant_name": "龙里伯爵钻石酒店", "price": { "original": 628, "deal": 468, @@ -615,28 +443,18 @@ { "id": "benefit-201", "merchant_id": "accommodation-001", - "title": "云河酒店到店住宿权益", + "merchant_name": "云河酒店", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/accommodations/accommodation-001/03.jpg", - "status": "published", "total_limit": 60, "claim_count": 32, - "claim_start": null, - "claim_end": null, - "validity_mode": "days", - "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-17T02:00:00Z", - "updated_at": "2026-09-17T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "stay", - "merchant_name": "云河酒店", "price": { "original": 468, "deal": 368, diff --git a/src/mock/v1/me-benefits.json b/src/mock/v1/me-benefits.json index f2d4360..95a63ea 100644 --- a/src/mock/v1/me-benefits.json +++ b/src/mock/v1/me-benefits.json @@ -2,20 +2,14 @@ "items": [ { "id": "user-benefit-103", - "user_id": "mock-user-0001", - "merchant_id": "food-002", "merchant_name": "龙里辣子鸡", "benefit_id": "benefit-103", - "title": "龙里餐饮 3-5 人餐权益", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/foods/food-001/01.jpg", - "usage_limit": null, "use_count": 0, - "last_used_at": null, "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "claimed_at": "2026-09-12T02:15:00Z", - "voided_at": null, "status": "available", "can_use": true, "unavailable_reason": "", @@ -33,20 +27,14 @@ }, { "id": "user-benefit-102", - "user_id": "mock-user-0001", - "merchant_id": "accommodation-001", "merchant_name": "云河酒店", "benefit_id": "benefit-102", - "title": "龙里住宿双床房权益", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/accommodations/accommodation-001/01.jpg", - "usage_limit": null, "use_count": 1, - "last_used_at": "2026-09-14T08:05:00Z", "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "claimed_at": "2026-09-12T02:12:00Z", - "voided_at": null, "status": "available", "can_use": true, "unavailable_reason": "", @@ -64,20 +52,14 @@ }, { "id": "user-benefit-101", - "user_id": "mock-user-0001", - "merchant_id": "attraction-001", "merchant_name": "龙里水乡旅游生态城", "benefit_id": "benefit-101", - "title": "龙里水乡单人票权益", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/attractions/attraction-001/01.jpg", - "usage_limit": null, "use_count": 2, - "last_used_at": "2026-09-15T03:20:00Z", "valid_from": "2026-09-12T00:00:00Z", "valid_until": "2026-12-31T00:00:00Z", "claimed_at": "2026-09-12T02:10:00Z", - "voided_at": null, "status": "available", "can_use": true, "unavailable_reason": "", @@ -95,20 +77,14 @@ }, { "id": "user-benefit-104", - "user_id": "mock-user-0001", - "merchant_id": "accommodation-005", "merchant_name": "龙里伯爵钻石酒店", "benefit_id": "benefit-104", - "title": "龙里住宿大床房权益", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/accommodations/accommodation-005/01.jpg", - "usage_limit": null, "use_count": 1, - "last_used_at": "2026-08-20T06:40:00Z", "valid_from": "2026-08-02T00:00:00Z", "valid_until": "2026-08-31T00:00:00Z", "claimed_at": "2026-08-02T01:00:00Z", - "voided_at": null, "status": "expired", "can_use": false, "unavailable_reason": "expired", diff --git a/src/mock/v1/merchant-details.json b/src/mock/v1/merchant-details.json index bae75fe..c10a810 100644 --- a/src/mock/v1/merchant-details.json +++ b/src/mock/v1/merchant-details.json @@ -30,28 +30,18 @@ { "id": "benefit-001", "merchant_id": "attraction-001", - "title": "龙里水乡单人票权益", + "merchant_name": "龙里水乡旅游生态城", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/attractions/attraction-001/01.jpg", - "status": "published", "total_limit": 200, "claim_count": 113, - "claim_start": "2026-09-12T00:00:00Z", - "claim_end": "2026-12-31T00:00:00Z", - "validity_mode": "days", - "valid_from": null, "valid_until": null, "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-12T02:00:00Z", - "updated_at": "2026-09-12T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "scenic", - "merchant_name": "龙里水乡旅游生态城", "price": { "original": 128, "deal": 88, @@ -66,28 +56,18 @@ { "id": "benefit-005", "merchant_id": "attraction-001", - "title": "龙里水乡双人票权益", + "merchant_name": "龙里水乡旅游生态城", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/attractions/attraction-001/02.jpg", - "status": "published", "total_limit": 150, "claim_count": 87, - "claim_start": "2026-09-12T00:00:00Z", - "claim_end": "2026-12-31T00:00:00Z", - "validity_mode": "days", - "valid_from": null, "valid_until": null, "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-12T02:00:00Z", - "updated_at": "2026-09-12T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "scenic", - "merchant_name": "龙里水乡旅游生态城", "price": { "original": 198, "deal": 148, @@ -102,28 +82,18 @@ { "id": "benefit-101", "merchant_id": "attraction-001", - "title": "龙里水乡单人票权益", + "merchant_name": "龙里水乡旅游生态城", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/attractions/attraction-001/01.jpg", - "status": "published", "total_limit": 200, "claim_count": 113, - "claim_start": "2026-09-12T00:00:00Z", - "claim_end": "2026-12-31T00:00:00Z", - "validity_mode": "days", - "valid_from": null, "valid_until": null, "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-12T02:00:00Z", - "updated_at": "2026-09-12T02:00:00Z", "already_claimed": true, "can_claim": false, "claim_unavailable_reason": "already_claimed", "user_benefit_id": "user-benefit-benefit-101", "section_key": "scenic", - "merchant_name": "龙里水乡旅游生态城", "price": { "original": 128, "deal": 88, @@ -1565,28 +1535,18 @@ { "id": "benefit-102", "merchant_id": "accommodation-001", - "title": "龙里住宿双床房权益", + "merchant_name": "云河酒店", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/accommodations/accommodation-001/01.jpg", - "status": "published", "total_limit": 120, "claim_count": 88, - "claim_start": "2026-09-12T00:00:00Z", - "claim_end": "2026-12-31T00:00:00Z", - "validity_mode": "days", - "valid_from": null, "valid_until": null, "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-12T02:00:00Z", - "updated_at": "2026-09-12T02:00:00Z", "already_claimed": true, "can_claim": false, "claim_unavailable_reason": "already_claimed", "user_benefit_id": "user-benefit-benefit-102", "section_key": "stay", - "merchant_name": "云河酒店", "price": { "original": 468, "deal": 368, @@ -1601,28 +1561,18 @@ { "id": "benefit-201", "merchant_id": "accommodation-001", - "title": "云河酒店到店住宿权益", + "merchant_name": "云河酒店", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/accommodations/accommodation-001/03.jpg", - "status": "published", "total_limit": 60, "claim_count": 32, - "claim_start": "2026-09-12T00:00:00Z", - "claim_end": "2026-12-31T00:00:00Z", - "validity_mode": "days", - "valid_from": null, "valid_until": null, "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-12T02:00:00Z", - "updated_at": "2026-09-12T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "stay", - "merchant_name": "云河酒店", "price": { "original": 468, "deal": 368, @@ -1744,31 +1694,20 @@ { "id": "benefit-002", "merchant_id": "accommodation-002", - "title": "龙里住宿周末双床房权益", + "merchant_name": "云从朵花温泉度假中心", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/accommodations/accommodation-002/01.jpg", - "status": "published", "total_limit": 120, "claim_count": 74, - "claim_start": "2026-09-12T00:00:00Z", - "claim_end": "2026-12-31T00:00:00Z", - "validity_mode": "days", - "valid_from": null, "valid_until": null, "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-12T02:00:00Z", - "updated_at": "2026-09-12T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "stay", - "merchant_name": "云从朵花温泉度假中心", "price": { - "original": 468, - "deal": 368, + "rate": 8, "spec": "双床房" }, "slogan": [ @@ -1994,28 +1933,18 @@ { "id": "benefit-104", "merchant_id": "accommodation-005", - "title": "龙里住宿大床房权益", + "merchant_name": "龙里伯爵钻石酒店", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/accommodations/accommodation-005/01.jpg", - "status": "published", "total_limit": 60, "claim_count": 60, - "claim_start": "2026-08-01T00:00:00Z", - "claim_end": "2026-08-31T00:00:00Z", - "validity_mode": "days", - "valid_from": null, "valid_until": null, "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-12T02:00:00Z", - "updated_at": "2026-09-12T02:00:00Z", "already_claimed": false, "can_claim": false, "claim_unavailable_reason": "benefit_expired", "user_benefit_id": null, "section_key": "stay", - "merchant_name": "龙里伯爵钻石酒店", "price": { "original": 628, "deal": 468, @@ -3737,28 +3666,18 @@ { "id": "benefit-006", "merchant_id": "food-001", - "title": "龙里餐饮 3-5 人餐权益", + "merchant_name": "野生菌肉饼鸡", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/foods/food-001/01.jpg", - "status": "published", "total_limit": 300, "claim_count": 172, - "claim_start": "2026-09-12T00:00:00Z", - "claim_end": "2026-12-31T00:00:00Z", - "validity_mode": "days", - "valid_from": null, "valid_until": null, "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-12T02:00:00Z", - "updated_at": "2026-09-12T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "food", - "merchant_name": "野生菌肉饼鸡", "price": { "original": 250, "deal": 199, @@ -3773,28 +3692,18 @@ { "id": "benefit-008", "merchant_id": "food-001", - "title": "龙里餐饮 5-9 人套餐权益", + "merchant_name": "野生菌肉饼鸡", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/foods/food-001/02.jpg", - "status": "published", "total_limit": 160, "claim_count": 86, - "claim_start": "2026-09-12T00:00:00Z", - "claim_end": "2026-12-31T00:00:00Z", - "validity_mode": "days", - "valid_from": null, "valid_until": null, "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-12T02:00:00Z", - "updated_at": "2026-09-12T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "food", - "merchant_name": "野生菌肉饼鸡", "price": { "original": 500, "deal": 399, @@ -3809,28 +3718,18 @@ { "id": "benefit-010", "merchant_id": "food-001", - "title": "龙里餐饮 9-12 人套餐权益", + "merchant_name": "野生菌肉饼鸡", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/foods/food-001/01.jpg", - "status": "published", "total_limit": 100, "claim_count": 59, - "claim_start": "2026-09-12T00:00:00Z", - "claim_end": "2026-12-31T00:00:00Z", - "validity_mode": "days", - "valid_from": null, "valid_until": null, "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-12T02:00:00Z", - "updated_at": "2026-09-12T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "food", - "merchant_name": "野生菌肉饼鸡", "price": { "original": 750, "deal": 599, @@ -3845,28 +3744,18 @@ { "id": "benefit-012", "merchant_id": "food-001", - "title": "龙里餐饮 10-16 人套餐权益", + "merchant_name": "野生菌肉饼鸡", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/foods/food-001/02.jpg", - "status": "published", "total_limit": 40, "claim_count": 28, - "claim_start": "2026-09-12T00:00:00Z", - "claim_end": "2026-12-31T00:00:00Z", - "validity_mode": "days", - "valid_from": null, "valid_until": null, "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-12T02:00:00Z", - "updated_at": "2026-09-12T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "food", - "merchant_name": "野生菌肉饼鸡", "price": { "original": 1250, "deal": 999, @@ -3983,28 +3872,18 @@ { "id": "benefit-003", "merchant_id": "food-002", - "title": "龙里餐饮 2-3 人餐权益", + "merchant_name": "龙里辣子鸡", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/foods/food-002/01.jpg", - "status": "published", "total_limit": 300, "claim_count": 148, - "claim_start": "2026-09-12T00:00:00Z", - "claim_end": "2026-12-31T00:00:00Z", - "validity_mode": "days", - "valid_from": null, "valid_until": null, "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-12T02:00:00Z", - "updated_at": "2026-09-12T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "food", - "merchant_name": "龙里辣子鸡", "price": { "original": 125, "deal": 99, @@ -4019,28 +3898,18 @@ { "id": "benefit-007", "merchant_id": "food-002", - "title": "龙里餐饮 5-7 人套餐权益", + "merchant_name": "龙里辣子鸡", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/foods/food-002/02.jpg", - "status": "published", "total_limit": 200, "claim_count": 109, - "claim_start": "2026-09-12T00:00:00Z", - "claim_end": "2026-12-31T00:00:00Z", - "validity_mode": "days", - "valid_from": null, "valid_until": null, "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-12T02:00:00Z", - "updated_at": "2026-09-12T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "food", - "merchant_name": "龙里辣子鸡", "price": { "original": 375, "deal": 299, @@ -4055,28 +3924,18 @@ { "id": "benefit-009", "merchant_id": "food-002", - "title": "龙里餐饮 7-10 人套餐权益", + "merchant_name": "龙里辣子鸡", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/foods/food-002/01.jpg", - "status": "published", "total_limit": 120, "claim_count": 62, - "claim_start": "2026-09-12T00:00:00Z", - "claim_end": "2026-12-31T00:00:00Z", - "validity_mode": "days", - "valid_from": null, "valid_until": null, "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-12T02:00:00Z", - "updated_at": "2026-09-12T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "food", - "merchant_name": "龙里辣子鸡", "price": { "original": 625, "deal": 499, @@ -4091,28 +3950,18 @@ { "id": "benefit-011", "merchant_id": "food-002", - "title": "龙里餐饮 10-14 人套餐权益", + "merchant_name": "龙里辣子鸡", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/foods/food-002/02.jpg", - "status": "published", "total_limit": 60, "claim_count": 37, - "claim_start": "2026-09-12T00:00:00Z", - "claim_end": "2026-12-31T00:00:00Z", - "validity_mode": "days", - "valid_from": null, "valid_until": null, "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-12T02:00:00Z", - "updated_at": "2026-09-12T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "food", - "merchant_name": "龙里辣子鸡", "price": { "original": 1000, "deal": 799, @@ -4127,28 +3976,18 @@ { "id": "benefit-103", "merchant_id": "food-002", - "title": "龙里餐饮 3-5 人餐权益", + "merchant_name": "龙里辣子鸡", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/foods/food-001/01.jpg", - "status": "published", "total_limit": 300, "claim_count": 204, - "claim_start": "2026-09-12T00:00:00Z", - "claim_end": "2026-12-31T00:00:00Z", - "validity_mode": "days", - "valid_from": null, "valid_until": null, "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-12T02:00:00Z", - "updated_at": "2026-09-12T02:00:00Z", "already_claimed": true, "can_claim": false, "claim_unavailable_reason": "already_claimed", "user_benefit_id": "user-benefit-benefit-103", "section_key": "food", - "merchant_name": "龙里辣子鸡", "price": { "original": 250, "deal": 199, @@ -6080,31 +5919,20 @@ { "id": "benefit-004", "merchant_id": "specialty-001", - "title": "龙里刺梨礼盒特产权益", + "merchant_name": "龙里刺梨干", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/specialties/specialty-001/01.png", - "status": "published", "total_limit": 80, "claim_count": 80, - "claim_start": "2026-09-12T00:00:00Z", - "claim_end": "2026-12-31T00:00:00Z", - "validity_mode": "days", - "valid_from": null, "valid_until": null, "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-12T02:00:00Z", - "updated_at": "2026-09-12T02:00:00Z", "already_claimed": false, "can_claim": false, "claim_unavailable_reason": "claim_limit_reached", "user_benefit_id": null, "section_key": "specialty", - "merchant_name": "龙里刺梨干", "price": { - "original": 158, - "deal": 108, + "rate": 9, "spec": "刺梨礼盒" }, "slogan": [ @@ -6206,28 +6034,18 @@ { "id": "benefit-013", "merchant_id": "specialty-002", - "title": "龙里刺梨原浆特产权益", + "merchant_name": "龙里刺梨汁", "description": "该权益不绑定具体商品,可多次使用。本次操作仅记录一次使用,不会使权益失效。", "image_url": "https://one-feel-bucket.oss-cn-guangzhou.aliyuncs.com/longli/miniprogram/specialties/specialty-002/01.jpg", - "status": "published", "total_limit": 200, "claim_count": 82, - "claim_start": "2026-09-12T00:00:00Z", - "claim_end": "2026-12-31T00:00:00Z", - "validity_mode": "days", - "valid_from": null, "valid_until": null, "valid_days": 7, - "usage_limit": null, - "version": 1, - "created_at": "2026-09-12T02:00:00Z", - "updated_at": "2026-09-12T02:00:00Z", "already_claimed": false, "can_claim": true, "claim_unavailable_reason": "", "user_benefit_id": null, "section_key": "specialty", - "merchant_name": "龙里刺梨汁", "price": { "original": 99, "deal": 69, diff --git a/src/styles/icons.scss b/src/styles/icons.scss index b871e43..c534d6f 100644 --- a/src/styles/icons.scss +++ b/src/styles/icons.scss @@ -12,6 +12,7 @@ .ai-chev.t-white{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAyNCAyNCcgZmlsbD0nbm9uZScgc3Ryb2tlPScjRkZGRkZGJyBzdHJva2Utd2lkdGg9JzEuOScgc3Ryb2tlLWxpbmVjYXA9J3JvdW5kJyBzdHJva2UtbGluZWpvaW49J3JvdW5kJz48cGF0aCBkPSJNOS41IDUuNSAxNiAxMmwtNi41IDYuNSIvPjwvc3ZnPg==")} .ai-chev.t-brand{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAyNCAyNCcgZmlsbD0nbm9uZScgc3Ryb2tlPScjMDBCNTc4JyBzdHJva2Utd2lkdGg9JzEuOScgc3Ryb2tlLWxpbmVjYXA9J3JvdW5kJyBzdHJva2UtbGluZWpvaW49J3JvdW5kJz48cGF0aCBkPSJNOS41IDUuNSAxNiAxMmwtNi41IDYuNSIvPjwvc3ZnPg==")} .ai-chev.t-ink2{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAyNCAyNCcgZmlsbD0nbm9uZScgc3Ryb2tlPScjNkI3MjgwJyBzdHJva2Utd2lkdGg9JzEuOScgc3Ryb2tlLWxpbmVjYXA9J3JvdW5kJyBzdHJva2UtbGluZWpvaW49J3JvdW5kJz48cGF0aCBkPSJNOS41IDUuNSAxNiAxMmwtNi41IDYuNSIvPjwvc3ZnPg==")} +.ai-chev.t-accentDeep{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAyNCAyNCcgZmlsbD0nbm9uZScgc3Ryb2tlPScjQzk1NTBDJyBzdHJva2Utd2lkdGg9JzEuOScgc3Ryb2tlLWxpbmVjYXA9J3JvdW5kJyBzdHJva2UtbGluZWpvaW49J3JvdW5kJz48cGF0aCBkPSJNOS41IDUuNSAxNiAxMmwtNi41IDYuNSIvPjwvc3ZnPg==")} .ai-back.t-ink{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAyNCAyNCcgZmlsbD0nbm9uZScgc3Ryb2tlPScjMTQxODFDJyBzdHJva2Utd2lkdGg9JzEuOScgc3Ryb2tlLWxpbmVjYXA9J3JvdW5kJyBzdHJva2UtbGluZWpvaW49J3JvdW5kJz48cGF0aCBkPSJNMTQuNSA1LjUgOCAxMmw2LjUgNi41Ii8+PC9zdmc+")} .ai-back.t-white{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAyNCAyNCcgZmlsbD0nbm9uZScgc3Ryb2tlPScjRkZGRkZGJyBzdHJva2Utd2lkdGg9JzEuOScgc3Ryb2tlLWxpbmVjYXA9J3JvdW5kJyBzdHJva2UtbGluZWpvaW49J3JvdW5kJz48cGF0aCBkPSJNMTQuNSA1LjUgOCAxMmw2LjUgNi41Ii8+PC9zdmc+")} .ai-back.t-brand{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAyNCAyNCcgZmlsbD0nbm9uZScgc3Ryb2tlPScjMDBCNTc4JyBzdHJva2Utd2lkdGg9JzEuOScgc3Ryb2tlLWxpbmVjYXA9J3JvdW5kJyBzdHJva2UtbGluZWpvaW49J3JvdW5kJz48cGF0aCBkPSJNMTQuNSA1LjUgOCAxMmw2LjUgNi41Ii8+PC9zdmc+")} diff --git a/src/utils/index.js b/src/utils/index.js index 5bd6b5e..d70c0a4 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -36,6 +36,14 @@ export const priceText = (val) => { return Number.isInteger(n) ? String(n) : n.toFixed(2).replace(/0+$/, "").replace(/\.$/, ""); }; +/** 折扣率文案(接口直给折扣,如 8 → 8 折;缺失或非法为空) */ +export const rateText = (val) => { + if (val === null || val === undefined || val === "") return ""; + const n = Number(val); + if (Number.isNaN(n) || n <= 0) return ""; + return `${priceText(n)} 折`; +}; + /** * 手机号中间四位打码 * 接口只回 `phone_masked`(形如 `+86138****8000`),先去掉 +86 国码; @@ -80,6 +88,7 @@ export default { unique, discountLabel, priceText, + rateText, maskPhone, cnDate, uid,