Authored by unknown

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

... ... @@ -40,7 +40,7 @@ class IndexData
$params['client_type'] = $client_type;
$params['private_key'] = Yohobuy::$privateKeyList[$client_type];
$params['client_secret'] = Sign::getSign($params);
return Yohobuy::get(Yohobuy::SERVICE_URL . self::URL_OPERATIONS_RESOURCE_GET, $params);
return Yohobuy::get(Yohobuy::SERVICE_URL . self::URL_OPERATIONS_RESOURCE_GET, $params, true);
}
/**
... ... @@ -66,7 +66,7 @@ class IndexData
unset($param['os_version']);
unset($param['screen_size']);
unset($param['v']);
return Yohobuy::get(Yohobuy::API_URL, $param);
return Yohobuy::post(Yohobuy::API_URL, $param);
}
/**
... ... @@ -94,7 +94,7 @@ class IndexData
unset($param['os_version']);
unset($param['screen_size']);
unset($param['v']);
return Yohobuy::get(Yohobuy::API_URL, $param);
return Yohobuy::post(Yohobuy::API_URL, $param);
}
}
\ No newline at end of file
... ...
... ... @@ -20,7 +20,7 @@ class UserData extends \LibModels\Wap\Home\UserData
$param['debug'] = 'Y';
$param['screen_size'] = '320x568';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(Yohobuy::API_URL, $param);
return Yohobuy::get(Yohobuy::API_URL, $param, true);
}
/**
... ... @@ -37,6 +37,6 @@ class UserData extends \LibModels\Wap\Home\UserData
$param['debug'] = 'Y';
$param['screen_size'] = '320x568';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(Yohobuy::API_URL, $param);
return Yohobuy::get(Yohobuy::API_URL, $param, true);
}
}
\ No newline at end of file
... ...
... ... @@ -16,7 +16,7 @@ class BackData extends \LibModels\Wap\Passport\BackData
$param['method'] = 'app.register.checkCodeValid';
$param['code'] = $code;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param, 3600); // 缓存1小时
return Yohobuy::get(Yohobuy::API_URL, $param, true); // 缓存1小时
}
/**
... ... @@ -33,6 +33,6 @@ class BackData extends \LibModels\Wap\Passport\BackData
$param['code'] = $code;
$param['newPwd'] = $password;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
return Yohobuy::post(Yohobuy::API_URL, $param);
}
}
\ No newline at end of file
... ...
... ... @@ -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']
);
}
... ...
... ... @@ -48,7 +48,7 @@
.gift-advance-good .name {
margin-bottom: 20rem / $pxConvertRem;
width: 440rem / $pxConvertRem;
width: 320rem / $pxConvertRem;
font-size: 28rem / $pxConvertRem;
}
... ...
... ... @@ -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
... ...
... ... @@ -136,10 +136,10 @@
</form>
</div>
<div class="gobuy float-left {{gobytype}}" id="miniCartBox">
{{# gobuy}}
<span class="ic-infomation">{{gobuynum}}</span>
<span class="ic-infomation">0</span>
<div class="gobuy-wrapper"></div>
{{/gobuy}}
</div>
</div>
</div>
... ...
... ... @@ -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>
... ... @@ -58,4 +58,4 @@
</div>
{{/ list}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer}}
... ...
... ... @@ -1647,10 +1647,14 @@ function actionLoopUpdCartNum() {
* @return {[type]} [description]
*/
function actionExeTemplate() {
var resulthtml = $('#goodcartempwarpper').html().replace(/\\/g, '');
$('#goodcartempwarpper').html(resulthtml);
vipInfoCombine = handlebars.compile($('#tmpl-my-login-new').html());
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());
}
}
/**
* 执行搜索
... ... @@ -1846,7 +1850,10 @@ define("js/product/entry", ["jquery","handlebars","source-map","lazyload"], func
require("js/product/list");
require("js/product/hotrank");
require("js/product/brand");
require("js/product/hotrank");
});
define("js/product/list", ["jquery","handlebars","source-map","lazyload"], function(require, exports, module){
/**
... ... @@ -2415,12 +2422,18 @@ exports.init = function(num) {
removeHtmlFn();
ulStr = createColorList(data).colorListStr; //ajax请求的颜色列表
ulNum = createColorList(data).ulNum;//ajax请求的颜色的数量
ulStr = createColorList(data.pics).colorListStr; //ajax请求的颜色列表
ulNum = createColorList(data.pics).ulNum;//ajax请求的颜色的数量
$goodInfoMain.append(event.targetDuplicate);
$goodSelectColor.append($(ulStr));
if (data.isFavorite) {
$goodInfoMain.find('.col-btn').addClass('coled');
} else {
$goodInfoMain.find('.col-btn').removeClass('coled');
}
wrapperPl = $goodItemWrapper.css('paddingLeft');
wrapperPt = $goodItemWrapper.css('paddingTop');
containerPt = $goodsContainer.css('paddingTop');
... ... @@ -2448,8 +2461,8 @@ exports.init = function(num) {
});
// 鼠标悬浮获取到商品信息后显示第一张图片
if (data[0] && data[0].src) {
$goodInfoMain.find('.good-thumb img').attr('src', data[0].src);
if (data.pics[0] && data.pics[0].src) {
$goodInfoMain.find('.good-thumb img').attr('src', data.pics[0].src);
}
//}, 1000);
... ... @@ -2457,7 +2470,8 @@ exports.init = function(num) {
});
$goodItemWrapper.mouseleave(function() {
removeHtmlFn();
// removeHtmlFn();
});
function removeHtmlFn() {
... ... @@ -2477,6 +2491,23 @@ $(document).on('hover', '.good-select-color li', function() {
$coverImg.attr('src', coverImg);
});
$goodInfoMain.on('click', '.col-btn', function() {
var $this = $(this);
$.ajax({
type: 'POST',
url: '/product/list/changeFavorite',
data: {
skn: $this.closest('.good-info').data('skn'),
isFavorite: !$this.hasClass('coled')
}
}).then(function(res) {
if (res.code === 200) {
$this.toggleClass('coled');
}
});
});
// 左侧导航
$productListNav.click(function() {
if ($(this).hasClass('active')) {
... ... @@ -2603,6 +2634,39 @@ module.exports = function($o, rowWidth) {
return pMouseHover;
};
});
define("js/product/brand", ["jquery"], function(require, exports, module){
/**
* 品牌页面
* @auhtor: bikai<kai.bi@yoho.cn>
* @date: 2016/1/21
*/
var $ = require("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');
}
});
});
});
define("js/product/hotrank", ["jquery","handlebars","source-map","lazyload"], function(require, exports, module){
/**
* 首页
... ... @@ -4340,7 +4404,8 @@ require("js/passport/reg");
require("js/passport/back");
require("js/passport/login");
require("js/passport/reset");
require("js/passport/vertification");
require("js/passport/vertification");
require("js/passport/thirdlogin");
});
define("js/passport/reg", ["jquery"], function(require, exports, module){
/*
... ... @@ -5971,3 +6036,115 @@ $('#captcha').keyup(function() {
$(this).removeClass('error');
});
});
define("js/passport/thirdlogin", ["jquery"], function(require, exports, module){
/**
* 登录
* @author: wq
* @date: 2016/1/21
*/
var $ = require("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();
});
... ...
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.
... ... @@ -1323,10 +1323,14 @@ function actionLoopUpdCartNum() {
* @return {[type]} [description]
*/
function actionExeTemplate() {
var resulthtml = $('#goodcartempwarpper').html().replace(/\\/g, '');
$('#goodcartempwarpper').html(resulthtml);
vipInfoCombine = handlebars.compile($('#tmpl-my-login-new').html());
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());
}
}
/**
* 执行搜索
... ...
... ... @@ -6,4 +6,5 @@ require('./reg');
require('./back');
require('./login');
require('./reset');
require('./vertification');
\ No newline at end of file
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('./hotrank');
\ No newline at end of file
require('./brand');
require('./hotrank');
... ...
... ... @@ -149,6 +149,11 @@
.brand-favor {
margin-right: 0;
cursor: pointer;
&.favored {
color: #ee0014;
}
}
.coled {
... ...
... ... @@ -469,7 +469,7 @@ class HomeController extends AbstractAction
$info = 'userId=' . $uid . '&name=' . $this->_uname . '&memo=&hashCode=' . md5( strtoupper( rawurlencode($uid . $this->_uname . $time . '1231') ) ) . '&timestamp=' . $time;
$serviceUrl .= rawurlencode($info);
}
$this->_view->display('online-service', array(
'onlineServicePage' => true,
'pageFooter' => true,
... ... @@ -937,7 +937,7 @@ class HomeController extends AbstractAction
}
$this->setTitle('订单详情');
$this->setNavHeader('订单详情', true, false);
$this->setNavHeader('订单详情', Helpers::url('/home/orders'), false);
$this->_view->display('order-detail', array(
'orderDetailPage' => true,
... ...
... ... @@ -115,7 +115,7 @@ class UserModel
// 处理个人中心页面优选新品数据
if (!empty($preferenceData['data'])) {
foreach ($preferenceData['data'] as $value) {
$value = Helpers::formatProduct($value, false, true, true, 299, 388, false, false);
$value = Helpers::formatProduct($value, false, true, true, 299, 388, false);
if (false !== $value) {
$result['recommendList'][] = $value;
}
... ...
... ... @@ -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;
}
... ...
... ... @@ -6,7 +6,7 @@ use Api\Yohobuy;
use LibModels\Web\Product\HotrankData;
use LibModels\Web\Product\SearchData;
use LibModels\Web\Home\IndexData;
use WebPlugin\DataProcess\WebChannel\Channel as ChannelProcess;
use WebPlugin\DataProcess\Channel as ChannelProcess;
class HotrankModel {
... ...
... ... @@ -35,14 +35,16 @@ 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) {
$v['img'] = Images::getSourceUrl($v['img'], 'couponImg');
$specialInfo['data']['banner'][] = $v;
}
$special = $specialInfo['data'];
$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;
}
... ...
... ... @@ -68,26 +68,27 @@ class BackController extends WebAction {
$area = intval ($this->post('area', '86'));
$verifyCode = $this->post('verifyCode', '');//图形验证码
$ret = false;
if (Helpers::verifyEmail($phoneNum)) { // 验证邮箱
$email = $phoneNum;
$data = BackData::sendCodeToEmail($email);
if ($data ['code'] == 200) {
$ret = true;
$this->setSession('email', $email);
return $this->redirect ('sendemail');
}
} else if (Helpers::verifyMobile($phoneNum)) { // 验证手机号
$mobile = $phoneNum;
$data = BackData::sendCodeToMobile($mobile, $area);
if ($data['code'] == 200) {
$ret = true;
$this->setSession ('mobile', $mobile );
$this->setSession ('area', $area );
$this->setSession ('verifyCode', $verifyCode );
return $this->redirect ('verification');
}
if(PassportModel::verifyCode($verifyCode)) {
if (Helpers::verifyEmail($phoneNum)) { // 验证邮箱
$email = $phoneNum;
$data = BackData::sendCodeToEmail($email);
if ($data ['code'] == 200) {
$ret = true;
$this->setSession('email', $email);
return $this->redirect ('sendemail');
}
} else if (Helpers::verifyMobile($phoneNum)) { // 验证手机号
$mobile = $phoneNum;
$data = BackData::sendCodeToMobile($mobile, $area);
if ($data['code'] == 200) {
$ret = true;
$this->setSession ('mobile', $mobile );
$this->setSession ('area', $area );
$this->setSession ('verifyCode', $verifyCode );
return $this->redirect ('verification');
}
}
}
if(!$ret) {//重新找回密码页
return $this->redirect('index');
}
... ... @@ -150,7 +151,7 @@ class BackController extends WebAction {
$ret = array();
if (!empty ( $info )) {
$verifyState = true;
if(isset($info['uid'])) { //老版修改邮箱密码
if(isset($info['uid'])) { //老版修改邮箱密码不处理
$verifyState = false;//重新找回密码
}
} else {
... ... @@ -187,6 +188,7 @@ class BackController extends WebAction {
$password = $this->post('pwd');
$info = $this->checkCode($code);
$ret = false;
$successType = '';
if (Helpers::verifyPassword ($password)) {
if(!empty($info)) { //手机号找回
// 修改密码
... ... @@ -196,6 +198,7 @@ class BackController extends WebAction {
$area = $info ['area'];
$data = BackData::modifyPasswordByMobile($mobile, $token, $password, $area);
if ($data ['code'] == 200) {
$successType ='mobile';
$ret = true;
}
} else if (isset ($info ['uid'])) { //其他方式修改密码,跳到找回密码首页
... ... @@ -204,11 +207,13 @@ class BackController extends WebAction {
} else { //新版邮箱修改接口
$data = BackData::modifyPasswordByEmailCode($code, $password);
if ($data ['code'] == 200) {
$successType = 'email';
$ret = true;
}
}
}
if($ret) { //跳转到成功页
$this->setSession('successType', $successType);
return $this->redirect ('resetsuccess');
}
else {
... ... @@ -222,6 +227,11 @@ class BackController extends WebAction {
*/
public function resetsuccessAction()
{
$successType = $this->getSession('successType');
//成功状态标识
if(empty($successType)) {
return $this->redirect('index');
}
$banner = PassportModel::getLeftBanner ( PassportModel::BACK_LFFT_BANNER_CODE );
$data = array (
'simpleHeader' => PassportModel::getSimpleHeader (),
... ... @@ -231,6 +241,8 @@ class BackController extends WebAction {
'countrys' => array ()
)
);
//清除标识
$this->setSession('successType', '');
$this->_view->display ( 'reset-success', $data );
}
... ... @@ -242,7 +254,7 @@ class BackController extends WebAction {
$mobile = $this->getSession ('mobile');
$area = $this->getSession ('area');
$verifyCode = $this->getSession ('verifyCode');//图形验证码
if (empty ($mobile)) {
if (empty ($mobile) || !PassportModel::verifyCode($verifyCode)) {
$this->redirect ('index');
}
$banner = PassportModel::getLeftBanner (PassportModel::BACK_LFFT_BANNER_CODE);
... ... @@ -271,7 +283,8 @@ class BackController extends WebAction {
$verifyCode = $this->post ( 'verifyCode' );//图形验证码
$code = $this->post ( 'code' ); //手机验证码
$data = array('code'=> 400, 'message' => '验证码错误!','data' => SITE_MAIN.'/passport/back/index');
if ($this->getSession ( 'mobile' ) == $mobile && $this->getSession ( 'area' ) == $area && ! empty($code)) {
if ($this->getSession ( 'mobile' ) == $mobile && $this->getSession ( 'area' ) == $area && ! empty($code)
&& PassportModel::verifyCode($verifyCode)) {
$result = BackData::validateMobileCode ( $mobile, $code, $area );
if ($result ['code'] == 200) {
$str = json_encode ( array (
... ...
... ... @@ -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
);
... ...