优惠券:完善APP优惠券查询接口
parent
2bf4f1fa56
commit
1f7824b0d7
|
|
@ -32,7 +32,7 @@ export function setFormId(formId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 领取优惠卷
|
* 领取优惠券
|
||||||
* @param int couponId
|
* @param int couponId
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,7 @@ export function orderConfirm(cartId, isNew, addAgain,secKill,combination,bargain
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前金额能使用的优惠卷
|
* 获取当前金额能使用的优惠券
|
||||||
* @param string price
|
* @param string price
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -15,15 +15,6 @@ export function getCouponPage(data) {
|
||||||
return request.get("app-api/promotion/coupon/page", 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) {
|
export function getCouponTemplatePage(data) {
|
||||||
return request.get("app-api/promotion/coupon-template/page", data);
|
return request.get("app-api/promotion/coupon-template/page", data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -819,8 +819,8 @@
|
||||||
* 获取优惠券
|
* 获取优惠券
|
||||||
*/
|
*/
|
||||||
getCouponList(useType) {
|
getCouponList(useType) {
|
||||||
CouponApi.getCouponTemplateList(this.id, useType).then(res => {
|
CouponApi.getCouponTemplatePage({spuId: this.id, productScope: useType}).then(res => {
|
||||||
this.$set(this.coupon, 'list', res.data);
|
this.$set(this.coupon, 'list', res.data.list);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="listBox acea-row">
|
<view class="listBox acea-row">
|
||||||
<view class="list" :class='item.takeStatus ? "listHui" : "listActive" '
|
<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="tit line1" :class='item.takeStatus ? "pricehui" : "titActive" '>{{ item.name }}</view>
|
||||||
<view class="price" :class='item.takeStatus ? "pricehui" : "icon-color" '>
|
<view class="price" :class='item.takeStatus ? "pricehui" : "icon-color" '>
|
||||||
<text v-if="item.discountType === 1">{{ fen2yuan(item.discountPrice) }} 元</text>
|
<text v-if="item.discountType === 1">{{ fen2yuan(item.discountPrice) }} 元</text>
|
||||||
|
|
@ -381,8 +381,8 @@
|
||||||
* 获得优惠劵列表
|
* 获得优惠劵列表
|
||||||
*/
|
*/
|
||||||
getcouponList() {
|
getcouponList() {
|
||||||
CouponApi.getCouponTemplateList().then(res => {
|
CouponApi.getCouponTemplatePage({pageSize: 2}).then(res => {
|
||||||
this.$set(this, 'couponList', res.data);
|
this.$set(this, 'couponList', res.data.list);
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
return this.$util.Tips({
|
return this.$util.Tips({
|
||||||
title: err
|
title: err
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,7 @@
|
||||||
getCoupon: function(id, index) {
|
getCoupon: function(id, index) {
|
||||||
// 领取优惠券
|
// 领取优惠券
|
||||||
CouponApi.takeCoupon(id).then(res => {
|
CouponApi.takeCoupon(id).then(res => {
|
||||||
|
// todo 会导致take_limit_count失效
|
||||||
this.couponsList[index].takeStatus = true;
|
this.couponsList[index].takeStatus = true;
|
||||||
this.$set(this, 'couponsList', this.couponsList);
|
this.$set(this, 'couponsList', this.couponsList);
|
||||||
this.$util.Tips({
|
this.$util.Tips({
|
||||||
|
|
@ -133,7 +134,7 @@
|
||||||
CouponApi.getCouponTemplatePage({
|
CouponApi.getCouponTemplatePage({
|
||||||
pageNo: this.page,
|
pageNo: this.page,
|
||||||
pageSize: this.limit,
|
pageSize: this.limit,
|
||||||
useType: this.type
|
productScope: this.type
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
const list = res.data.list;
|
const list = res.data.list;
|
||||||
const loadend = list.length < this.limit;
|
const loadend = list.length < this.limit;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue