Authored by 张孝茹

Merge branch 'feature/shareBuy2' into 'release/5.9.1'

Feature/share buy2



See merge request !718
... ... @@ -36,6 +36,8 @@ module.exports = class extends global.yoho.BaseModel {
val.couponDescribe = '任意商品使用';
} else if (val.shopNames) {
val.couponDescribe = '限' + val.shopNames + '使用';
} else if (val.shareCoupon === '商品券'){
val.couponDescribe = '指定商品可用';
}
val.detailUrl = helpers.urlFormat('/activity/share-buy/detail', {
... ... @@ -145,7 +147,8 @@ module.exports = class extends global.yoho.BaseModel {
code: 200
}).then((result) => {
let moreUrl,
detailData;
detailData,
couponDetail = _.get(result, 'data.userCouponBoList[0]', {});
if (result && result.code === 200 && result.data) {
detailData = _.assign(detailData, param);
... ... @@ -166,14 +169,17 @@ module.exports = class extends global.yoho.BaseModel {
detailData.finish = parseInt(result.data.expiredTime, 10) > 0 ? false : true;
if (result.data.userCouponBoList[0].sortNames) {
if (couponDetail.sortNames) {
detailData.detailDes = '限品类: ' + result.data.userCouponBoList[0].sortNames;
} else if (result.data.userCouponBoList[0].brandNames) {
} else if (couponDetail.brandNames) {
detailData.detailDes = '限品牌: ' + result.data.userCouponBoList[0].brandNames;
} else if (result.data.userCouponBoList[0].shareCoupon === '全场通用') {
} else if (couponDetail.shareCoupon === '全场通用') {
detailData.detailDes = result.data.userCouponBoList[0].shareCoupon;
} else if (result.data.userCouponBoList[0].shopNames) {
detailData.detailDes = result.data.userCouponBoList[0].shopNames;
} else if (couponDetail.shopNames) {
detailData.detailDes = '限店铺:' + result.data.userCouponBoList[0].shopNames;
} else if (couponDetail.shareCoupon === '商品券') {
detailData.detailDes = '限商品:指定商品可用';
detailData.goodsCoupon = true;
}
detailData = _.assign(detailData, {
... ...
... ... @@ -40,7 +40,13 @@
</div>
<div class="info-bottom">
<span class="share-coupon">{{detailDes}}</span>
<span class="coupon-tip">特列商品(秒杀、限定、境外、预售等)暂不支持使用优惠券。</span>
<span class="coupon-tip">
{{#if goodsCoupon}}
下方为优惠劵适用商品,也可兑换劵码后到优惠券列表产看指定商品。
{{else}}
特列商品(秒杀、限定、境外、预售等)暂不支持使用优惠券。
{{/if}}
</span>
<span class="validity">有效期: {{couponValidity}}</span>
</div>
... ...
... ... @@ -20,14 +20,13 @@ let params = {
endTime: [endTime] // 时间差数组
};
let noResultHbs = require('product/search/no-result-new.hbs');
let couponSum = $('.coupon-money').find('span').text();
let shareData = {
title: '发福利啦!专享优惠速来领~',
title: '【YOHO!BUY有货】送你' + couponSum + '元专享福利啦!速来领~',
link: location.href,
desc: '来YOHO玩潮流~甄选好货等你来BUY~',
desc: '400+潮流品牌每日上新,等你来BUY!',
imgUrl: 'http://img11.static.yhbimg.com/yhb-img01/2017/05/10/16/011568a808f9b10e098b6542d3a8cb3d6b.png'
};
let appVersion, link;
... ... @@ -136,7 +135,7 @@ function productData() {
success: function(data) {
if (data === '' || (data.list && data.list.length <= 0)) {
$container.html(noResultHbs());
return false;
} else {
$container.append(data);
}
... ...