Authored by whb

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

@@ -1085,7 +1085,7 @@ class HelperSearch @@ -1085,7 +1085,7 @@ class HelperSearch
1085 } 1085 }
1086 1086
1087 //组织静态资源数据格式 1087 //组织静态资源数据格式
1088 - public static function formatNodeContent($code) 1088 + public static function getNodeContent($code)
1089 { 1089 {
1090 $nodeContent = BrandData::getByNodeContent($code); 1090 $nodeContent = BrandData::getByNodeContent($code);
1091 if (isset($nodeContent['code']) && $nodeContent['code'] === 200) { 1091 if (isset($nodeContent['code']) && $nodeContent['code'] === 200) {
@@ -1102,6 +1102,7 @@ class HelperSearch @@ -1102,6 +1102,7 @@ class HelperSearch
1102 $result[$key]['href'] = $vo; 1102 $result[$key]['href'] = $vo;
1103 $result[$key]['src'] = $img[1][$key]; 1103 $result[$key]['src'] = $img[1][$key];
1104 } 1104 }
  1105 +
1105 return $result; 1106 return $result;
1106 } 1107 }
1107 } 1108 }
@@ -1311,7 +1312,8 @@ class HelperSearch @@ -1311,7 +1312,8 @@ class HelperSearch
1311 'coled' => $is_favorite, 1312 'coled' => $is_favorite,
1312 'banner' => $bannerImg, 1313 'banner' => $bannerImg,
1313 'brandHome' => $brandHome, 1314 'brandHome' => $brandHome,
1314 - 'brandIntro' => $brandIntro 1315 + 'brandIntro' => $brandIntro,
  1316 + 'dataId' => $brand['brand_id']
1315 ); 1317 );
1316 } 1318 }
1317 1319
@@ -4,8 +4,12 @@ @@ -4,8 +4,12 @@
4 欢迎加入 4 欢迎加入
5 <span class="yoho">YOHO!FAMILY</span> 5 <span class="yoho">YOHO!FAMILY</span>
6 </h3> 6 </h3>
  7 +
7 <p class="safeword">为了您的账户安全,请您完善账户信息,以便为您提供更优质的服务</p> 8 <p class="safeword">为了您的账户安全,请您完善账户信息,以便为您提供更优质的服务</p>
8 - <form action="" id="bindmobileform"> 9 + <form action="" id="bindmobileform" method="post">
  10 + <input type="hidden" value="{{openId}}" id="openId" name="openId"/>
  11 + <input type="hidden" value="{{sourceType}}" id="sourceType" name="sourceType"/>
  12 + <input type="hidden" value="+86" id="areacode" name="area"/>
9 <div class="yohobindrow"> 13 <div class="yohobindrow">
10 <div class="name areatag">地区</div> 14 <div class="name areatag">地区</div>
11 <div class="content"> 15 <div class="content">
@@ -15,9 +19,11 @@ @@ -15,9 +19,11 @@
15 <span class="righttag"></span> 19 <span class="righttag"></span>
16 </div> 20 </div>
17 <div class="optionslist hide"> 21 <div class="optionslist hide">
18 - <div class="optionitem" areanum="+88">中国香港</div>  
19 - <div class="optionitem" areanum="+87">中国台湾</div>  
20 - <div class="optionitem" areanum="+86">中国</div> 22 + {{#each region}}
  23 + <div class="optionitem" areanum="{{areaCode}}">{{name}}
  24 + </div>
  25 + {{/each}}
  26 +
21 </div> 27 </div>
22 </div> 28 </div>
23 </div> 29 </div>
@@ -27,7 +33,7 @@ @@ -27,7 +33,7 @@
27 <div class="content"> 33 <div class="content">
28 <div class="yohophonewrapper"> 34 <div class="yohophonewrapper">
29 <div class="areanum" id="areanum">+86</div> 35 <div class="areanum" id="areanum">+86</div>
30 - <input type="text" class="phonenum" /> 36 + <input type="text" class="phonenum" name="mobile"/>
31 </div> 37 </div>
32 </div> 38 </div>
33 </div> 39 </div>
  1 +{{> layout/simple-header}}
  2 +<div class="bindwrapper">
  3 + <h3 class="welcomeword">
  4 + 欢迎加入
  5 + <span class="yoho">YOHO!FAMILY</span>
  6 + </h3>
  7 + <p class="safeword">为了您的账户安全,请您完善账户信息,以便为您提供更优质的服务</p>
  8 + <p class="sendnotify novisiable">验证码已发送至<span class="sendphone">{{mobile}}</span></p>
  9 + <div class="validaterow">
  10 + <div class="name phonetag">短信验证码</div>
  11 + <div class="content">
  12 + <div class="yohophonewrapper">
  13 + <input type="text" class="phonenum" value="" />
  14 + </div>
  15 + </div>
  16 + <div class="validatewrapper">
  17 + <a href="javascript:void(0)" class="yohobindbtn disabled" id="sendmessage" disabled="disabled">免费获取短信验证码</a>
  18 + </div>
  19 + <div class="hide" id="nopermissionmessage">
  20 + <span class="second">60</span>秒后可重新操作
  21 + </div>
  22 + </div>
  23 + <div class="setpwdcontent">
  24 + <div class="yohobindrow setpwdwrapper">
  25 + <div class="name setpwdtag">设置密码</div>
  26 + <div class="content">
  27 + <div class="yohophonewrapper">
  28 + <input type="password" class="phonenum pwdcontent" maxlength="20" id="pwd"/>
  29 + <div id="pwd-tips" class="pwd-tips hide">
  30 + <div class="yes" id="pwd-tip1">密码只支持6-20位字符</div>
  31 + <div class="default" id="pwd-tip2">建议由字母、 数字、 符号两种以上组合</div>
  32 + </div>
  33 + </div>
  34 + </div>
  35 + </div>
  36 + <div class="safelevel clearfix">
  37 + 安全程度: &nbsp; <span class="low pwd-intensity">低</span><span class="mid pwd-intensity">中</span><span class="high pwd-intensity">高</span>
  38 + </div>
  39 + </div>
  40 + <div class="btnwrapper confirmwrapper">
  41 + <a href="javascript:void(0)" class="yohobindbtn" >确定</a>
  42 + </div>
  43 +</div>
  44 +{{> layout/footer}}
@@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
11 {{!-- 搜索 --}} 11 {{!-- 搜索 --}}
12 {{#if searchListPage}} 12 {{#if searchListPage}}
13 <script> 13 <script>
  14 + seajs.use('js/product/brand');
14 seajs.use(['js/product/list', 'js/product/product'], function (list, product) { 15 seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
15 16
16 product.init(5); 17 product.init(5);
@@ -113,6 +114,12 @@ @@ -113,6 +114,12 @@
113 seajs.use('js/passport/login'); 114 seajs.use('js/passport/login');
114 </script> 115 </script>
115 {{/if}} 116 {{/if}}
  117 +{{!-- 第三方绑定--}}
  118 +{{#if thirdLogin}}
  119 + <script>
  120 + seajs.use('js/passport/thirdlogin');
  121 + </script>
  122 +{{/if}}
116 123
117 {{!-- 注册页--}} 124 {{!-- 注册页--}}
118 {{#if registerPage}} 125 {{#if registerPage}}
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 <i class="iconfont">&#xe618;</i> 14 <i class="iconfont">&#xe618;</i>
15 品牌介绍 15 品牌介绍
16 </a> 16 </a>
17 - <span id="brand-favor" class="brand-favor"> 17 + <span id="brand-favor" class="brand-favor" data-id="{{brandId}}">
18 <i class="iconfont{{#if coled}} coled{{/if}}">&#xe616;</i> 18 <i class="iconfont{{#if coled}} coled{{/if}}">&#xe616;</i>
19 </span> 19 </span>
20 </p> 20 </p>
@@ -58,4 +58,4 @@ @@ -58,4 +58,4 @@
58 </div> 58 </div>
59 {{/ list}} 59 {{/ list}}
60 </div> 60 </div>
61 -{{> layout/footer}}  
  61 +{{> layout/footer}}
@@ -1323,10 +1323,14 @@ function actionLoopUpdCartNum() { @@ -1323,10 +1323,14 @@ function actionLoopUpdCartNum() {
1323 * @return {[type]} [description] 1323 * @return {[type]} [description]
1324 */ 1324 */
1325 function actionExeTemplate() { 1325 function actionExeTemplate() {
1326 - var resulthtml = $('#goodcartempwarpper').html().replace(/\\/g, '');  
1327 -  
1328 - $('#goodcartempwarpper').html(resulthtml);  
1329 - vipInfoCombine = handlebars.compile($('#tmpl-my-login-new').html()); 1326 + var $goodcartempwarpper = $('#goodcartempwarpper');
  1327 + var resulthtml = '';
  1328 +
  1329 + if ($goodcartempwarpper && $goodcartempwarpper.html()) {
  1330 + resulthtml = $('#goodcartempwarpper').html().replace(/\\/g, '');
  1331 + $('#goodcartempwarpper').html(resulthtml);
  1332 + vipInfoCombine = handlebars.compile($('#tmpl-my-login-new').html());
  1333 + }
1330 } 1334 }
1331 /** 1335 /**
1332 * 执行搜索 1336 * 执行搜索
@@ -6,4 +6,5 @@ require('./reg'); @@ -6,4 +6,5 @@ require('./reg');
6 require('./back'); 6 require('./back');
7 require('./login'); 7 require('./login');
8 require('./reset'); 8 require('./reset');
9 -require('./vertification');  
  9 +require('./vertification');
  10 +require('./thirdlogin');
  1 +/**
  2 + * 登录
  3 + * @author: wq
  4 + * @date: 2016/1/21
  5 + */
  6 +var $ = require('yoho.jquery');
  7 +
  8 +function chooseProtocol() {
  9 + $('.choosetag').on('change', function() {
  10 + if ($(this).attr('checked')) {
  11 + $('.choosewrapper').css({
  12 + 'background-image': 'url("http://webstatic.dev.yohobuy.com/img/passport/choosed.png")'
  13 + });
  14 + } else {
  15 + $('.choosewrapper').css({
  16 + 'background-image': 'none'
  17 + });
  18 + }
  19 +
  20 + })
  21 +}
  22 +
  23 +function chooseAreaToogle() {
  24 + $('.optionshow').on('click', function() {
  25 + $('.optionslist').toggleClass('hide');
  26 + });
  27 +}
  28 +
  29 +function cancelChooseArea() {
  30 + $(document).on('click', 'body', function(e) {
  31 + var $target = $(e.target);
  32 + if ($target.hasClass('yohoselectarea') || $target.hasClass('yohoselectarea') || $target.hasClass('areaname') || $target.hasClass('righttag') || $target.hasClass('optionslist') || $target.hasClass('optionitem')) {
  33 + return;
  34 + } else {
  35 + $('.optionslist').addClass('hide');
  36 + }
  37 + })
  38 +}
  39 +
  40 +function chooseArea() {
  41 + $('.optionitem').on('click', function() {
  42 + var $option = $(this);
  43 + var areanum = $option.attr('areanum');
  44 + var areaname = $option.text();
  45 + $('#areaname').text(areaname);
  46 + $('#areanum').text(areanum);
  47 + $('#areacode').val(areanum);
  48 + $('.optionslist').addClass('hide');
  49 + })
  50 +}
  51 +
  52 +function isagree() {
  53 + return $('.choosetag').attr('checked');
  54 +}
  55 +
  56 +function nextStep() {
  57 + var openId = '';
  58 + var sourceType = '';
  59 + var mobile = '';
  60 + var areaCode = '';
  61 +
  62 + $('#bindfirststep').on('click', function(e) {
  63 + e.preventDefault();
  64 + mobile = $('.phonenum').val();
  65 + areaCode = $('.areanum').text();
  66 + if (mobile === '') {
  67 + alert('手机号码不能为空');
  68 + return;
  69 + }
  70 + if (!isagree()) {
  71 + alert('请先同意我们的协议');
  72 + return;
  73 + }
  74 + openId = $('#openId').val() || '29803EC6D4AAC3AAB8ABDB6AE829D579';
  75 + sourceType = $('#sourceType').val() || 'qq';
  76 + $.ajax({
  77 + type: "post",
  78 + url: '/passport/autouserinfo/bindCheck',
  79 + data: {
  80 + mobile: mobile,
  81 + area: areaCode,
  82 + openId: openId,
  83 + sourceType: sourceType
  84 + },
  85 + dataType: 'json',
  86 + success: function(data) {
  87 + if (data.code === 200) {
  88 + if (data.data.isReg === 0) {
  89 + $('#bindmobileform').attr('action','/passport/thirdlogin/noregist');
  90 + $('#bindmobileform').submit();
  91 + } else {
  92 +
  93 + }
  94 + } else {
  95 + alert(data.message);
  96 + }
  97 +
  98 + }
  99 + });
  100 + })
  101 +}
  102 +
  103 +function init() {
  104 + chooseProtocol();
  105 + chooseArea();
  106 + chooseAreaToogle();
  107 + cancelChooseArea();
  108 + nextStep();
  109 +}
  110 +init();
  1 +/**
  2 + * 品牌页面
  3 + * @auhtor: bikai<kai.bi@yoho.cn>
  4 + * @date: 2016/1/21
  5 + */
  6 +
  7 +var $ = require('yoho.jquery');
  8 +
  9 +$('#brand-favor').on('click', function() {
  10 + var $this = $(this),
  11 + uid = window.getUid();
  12 +
  13 + if (!uid) {
  14 + location.href = '/signin.html?refer=' + location.href;
  15 + return;
  16 + }
  17 +
  18 + $.ajax({
  19 + type: 'post',
  20 + url: '/product/index/favoriteBrand',
  21 + data: {
  22 + uid: uid,
  23 + brandId: $this.data('id')
  24 + }
  25 + }).then(function(res) {
  26 + if (res.code === 200) {
  27 + $this.addClass('favored');
  28 + }
  29 + });
  30 +});
@@ -6,4 +6,6 @@ @@ -6,4 +6,6 @@
6 6
7 require('./list'); 7 require('./list');
8 8
9 -require('./hotrank');  
  9 +require('./brand');
  10 +
  11 +require('./hotrank');
@@ -149,6 +149,11 @@ @@ -149,6 +149,11 @@
149 149
150 .brand-favor { 150 .brand-favor {
151 margin-right: 0; 151 margin-right: 0;
  152 + cursor: pointer;
  153 +
  154 + &.favored {
  155 + color: #ee0014;
  156 + }
152 } 157 }
153 158
154 .coled { 159 .coled {
@@ -71,7 +71,7 @@ class Bootstrap extends Bootstrap_Abstract @@ -71,7 +71,7 @@ class Bootstrap extends Bootstrap_Abstract
71 $controller = 'Index'; 71 $controller = 'Index';
72 $action = 'Index'; 72 $action = 'Index';
73 // 二级域名 73 // 二级域名
74 - if (2 === $level) { 74 + if (3 === $level) {
75 $url = strtolower($dispatcher->getRequest()->getRequestUri()); 75 $url = strtolower($dispatcher->getRequest()->getRequestUri());
76 if(empty($url) || $url == '/index' || $url == '/') { 76 if(empty($url) || $url == '/index' || $url == '/') {
77 $urlAction = '/index'; 77 $urlAction = '/index';
@@ -40,7 +40,7 @@ class BrandsModel @@ -40,7 +40,7 @@ class BrandsModel
40 40
41 //获取静态内容 41 //获取静态内容
42 if ($options['node']) { 42 if ($options['node']) {
43 - $nodeContent = HelperSearch::formatNodeContent($options['node']); 43 + $nodeContent = HelperSearch::getNodeContent($options['node']);
44 $data['leftContent'][]['picLink']['list'] = $nodeContent; 44 $data['leftContent'][]['picLink']['list'] = $nodeContent;
45 } 45 }
46 46
@@ -35,14 +35,16 @@ class SaleModel @@ -35,14 +35,16 @@ class SaleModel
35 $data = HelperSearch::getList($result, $searchCondition['options']); 35 $data = HelperSearch::getList($result, $searchCondition['options']);
36 36
37 //组织sale数据 37 //组织sale数据
  38 + $special = array();
38 if (isset($specialInfo['data']) && !empty($specialInfo['data']['banner_img'])) { 39 if (isset($specialInfo['data']) && !empty($specialInfo['data']['banner_img'])) {
39 $banner = json_decode($specialInfo['data']['banner_img'], true); 40 $banner = json_decode($specialInfo['data']['banner_img'], true);
40 foreach ($banner as $k => $v) { 41 foreach ($banner as $k => $v) {
41 $v['img'] = Images::getSourceUrl($v['img'], 'couponImg'); 42 $v['img'] = Images::getSourceUrl($v['img'], 'couponImg');
42 $specialInfo['data']['banner'][] = $v; 43 $specialInfo['data']['banner'][] = $v;
43 } 44 }
44 - $special = $specialInfo['data']; 45 + $special = $specialInfo['data'];
45 } 46 }
  47 +
46 //Sale首页 banner数据 48 //Sale首页 banner数据
47 $data['saleBanner']['bannerHeight'] = $special['banner'][0]['height']; 49 $data['saleBanner']['bannerHeight'] = $special['banner'][0]['height'];
48 $data['saleBanner']['img'] = $special['banner'][0]['img']; 50 $data['saleBanner']['img'] = $special['banner'][0]['img'];
@@ -51,7 +53,7 @@ class SaleModel @@ -51,7 +53,7 @@ class SaleModel
51 53
52 //获取广告位数据 54 //获取广告位数据
53 if (isset($special['left_ad_code'])) { 55 if (isset($special['left_ad_code'])) {
54 - $nodeContent = HelperSearch::formatNodeContent($special['left_ad_code']); 56 + $nodeContent = HelperSearch::getNodeContent($special['left_ad_code']);
55 $data['leftContent'][]['picLink']['list'] = $nodeContent; 57 $data['leftContent'][]['picLink']['list'] = $nodeContent;
56 } 58 }
57 59
@@ -40,4 +40,11 @@ class ThirdloginController extends WebAction @@ -40,4 +40,11 @@ class ThirdloginController extends WebAction
40 $this->_view->display('index', $data); 40 $this->_view->display('index', $data);
41 } 41 }
42 42
  43 + public function noregistAction()
  44 + {
  45 +
  46 + $mobile = trim($this->post('mobile'));
  47 + $data = array('mobile' => $mobile);
  48 + $this->_view->display('noregist', $data);
  49 + }
43 } 50 }
@@ -32,7 +32,7 @@ class SaleController extends WebAction @@ -32,7 +32,7 @@ class SaleController extends WebAction
32 if(!empty($special['brand_id'])){ 32 if(!empty($special['brand_id'])){
33 $condition['brand'] = $special['brand_id']; 33 $condition['brand'] = $special['brand_id'];
34 } 34 }
35 - //传促销id 35 + //传促销id,促销id为空时传专区id
36 if(!empty($special['ispromotion'])){ 36 if(!empty($special['ispromotion'])){
37 $condition['promotion'] = $special['ispromotion']; 37 $condition['promotion'] = $special['ispromotion'];
38 }else{ 38 }else{
@@ -40,7 +40,6 @@ class SaleController extends WebAction @@ -40,7 +40,6 @@ class SaleController extends WebAction
40 } 40 }
41 41
42 $options = array( 42 $options = array(
43 - 'specialsale_id' => 'Y',  
44 'controller' => $this->_request->controller, 43 'controller' => $this->_request->controller,
45 'reviewNum' => 6 44 'reviewNum' => 6
46 ); 45 );