75

parent 524740d6
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
<img class="closeImg" @click="closeCouponPop" :src="closeImg" alt=""> <img class="closeImg" @click="closeCouponPop" :src="closeImg" alt="">
<div class="content"> <div class="content">
<p>您的好友{{shareName}}赠您</p> <p>您的好友{{shareName}}赠您</p>
<img class="btn" :src="couponBtn" alt=""> <img class="btn" @click="getCoupon" :src="couponBtn" alt="">
</div> </div>
</div> </div>
</mt-popup> </mt-popup>
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
<img :src="dataURL" class="cvs-img"> <img :src="dataURL" class="cvs-img">
</mt-popup> </mt-popup>
<div v-if="groupDetail.status === 1 && invite_code_f"> <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"> <footer v-if="groupDetail.goods_type && groupDetail.goods_type === 2">
<div <div
class="btn" class="btn"
...@@ -198,6 +198,7 @@ import "swiper/dist/css/swiper.css"; ...@@ -198,6 +198,7 @@ import "swiper/dist/css/swiper.css";
import { swiper, swiperSlide } from "vue-awesome-swiper"; import { swiper, swiperSlide } from "vue-awesome-swiper";
import {Popup} from 'mint-ui' import {Popup} from 'mint-ui'
import comment from "../../util/common"; import comment from "../../util/common";
import { Toast } from 'vant';
import { import {
getwechatParam, getwechatParam,
getGoodsDetailApi, getGoodsDetailApi,
...@@ -208,7 +209,9 @@ import { ...@@ -208,7 +209,9 @@ import {
getStatusWechatApi, getStatusWechatApi,
payApi, payApi,
getCouponListApi, getCouponListApi,
getAutomationCouponApi getAutomationCouponApi,
getInvitedCouponApi,
getReceiveCouponApi
} from "../../service/api"; } from "../../service/api";
import refBg from "../../assets/refBg.png"; import refBg from "../../assets/refBg.png";
import moreUrl from "../../assets/moreIcon.png"; import moreUrl from "../../assets/moreIcon.png";
...@@ -290,6 +293,13 @@ export default { ...@@ -290,6 +293,13 @@ export default {
// }) // })
}, },
methods: { methods: {
getCoupon(){
getReceiveCouponApi(this.$route.query.shopId).then(res=>{
this.couponShadow = true;
this.couponPopup=false;
Toast('领取成功')
})
},
closeCouponPop(){ closeCouponPop(){
this.couponPopup = false this.couponPopup = false
this.closeStatus = true this.closeStatus = true
...@@ -572,6 +582,19 @@ export default { ...@@ -572,6 +582,19 @@ export default {
console.log(this.couponInfo); 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() { showTeacher() {
this.popType = false; this.popType = false;
......
...@@ -40,9 +40,9 @@ Vue.component('scroll', scroll); ...@@ -40,9 +40,9 @@ Vue.component('scroll', scroll);
// Vue.prototype.$throw = (error)=> errorHandler(error,this); // Vue.prototype.$throw = (error)=> errorHandler(error,this);
/* eslint-disable no-new */ /* eslint-disable no-new */
if (process.env.NODE_ENV != 'production') { // if (process.env.NODE_ENV != 'production') {
new VConsole(); // new VConsole();
} // }
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
next() next()
......
...@@ -332,4 +332,12 @@ export const searchAccountinfoApi = function (authorization) { ...@@ -332,4 +332,12 @@ export const searchAccountinfoApi = function (authorization) {
export const getStarInfoApi = function () { export const getStarInfoApi = function () {
return Vue.prototype.$fetch(`/api/client/user/starActivity`) 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