|
|
let $ = require('yoho-jquery'),
|
|
|
Swiper = require('yoho-swiper'),
|
|
|
tip = require('plugin/tip');
|
|
|
|
|
|
require('common');
|
...
|
...
|
@@ -9,7 +8,7 @@ let shopCoupon = {}; |
|
|
shopCoupon = {
|
|
|
common: {
|
|
|
appVersion: window.queryString.app_version || window.queryString.appVersion,
|
|
|
shopId: parseInt($('.shop-id').val() || $('.shopId').val(), 10) || null,
|
|
|
shopId: parseInt($('.shop-id').val() || $('.shopId').val() || $('#shopId').val(), 10) || null,
|
|
|
couponTemplate: require('product/shop/coupon.hbs')
|
|
|
},
|
|
|
init: function() {
|
...
|
...
|
@@ -42,11 +41,6 @@ shopCoupon = { |
|
|
},
|
|
|
success: function(result) {
|
|
|
$('.coupon-group').html(that.common.couponTemplate(result));
|
|
|
new Swiper('.coupon-content', {
|
|
|
slideElement: '.coupon-small',
|
|
|
slidesPerView: 'auto',
|
|
|
watchSlidesVisibility: true
|
|
|
});
|
|
|
that.userCoupon();
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -54,7 +48,7 @@ shopCoupon = { |
|
|
userCoupon: function() {
|
|
|
let $self = this;
|
|
|
|
|
|
$('.coupon-content .receive-btn').closest('.swiper-slide').on('click', function() {
|
|
|
$('.coupon-group .receive-btn').closest('.coupon-center').on('click', function() {
|
|
|
let that = this,
|
|
|
code = $(this).data('id') || '';
|
|
|
|
...
|
...
|
|