Authored by xiaowei

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

@@ -2,9 +2,14 @@ @@ -2,9 +2,14 @@
2 <div class="new-sale-page product-page yoho-page"> 2 <div class="new-sale-page product-page yoho-page">
3 {{# saleList}} 3 {{# saleList}}
4 {{# saleBanner}} 4 {{# saleBanner}}
5 - <div class="banner-img" style="height: {{bannerHeight}}px;background:url({{img}}) no-repeat top center;"></div> 5 + <div class="sale-list-banner" style="height: {{bannerHeight}}px;">
  6 + <ul style="height: {{bannerHeight}}px;">
  7 + {{# list}}
  8 + <li class="banner-img" style="background:url({{img}}) no-repeat top center;"></li>
  9 + {{/ list}}
  10 + </ul>
  11 + </div>
6 {{/ saleBanner}} 12 {{/ saleBanner}}
7 -  
8 <div class="center-content clearfix"> 13 <div class="center-content clearfix">
9 {{# saleTitle}} 14 {{# saleTitle}}
10 <div class="header-title"> 15 <div class="header-title">
@@ -144,7 +144,7 @@ @@ -144,7 +144,7 @@
144 {{!-- sale列表 --}} 144 {{!-- sale列表 --}}
145 {{#if saleListPage}} 145 {{#if saleListPage}}
146 <script> 146 <script>
147 - seajs.use(['js/product/list', 'js/product/product'], function (list, product) { 147 + seajs.use(['js/product/list', 'js/product/product', 'js/product/banner'], function (list, product) {
148 148
149 product.init(4); 149 product.init(4);
150 window.onresize = function () { 150 window.onresize = function () {
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 {{/ tags}} 25 {{/ tags}}
26 </div> 26 </div>
27 <div class="good-detail-img"> 27 <div class="good-detail-img">
28 - <a class="good-thumb" href="{{url}}"> 28 + <a class="good-thumb" href="{{url}}" target="_blank">
29 <img class="lazy" data-original="{{thumb}}"> 29 <img class="lazy" data-original="{{thumb}}">
30 </a> 30 </a>
31 {{# isFew}} 31 {{# isFew}}
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 {{/if}} 37 {{/if}}
38 </div> 38 </div>
39 <div class="good-detail-text"> 39 <div class="good-detail-text">
40 - <a href="{{url}}">{{name}}</a> 40 + <a href="{{url}}" target="_blank">{{name}}</a>
41 <p class="price"> 41 <p class="price">
42 {{# marketPrice}} 42 {{# marketPrice}}
43 <span class="market-price">¥{{.}}</span> 43 <span class="market-price">¥{{.}}</span>
@@ -417,6 +417,18 @@ function pwdFn($obj) { @@ -417,6 +417,18 @@ function pwdFn($obj) {
417 // Tips: 不可以在获得焦点的时候验证,获得焦点和失去焦点的间隔太小,如果中间存在ajax校验的话会出现问题 417 // Tips: 不可以在获得焦点的时候验证,获得焦点和失去焦点的间隔太小,如果中间存在ajax校验的话会出现问题
418 // ( ▼-▼ )注册页和信息完善页面接口不同 418 // ( ▼-▼ )注册页和信息完善页面接口不同
419 exports.init = function(page) { 419 exports.init = function(page) {
  420 +
  421 + $('#agree-terms').click(function() {
  422 + if ($(this).attr('notchecked')) {
  423 + console.log(1);
  424 + $(this).removeAttr('notchecked');
  425 + } else {
  426 + console.log(2);
  427 + $(this).attr('notchecked', 'true');
  428 + }
  429 +
  430 + });
  431 +
420 $registerPage.find('.va').keyup(function() { 432 $registerPage.find('.va').keyup(function() {
421 433
422 var j, 434 var j,
@@ -438,7 +450,7 @@ exports.init = function(page) { @@ -438,7 +450,7 @@ exports.init = function(page) {
438 450
439 } 451 }
440 452
441 - if (statusLen === 4 && $('#agree-terms').is(':checked')) { 453 + if (statusLen === 4 && !$('#agree-terms').attr('notchecked')) {
442 $registerBtn.removeClass('disable').removeAttr('disabled'); 454 $registerBtn.removeClass('disable').removeAttr('disabled');
443 } else { 455 } else {
444 $registerBtn.addClass('disable').attr('disabled', 'true'); 456 $registerBtn.addClass('disable').attr('disabled', 'true');
@@ -515,18 +527,6 @@ exports.init = function(page) { @@ -515,18 +527,6 @@ exports.init = function(page) {
515 }); 527 });
516 528
517 // 防止粘贴密码 529 // 防止粘贴密码
518 - /*$('#pwd, #repwd').keydown(function (event) {  
519 -  
520 - console.log(event.ctrlKey);  
521 - console.log(isPwd);  
522 - console.log(event.keyCode);  
523 -  
524 - if (event.ctrlKey && isPwd && event.keyCode === 86) {  
525 - $(this).val(pwdVal);  
526 - }  
527 -  
528 - });*/  
529 -  
530 $pwd[0].onpaste = function() { 530 $pwd[0].onpaste = function() {
531 return false; 531 return false;
532 }; 532 };
  1 +/*
  2 + * author: chenglong
  3 + */
  4 +
  5 +var Slide = require('../common/yohoui/YH.slide');
  6 +var $ = require('yoho.jquery');
  7 +
  8 +var $contain = $('.sale-list-banner');
  9 +var $item = $contain.find('li');
  10 +var index = 0;
  11 +var pagationStr = '';
  12 +var pagationBoxStr = '';
  13 +var i;
  14 +var current = true;
  15 +var slide;
  16 +
  17 +for (i = 0; i < $item.length; i++) {
  18 +
  19 + if (i === 0) {
  20 + pagationStr += '<span class="active"></span>';
  21 + } else {
  22 + pagationStr += '<span></span>';
  23 + }
  24 +}
  25 +
  26 +pagationBoxStr = '<div class="sale-list-pagation"><div>' + pagationStr + '</div></div>';
  27 +
  28 +$contain.append($(pagationBoxStr));
  29 +
  30 +slide = new Slide({
  31 + length: $item.length,
  32 + loop: true,
  33 + auto: true,
  34 + timeout: 2,
  35 + index: 0
  36 +});
  37 +
  38 +
  39 +slide.on('change', function(data) {
  40 + if (current) {
  41 + current = false;
  42 + } else {
  43 + return;
  44 + }
  45 + index++;
  46 +
  47 +
  48 + $('.sale-list-pagation').find('span').removeClass('active');
  49 + $item.eq(data.from).animate({
  50 + opacity: 0
  51 + }, 300);
  52 + $item.eq(data.to).css({
  53 + zIndex: index
  54 + }).animate({
  55 + opacity: 1
  56 + }, 300, function() {
  57 + current = true;
  58 + });
  59 +
  60 + $('.sale-list-pagation').find('span').eq(data.to).addClass('active');
  61 +
  62 +});
  63 +
  64 +$contain.hover(function() {
  65 + if (current) {
  66 + slide.pause();
  67 + }
  68 +
  69 +}, function() {
  70 + slide.resume();
  71 +});
  72 +
  73 +$('.sale-list-pagation span').click(function() {
  74 +
  75 + var index = $(this).index();
  76 +
  77 + if (current) {
  78 + slide.go(index);
  79 + }
  80 +});
  81 +
  82 +slide.init();
@@ -117,6 +117,10 @@ $('.logo-brand').logoBrand({ @@ -117,6 +117,10 @@ $('.logo-brand').logoBrand({
117 var nowIndex = $(this).index(), 117 var nowIndex = $(this).index(),
118 sid = $(this).data('sid'); 118 sid = $(this).data('sid');
119 119
  120 + if ($(this).hasClass('current')) {
  121 + return;
  122 + }
  123 +
120 //处理current样式 124 //处理current样式
121 $(this).addClass('current').siblings().removeClass('current'); 125 $(this).addClass('current').siblings().removeClass('current');
122 $('.floatlayer').find('li').removeClass('current').eq(nowIndex).addClass('current'); 126 $('.floatlayer').find('li').removeClass('current').eq(nowIndex).addClass('current');
@@ -135,7 +139,11 @@ $('.logo-brand').logoBrand({ @@ -135,7 +139,11 @@ $('.logo-brand').logoBrand({
135 $('.floatlayer').on('click', 'li', function() { 139 $('.floatlayer').on('click', 'li', function() {
136 var nowIndex = $(this).index(); 140 var nowIndex = $(this).index();
137 141
138 - $('.hot-cate').find('li').trigger('click'); 142 + if ($(this).hasClass('current')) {
  143 + return;
  144 + }
  145 +
  146 + $('.hot-cate').find('li').eq(nowIndex).trigger('click');
139 147
140 //处理current样式 148 //处理current样式
141 $(this).addClass('current').siblings().removeClass('current'); 149 $(this).addClass('current').siblings().removeClass('current');
@@ -46,6 +46,9 @@ @@ -46,6 +46,9 @@
46 width: 209px; 46 width: 209px;
47 display: block; 47 display: block;
48 float: left; 48 float: left;
  49 + position: absolute;
  50 + top: 0;
  51 + right: 0;
49 } 52 }
50 53
51 &.captcha, &.msg-captcha{ 54 &.captcha, &.msg-captcha{
1 .new-sale-page { 1 .new-sale-page {
  2 +
  3 + /*Modify by chenglong.wang at 2016/1/18
  4 + *sale列表页面轮播图
  5 + */
  6 + .sale-list-banner {
  7 + width: 100%;
  8 + position: relative;
  9 +
  10 + ul {
  11 + overflow: hidden;
  12 + width: 100%;
  13 + position: relative;
  14 + z-index: 1;
  15 +
  16 + li {
  17 + width: 100%;
  18 + height: 100%;
  19 + display: block;
  20 + float: left;
  21 + position: absolute;
  22 + top: 0;
  23 + left: 0;
  24 + }
  25 + }
  26 +
  27 + .sale-list-pagation {
  28 + z-index: 2;
  29 + position: absolute;
  30 + left: 0;
  31 + bottom: 50px;
  32 + width: 100%;
  33 + height: 20px;
  34 + text-align: center;
  35 +
  36 + div {
  37 + display: inline-block;
  38 + }
  39 +
  40 + span {
  41 + display: block;
  42 + width: 20px;
  43 + height: 20px;
  44 + background: image_url('product/default-normal.png');
  45 + float: left;
  46 + margin: 0 10px;
  47 + cursor: pointer;
  48 +
  49 + &.active {
  50 + background: image_url('product/default-active.png');
  51 + }
  52 + }
  53 + }
  54 + }
  55 +
2 .header-title { 56 .header-title {
3 position: relative; 57 position: relative;
4 width: 100%; 58 width: 100%;
@@ -166,7 +166,32 @@ class Sale1Controller extends WebAction @@ -166,7 +166,32 @@ class Sale1Controller extends WebAction
166 'saleList' => array( 166 'saleList' => array(
167 'saleBanner' => array( 167 'saleBanner' => array(
168 'bannerHeight' => 350, 168 'bannerHeight' => 350,
169 - 'img' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/08/02d4c26f19ca2e44359d69d5cff86167fb.jpg' 169 + 'list' => array(
  170 + array(
  171 + 'bannerHeight' => 350,
  172 + 'img' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/08/02d4c26f19ca2e44359d69d5cff86167fb.jpg'
  173 + ),
  174 + array(
  175 + 'bannerHeight' => 350,
  176 + 'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/06/05/02062366574a01418596caa38a773f6beb.jpg?imageView/1/w/1150/h/450'
  177 + ),
  178 + array(
  179 + 'bannerHeight' => 350,
  180 + 'img' => 'http://img11.static.yhbimg.com/yhb-img01/2016/01/06/05/013341a0632177cc3425c3c6082845be57.jpg?imageView/1/w/1150/h/450'
  181 + ),
  182 + array(
  183 + 'bannerHeight' => 350,
  184 + 'img' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/08/02d4c26f19ca2e44359d69d5cff86167fb.jpg'
  185 + ),
  186 + array(
  187 + 'bannerHeight' => 350,
  188 + 'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/06/05/02062366574a01418596caa38a773f6beb.jpg?imageView/1/w/1150/h/450'
  189 + ),
  190 + array(
  191 + 'bannerHeight' => 350,
  192 + 'img' => 'http://img11.static.yhbimg.com/yhb-img01/2016/01/06/05/013341a0632177cc3425c3c6082845be57.jpg?imageView/1/w/1150/h/450'
  193 + )
  194 + )
170 ), 195 ),
171 'saleTitle' => array( 196 'saleTitle' => array(
172 'name' => '全部商品', 197 'name' => '全部商品',