...
|
...
|
@@ -2,7 +2,9 @@ var $ = require('yoho-jquery'), |
|
|
Swiper = require('yoho-swiper'),
|
|
|
lazyLoad = require('yoho-jquery-lazyload'),
|
|
|
fastclick = require('yoho-fastclick'),
|
|
|
tip = require('../plugin/tip');
|
|
|
tip = require('../plugin/tip'),
|
|
|
dialog = require('../plugin/dialog'),
|
|
|
Hammer = require('yoho-hammer');
|
|
|
|
|
|
var _weChatInterface = '//m.yohobuy.com/life/getSignPackage',
|
|
|
wx = window.wx,
|
...
|
...
|
@@ -13,6 +15,21 @@ var _weChatInterface = '//m.yohobuy.com/life/getSignPackage', |
|
|
|
|
|
require('../common');
|
|
|
|
|
|
// 根据ua判断页头
|
|
|
(function uaHeader() {
|
|
|
var UALIST = ['MicroMessenger', 'QQ/', 'Weibo'],
|
|
|
UA = navigator.userAgent,
|
|
|
i;
|
|
|
|
|
|
for (i = 0; i < UALIST.length; i++) {
|
|
|
if (UA.indexOf(UALIST[i]) > -1) {
|
|
|
$('#yoho-header').remove();
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}());
|
|
|
|
|
|
getChannel = function() {
|
|
|
var name = window.cookie('_Channel');
|
|
|
|
...
|
...
|
@@ -393,3 +410,74 @@ $('.s-renzhen').click(function() { |
|
|
window._yas.sendCustomInfo(options, true);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$('.dialog-wrapper').addClass('s-dialog-wrapper');
|
|
|
$('.s-dialog').on('click', function() {
|
|
|
var text = [{
|
|
|
dialogText: '<h2>权益1: 新品立享9折</h2><p>1、学生购买指定原价新品时,可立即享受9折优惠,与VIP折扣不可同时享受</p>',
|
|
|
}, {
|
|
|
dialogText: '<h2>权益2: 每1元返1个有货币</h2><p>1、学生购买指定商品时,以商品的实际成交金额计算,每1元返1个有货币;</p>' +
|
|
|
'<p>2、返有货币时间:确认收货7日后,系统将自动将对应数量的有货币返至购买账户;</p>' +
|
|
|
'<p>3、有货币有效期:获得当日至次年12月31日,逾期自动作废;</p>' +
|
|
|
'<p>4、查看有货币:登录后,点击“个人中心”在“我的有货币”中可以查看有货币余额及明细。</p>',
|
|
|
}, {
|
|
|
dialogText: '<h2>权益3: 免单抽奖</h2><p>1、每月将在累计购物金额最高的学校中,抽取3名幸运学生用户,获得免单资格;</p>' +
|
|
|
'<p>2、免单用户名单将在每月第1个工作日公布在有货微信公众号上,可关注【有货YOHOBUY】;</p>' +
|
|
|
'<p>3、免单用户将在中奖次日获得与实付金额等额的现金券,使用时间:中奖当月。</p>',
|
|
|
}, {
|
|
|
dialogText: '<h2>权益4: 学生专享活动</h2><p>1、每月不定期的开展学生专享活动,可打开有货APP推送,及时查收学生专享活动通知。</p>',
|
|
|
}];
|
|
|
var dialogBoxHammer, dialogRightBtn;
|
|
|
|
|
|
dialog.showDialog({
|
|
|
student: true,
|
|
|
dialogText: text[$(this).index()].dialogText,
|
|
|
hasFooter: {
|
|
|
rightBtnText: '我知道了'
|
|
|
}
|
|
|
}, function() {
|
|
|
$('body').css({
|
|
|
overflow: '',
|
|
|
position: '',
|
|
|
});
|
|
|
dialog.hideDialog();
|
|
|
}, undefined, true);
|
|
|
|
|
|
$('.dialog-content').css({
|
|
|
padding: '0 1.5rem 1rem 1.5rem',
|
|
|
});
|
|
|
|
|
|
$('.dialog-box').css({
|
|
|
'border-radius': '0.25rem',
|
|
|
background: '#fff',
|
|
|
});
|
|
|
|
|
|
$('.dialog-right-btn').css({
|
|
|
border: 'none',
|
|
|
color: '#d0021b',
|
|
|
});
|
|
|
|
|
|
$('body').css({
|
|
|
overflow: 'hidden',
|
|
|
position: 'fixed',
|
|
|
});
|
|
|
|
|
|
dialogBoxHammer = new Hammer(document.getElementsByClassName('dialog-box')[0]);
|
|
|
dialogRightBtn = new Hammer(document.getElementsByClassName('dialog-right-btn')[0]);
|
|
|
|
|
|
dialogBoxHammer.on('tap', function(event) {
|
|
|
event.srcEvent.stopPropagation();
|
|
|
});
|
|
|
|
|
|
dialogRightBtn.on('tap', function(event) {
|
|
|
$('body').css({
|
|
|
overflow: '',
|
|
|
position: '',
|
|
|
});
|
|
|
dialog.hideDialog();
|
|
|
event.preventDefault();
|
|
|
event.srcEvent.stopPropagation();
|
|
|
});
|
|
|
|
|
|
$('.dialog-content').addClass('s-dialog-content');
|
|
|
}); |
|
|
\ No newline at end of file |
...
|
...
|
|