Commit 7abe4fbc7821ffe1fc82fe1a8e9d5d351b2a6468

Authored by pengye
1 parent 3c81e476

商家有礼发免费券加判断

@@ -29,6 +29,7 @@ Page({ @@ -29,6 +29,7 @@ Page({
29 hasValueRecharge: false, //商家是否开通充值功能 29 hasValueRecharge: false, //商家是否开通充值功能
30 couponData: '', //评价赠送优惠券数据 30 couponData: '', //评价赠送优惠券数据
31 }, 31 },
  32 + give_user:'',
32 /** 33 /**
33 * 生命周期函数--监听页面加载 34 * 生命周期函数--监听页面加载
34 */ 35 */
@@ -66,6 +67,7 @@ Page({ @@ -66,6 +67,7 @@ Page({
66 rid: this.data.options.id 67 rid: this.data.options.id
67 }).then(res => { 68 }).then(res => {
68 let reserev = RS.reserve(res.data) 69 let reserev = RS.reserve(res.data)
  70 + this.give_user = reserev.give_user ? reserev.give_user : '2';
69 this.setData({ 71 this.setData({
70 is_user_comments: res.data.is_user_comments, 72 is_user_comments: res.data.is_user_comments,
71 seller: { 73 seller: {
@@ -348,8 +350,21 @@ Page({ @@ -348,8 +350,21 @@ Page({
348 let freeCoupons = list.filter(item => { 350 let freeCoupons = list.filter(item => {
349 return item.is_type == '3' 351 return item.is_type == '3'
350 }) 352 })
  353 + let give = this.give_user;
  354 + let couponShow = false;
  355 + switch (give) {
  356 + case '1':
  357 + couponShow = this.data.options.hasSellerShare == '1' ? true : false;
  358 + break;
  359 + case '2':
  360 + couponShow = true;
  361 + break;
  362 + case '3':
  363 + couponShow = this.data.options.hasSellerShare != '1' ? true : false;
  364 + break;
  365 + }
351 // 显示已领取 366 // 显示已领取
352 - if (freeCoupons.length > 0) { 367 + if (freeCoupons.length > 0 && couponShow) {
353 this.getCoupon(freeCoupons,obj) 368 this.getCoupon(freeCoupons,obj)
354 } 369 }
355 console.log('邀请函--------------------优惠券', list); 370 console.log('邀请函--------------------优惠券', list);