Authored by Rock Zhang

更新到201604202048静态资源

... ... @@ -170,17 +170,17 @@ function reMarginFooter(fixedElement) {
//未登录
$op.prepend(
'<a href="http://m.yohobuy.com/signin.html?refer=' + location.href + '">登录</a>' +
'<a href="//m.yohobuy.com/signin.html?refer=' + location.href + '">登录</a>' +
'<span class="sep-line">|</span>' +
'<a href="http://m.yohobuy.com/reg.html">注册</a>'
'<a href="//m.yohobuy.com/reg.html">注册</a>'
);
} else {
//已登录
$op.prepend(
'<span>Hi,</span>' +
'<a class="user-name" href="http://m.yohobuy.com/home?tmp=' + Math.random() + '">' + user[0] + '</a>' +
'<a href="http://m.yohobuy.com/passport/signout/index?token=' + user[3] + '">退出</a>'
'<a class="user-name" href="//m.yohobuy.com/home?tmp=' + Math.random() + '">' + user[0] + '</a>' +
'<a href="//m.yohobuy.com/passport/signout/index?token=' + user[3] + '">退出</a>'
);
}
... ... @@ -209,7 +209,7 @@ function reMarginFooter(fixedElement) {
a.async = 1;
a.src = j;
m.parentNode.insertBefore(a, m);
})(window, document, 'script', 'http://cdn.yoho.cn/yas-jssdk/1.0.14/yas.js', '_yas');
})(window, document, 'script', '//cdn.yoho.cn/yas-jssdk/1.0.14/yas.js', '_yas');
(function() {
var uid = getUid();
... ... @@ -2229,7 +2229,7 @@ $('.nav-btn').on('touchstart', function() {
return false;
});
function hideSideBar() {
function hideSideBar(){
openSideNav = false;
if ($mobileWrap.hasClass('menu-open')) {
$mobileWrap.removeClass('menu-open');
... ... @@ -3829,6 +3829,9 @@ require("js/passport/bind/bind");
require("js/passport/bind/code");
require("js/passport/bind/password");
// 关联手机
require("js/passport/bind/relate");
});
define("js/passport/register/register", ["jquery"], function(require, exports, module){
/**
... ... @@ -4064,11 +4067,10 @@ define("js/passport/code", ["jquery"], function(require, exports, module){
*/
var $ = require("jquery");
module.exports = function(useInRegister, useForBind) {
module.exports = function(useInRegister, useForBind, useForRelate) {
var $captcha = $('#captcha'),
$btnNext = $('#btn-next'),
$captchaTip = $('#captcha-tip'),
isReg = parseInt($('#isReg').val()),
nickname = $('#nickname').val(),
sourceType = $('#sourceType').val(),
openId = $('#openId').val(),
... ... @@ -4083,9 +4085,11 @@ module.exports = function(useInRegister, useForBind) {
var urlMid = useInRegister ? 'reg' : 'back';
// var isReg = parseInt($('#isReg').val());
function startBind() {
$.ajax({
url: '/passport/bind/bindMobile',
url: useForBind ? '/passport/bind/bindMobile' : '/passport/bind/relateMobile',
type: 'post',
data: {
areaCode: areaCode.replace('+', ''),
... ... @@ -4093,7 +4097,8 @@ module.exports = function(useInRegister, useForBind) {
openId: openId,
sourceType: sourceType,
nickname: nickname,
password: ''
password: '',
code: trim($captcha.val())
},
success: function(res) {
if (res.code === 200) {
... ... @@ -4143,7 +4148,7 @@ module.exports = function(useInRegister, useForBind) {
$.ajax({
type: 'POST',
url: useForBind ? '/passport/bind/sendBindMsg' : '/passport/' + urlMid + '/sendcode',
url: (useForBind || useForRelate) ? '/passport/bind/sendBindMsg' : '/passport/' + urlMid + '/sendcode',
data: {
phoneNum: phoneNum,
areaCode: areaCode
... ... @@ -4166,36 +4171,38 @@ module.exports = function(useInRegister, useForBind) {
return;
}
$.ajax({
type: 'POST',
url: useForBind ? '/passport/bind/checkBindMsg' : '/passport/' + urlMid + '/verifycode',
data: {
phoneNum: phoneNum,
areaCode: areaCode,
code: trim($captcha.val()),
token: $('#token').val()
},
success: function(data) {
if (data.code === 200) {
if (useForBind) {
if (isReg) {
startBind();
} else {
location.href = '/passport/bind/password?phoneNum=' +
phoneNum + '&areaCode=' + areaCode + '&openId=' +
openId + '&sourceType=' + sourceType + '&nickname=' + nickname;
}
} else {
location.href = data.data;
}
} else {
//验证码不正确,显示提示
showErrTip(data.message);
}
}
});
// $.ajax({
// type: 'POST',
// url: useForBind ? '/passport/bind/checkBindMsg' : '/passport/' + urlMid + '/verifycode',
// data: {
// phoneNum: phoneNum,
// areaCode: areaCode,
// code: trim($captcha.val()),
// token: $('#token').val()
// },
// success: function(data) {
// if (data.code === 200) {
// if (useForBind) {
// if (isReg) {
// startBind();
// } else {
// location.href = '/passport/bind/password?phoneNum=' +
// phoneNum + '&areaCode=' + areaCode + '&openId=' +
// openId + '&sourceType=' + sourceType + '&nickname=' + nickname;
// }
// } else {
// location.href = data.data;
// }
// } else {
//
// //验证码不正确,显示提示
// showErrTip(data.message);
// }
//
// }
// });
});
countDown();
... ... @@ -4845,7 +4852,11 @@ function nextStep(url, mobileNo, areaCode) {
success: function(res) {
// console.log(res.data);
if (res.code === 200) {
location.href = url;
} else {
tip.show(res.message);
}
},
error: function() {
tip.show('出错了,请重试!');
... ... @@ -4918,6 +4929,16 @@ $btnNext.on('touchstart', function() {
}, function() {
nextStep(res.data.next, pn, areaCode);
});
} else if (res.data.isReg === 3) {
dialog.showDialog({
dialogText: '该手机号已注册过有货\n' + pn + ',是否进行关联?',
hasFooter: {
leftBtnText: '更换号码',
rightBtnText: '确定'
}
}, function() {
nextStep(res.data.next, pn, areaCode);
});
} else {
nextStep(res.data.next, pn, areaCode);
}
... ... @@ -5140,6 +5161,14 @@ $btnSure.on('touchstart', function() {
});
});
define("js/passport/bind/relate", ["jquery"], function(require, exports, module){
/**
* 关联手机号-验证码
*/
require("js/passport/code")(true, false, true);
});
define("js/product/entry", ["jquery","swiper","lazyload","hammer","handlebars","source-map","index"], function(require, exports, module){
/**
* 产品打包入口
... ... @@ -6887,6 +6916,7 @@ define("js/cart/chose-panel", ["jquery"], function(require, exports, module){
* @date: 2015/10/21
*/
// bikai
// 增加init函数,异步请求的接口需要重新初始化一下选择列表
// 异步渲染的模板统一插入 #chose-panel ,兼容页面多个选择框
... ... @@ -8152,6 +8182,7 @@ require("js/me/pay");
require("js/me/personal-details");
require("js/me/currency");
require("js/me/currency-new");
require("js/me/message");
});
define("js/me/order", ["jquery","hammer","lazyload","handlebars","source-map"], function(require, exports, module){
... ... @@ -9902,6 +9933,7 @@ $('.employ span').each(function(index) {
});
});
function scrollHandler() {
if ($(window).scrollTop() + $(window).height() > $('body').height() - 100) {
page++;
... ... @@ -10664,6 +10696,88 @@ require("js/home/maybe-like")(getGender());
});
define("js/me/message", ["jquery","handlebars","source-map","hammer"], function(require, exports, module){
var $ = require("jquery"),
loading = require("js/plugin/loading"),
dialog = require("js/me/dialog");
var $page = $('.massage-page'),
page = 1,
stopLoading = false;
function massageAJAX(page) {
loading.showLoadingMask();
$.ajax({
type: 'POST',
url: '/home/ajaxMessage',
dataType: 'html',
data: {
page: page
},
success: function(data) {
if (data === ' ') {
stopLoading = true;
if (page === 1) {
data = '<p style="text-align:center">您没有消息</p>';
}
}
$('.massage-page').append(data);
window.rePosFooter();
loading.hideLoadingMask();
}
});
}
function scrollHandler() {
if (!stopLoading && ($(window).scrollTop() + $(window).height() > $('body').height() - 100)) {
page++;
massageAJAX(page);
}
}
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
// 删除消息
$page.on('touchstart', '.del', function() {
var $good = $(this).closest('.massage-list'),
$id = $good.data('id');
dialog.showDialog({
dialogText: '确定删除这条消息吗?',
hasFooter: {
leftBtnText: '取消',
rightBtnText: '确定'
}
}, function() {
$.ajax({
type: 'POST',
url: '/home/ajaxDelMes',
data: {
id: $id
},
success: function(data) {
if (data.code === 200) {
dialog.showDialog({
dialogText: '删除消息成功',
autoHide: 2000,
fast: true
});
setTimeout(function() {
window.history.go(0);
}, 1200);
}
}
});
});
});
massageAJAX(page);
});
define("js/cart/entry", ["jquery","mlellipsis","hammer","handlebars","source-map","swiper","lazyload","index"], function(require, exports, module){
/**
* 购物车打包入口
... ... @@ -10684,7 +10798,6 @@ define("js/cart/cart", ["jquery","mlellipsis","hammer","handlebars","source-map"
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/20
*/
var $ = require("jquery"),
ellipsis = require("mlellipsis"),
Hammer = require("hammer");
... ... @@ -10897,7 +11010,7 @@ $('.btn-balance').on('touchend', function() {
}
});
$('.off-shell-goods').on('touchstart touchend', function() {
$('.off-shell-goods').on('touchstart touchend', function(e) {
var $this = $(e.target).closest('span');
if ($this.hasClass('icon-del')) {
... ... @@ -11682,9 +11795,7 @@ var $ = require("jquery"),
tip = require("js/plugin/tip"),
orderInfo = require("js/cart/order-info").orderInfo;
var page = 1,
canGetCoupon = true,
isGetData;
var isGetData;
var conponTmpl = Handlebars.compile($('#tmpl-coupon').html()),
conponNotAvaliableTmpl = Handlebars.compile($('#tmpl-coupon-not-avaliable').html()),
... ... @@ -11764,54 +11875,22 @@ $newCoupon.find('input').on('input', function() {
}
});
function getCouponHandle(coupons) {
var notAvailableCoupons = [];
// 后端需要返回一个 coupons 列表,如下
// notAvailable 表示不可用的优惠券
// coupons = [{
// money: '99',
// coupon_name: '满XX-减去吴悠右腿有益于有2222',
// couponValidity: '20150129-20150430',
// coupon_id: '22222'
// }, {
// money: '99',
// coupon_name: '满XX-减去吴悠右腿有益于有2222',
// couponValidity: '20150129-20150430',
// coupon_id: '2222233'
// }, {
// money: '99',
// coupon_name: 'NONO满XX-减去吴悠右腿有益于有2222',
// couponValidity: '20150129-20150430',
// coupon_id: '2222233',
// notAvailable: 1
// }];
// coupons 是个列表,如果不是列表,可能是服务器错误,这次翻页加载不算
if (!$.isArray(coupons)) {
page--;
return;
}
function getCouponHandle(allCoupons) {
var notAvailableCoupons,
coupons;
// 每页10张,当不足10张时,说明已经加载完
if (coupons.length < 10) {
canGetCoupon = false;
}
// 第一页张数为 0 ,显示优惠券为空
if (!coupons.length && page === 2) {
// 空数组表示没有优惠券
if ($.isArray(allCoupons)) {
$('.coupin-wrap').html($('#tmpl-no-coupon').html());
fixedLayOut();
return;
}
// 把不可用的优惠券分离出来
$.each(coupons, function(i, coupon) {
if (coupon.notAvailable) {
notAvailableCoupons.push(coupon);
}
});
// 把可用和不可用的优惠券分离出来
notAvailableCoupons = allCoupons['notAvailableCoupons'];
coupons = allCoupons['coupons'];
// 渲染可用的优惠券
$couponList.append(conponTmpl({
coupons: coupons
})).find('.employ-main').each(function(i, elem) {
... ... @@ -11854,27 +11933,19 @@ function getCouponHandle(coupons) {
}
function getCouponDate() {
if (!canGetCoupon) {
return;
}
if (isGetData) {
return;
}
loading.showLoadingMask();
page += 1;
isGetData = true;
$.ajax({
type: 'POST',
type: 'GET',
url: '/cart/index/couponList',
dataType: 'json',
data: {
page: page
}
dataType: 'json'
}).then(getCouponHandle).fail(function() {
page -= 1;
// tip.show('加载优惠券失败');
}).always(function() {
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.