From 576d0874ada383484291b5ca7fc2bbfe813ecc79 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 25 Jun 2023 17:43:59 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E6=83=A0=E5=8A=B5=E9=A2=86?= =?UTF-8?q?=E5=8F=96=E3=80=91=201.=20=E5=AE=9E=E7=8E=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/promotion/coupon.js | 11 ++ api/promotion/couponTemplate.js | 8 -- components/couponListWindow/index.vue | 4 +- pages/goods_details/index.vue | 4 +- pages/users/user_get_coupon/index.vue | 181 +++++++++++--------------- 5 files changed, 94 insertions(+), 114 deletions(-) delete mode 100644 api/promotion/couponTemplate.js diff --git a/api/promotion/coupon.js b/api/promotion/coupon.js index 2a04f75c..d3549b59 100644 --- a/api/promotion/coupon.js +++ b/api/promotion/coupon.js @@ -5,3 +5,14 @@ export function takeCoupon(templateId) { templateId }); } + +export function getCouponTemplateList(spuId, useType) { + return request.get("app-api/promotion/coupon-template/list", { + spuId, + useType + }); +} + +export function getCouponTemplatePage(data) { + return request.get("app-api/promotion/coupon-template/page", data); +} diff --git a/api/promotion/couponTemplate.js b/api/promotion/couponTemplate.js deleted file mode 100644 index 11773632..00000000 --- a/api/promotion/couponTemplate.js +++ /dev/null @@ -1,8 +0,0 @@ -import request from "@/utils/request.js"; - -export function getCouponTemplateList(spuId, useType) { - return request.get("app-api/promotion/coupon-template/list", { - spuId, - useType - }); -} diff --git a/components/couponListWindow/index.vue b/components/couponListWindow/index.vue index e070f5a3..0508cd1b 100644 --- a/components/couponListWindow/index.vue +++ b/components/couponListWindow/index.vue @@ -21,9 +21,9 @@ - 通用 + 通用 品类 + v-else-if='type === 3'>品类 商品 {{item.name}} diff --git a/pages/goods_details/index.vue b/pages/goods_details/index.vue index 682fab9e..d9a34a26 100644 --- a/pages/goods_details/index.vue +++ b/pages/goods_details/index.vue @@ -290,7 +290,7 @@ import * as ProductSpuApi from '@/api/product/spu.js'; import * as ProductFavoriteApi from '@/api/product/favorite.js'; import * as ProductCommentApi from '@/api/product/comment.js'; - import * as CouponTemplateApi from '@/api/promotion/couponTemplate.js'; + import * as CouponApi from '@/api/promotion/coupon.js'; import * as PromotionActivityApi from '@/api/promotion/activity.js'; import * as TradeCartApi from '@/api/trade/cart.js'; import * as Util from '@/utils/util.js'; @@ -820,7 +820,7 @@ * 获取优惠券 */ getCouponList(useType) { - CouponTemplateApi.getCouponTemplateList(this.id, useType).then(res => { + CouponApi.getCouponTemplateList(this.id, useType).then(res => { this.$set(this.coupon, 'list', res.data); }) }, diff --git a/pages/users/user_get_coupon/index.vue b/pages/users/user_get_coupon/index.vue index 1a748943..d1cc3c25 100644 --- a/pages/users/user_get_coupon/index.vue +++ b/pages/users/user_get_coupon/index.vue @@ -9,65 +9,50 @@ - - {{item.money?Number(item.money):''}} - 满{{item.minPrice?Number(item.minPrice):''}}元可用 + + ¥ + {{ fen2yuan(item.discountPrice) }} + {{ (item.discountPercent / 10.0).toFixed(1) }} 折 + + 满 {{ fen2yuan(item.usePrice) }} 元可用 - 通用 - 品类 - 商品 + 通用 + 品类 + 商品 {{item.name}} - 领取后{{item.day}}天内可用 - - {{ item.useStartTimeStr&& item.useEndTimeStr ? item.useStartTimeStr + " - " + item.useEndTimeStr : ""}} - - 已领取 - 立即领取 + 领取后 {{ item.fixedEndTerm }} 天内可用 + + {{ formatDate(item.validStartTime) + " - " + formatDate(item.validEndTime) }} + + 已领取 + 立即领取 - {{couponsList.length?loadTitle:''}} + {{couponsList.length?loadTitle:''}} - + - - - - -