|
|
var $ = require('yoho-jquery');
|
|
|
var lazyLoad = require('yoho-jquery-lazyload');
|
|
|
var Swiper = require('yoho-swiper');
|
|
|
var qs = require('yoho-qs');
|
|
|
var yoho = require('../yoho-app');
|
|
|
|
|
|
global.jQuery = $;
|
...
|
...
|
@@ -156,7 +157,29 @@ function modalInit() { |
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
function persenalCouponInit() {
|
|
|
let activityId = $('.feature-page').data('id');
|
|
|
|
|
|
$('.yoho-conpon').each(function() {
|
|
|
let $this = $(this);
|
|
|
|
|
|
if ($this.data('persenal-enable')) {
|
|
|
$.ajax({
|
|
|
url: '//m.yohobuy.com/activity/individuation/coupon',
|
|
|
dataType: 'jsonp',
|
|
|
data: {
|
|
|
uid: qs.uid || 0,
|
|
|
activity_id: activityId
|
|
|
},
|
|
|
success: function(res) {
|
|
|
if (res.code === 200 && res.data && res.data.couponId && res.data.personCouponId) {
|
|
|
$this.attr('data-token', `${res.data.couponId}:${res.data.personCouponId}`);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$(function() {
|
|
|
if ($('.over').length) {
|
...
|
...
|
@@ -197,4 +220,7 @@ $(function() { |
|
|
|
|
|
// 模态框
|
|
|
modalInit();
|
|
|
|
|
|
// 个性化券查询
|
|
|
persenalCouponInit();
|
|
|
}); |
...
|
...
|
|