Authored by yangyang

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

... ... @@ -32,7 +32,7 @@ class AliwapConfig
* Enter description here ...
* @var String
*/
var $notify_url = 'http://testservice.yoho.cn:28077/payment/alipay_notify';//"http://m.yohobuy.com/shopping/pay/aliwapnotice";
var $notify_url = 'http://testservice.yoho.cn:28077/payment/alipaywap_notify';//"http://m.yohobuy.com/shopping/pay/aliwapnotice";
/**
* 浏览器的返回
... ...
... ... @@ -71,8 +71,7 @@ class HelperSearch
$result = array();
self::$params = $_GET;
self::$options = $options;
// unset(self::$params['/']);
// unset(self::$params['page']);
unset(self::$params['page']);
self::$filter = isset($data['product']['filter']) ? $data['product']['filter'] : array();
//产品列表
$result['goods'] = isset($data['product']['product_list']) ? self::getProductList($data['product']['product_list'], $options['imgSize']) : array();
... ... @@ -555,6 +554,7 @@ class HelperSearch
$result = array();
$color = $filter['color'];
foreach ($color as $v) {
$checked = false;
//设置已选中
if ($v['color_id'] == $colorId) {
$background = empty($v['color_value']) ? '#' . $v['color_code'] : "url(" . $v['color_value'] . ")";
... ... @@ -562,6 +562,7 @@ class HelperSearch
'color' => $background,
'href' => self::buildUrl($params)
);
$checked = true;
}
$result[] = array(
'name' => $v['color_name'],
... ... @@ -569,6 +570,7 @@ class HelperSearch
'href' => self::buildUrl(array_merge($params, array(
'color' => $v['color_id']
))) ,
'checked' => $checked
);
}
if (self::checkSearch('color')) {
... ... @@ -663,6 +665,7 @@ class HelperSearch
$styleNum = 0;
$styleName = '';
foreach ($style as $v) {
$checked = false;
//选中的筛选条件
if (in_array($v['style_id'], $styleIds)) {
if (!$styleNum) {
... ... @@ -681,6 +684,7 @@ class HelperSearch
$url = self::buildUrl(array_merge($params, array(
'style' => implode(',', $selectedStyle)
)));
$checked = true;
}
//该风格url参数中添加该风格的id
else {
... ... @@ -693,6 +697,7 @@ class HelperSearch
'id' => $v['style_id'],
'name' => $v['style_name'],
'href' => $url,
'checked' => $checked
);
}
if (isset(self::$params['style']) && !empty(self::$params['style'])) {
... ... @@ -1281,16 +1286,41 @@ class HelperSearch
*/
public static function fromPram($url, $position, $abEnabled = false)
{
$type = '';
$itemFrom = ChannelConfig::$itemFromStats;
$controller = isset(self::$options['controller']) ? strtolower(self::$options['controller']) : '';
$action = isset(self::$options['action']) ? strtolower(self::$options['action']) : '';
//列表页面
if ($controller == 'list' && $action == 'index') {
$type = isset(self::$params['msort']) && self::$params['msort'] ? self::$params['msort'] : '';
}
//新品到着
elseif ($controller == 'list' && $action == 'new') {
if (isset(self::$params['shelve_time'])) {
$date = explode(',', self::$params['shelve_time']);
$date = date('Y-m-d', $date[0]);
}
$type = $date;
}
//list - sale
elseif ($controller == 'list' && $action == 'sale') {
$type = isset(self::$params['discount']) && self::$params['discount'] ? self::$params['discount'] : '0,0.9';
}
// 品牌
elseif ($controller == 'list' && $action == 'sale') {
$type = isset(self::$params['brandId']) && self::$params['brandId'] ? self::$params['brandId'] : '';
}
// 搜索
elseif ($controller == 'search') {
$type = isset(self::$params['query']) && self::$params['query'] ? self::$params['query'] : '';
}
$itemIndex = $controller."_".$action;
//获取domain-module-$keyword_page_position{ab}
$ab = (isset($_COOKIE['ab_5']) && $abEnabled == true) ? '_'.$_COOKIE['ab_5'] : '';
$page = self::$page;
$keyword = isset(self::$options['query']) ? self::$options['query'] : '';
if (isset($itemFrom[$itemIndex])) {
$url .= "?from={$itemFrom[$itemIndex]['domain']}-{$itemFrom[$itemIndex]['module']}-{$keyword}_{$page}_{$position}{$ab}";
$url .= "?from={$itemFrom[$itemIndex]['domain']}-{$itemFrom[$itemIndex]['module']}-{$type}_{$page}_{$position}{$ab}";
}
return $url;
}
... ...
... ... @@ -6,7 +6,8 @@
var $ = require('yoho.jquery');
require('./footer');
require('./simple-header');
function cookie(name) {
... ... @@ -131,5 +132,9 @@ window.getUser = getUser;
window.getUid = getUid;
window.getShoppingKey = getShoppingKey;
if($('.simple-header').hasClass('simple-header')){
require('./simple-header');
}else{
require('./header');
}
require('./header');
... ...
... ... @@ -773,8 +773,8 @@ function actionTipPic() {
var $img = '';
var $title = '';
var $link = '';
var link = '';
var logolink = '';
$(document).on('mouseenter', '.sub-nav-item', function() {
$contentcode = $(this).find('.showdetail').attr('data-code');
if ($contentcode) {
... ... @@ -791,7 +791,7 @@ function actionTipPic() {
}
}
});
link = $('.first-nav-list .cur').find('a').attr('href');
logolink = $('.first-nav-list .cur').find('a').attr('href');
$('.main-link').attr('href', link);
}
... ...
... ... @@ -4,7 +4,7 @@ application.directory = APPLICATION_PATH "/application"
;;website library
application.library = ROOT_PATH "/library"
;;模块配置
application.modules = "Index,Category,Channel,Guang,Passport,Product,Cart,Shopping"
application.modules = "Index,Category,Channel,Guang,Passport,Product,Cart"
;;加载
application.bootstrap = APPLICATION_PATH "/application/Bootstrap.php"
;;view文件的扩展名
... ...
... ... @@ -6,6 +6,7 @@ use LibModels\Web\Passport\LoginData;
use Passport\PassportModel as PassportModel;
use Configs\ChannelConfig;
use WebPlugin\Helpers;
use WebPlugin\Cache;
class LoginController extends WebAction
{
... ... @@ -61,8 +62,7 @@ class LoginController extends WebAction
*/
public function authAction()
{
$data = array('code' => 400, 'message' => '账号或密码不正确', 'data' => '');
$data = array('code' => 400, 'message' => '您输入的密码及账户名不匹配,是否忘记密码?', 'data' => '');
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax()) {
... ... @@ -91,10 +91,29 @@ class LoginController extends WebAction
break;
}
/* 调用登录接口进行登录 */
/* 购物车 */
$shoppingKey = Helpers::getShoppingKeyByCookie();
/*
* 登录-防恶意机制
* 同一用户名登录密码错误次数超10次,需30分钟后尝试
* 同一ip登录密码错误次数超100次,需1小时后尝试 , ip错误提示语:您尝试的次数过多,账号已被暂时锁定,请稍后再试
*/
$ip = Helpers::getClientIp();
$ipKey = md5('ip_signin_' . $ip);
$accountKey = md5('account_signin_' . $account);
$accountTimes = Cache::increment($accountKey, 1, 0, 1800);
$ipTimes = Cache::increment($ipKey, 1, 0, 3600);
if ($accountTimes > 10) {
$data = array('code' => 400, 'message' => '您输入的密码及账户名不匹配,是否忘记密码?', 'data' => '');
break;
}
if ($ipTimes > 100) {
$data = array('code' => 400, 'message' => '您尝试的次数过多,账号已被暂时锁定,请稍后再试', 'data' => '');
break;
}
$data = LoginData::signin($area, $account, $password, $shoppingKey);
if (!isset($data['code']) || $data['code'] != 200 || !isset($data['data']['uid'])) {
$data = array('code' => 400, 'message' => '您输入的密码及账户名不匹配,是否忘记密码?', 'data' => '');
break;
}
... ...
... ... @@ -59,7 +59,7 @@ class RegisterController extends WebAction
$data['message'] = '手机号码格式不正确';
break;
}
if ($ip_times >= 1000) {
if ($ip_times >= 500) {
$data['message'] = '由于你IP受限无法注册';
break;
}
... ...
... ... @@ -6,8 +6,8 @@ class SearchController extends WebAction
public function indexAction()
{
//当前控制器
$options['controller'] = $this->_request->controller;
$options['action'] = $this->_request->action;
$options['controller'] = 'Search';
$options['action'] = 'index';
//浏览记录数
$options['reviewNum'] = 7;
$searchData = SearchModel::searchData(array(),$options);
... ... @@ -16,8 +16,6 @@ class SearchController extends WebAction
'searchListPage' => true,
'search' => $searchData
);
// $this->setTitle();
// $this->setTitle();
$this->setWebNavHeader();
$this->_view->display('search', $data);
}
... ...