优惠券:完善APP优惠券查询接口

pull/3/head
owen 2023-09-26 20:44:17 +08:00
parent 2bf4f1fa56
commit 1f7824b0d7
6 changed files with 9 additions and 17 deletions

View File

@ -32,7 +32,7 @@ export function setFormId(formId) {
}
/**
* 领取优惠
* 领取优惠
* @param int couponId
*
*/

View File

@ -178,7 +178,7 @@ export function orderConfirm(cartId, isNew, addAgain,secKill,combination,bargain
}
/**
* 获取当前金额能使用的优惠
* 获取当前金额能使用的优惠
* @param string price
*
*/

View File

@ -15,15 +15,6 @@ export function getCouponPage(data) {
return request.get("app-api/promotion/coupon/page", data);
}
export function getCouponTemplateList(spuId, useType) {
return request.get("app-api/promotion/coupon-template/list", {
spuId,
useType
}, {
noAuth: true // TODO 芋艿:后续要做调整
});
}
export function getCouponTemplatePage(data) {
return request.get("app-api/promotion/coupon-template/page", data);
}

View File

@ -819,8 +819,8 @@
* 获取优惠券
*/
getCouponList(useType) {
CouponApi.getCouponTemplateList(this.id, useType).then(res => {
this.$set(this.coupon, 'list', res.data);
CouponApi.getCouponTemplatePage({spuId: this.id, productScope: useType}).then(res => {
this.$set(this.coupon, 'list', res.data.list);
})
},
/**

View File

@ -98,7 +98,7 @@
</view>
<view class="listBox acea-row">
<view class="list" :class='item.takeStatus ? "listHui" : "listActive" '
v-for="(item, index) in couponList.slice(0,2)" :key="index">
v-for="(item, index) in couponList" :key="index">
<view class="tit line1" :class='item.takeStatus ? "pricehui" : "titActive" '>{{ item.name }}</view>
<view class="price" :class='item.takeStatus ? "pricehui" : "icon-color" '>
<text v-if="item.discountType === 1">{{ fen2yuan(item.discountPrice) }} </text>
@ -381,8 +381,8 @@
* 获得优惠劵列表
*/
getcouponList() {
CouponApi.getCouponTemplateList().then(res => {
this.$set(this, 'couponList', res.data);
CouponApi.getCouponTemplatePage({pageSize: 2}).then(res => {
this.$set(this, 'couponList', res.data.list);
}).catch(err => {
return this.$util.Tips({
title: err

View File

@ -111,6 +111,7 @@
getCoupon: function(id, index) {
//
CouponApi.takeCoupon(id).then(res => {
// todo take_limit_count
this.couponsList[index].takeStatus = true;
this.$set(this, 'couponsList', this.couponsList);
this.$util.Tips({
@ -133,7 +134,7 @@
CouponApi.getCouponTemplatePage({
pageNo: this.page,
pageSize: this.limit,
useType: this.type
productScope: this.type
}).then(res => {
const list = res.data.list;
const loadend = list.length < this.limit;