Authored by whb

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

... ... @@ -1085,7 +1085,7 @@ class HelperSearch
}
//组织静态资源数据格式
public static function formatNodeContent($code)
public static function getNodeContent($code)
{
$nodeContent = BrandData::getByNodeContent($code);
if (isset($nodeContent['code']) && $nodeContent['code'] === 200) {
... ... @@ -1102,6 +1102,7 @@ class HelperSearch
$result[$key]['href'] = $vo;
$result[$key]['src'] = $img[1][$key];
}
return $result;
}
}
... ... @@ -1311,7 +1312,8 @@ class HelperSearch
'coled' => $is_favorite,
'banner' => $bannerImg,
'brandHome' => $brandHome,
'brandIntro' => $brandIntro
'brandIntro' => $brandIntro,
'dataId' => $brand['brand_id']
);
}
... ...
... ... @@ -4,8 +4,12 @@
欢迎加入
<span class="yoho">YOHO!FAMILY</span>
</h3>
<p class="safeword">为了您的账户安全,请您完善账户信息,以便为您提供更优质的服务</p>
<form action="" id="bindmobileform">
<form action="" id="bindmobileform" method="post">
<input type="hidden" value="{{openId}}" id="openId" name="openId"/>
<input type="hidden" value="{{sourceType}}" id="sourceType" name="sourceType"/>
<input type="hidden" value="+86" id="areacode" name="area"/>
<div class="yohobindrow">
<div class="name areatag">地区</div>
<div class="content">
... ... @@ -15,9 +19,11 @@
<span class="righttag"></span>
</div>
<div class="optionslist hide">
<div class="optionitem" areanum="+88">中国香港</div>
<div class="optionitem" areanum="+87">中国台湾</div>
<div class="optionitem" areanum="+86">中国</div>
{{#each region}}
<div class="optionitem" areanum="{{areaCode}}">{{name}}
</div>
{{/each}}
</div>
</div>
</div>
... ... @@ -27,7 +33,7 @@
<div class="content">
<div class="yohophonewrapper">
<div class="areanum" id="areanum">+86</div>
<input type="text" class="phonenum" />
<input type="text" class="phonenum" name="mobile"/>
</div>
</div>
</div>
... ...
{{> layout/simple-header}}
<div class="bindwrapper">
<h3 class="welcomeword">
欢迎加入
<span class="yoho">YOHO!FAMILY</span>
</h3>
<p class="safeword">为了您的账户安全,请您完善账户信息,以便为您提供更优质的服务</p>
<p class="sendnotify novisiable">验证码已发送至<span class="sendphone">{{mobile}}</span></p>
<div class="validaterow">
<div class="name phonetag">短信验证码</div>
<div class="content">
<div class="yohophonewrapper">
<input type="text" class="phonenum" value="" />
</div>
</div>
<div class="validatewrapper">
<a href="javascript:void(0)" class="yohobindbtn disabled" id="sendmessage" disabled="disabled">免费获取短信验证码</a>
</div>
<div class="hide" id="nopermissionmessage">
<span class="second">60</span>秒后可重新操作
</div>
</div>
<div class="setpwdcontent">
<div class="yohobindrow setpwdwrapper">
<div class="name setpwdtag">设置密码</div>
<div class="content">
<div class="yohophonewrapper">
<input type="password" class="phonenum pwdcontent" maxlength="20" id="pwd"/>
<div id="pwd-tips" class="pwd-tips hide">
<div class="yes" id="pwd-tip1">密码只支持6-20位字符</div>
<div class="default" id="pwd-tip2">建议由字母、 数字、 符号两种以上组合</div>
</div>
</div>
</div>
</div>
<div class="safelevel clearfix">
安全程度: &nbsp; <span class="low pwd-intensity">低</span><span class="mid pwd-intensity">中</span><span class="high pwd-intensity">高</span>
</div>
</div>
<div class="btnwrapper confirmwrapper">
<a href="javascript:void(0)" class="yohobindbtn" >确定</a>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -11,6 +11,7 @@
{{!-- 搜索 --}}
{{#if searchListPage}}
<script>
seajs.use('js/product/brand');
seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
product.init(5);
... ... @@ -113,6 +114,12 @@
seajs.use('js/passport/login');
</script>
{{/if}}
{{!-- 第三方绑定--}}
{{#if thirdLogin}}
<script>
seajs.use('js/passport/thirdlogin');
</script>
{{/if}}
{{!-- 注册页--}}
{{#if registerPage}}
... ...
... ... @@ -14,7 +14,7 @@
<i class="iconfont">&#xe618;</i>
品牌介绍
</a>
<span id="brand-favor" class="brand-favor">
<span id="brand-favor" class="brand-favor" data-id="{{brandId}}">
<i class="iconfont{{#if coled}} coled{{/if}}">&#xe616;</i>
</span>
</p>
... ...
... ... @@ -1323,10 +1323,14 @@ function actionLoopUpdCartNum() {
* @return {[type]} [description]
*/
function actionExeTemplate() {
var resulthtml = $('#goodcartempwarpper').html().replace(/\\/g, '');
var $goodcartempwarpper = $('#goodcartempwarpper');
var resulthtml = '';
if ($goodcartempwarpper && $goodcartempwarpper.html()) {
resulthtml = $('#goodcartempwarpper').html().replace(/\\/g, '');
$('#goodcartempwarpper').html(resulthtml);
vipInfoCombine = handlebars.compile($('#tmpl-my-login-new').html());
}
}
/**
* 执行搜索
... ...
... ... @@ -7,3 +7,4 @@ require('./back');
require('./login');
require('./reset');
require('./vertification');
require('./thirdlogin');
\ No newline at end of file
... ...
/**
* 登录
* @author: wq
* @date: 2016/1/21
*/
var $ = require('yoho.jquery');
function chooseProtocol() {
$('.choosetag').on('change', function() {
if ($(this).attr('checked')) {
$('.choosewrapper').css({
'background-image': 'url("http://webstatic.dev.yohobuy.com/img/passport/choosed.png")'
});
} else {
$('.choosewrapper').css({
'background-image': 'none'
});
}
})
}
function chooseAreaToogle() {
$('.optionshow').on('click', function() {
$('.optionslist').toggleClass('hide');
});
}
function cancelChooseArea() {
$(document).on('click', 'body', function(e) {
var $target = $(e.target);
if ($target.hasClass('yohoselectarea') || $target.hasClass('yohoselectarea') || $target.hasClass('areaname') || $target.hasClass('righttag') || $target.hasClass('optionslist') || $target.hasClass('optionitem')) {
return;
} else {
$('.optionslist').addClass('hide');
}
})
}
function chooseArea() {
$('.optionitem').on('click', function() {
var $option = $(this);
var areanum = $option.attr('areanum');
var areaname = $option.text();
$('#areaname').text(areaname);
$('#areanum').text(areanum);
$('#areacode').val(areanum);
$('.optionslist').addClass('hide');
})
}
function isagree() {
return $('.choosetag').attr('checked');
}
function nextStep() {
var openId = '';
var sourceType = '';
var mobile = '';
var areaCode = '';
$('#bindfirststep').on('click', function(e) {
e.preventDefault();
mobile = $('.phonenum').val();
areaCode = $('.areanum').text();
if (mobile === '') {
alert('手机号码不能为空');
return;
}
if (!isagree()) {
alert('请先同意我们的协议');
return;
}
openId = $('#openId').val() || '29803EC6D4AAC3AAB8ABDB6AE829D579';
sourceType = $('#sourceType').val() || 'qq';
$.ajax({
type: "post",
url: '/passport/autouserinfo/bindCheck',
data: {
mobile: mobile,
area: areaCode,
openId: openId,
sourceType: sourceType
},
dataType: 'json',
success: function(data) {
if (data.code === 200) {
if (data.data.isReg === 0) {
$('#bindmobileform').attr('action','/passport/thirdlogin/noregist');
$('#bindmobileform').submit();
} else {
}
} else {
alert(data.message);
}
}
});
})
}
function init() {
chooseProtocol();
chooseArea();
chooseAreaToogle();
cancelChooseArea();
nextStep();
}
init();
\ No newline at end of file
... ...
/**
* 品牌页面
* @auhtor: bikai<kai.bi@yoho.cn>
* @date: 2016/1/21
*/
var $ = require('yoho.jquery');
$('#brand-favor').on('click', function() {
var $this = $(this),
uid = window.getUid();
if (!uid) {
location.href = '/signin.html?refer=' + location.href;
return;
}
$.ajax({
type: 'post',
url: '/product/index/favoriteBrand',
data: {
uid: uid,
brandId: $this.data('id')
}
}).then(function(res) {
if (res.code === 200) {
$this.addClass('favored');
}
});
});
... ...
... ... @@ -6,4 +6,6 @@
require('./list');
require('./brand');
require('./hotrank');
... ...
... ... @@ -149,6 +149,11 @@
.brand-favor {
margin-right: 0;
cursor: pointer;
&.favored {
color: #ee0014;
}
}
.coled {
... ...
... ... @@ -71,7 +71,7 @@ class Bootstrap extends Bootstrap_Abstract
$controller = 'Index';
$action = 'Index';
// 二级域名
if (2 === $level) {
if (3 === $level) {
$url = strtolower($dispatcher->getRequest()->getRequestUri());
if(empty($url) || $url == '/index' || $url == '/') {
$urlAction = '/index';
... ...
... ... @@ -40,7 +40,7 @@ class BrandsModel
//获取静态内容
if ($options['node']) {
$nodeContent = HelperSearch::formatNodeContent($options['node']);
$nodeContent = HelperSearch::getNodeContent($options['node']);
$data['leftContent'][]['picLink']['list'] = $nodeContent;
}
... ...
... ... @@ -35,6 +35,7 @@ class SaleModel
$data = HelperSearch::getList($result, $searchCondition['options']);
//组织sale数据
$special = array();
if (isset($specialInfo['data']) && !empty($specialInfo['data']['banner_img'])) {
$banner = json_decode($specialInfo['data']['banner_img'], true);
foreach ($banner as $k => $v) {
... ... @@ -43,6 +44,7 @@ class SaleModel
}
$special = $specialInfo['data'];
}
//Sale首页 banner数据
$data['saleBanner']['bannerHeight'] = $special['banner'][0]['height'];
$data['saleBanner']['img'] = $special['banner'][0]['img'];
... ... @@ -51,7 +53,7 @@ class SaleModel
//获取广告位数据
if (isset($special['left_ad_code'])) {
$nodeContent = HelperSearch::formatNodeContent($special['left_ad_code']);
$nodeContent = HelperSearch::getNodeContent($special['left_ad_code']);
$data['leftContent'][]['picLink']['list'] = $nodeContent;
}
... ...
... ... @@ -40,4 +40,11 @@ class ThirdloginController extends WebAction
$this->_view->display('index', $data);
}
public function noregistAction()
{
$mobile = trim($this->post('mobile'));
$data = array('mobile' => $mobile);
$this->_view->display('noregist', $data);
}
}
... ...
... ... @@ -32,7 +32,7 @@ class SaleController extends WebAction
if(!empty($special['brand_id'])){
$condition['brand'] = $special['brand_id'];
}
//传促销id
//传促销id,促销id为空时传专区id
if(!empty($special['ispromotion'])){
$condition['promotion'] = $special['ispromotion'];
}else{
... ... @@ -40,7 +40,6 @@ class SaleController extends WebAction
}
$options = array(
'specialsale_id' => 'Y',
'controller' => $this->_request->controller,
'reviewNum' => 6
);
... ...