Authored by whb

index js css

... ... @@ -399,7 +399,8 @@ function getSource(column, postition, event) {
} catch (e) {}
}
function submitSearch() {
window.submitSearch = function() {
var $keywordinput = $('#query_key').val();
var column = 'Search';
var postition = 'Head Search';
... ... @@ -421,6 +422,7 @@ function submitSearch() {
}
}
}
/**
* 定义购物车扩展
*/
... ... @@ -509,7 +511,7 @@ function actionGoodsCart() {
listIndex = (listIndex + 1) % queryNum;
getText(this);
} else if (event.which === 13) {
submitSearch();
window.submitSearch();
} else {
getKeywords(this);
}
... ... @@ -1830,6 +1832,8 @@ require("js/product/filter");
require("js/product/sort-pager");
require("js/product/latest-walk");
require("js/product/product");
});
define("js/product/filter", ["jquery","handlebars","source-map"], function(require, exports, module){
... ... @@ -2144,6 +2148,9 @@ $seniorAttrWrap.on('mouseenter', '.attr', function() {
var $this = $(this);
var index = $this.index();
if ($this.hasClass('no-sub')) {
return;
}
$this.addClass('hover').siblings().removeClass('hover');
$seniorSubWrap.children('.senior-sub:eq(' + index + ')').removeClass('hide').siblings().addClass('hide');
... ... @@ -2151,6 +2158,10 @@ $seniorAttrWrap.on('mouseenter', '.attr', function() {
var $this = $(this),
index = $this.index();
if ($this.hasClass('no-sub')) {
return;
}
hoveredIndex = index;
seniorHoverTime = setTimeout(function() {
... ... @@ -2214,6 +2225,65 @@ $countPerPage.click(function() {
}
});
});
define("js/product/latest-walk", ["jquery","handlebars","source-map","lazyload"], function(require, exports, module){
/**
* 最近浏览取接口渲染模板
* @author: xuqi<qi.xu@yoho.cn>
8 @date: 2016/1/20
*/
var $ = require("jquery");
var Handlebars = require("handlebars");
var lazyLoad = require("lazyload");
var $latestWalkCount = $('#latest-walk-count');
(function() {
var tpl;
if ($latestWalkCount.lenght < 0) {
return;
}
tpl = Handlebars.compile($('#latest-walk-tpl').html());
$.ajax({
url: 'http://itemapi.yohobuy.com/item/item/recentreview',
dataType: 'jsonp',
data: {
limit: $latestWalkCount.val()
},
success: function(data) {
var latestWalk = [],
res, i, cur;
if (data.code === 200) {
res = data.data;
for (i = 0; i < res.length; i++) {
cur = res[i];
latestWalk.push({
href: cur.url,
img: cur.pic_url,
name: cur.product_name,
salePrice: cur.price,
marketPrice: cur.market_price
});
}
if (latestWalk.length > 0) {
$('#latest-walk-goods').html(tpl({
latestWalk: latestWalk
}));
lazyLoad($('#latest-walk-goods .lazy'));
}
}
}
});
}());
});
define("js/product/product", ["jquery","lazyload"], function(require, exports, module){
/**
*Description: 商品列表页
... ... @@ -5778,7 +5848,7 @@ $sc.click(function() {
$.post('/passport/back/sendbackmobile', {
mobile: $('#mobile').val(),
area: $('#area').val(),
verifyCode: $('#captchaPic').val(),
verifyCode: $('#captchaPic').val()
}, function(jsonData) {
if (jsonData.code === 200) {
$errTip.hide();
... ... @@ -5832,17 +5902,34 @@ itime = setInterval(function() {
$('#captcha').keyup(function() {
var v = $.trim($(this).val());
var v = $.trim($(this).val()),
that = this;
if (v !== '') {
if (v.length === 4) {
$.ajax({
type: 'POST',
url: '/passport/back/backmobile',
dataType: 'json',
data: {
code: $('#captcha').val(),
verifyCode: $("#captchaPic").val(),
area: $('#area').val(),
mobile: $('#mobile').val()
},
success: function(res) {
if (res.code === 200) {
//添加验证码正确验证
//$next.removeClass('disable').prop('disabled', false);
$next.removeClass('disable').removeAttr('disabled');
$errTip.addClass('hide');
$(that).removeClass('error');
} else {
//$next.addClass('disable').prop('disabled', true);
$next.addClass('disable').attr('disabled', true);
$errTip.removeClass('hide').find('em').text('验证码输入错误');
$(that).addClass('error');
}
}
});
}
}).blur(function() {
var v = $.trim($(this).val());
... ... @@ -5851,10 +5938,7 @@ $('#captcha').keyup(function() {
//添加验证码正确验证
$(this).addClass('error');
$errTip.removeClass('hide');
} else {
$(this).removeClass('error');
$errTip.addClass('hide');
$errTip.removeClass('hide').text('请输入验证码');
}
}).focus(function() {
$(this).removeClass('error');
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.