ajaxActivityTime.js
816 Bytes
/**
* 获取奥莱活动时间
* @author: wsl<shuiling.wang@yoho.cn>
* @date: 2016/10/10
*/
let $ = require('yoho-jquery'),
Countdown = require('../outlet/countdown'),
tip = require('js/plugin/tip');
let $el = $('.cd-lite');
module.exports = function(params) {
$.ajax({
type: 'GET',
url: '/product/outlet/activityTime',
data: params,
success: function(data) {
if (data) {
$el.each(function(key, item) {
$(item).attr('data-config', '{"leftTime": ' + data[key] + ' }');
new Countdown.Countdown({
el: $(item)
});
});
}
},
error: function() {
tip.show('网络断开连接了~');
}
});
};