From dfe4a33e2d945e808ee5e14154b17ccf56616daf Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 28 Apr 2025 22:43:30 +0800 Subject: [PATCH] =?UTF-8?q?reactor=EF=BC=9Aconsts=20=E6=8C=AA=E5=88=B0=20h?= =?UTF-8?q?elper=20=E7=9B=AE=E5=BD=95=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/activity/groupon/detail.vue | 2 +- pages/activity/seckill/list.vue | 2 +- pages/commission/index.vue | 69 ++-- pages/goods/groupon.vue | 2 +- pages/goods/index.vue | 10 +- pages/goods/point.vue | 2 +- pages/goods/seckill.vue | 2 +- pages/order/aftersale/apply.vue | 1 - pages/order/confirm.vue | 2 +- pages/pay/recharge.vue | 47 ++- pages/pay/result.vue | 2 +- .../s-coupon-block/s-coupon-block.vue | 325 +++++++++--------- .../s-goods-column/s-goods-column.vue | 2 +- .../s-point-block/s-point-block.vue | 12 +- .../components/s-point-card/s-point-card.vue | 106 +++--- .../s-select-seckill-sku.vue | 2 +- sheep/{util => helper}/const.js | 2 - sheep/platform/share.js | 2 +- sheep/request/index.js | 19 +- 19 files changed, 328 insertions(+), 283 deletions(-) rename sheep/{util => helper}/const.js (98%) diff --git a/pages/activity/groupon/detail.vue b/pages/activity/groupon/detail.vue index 456bf7b4..5312b879 100644 --- a/pages/activity/groupon/detail.vue +++ b/pages/activity/groupon/detail.vue @@ -208,7 +208,7 @@ import { isEmpty } from 'lodash-es'; import CombinationApi from '@/sheep/api/promotion/combination'; import SpuApi from '@/sheep/api/product/spu'; - import { SharePageEnum } from '@/sheep/util/const'; + import { SharePageEnum } from '@/sheep/helper/const'; const headerBg = sheep.$url.css('/static/img/shop/user/withdraw_bg.png'); const statusBarHeight = sheep.$platform.device.statusBarHeight * 2; diff --git a/pages/activity/seckill/list.vue b/pages/activity/seckill/list.vue index 44b82884..16eca3b8 100644 --- a/pages/activity/seckill/list.vue +++ b/pages/activity/seckill/list.vue @@ -151,7 +151,7 @@ import { useDurationTime } from '@/sheep/hooks/useGoods'; import SeckillApi from '@/sheep/api/promotion/seckill'; import dayjs from 'dayjs'; - import { TimeStatusEnum } from '@/sheep/util/const'; + import { TimeStatusEnum } from '@/sheep/helper/const'; // 计算页面高度 const { safeAreaInsets, safeArea } = sheep.$platform.device; diff --git a/pages/commission/index.vue b/pages/commission/index.vue index ab0984dd..28c077cc 100644 --- a/pages/commission/index.vue +++ b/pages/commission/index.vue @@ -1,48 +1,57 @@ diff --git a/pages/goods/groupon.vue b/pages/goods/groupon.vue index 51329296..a582f49b 100644 --- a/pages/goods/groupon.vue +++ b/pages/goods/groupon.vue @@ -159,7 +159,7 @@ import { useDurationTime, formatGoodsSwiper, fen2yuan } from '@/sheep/hooks/useGoods'; import CombinationApi from '@/sheep/api/promotion/combination'; import SpuApi from '@/sheep/api/product/spu'; - import { SharePageEnum } from '@/sheep/util/const'; + import { SharePageEnum } from '@/sheep/helper/const'; const headerBg = sheep.$url.css('/static/img/shop/goods/groupon-bg.png'); const btnBg = sheep.$url.css('/static/img/shop/goods/groupon-btn.png'); diff --git a/pages/goods/index.vue b/pages/goods/index.vue index 11ea8288..52810f62 100644 --- a/pages/goods/index.vue +++ b/pages/goods/index.vue @@ -85,7 +85,10 @@ {{ fen2yuan(state.selectedSku.price || state.goodsInfo.price) }} - + {{ fen2yuan(state.selectedSku.marketPrice || state.goodsInfo.marketPrice) }} @@ -205,7 +208,7 @@ \ No newline at end of file + .coupon-item { + &:nth-of-type(1) { + margin-left: 0 !important; + } + } + diff --git a/sheep/components/s-goods-column/s-goods-column.vue b/sheep/components/s-goods-column/s-goods-column.vue index 272c13ca..2f07705e 100644 --- a/sheep/components/s-goods-column/s-goods-column.vue +++ b/sheep/components/s-goods-column/s-goods-column.vue @@ -502,7 +502,7 @@ getRewardActivityRuleItemDescriptions, } from '@/sheep/hooks/useGoods'; import { isArray } from 'lodash-es'; - import { PromotionActivityTypeEnum } from '@/sheep/util/const'; + import { PromotionActivityTypeEnum } from '@/sheep/helper/const'; // 数据 let defaultImgWidth = ref(0); diff --git a/sheep/components/s-point-block/s-point-block.vue b/sheep/components/s-point-block/s-point-block.vue index 9de154cf..c2cf117a 100644 --- a/sheep/components/s-point-block/s-point-block.vue +++ b/sheep/components/s-point-block/s-point-block.vue @@ -141,11 +141,11 @@ /** * 商品卡片 */ - import { computed, onMounted, reactive, ref } from 'vue'; + import { computed, onMounted, reactive } from 'vue'; import sheep from '@/sheep'; import SpuApi from '@/sheep/api/product/spu'; import PointApi from '@/sheep/api/promotion/point'; - import { PromotionActivityTypeEnum } from '@/sheep/util/const'; + import { PromotionActivityTypeEnum } from '@/sheep/helper/const'; // 布局类型 const LayoutTypeEnum = { @@ -260,10 +260,10 @@ // 查找对应的 spu 并更新价格 const spu = state.spuList.find((spu) => activity.spuId === spu.id); if (spu) { - spu.pointStock = activity.stock - spu.pointTotalStock = activity.totalStock - spu.point = activity.point - spu.pointPrice = activity.price + spu.pointStock = activity.stock; + spu.pointTotalStock = activity.totalStock; + spu.point = activity.point; + spu.pointPrice = activity.price; // 赋值活动ID,为了点击跳转详情页 spu.activityId = activity.id; // 赋值活动类型 diff --git a/sheep/components/s-point-card/s-point-card.vue b/sheep/components/s-point-card/s-point-card.vue index 5153d814..1c12c033 100644 --- a/sheep/components/s-point-card/s-point-card.vue +++ b/sheep/components/s-point-card/s-point-card.vue @@ -76,7 +76,12 @@ @@ -106,7 +111,12 @@ @@ -141,10 +151,10 @@ /** * 商品卡片 */ - import { computed, nextTick, onMounted, reactive, watch } from 'vue'; + import { computed, reactive, watch } from 'vue'; import sheep from '@/sheep'; import SpuApi from '@/sheep/api/product/spu'; - import { PromotionActivityTypeEnum } from '@/sheep/util/const'; + import { PromotionActivityTypeEnum } from '@/sheep/helper/const'; import { isEmpty } from '@/sheep/helper/utils'; // 布局类型 @@ -162,53 +172,53 @@ leftSpuList: [], rightSpuList: [], property: { - 'layoutType': 'oneColBigImg', - 'fields': { - 'name': { - 'show': true, - 'color': '#000', + layoutType: 'oneColBigImg', + fields: { + name: { + show: true, + color: '#000', }, - 'introduction': { - 'show': true, - 'color': '#999', + introduction: { + show: true, + color: '#999', }, - 'price': { - 'show': true, - 'color': '#ff3000', + price: { + show: true, + color: '#ff3000', }, - 'marketPrice': { - 'show': true, - 'color': '#c4c4c4', + marketPrice: { + show: true, + color: '#c4c4c4', }, - 'salesCount': { - 'show': true, - 'color': '#c4c4c4', + salesCount: { + show: true, + color: '#c4c4c4', }, - 'stock': { - 'show': true, - 'color': '#c4c4c4', + stock: { + show: true, + color: '#c4c4c4', }, }, - 'badge': { - 'show': false, - 'imgUrl': '', + badge: { + show: false, + imgUrl: '', }, - 'btnBuy': { - 'type': 'text', - 'text': '立即兑换', - 'bgBeginColor': '#FF6000', - 'bgEndColor': '#FE832A', - 'imgUrl': '', + btnBuy: { + type: 'text', + text: '立即兑换', + bgBeginColor: '#FF6000', + bgEndColor: '#FE832A', + imgUrl: '', }, - 'borderRadiusTop': 8, - 'borderRadiusBottom': 8, - 'space': 8, - 'style': { - 'bgType': 'color', - 'bgColor': '', - 'marginLeft': 8, - 'marginRight': 8, - 'marginBottom': 8, + borderRadiusTop: 8, + borderRadiusBottom: 8, + space: 8, + style: { + bgType: 'color', + bgColor: '', + marginLeft: 8, + marginRight: 8, + marginBottom: 8, }, }, }); @@ -219,9 +229,13 @@ }, }); // 动态更新 property - watch(() => props.property, (newVal) => { - state.property = { ...state.property, ...newVal }; - }, { immediate: true, deep: true }); + watch( + () => props.property, + (newVal) => { + state.property = { ...state.property, ...newVal }; + }, + { immediate: true, deep: true }, + ); const { marginLeft, marginRight } = state.property.styles || {}; // 购买按钮样式 @@ -317,7 +331,7 @@ function getActivityCount() { return state.spuList.length; } - defineExpose({ concatActivity,getActivityCount,calculateGoodsColumn }); + defineExpose({ concatActivity, getActivityCount, calculateGoodsColumn });