Authored by xiaowei

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -2,9 +2,14 @@
<div class="new-sale-page product-page yoho-page">
{{# saleList}}
{{# saleBanner}}
<div class="banner-img" style="height: {{bannerHeight}}px;background:url({{img}}) no-repeat top center;"></div>
<div class="sale-list-banner" style="height: {{bannerHeight}}px;">
<ul style="height: {{bannerHeight}}px;">
{{# list}}
<li class="banner-img" style="background:url({{img}}) no-repeat top center;"></li>
{{/ list}}
</ul>
</div>
{{/ saleBanner}}
<div class="center-content clearfix">
{{# saleTitle}}
<div class="header-title">
... ...
... ... @@ -144,7 +144,7 @@
{{!-- sale列表 --}}
{{#if saleListPage}}
<script>
seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
seajs.use(['js/product/list', 'js/product/product', 'js/product/banner'], function (list, product) {
product.init(4);
window.onresize = function () {
... ...
... ... @@ -25,7 +25,7 @@
{{/ tags}}
</div>
<div class="good-detail-img">
<a class="good-thumb" href="{{url}}">
<a class="good-thumb" href="{{url}}" target="_blank">
<img class="lazy" data-original="{{thumb}}">
</a>
{{# isFew}}
... ... @@ -37,7 +37,7 @@
{{/if}}
</div>
<div class="good-detail-text">
<a href="{{url}}">{{name}}</a>
<a href="{{url}}" target="_blank">{{name}}</a>
<p class="price">
{{# marketPrice}}
<span class="market-price">¥{{.}}</span>
... ...
... ... @@ -417,6 +417,18 @@ function pwdFn($obj) {
// Tips: 不可以在获得焦点的时候验证,获得焦点和失去焦点的间隔太小,如果中间存在ajax校验的话会出现问题
// ( ▼-▼ )注册页和信息完善页面接口不同
exports.init = function(page) {
$('#agree-terms').click(function() {
if ($(this).attr('notchecked')) {
console.log(1);
$(this).removeAttr('notchecked');
} else {
console.log(2);
$(this).attr('notchecked', 'true');
}
});
$registerPage.find('.va').keyup(function() {
var j,
... ... @@ -438,7 +450,7 @@ exports.init = function(page) {
}
if (statusLen === 4 && $('#agree-terms').is(':checked')) {
if (statusLen === 4 && !$('#agree-terms').attr('notchecked')) {
$registerBtn.removeClass('disable').removeAttr('disabled');
} else {
$registerBtn.addClass('disable').attr('disabled', 'true');
... ... @@ -515,18 +527,6 @@ exports.init = function(page) {
});
// 防止粘贴密码
/*$('#pwd, #repwd').keydown(function (event) {
console.log(event.ctrlKey);
console.log(isPwd);
console.log(event.keyCode);
if (event.ctrlKey && isPwd && event.keyCode === 86) {
$(this).val(pwdVal);
}
});*/
$pwd[0].onpaste = function() {
return false;
};
... ...
/*
* author: chenglong
*/
var Slide = require('../common/yohoui/YH.slide');
var $ = require('yoho.jquery');
var $contain = $('.sale-list-banner');
var $item = $contain.find('li');
var index = 0;
var pagationStr = '';
var pagationBoxStr = '';
var i;
var current = true;
var slide;
for (i = 0; i < $item.length; i++) {
if (i === 0) {
pagationStr += '<span class="active"></span>';
} else {
pagationStr += '<span></span>';
}
}
pagationBoxStr = '<div class="sale-list-pagation"><div>' + pagationStr + '</div></div>';
$contain.append($(pagationBoxStr));
slide = new Slide({
length: $item.length,
loop: true,
auto: true,
timeout: 2,
index: 0
});
slide.on('change', function(data) {
if (current) {
current = false;
} else {
return;
}
index++;
$('.sale-list-pagation').find('span').removeClass('active');
$item.eq(data.from).animate({
opacity: 0
}, 300);
$item.eq(data.to).css({
zIndex: index
}).animate({
opacity: 1
}, 300, function() {
current = true;
});
$('.sale-list-pagation').find('span').eq(data.to).addClass('active');
});
$contain.hover(function() {
if (current) {
slide.pause();
}
}, function() {
slide.resume();
});
$('.sale-list-pagation span').click(function() {
var index = $(this).index();
if (current) {
slide.go(index);
}
});
slide.init();
\ No newline at end of file
... ...
... ... @@ -117,6 +117,10 @@ $('.logo-brand').logoBrand({
var nowIndex = $(this).index(),
sid = $(this).data('sid');
if ($(this).hasClass('current')) {
return;
}
//处理current样式
$(this).addClass('current').siblings().removeClass('current');
$('.floatlayer').find('li').removeClass('current').eq(nowIndex).addClass('current');
... ... @@ -135,7 +139,11 @@ $('.logo-brand').logoBrand({
$('.floatlayer').on('click', 'li', function() {
var nowIndex = $(this).index();
$('.hot-cate').find('li').trigger('click');
if ($(this).hasClass('current')) {
return;
}
$('.hot-cate').find('li').eq(nowIndex).trigger('click');
//处理current样式
$(this).addClass('current').siblings().removeClass('current');
... ...
... ... @@ -46,6 +46,9 @@
width: 209px;
display: block;
float: left;
position: absolute;
top: 0;
right: 0;
}
&.captcha, &.msg-captcha{
... ...
.new-sale-page {
/*Modify by chenglong.wang at 2016/1/18
*sale列表页面轮播图
*/
.sale-list-banner {
width: 100%;
position: relative;
ul {
overflow: hidden;
width: 100%;
position: relative;
z-index: 1;
li {
width: 100%;
height: 100%;
display: block;
float: left;
position: absolute;
top: 0;
left: 0;
}
}
.sale-list-pagation {
z-index: 2;
position: absolute;
left: 0;
bottom: 50px;
width: 100%;
height: 20px;
text-align: center;
div {
display: inline-block;
}
span {
display: block;
width: 20px;
height: 20px;
background: image_url('product/default-normal.png');
float: left;
margin: 0 10px;
cursor: pointer;
&.active {
background: image_url('product/default-active.png');
}
}
}
}
.header-title {
position: relative;
width: 100%;
... ...
... ... @@ -166,7 +166,32 @@ class Sale1Controller extends WebAction
'saleList' => array(
'saleBanner' => array(
'bannerHeight' => 350,
'img' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/08/02d4c26f19ca2e44359d69d5cff86167fb.jpg'
'list' => array(
array(
'bannerHeight' => 350,
'img' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/08/02d4c26f19ca2e44359d69d5cff86167fb.jpg'
),
array(
'bannerHeight' => 350,
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/06/05/02062366574a01418596caa38a773f6beb.jpg?imageView/1/w/1150/h/450'
),
array(
'bannerHeight' => 350,
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2016/01/06/05/013341a0632177cc3425c3c6082845be57.jpg?imageView/1/w/1150/h/450'
),
array(
'bannerHeight' => 350,
'img' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/08/02d4c26f19ca2e44359d69d5cff86167fb.jpg'
),
array(
'bannerHeight' => 350,
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/06/05/02062366574a01418596caa38a773f6beb.jpg?imageView/1/w/1150/h/450'
),
array(
'bannerHeight' => 350,
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2016/01/06/05/013341a0632177cc3425c3c6082845be57.jpg?imageView/1/w/1150/h/450'
)
)
),
'saleTitle' => array(
'name' => '全部商品',
... ...