Authored by Rock Zhang

Merge branch 'feature/wap4.3' of git.dev.yoho.cn:web/yohobuy into feature/wap4.3

... ... @@ -3485,7 +3485,7 @@ module.exports = function(specificGender) {
};
});
define("js/index/entry", ["jquery","hammer"], function(require, exports, module){
define("js/index/entry", ["jquery","hammer","swiper","index"], function(require, exports, module){
/**
* Index打包入口
* @author: xuqi<qi.xu@yoho.cn>
... ... @@ -3494,7 +3494,8 @@ define("js/index/entry", ["jquery","hammer"], function(require, exports, module)
require("js/index/search");
require("js/index/footer");
require("js/index/channel");
require("js/index/channel");
require("js/index/coupon");
});
define("js/index/search", ["jquery","hammer"], function(require, exports, module){
/**
... ... @@ -3825,6 +3826,74 @@ $channelLink.on('touchstart', function() {
});
});
define("js/index/coupon", ["jquery","swiper","index"], function(require, exports, module){
/**
* Created by Administrator on 2016/4/13.
*/
var $ = require("jquery"),
Swiper = require("swiper"),
$receive = $('.main-right-receive'),
$mask = $('.floor-mask'),
$message = $('.floor-message'),
$tooltip = $('.floor-tooltip');
var bannerSwiper;
$receive.on('click', function() {
var $curDom = $(this);
$.ajax({
url: '/coupon/receiveCoupon',
dataType: 'json',
success: function(data) {
var msg = data.msg,
status = data.status;
if (data.noLogin === true) {
location.href = data.url + '?code=' + getUrlParam('code');
} else {
if (status) {
$curDom.hide();
$curDom.next().show();
$tooltip.show();
setTimeout(function() {
$tooltip.hide();
}, 3000);
} else {
$message.find('.coupon-message-content').text(msg);
$mask.show();
$message.show();
}
}
}
});
});
//获取url中的参数
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
var r = window.location.search.substr(1).match(reg); //匹配目标参数
if (r != null) return unescape(r[2]); return null; //返回参数值
}
$('.coupon-floor a').on('click', function() {
if ($(this).attr('href').length <= 0) {
return false;
}
});
if ($('.banner-swiper').find('li').size() > 1) {
bannerSwiper = new Swiper('.banner-swiper', {
lazyLoading: true,
lazyLoadingInPrevNext: true,
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
paginationClickable: true,
slideElement: 'li',
pagination: '.banner-top .pagination-inner'
});
}
});
define("js/passport/entry", ["jquery","handlebars","source-map","hammer"], function(require, exports, module){
/**
* 注册、登录、密码找回打包入口
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -6,4 +6,5 @@
require('./search');
require('./footer');
require('./channel');
\ No newline at end of file
require('./channel');
require('./coupon');
\ No newline at end of file
... ...
... ... @@ -378,3 +378,9 @@
seajs.use('js/me/message-detail');
</script>
{{/if}}
{{#if floorPage}}
<script>
seajs.use('js/index/coupon');
</script>
{{/if}}
... ...