Authored by xuqi

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

... ... @@ -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";
/**
* 浏览器的返回
... ...
... ... @@ -4,9 +4,6 @@ namespace WebPlugin;
use WebPlugin\Paging;
use LibModels\Web\Product\BrandData;
use LibModels\Web\Product\SearchData;
use Api\Yohobuy;
use Api\Sign;
use Configs\ChannelConfig;
use Index\HomeModel;
/**
... ... @@ -74,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();
... ... @@ -318,7 +314,7 @@ class HelperSearch
foreach ($sort as $key => $val) {
//是否有品牌
if ($options['action'] != 'brand' && $options['controller'] != 'index') {
if ($options['action'] != 'brand' && $options['controller'] != 'Index') {
//若url参数有分类,设置msort导航
if (isset(self::$params['msort']) && self::$params['msort'] == $val['sort_id']) {
self::$listNav[1] = array(
... ... @@ -558,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'] . ")";
... ... @@ -565,6 +562,7 @@ class HelperSearch
'color' => $background,
'href' => self::buildUrl($params)
);
$checked = true;
}
$result[] = array(
'name' => $v['color_name'],
... ... @@ -572,6 +570,7 @@ class HelperSearch
'href' => self::buildUrl(array_merge($params, array(
'color' => $v['color_id']
))) ,
'checked' => $checked
);
}
if (self::checkSearch('color')) {
... ... @@ -666,6 +665,7 @@ class HelperSearch
$styleNum = 0;
$styleName = '';
foreach ($style as $v) {
$checked = false;
//选中的筛选条件
if (in_array($v['style_id'], $styleIds)) {
if (!$styleNum) {
... ... @@ -684,6 +684,7 @@ class HelperSearch
$url = self::buildUrl(array_merge($params, array(
'style' => implode(',', $selectedStyle)
)));
$checked = true;
}
//该风格url参数中添加该风格的id
else {
... ... @@ -696,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'])) {
... ... @@ -1284,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;
}
... ...
... ... @@ -19,7 +19,8 @@ define("js/common", ["jquery","handlebars","source-map","index"], function(requi
var $ = require("jquery");
require("js/footer");
require("js/simple-header");
function cookie(name) {
... ... @@ -144,8 +145,12 @@ window.getUser = getUser;
window.getUid = getUid;
window.getShoppingKey = getShoppingKey;
if($('.simple-header').hasClass('simple-header')){
require("js/simple-header");
}else{
require("js/header");
}
require("js/header");
});
define("js/footer", ["jquery"], function(require, exports, module){
... ... @@ -735,26 +740,26 @@ function JsonPCallBack(data) {
if (+data.code === 200) {
if (typeof data.data === 'object') {
if(data.data.url !== ''){
topbanner = '<a target="_blank" href="' + data.data.url + '" class="page-top-banner"' +
'style="height:36px;border:none;background-image:url(' + window.unescape(data.data.src) + ');' +
'background-position: center;display:block;background-size:contain">&nbsp;</a>';
}else{
topbanner = '<div class="noticewrapper">' +
'<div class="noticecontainer">' +
'<h1 class="noticetitle">关于系统升级的公告</h1>' +
'<div class="noticecontent">' +
'<p class="tips">尊敬的顾客:</p>' +
'<p class="detail">您好!为了向您提供更优质的服务,目前系统正在升级,请耐心等待。</p>' +
'<p class="detail">' +
'系统升级期间,部分地区用户体验会有暂时中断,如遇紧急事宜,欢迎垂询客服热线:400-889-9646 09:00-22:30(周一至周日)。稍后系统将恢复正常' +
'</p>' +
'<p class="detail">使用,欢迎您继续光顾YOHO!BUY有货!带来不便之处深表歉意,请您谅解!</p>' +
'</div>' +
'</div>' +
'</div>';
}
$('body').prepend(topbanner);
if (data.data.url !== '') {
topbanner = '<a target="_blank" href="' + data.data.url + '" class="page-top-banner"' +
'style="height:36px;border:none;background-image:url(' + window.unescape(data.data.src) + ');' +
'background-position: center;display:block;background-size:contain">&nbsp;</a>';
} else {
topbanner = '<div class="noticewrapper">' +
'<div class="noticecontainer">' +
'<h1 class="noticetitle">关于系统升级的公告</h1>' +
'<div class="noticecontent">' +
'<p class="tips">尊敬的顾客:</p>' +
'<p class="detail">您好!为了向您提供更优质的服务,目前系统正在升级,请耐心等待。</p>' +
'<p class="detail">' +
'系统升级期间,部分地区用户体验会有暂时中断,如遇紧急事宜,欢迎垂询客服热线:400-889-9646 09:00-22:30(周一至周日)。稍后系统将恢复正常' +
'</p>' +
'<p class="detail">使用,欢迎您继续光顾YOHO!BUY有货!带来不便之处深表歉意,请您谅解!</p>' +
'</div>' +
'</div>' +
'</div>';
}
$('body').prepend(topbanner);
}
}
}
... ... @@ -1189,6 +1194,7 @@ function actionTipPic() {
var $img = '';
var $title = '';
var $link = '';
var logolink = '';
$(document).on('mouseenter', '.sub-nav-item', function() {
$contentcode = $(this).find('.showdetail').attr('data-code');
... ... @@ -1206,6 +1212,8 @@ function actionTipPic() {
}
}
});
logolink = $('.first-nav-list .cur').find('a').attr('href');
$('.main-link').attr('href', link);
}
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -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文件的扩展名
... ...
... ... @@ -24,8 +24,6 @@ class NewModel
$urlList['sort'] = SearchData::getClassesUrl($searchCondition['sortCondition']);
// 组合搜索最新上架url
$urlList['recent'] = SearchData::getRecentShelveUrl($searchCondition['condition']);
//用户浏览记录
//$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
$result = Yohobuy::getMulti($urlList, array(), true);
// 组织模板数据
... ...
... ... @@ -102,7 +102,12 @@ class SearchModel
$condition['attribute_not'] = 2;
//默认排序
if (!isset($condition['order']) || empty($condition['order'])) {
$condition['order'] = 's_n_desc';
//如果新品到着没传排序方式,默认按s_t_desc(新品)顺序排序
if ($option['controller'] == 'List' && $option['action'] == 'new') {
$condition['order'] = 's_t_desc';
}else{
$condition['order'] = 's_n_desc';
}
}
$options = array(
'imgSize' => $imgSize,
... ...
... ... @@ -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;
}
... ...
... ... @@ -44,7 +44,7 @@ class IndexController extends WebAction
$options['brandNameEn'] = isset($result['brandNameEn']) ? $result['brandNameEn'] : '';
$options['brandNameCn'] = isset($result['brandNameCn']) ? $result['brandNameCn'] : '';
$options['reviewNum'] = 6;
$options['controller'] = 'index';
$options['controller'] = 'Index';
$options['action'] = 'brand';
//调用模型获得数据
... ... @@ -90,10 +90,10 @@ class IndexController extends WebAction
$options['brandId'] = isset($result['brandId']) ? $result['brandId'] : '';
$options['brandBanner'] = isset($result['brandBanner']) ? $result['brandBanner'] : '';
$options['brandAbout'] = isset($result['brandAbout']) ? $result['brandAbout'] : '';
$options['controller'] = $this->_request->controller;
$options['action'] = $this->_request->action;
$options['controller'] = 'Index';
$options['action'] = 'brand';
//调用模型获得数据
$data = Product\BrandsModel::getBrandIntro($condition, $options);
$data = BrandsModel::getBrandIntro($condition, $options);
$data = array(
//初始化js
... ...
... ... @@ -15,8 +15,8 @@ class ListController extends WebAction
$options = array(
'positionId' => $positionId,
'reviewNum' => 6,
'controller' => $this->_request->controller,//TODO
'action' => $this->_request->action
'controller' => 'List',
'action' => 'index'
);
$indexData = IndexModel::getIndexData($condition, $options);
... ... @@ -35,12 +35,10 @@ class ListController extends WebAction
*/
public function newAction()
{
$condition = array(
'order' => 's_t_desc'
);
$condition = array();
$options = array(
'reviewNum' => 6,
'controller' => 'list',
'controller' => 'List',
'action' => 'new'
);
... ... @@ -64,7 +62,7 @@ class ListController extends WebAction
$options['reviewNum'] = 6;
$condition = array();
$option = array(
'controller' => 'list',
'controller' => 'List',
'action' => 'sale',
'reviewNum'=>6
);
... ...
... ... @@ -2,6 +2,7 @@
use Action\WebAction;
use LibModels\Web\Product\SaleData;
use Product\SaleModel;
/**
* sale页
... ... @@ -43,12 +44,12 @@ class SaleController extends WebAction
}
$options = array(
'controller' => 'sale',
'controller' => 'Sale',
'action' => 'index',
'reviewNum' => 6
);
$saleData = Product\SaleModel::getSaleSearchData($condition, $options, $specialInfo);
$saleData = SaleModel::getSaleSearchData($condition, $options, $specialInfo);
$data = array(
//初始化js
... ...
... ... @@ -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);
}
... ...