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:''}} - + - - - - -