Authored by 郭成尧

del-brand

... ... @@ -11,12 +11,11 @@ shopCoupon = {
appVersion: window.queryString.app_version || window.queryString.appVersion,
uid: window.queryString.uid,
shopId: parseInt($('.shop-id').val() || $('.shopId').val(), 10) || null,
brandId: parseInt($('.brand-header').data('id'), 10) || null,
couponTemplate: require('product/shop/coupon.hbs')
},
init: function() {
// 如果都为空,则不请求
if (!this.common.shopId && !this.common.brandId) {
// 如果为空,则不请求
if (!this.common.shopId) {
return true;
}
... ... @@ -27,26 +26,17 @@ shopCoupon = {
},
getShopCouponsList: function() {
let that = this,
_url = location.protocol + '//m.yohobuy.com';
_url = location.protocol + '//m.yohobuy.com/product/index/getShopCouponsList';
if ($('.coupon-group').length <= 0) {
return false;
}
if (that.common.shopId) {
// 店铺领券
_url += '/product/index/getShopCouponsList';
} else {
// 品牌领券
_url += '/product/index/getBrandCouponsList';
}
$.ajax({
method: 'GET',
url: _url,
data: {
shopId: that.common.shopId,
brandId: that.common.brandId,
uid: that.common.uid
},
xhrFields: {
... ...