75

parent 524740d6
......@@ -93,7 +93,7 @@
<img class="closeImg" @click="closeCouponPop" :src="closeImg" alt="">
<div class="content">
<p>您的好友{{shareName}}赠您</p>
<img class="btn" :src="couponBtn" alt="">
<img class="btn" @click="getCoupon" :src="couponBtn" alt="">
</div>
</div>
</mt-popup>
......@@ -119,7 +119,7 @@
<img :src="dataURL" class="cvs-img">
</mt-popup>
<div v-if="groupDetail.status === 1 && invite_code_f">
<div v-if="couponInfo.money" class="couponBox">您有{{couponInfo.money/100}}元优惠券可使用</div>
<div v-if="couponShadow" class="couponBox">您有{{couponInfo.money/100}}元优惠券可使用</div>
<footer v-if="groupDetail.goods_type && groupDetail.goods_type === 2">
<div
class="btn"
......@@ -198,6 +198,7 @@ import "swiper/dist/css/swiper.css";
import { swiper, swiperSlide } from "vue-awesome-swiper";
import {Popup} from 'mint-ui'
import comment from "../../util/common";
import { Toast } from 'vant';
import {
getwechatParam,
getGoodsDetailApi,
......@@ -208,7 +209,9 @@ import {
getStatusWechatApi,
payApi,
getCouponListApi,
getAutomationCouponApi
getAutomationCouponApi,
getInvitedCouponApi,
getReceiveCouponApi
} from "../../service/api";
import refBg from "../../assets/refBg.png";
import moreUrl from "../../assets/moreIcon.png";
......@@ -290,6 +293,13 @@ export default {
// })
},
methods: {
getCoupon(){
getReceiveCouponApi(this.$route.query.shopId).then(res=>{
this.couponShadow = true;
this.couponPopup=false;
Toast('领取成功')
})
},
closeCouponPop(){
this.couponPopup = false
this.closeStatus = true
......@@ -572,6 +582,19 @@ export default {
console.log(this.couponInfo);
});
}
getInvitedCouponApi(this.$route.query.shopId).then(res =>{
console.log(res)
if(res.code&&res.code==100){
this.couponShadow = true;
this.couponInfo.money = res.data.original_price
console.log( this.couponInfo)
}else if(this.$route.query.invite_code){
this.couponInfo = res
this.couponInfo.money = res.original_price
this.couponPopup = true
// res.original_price
}
})
},
showTeacher() {
this.popType = false;
......
......@@ -40,9 +40,9 @@ Vue.component('scroll', scroll);
// Vue.prototype.$throw = (error)=> errorHandler(error,this);
/* eslint-disable no-new */
if (process.env.NODE_ENV != 'production') {
new VConsole();
}
// if (process.env.NODE_ENV != 'production') {
// new VConsole();
// }
router.beforeEach((to, from, next) => {
next()
......
......@@ -332,4 +332,12 @@ export const searchAccountinfoApi = function (authorization) {
export const getStarInfoApi = function () {
return Vue.prototype.$fetch(`/api/client/user/starActivity`)
};
//
//获取商品可用优惠券
export const getInvitedCouponApi = function (goods_id) {
return Vue.prototype.$fetch(`/api/client/user/invited/coupon/${goods_id}`)
};
//领取商品可用优惠券
export const getReceiveCouponApi = function (goods_id) {
return Vue.prototype.$fetch(`/api/client/user/receive/coupon/${goods_id}`)
};
///api/client/user/receive/coupon/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment