Authored by uedxwg

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

Showing 40 changed files with 752 additions and 390 deletions
... ... @@ -22,8 +22,8 @@ class Yohobuy
// const API_URL2 = 'http://api.open.yohobuy.com/';
// const SERVICE_URL = 'http://service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_URL = 'http://apih5.yoho.cn/';
// const API_URL = 'http://apih5.yoho.cn/';
// const API_URL2 = 'http://apih5.yoho.cn/';
// const SERVICE_URL = 'http://serviceh5.yoho.cn/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
... ... @@ -45,7 +45,7 @@ class Yohobuy
/* PC重构地址 */
// const API_URL = 'http://test.open.yohobuy.com/';
// const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
// const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_OLD = 'http://api2.open.yohobuy.com/';
... ... @@ -72,9 +72,9 @@ class Yohobuy
}
// 苹果IPAD
elseif (strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) {
return 'ipad';
}
}
elseif (stristr($_SERVER['HTTP_USER_AGENT'], 'android')) {
return 'android';
}
... ... @@ -179,7 +179,7 @@ class Yohobuy
if (!$returnJson && !empty($result)) {
$result = json_decode($result, true);
}
curl_close($ch);
$data = array();
... ...
... ... @@ -25,7 +25,7 @@ class LoginData extends \LibModels\Wap\Passport\LoginData
* @param string $shoppingKey 未登录用户唯一识别码, 默认为空
* @return array 登录返回结果
*/
public static function signinByOpenID($nickname, $openId, $sourceType, $shoppingKey = null)
public static function signinByOpenID($nickname, $openId, $sourceType, $shoppingKey = null, $replaceId = '')
{
// 构建必传参数
$param = Yohobuy::param();
... ... @@ -35,13 +35,18 @@ class LoginData extends \LibModels\Wap\Passport\LoginData
$param['openId'] = $openId;
$param['source_type'] = $sourceType;
$param['nickname'] = $nickname;
//wechat传入replace_id
if (!empty($replaceId)) {
$param['replace_id'] = $replaceId;
}
//购物车
if (!empty($shoppingKey)) {
$param['shopping_key'] = $shoppingKey;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
return Yohobuy::get(Yohobuy::API_URL2, $param);
}
}
... ...
<?php
namespace Plugin\Partner\wechat;
use Plugin\Partner\Factory;
define('WECHAT_CLASS_PATH', dirname(__FILE__) . '/class/');
require WECHAT_CLASS_PATH . 'Wechat.class.php';
/**
* 微信的调用接口
*
* @name Call
* @package lib/partner/wechat
* @copyright yoho.inc
* @version 5.0 (2016-01-12 10:54:54)
* @author xiaowei <xiaowei.gong@yoho.cn>
*/
class Call extends Factory
{
//微信对象
protected $wechat;
/**
* 初始化
*/
protected function init()
{
$this->wechat = new \WechatAuth($this->apiConfig['appId'], $this->apiConfig['appKey']);
}
/**
* 获取授权URL
*
* @return string
*/
public function getAuthorizeUrl()
{
return $this->wechat->getAuthorizeURL($this->apiConfig['callback'], $this->apiConfig['scope']);
}
/**
* 获取授权的TOKEN
*
* @return array
*/
public function getAccessToken()
{
$token = array();
if (isset($_REQUEST['code']) && !empty($_REQUEST['code'])) {
try {
$token = $this->wechat->getAccessToken($_REQUEST['code']);
}
catch (Exception $e) {
// do nothing
}
}
return $token;
}
/**
* 获取当前用户的基本资料
*
* @param object $token 授权成功的TOKEN, 默认为NULL
* @return array
*/
public function getUserInfo($token)
{
$userInfo = array();
if (!empty($token)) {
$userInfo = $this->wechat->getUserInfo($token['access_token'], $token['openid']);
}
return $userInfo;
}
public function getFriends($token, $params)
{
}
public function syncShare($token, $content, $image, $link)
{
}
}
... ...
<?php
defined('SITE_MAIN') || define('SITE_MAIN', $_SERVER['HTTP_HOST']);
return array(
'appId' => 'wx3ae21dcbb82ad672',
'appKey' => 'e78afb2321e6a19085767e1a0f0d52c1',
'callback' => SITE_MAIN . '/passport/autosign/wechatback',
'scope' => 'snsapi_login'
);
... ...
<?php
/**
* @ignore
*/
class OAuthException extends Exception
{
// pass
}
class WechatAuth
{
/**
* @ignore
*/
public $appId;
/**
* @ignore
*/
public $appKey;
/**
* @ignore
*/
public $accessToken;
/**
* @ignore
*/
public $refreshToken;
/**
* Set API URLS
*/
/**
* @ignore
*/
function userInfoURL()
{
return 'https://api.weixin.qq.com/sns/userinfo';
}
/**
* @ignore
*/
function authorizeURL()
{
return 'https://open.weixin.qq.com/connect/qrconnect';
}
/**
* @ignore
*/
function accessTokenURL()
{
return 'https://api.weixin.qq.com/sns/oauth2/access_token';
}
/**
* construct WeichatOAuth object
*/
function __construct($appId, $appKey, $accessToken = NULL)
{
$this->appId = $appId;
$this->appKey = $appKey;
$this->accessToken = $accessToken;
}
/**
* authorize接口
* $callBackurl 回调地址
*/
function getAuthorizeURL($callBackurl, $scope, $responseType = 'code', $state = 'STATE#wechat_redirect')
{
$params = array();
$params['appid'] = $this->appId;
$params['redirect_uri'] = $callBackurl;
$params['response_type'] = $responseType;
$params['scope'] = $scope;
$params['state'] = $state;
return $this->authorizeURL() . "?" . http_build_query($params);
}
/*
* 获取accesstoken
* code:授权链接返回的code
*/
function getAccessToken($code, $grant_type = 'authorization_code')
{
if (empty($code)) {
return '';
}
$params = array();
$params['appid'] = $this->appId;
$params['secret'] = $this->appKey;
$params['code'] = $code;
$params['grant_type'] = $grant_type;
$url = $this->accessTokenURL() . "?" . http_build_query($params);
$result = self::getCurl($url);
return json_decode($result, true);
}
// 获取用户信息
function getUserInfo($access_token, $openid)
{
if (empty($access_token) || empty($openid)) {
return array();
}
$params = array();
$params['access_token'] = $access_token;
$params['openid'] = $openid;
$url = $this->userInfoURL() . "?" . http_build_query($params);
$result = self::getCurl($url);
return json_decode($result, true);
}
/**
* Send a GET requst using cURL
* @param string $url to request
* @param array $get values to send
* @param array $options for cURL
* @return string
*/
public static function getCurl($url,$method="GET")
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_TIMEOUT, 20);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
$output = curl_exec($curl);
curl_close($curl);
return $output;
}
}
... ...
No preview for this file type
... ... @@ -2,7 +2,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
Created by FontForge 20120731 at Mon Dec 21 17:16:11 2015
Created by FontForge 20120731 at Wed Jan 13 13:50:02 2016
By Ads
</metadata>
<defs>
... ... @@ -16,10 +16,10 @@ Created by FontForge 20120731 at Mon Dec 21 17:16:11 2015
ascent="896"
descent="-128"
x-height="792"
bbox="-0.75 -224 3943 893"
bbox="-0.75 -224 3943 896"
underline-thickness="50"
underline-position="-100"
unicode-range="U+0078-E641"
unicode-range="U+0078-E644"
/>
<missing-glyph horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
... ... @@ -268,5 +268,15 @@ d="M522 893q-103 0 -197 -40t-162 -108t-108.5 -162t-40.5 -197.5t40.5 -197.5t108.5
t92.5 138.5t138.5 92.5t169 34.5t168.5 -34.5t138.5 -92.5t93 -138.5t34.5 -169t-34.5 -168.5t-93 -138.5t-138.5 -93t-169 -34.5zM775 268l-105 61q-11 4 -21 6.5t-18 2.5t-15 -0.5t-13 -4t-10 -5.5t-9 -6l-6 -7q-2 -2 -6 -7l-3 -4l-6 -10q-34 -4 -59 21l-51 50
q-24 25 -20 60l9 4q3 5 16 16t17 18t4 25t-11 43h-1l-60 105q-8 13 -20.5 20t-26 7t-27.5 -7l-62 -36q-3 -1 -6 -4l-6 -6l-6 -6q-3 -3 -5.5 -6t-4.5 -5t-3 -4l-1 -1q-14 -87 24.5 -183.5t121.5 -174.5q72 -68 157 -101.5t165 -29.5q4 1 10.5 2.5t20.5 10t21 20.5l36 62
q11 20 5.5 41.5t-25.5 32.5z" />
<glyph glyph-name="uniE642" unicode="&#xe642;"
d="M439 324h110l-54 148zM501 881q-101 0 -192.5 -39.5t-158 -105.5t-105.5 -158t-39 -193q0 -205 145 -350t350 -145q101 0 192.5 39t158 105.5t105.5 158.5t39 192.5t-39 192.5t-105.5 158t-158 105.5t-192.5 39.5zM656 180l-19 -9q-2 -1 -4 -1.5t-3.5 -1t-3.5 -0.5
q-5 0 -9 2q-5 2 -8.5 5.5t-5.5 8.5l-27 69h-163l-25 -69q-4 -10 -14.5 -14t-19.5 1l-20 9q-9 4 -12.5 13t-0.5 18l151 401q6 16 23 16t23 -16l151 -401q3 -9 -0.5 -18t-12.5 -13z" />
<glyph glyph-name="uniE643" unicode="&#xe643;" horiz-adv-x="1124"
d="M859 896h-595q-109 0 -186.5 -77.5t-77.5 -186.5v-760l200 135q18 14 49.5 24t63.5 14.5t71.5 6.5t66 2t57 -1t34.5 -1h317q109 0 186.5 77.5t77.5 186.5v316q0 109 -77.5 186.5t-186.5 77.5zM477 367q-42 0 -71.5 29.5t-29.5 70.5t29.5 70t71.5 29t71.5 -29t29.5 -70
q0 -14 -3.5 -27t-10 -23.5t-16 -20t-20.5 -15.5t-24 -10t-27 -4zM848 367q-42 0 -71.5 29.5t-29.5 70.5t29.5 70t71.5 29t71.5 -29t29.5 -70t-29.5 -70.5t-71.5 -29.5z" />
<glyph glyph-name="uniE644" unicode="&#xe644;"
d="M523 881q-101 0 -192.5 -39.5t-158 -105.5t-105.5 -158t-39 -193q0 -205 145 -350t350 -145q67 0 131.5 18t119 49.5t100 77.5t77.5 100.5t49.5 118.5t17.5 131q0 101 -39 193t-105.5 158t-158 105.5t-192.5 39.5zM739 224q8 -8 7 -19q0 -2 -0.5 -4.5t-1.5 -5t-2.5 -4.5
t-3.5 -3q-11 -10 -15 -14q-7 -7 -17 -7t-18 7l-34 34q-59 -42 -131 -42q-94 0 -160.5 66.5t-66.5 160.5q0 46 18 88t48.5 72.5t72.5 48.5t88 18t88 -18t72.5 -48.5t48.5 -72.5t18 -88q0 -75 -45 -135zM592 337q8 7 18 6.5t17 -7.5l27 -27q25 39 25 84q0 64 -45.5 109.5
t-110 45.5t-110 -45.5t-45.5 -109.5t45.5 -109.5t109.5 -45.5q44 0 80 21l-27 28q-8 7 -7.5 18t7.5 18z" />
</font>
</defs></svg>
... ...
No preview for this file type
No preview for this file type
... ... @@ -9,12 +9,12 @@ var $ = require('jquery'),
var commentsNum,consultsNum;
var consultFooterEle = $('.consult-content-footer')[0],
consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle),
navtabEle = document.getElementById('nav-tab'),
var navtabEle = document.getElementById('nav-tab'),
navtabHammer = navtabEle && new Hammer(navtabEle),
// consultFooterEle = $('.consult-content-footer')[0],
// consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle),
gotoConsultEle = document.getElementById('goto-consult'),
gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle),
... ... @@ -70,11 +70,11 @@ if (navtabHammer) {
});
}
if (consultFooterHammer) {
consultFooterHammer.on('tap', function() {
location.href = $(consultFooterEle).data('href');
});
}
// if (consultFooterHammer) {
// consultFooterHammer.on('tap', function() {
// location.href = $(consultFooterEle).data('href');
// });
// }
if (gotoConsultHammer) {
gotoConsultHammer.on('tap', function() {
... ...
... ... @@ -97,7 +97,7 @@
span {
display: block;
float: left;
font-size: inherit;
// font-size: inherit;
padding-right: pxToRem(15px);
}
p {
... ... @@ -118,7 +118,7 @@
span {
display: block;
float: left;
font-size: inherit;
// font-size: inherit;
color: $mainFontC;
padding-right: pxToRem(15px);
}
... ...
{{> layout/header}}
<div class="brand-page brand-search-page yoho-page">
<div class="newbrand-search">
<form class="search-box clearfix">
<input type="text" class="search-input" id="keyword" placeholder="查找品牌">
<form class="search-box clearfix">
<input type="text" class="search-input" id="keyword" placeholder="查找品牌" autofocus>
<i class="search-icon iconfont">&#xe60f;</i>
<div class="search-action">
<span class="iconfont clear-text">&#xe623;</span>
... ...
{{> layout/header}}
<div class="goods-consults-page yoho-page">
<div class="goto-consult tap-hightlight" id="goto-consult" data-href="{{link}}">
<i class="iconfont consult-logo">&#xe639;</i>
<i class="iconfont consult-logo">&#xe643;</i>
<span>我要咨询</span>
<a href="{{link}}" class="iconfont enter-consult-page">&#xe604;</a>
</div>
... ... @@ -10,7 +10,7 @@
{{#list}}
<div class="consult-item" data-id="{{id}}">
<div class="question">
<span class="iconfont">&#xe639;</span>
<span class="iconfont">&#xe644;</span>
<p>
{{question}}<br>
<span class="time">{{time}}</span>
... ... @@ -18,7 +18,7 @@
</div>
<div class="answer">
<span class="iconfont">&#xe63f;</span>
<span class="iconfont">&#xe642;</span>
<p>{{answer}}</p>
</div>
... ... @@ -58,14 +58,14 @@
{{#commonConsults}}
<div class="faq-item">
<div class="question">
<span class="iconfont">&#xe639;</span>
<span class="iconfont">&#xe644;</span>
<p>
{{question}}
</p>
</div>
<div class="answer">
<span class="iconfont">&#xe63f;</span>
<span class="iconfont">&#xe642;</span>
<p>{{answer}}</p>
</div>
</div>
... ...
{{> layout/header}}
<div class="product-list-page product-page yoho-page">
{{# list}}
{{# brandBanner}}
<div class="brand-banner">
<div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div>
<div class="opt-wrap">
<p class="opt center-content">
<a href="{{brandHome}}">
<i class="iconfont">&#xe617;</i>
品牌首页
</a>
<a href="{{brandIntro}}">
<i class="iconfont">&#xe618;</i>
品牌介绍
</a>
<span id="brand-favor" class="brand-favor">
<i class="iconfont{{#if coled}} coled{{/if}}">&#xe616;</i>
</span>
</p>
</div>
</div>
{{/ brandBanner}}
<div class="center-content clearfix">
{{> layout/path-nav}}
{{# brandAbout}}
<div class="brand-about">
{{{brandIntro}}}
</div>
{{^}}
<div class="list-left pull-left">
{{> product/left-content}}
</div>
<div class="list-right pull-right">
{{# shopEntry}}
<div class="shop-entry clearfix">
<a class="pull-left" href="{{home}}">
<img class="logo" src="{{logo}}">
</a>
<div class="name pull-left">
<a class="shop-name" href="{{home}}">{{shopName}}</a>
<p class="sorts">
{{#each sort}}
<a href="{{href}}">{{name}}</a>
{{#unless @last}}
/
{{/unless}}
{{/each}}
</p>
</div>
<a class="entry-btn pull-right" href="{{home}}">
进入品牌店铺
<span class="iconfont">&#xe601;</span>
</a>
</div>
{{/ shopEntry}}
{{> product/standard-content}}
{{> product/latest-walk}}
</div>
{{/ brandAbout}}
</div>
{{/ list}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> product/list}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="product-search-page product-page yoho-page center-content">
{{# search}}
{{> layout/path-nav}}
{{> product/standard-content}}
{{> product/latest-walk}}
{{/ search}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/header}}
<div class="product-list-page product-page yoho-page">
{{# list}}
{{# brandBanner}}
<div class="brand-banner">
<div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div>
<div class="opt-wrap">
<p class="opt center-content">
<a href="{{brandHome}}">
<i class="iconfont">&#xe617;</i>
品牌首页
</a>
<a href="{{brandIntro}}">
<i class="iconfont">&#xe618;</i>
品牌介绍
</a>
<span id="brand-favor" class="brand-favor">
<i class="iconfont{{#if coled}} coled{{/if}}">&#xe616;</i>
</span>
</p>
</div>
</div>
{{/ brandBanner}}
<div class="center-content clearfix">
{{> layout/path-nav}}
{{# brandAbout}}
<div class="brand-about">
{{{brandIntro}}}
</div>
{{^}}
<div class="list-left pull-left">
{{> product/left-content}}
</div>
<div class="list-right pull-right">
{{> product/standard-content}}
{{> product/latest-walk}}
</div>
{{/ brandAbout}}
</div>
{{/ list}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> product/list}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="product-search-page product-page yoho-page center-content">
{{# search}}
{{> layout/path-nav}}
{{# shopEntry}}
<div class="shop-entry clearfix">
<a class="pull-left" href="{{home}}">
<img class="logo" src="{{logo}}">
</a>
<div class="name pull-left">
<a class="shop-name" href="{{home}}">{{shopName}}</a>
<p class="sorts">
{{#each sort}}
<a href="{{href}}">{{name}}</a>
{{#unless @last}}
/
{{/unless}}
{{/each}}
</p>
</div>
<a class="entry-btn pull-right" href="{{home}}">
进入品牌店铺
<span class="iconfont">&#xe601;</span>
</a>
</div>
{{/ shopEntry}}
{{> product/standard-content}}
{{> product/latest-walk}}
{{/ search}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> product/new-sale}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="new-sale-page product-page yoho-page">
{{# newSale}}
{{# saleBanner}}
<div class="banner-img" style="height: {{bannerHeight}}px;background:url({{img}}) no-repeat top center;"></div>
{{/ saleBanner}}
<div class="center-content clearfix">
{{> layout/path-nav}}
{{# saleTitle}}
<div class="header-title">
{{name}}
<p class="line-through"></p>
<p class="count-wrap">
<span class="count">共{{count}}个结果</span>
</p>
</div>
{{/ saleTitle}}
<div class="list-left pull-left">
{{> product/left-content}}
</div>
<div class="list-right pull-right">
{{# newMain}}
<div class="new-banner">
<a href="{{bannerHref}}">
<img src="{{banner}}">
</a>
</div>
<div class="new-brands clearfix">
<span class="iconfont pre">&#xe607;</span>
<div class="brands-wrap">
<ul class="brands">
{{# brands}}
<li>
<a href="{{href}}">
<img src="{{logo}}">
</a>
</li>
{{/ brands}}
</ul>
</div>
<span class="iconfont next">&#xe608;</span>
</div>
<div class="new-floor-title">
<span class="date">{{date}}</span>
<span class="title">{{title}}</span>
</div>
{{/ newMain}}
{{> product/standard-content}}
</div>
</div>
{{/ newSale}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> product/new-sale}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="product-search-page product-page yoho-page center-content">
{{# search}}
{{> layout/path-nav}}
{{> layout/path-nav}}
{{> product/shop-entry}}
{{> product/shop-entry}}
{{> product/standard-content}}
{{> product/standard-content}}
{{> product/latest-walk}}
{{> product/latest-walk}}
{{/ search}}
</div>
{{> layout/footer}}
... ...
{{> layout/header}}
<div class="product-list-page product-page yoho-page">
{{# list}}
{{# brandBanner}}
<div class="brand-banner">
<div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div>
<div class="opt-wrap">
<p class="opt center-content">
<a href="{{brandHome}}">
<i class="iconfont">&#xe617;</i>
品牌首页
</a>
<a href="{{brandIntro}}">
<i class="iconfont">&#xe618;</i>
品牌介绍
</a>
<span id="brand-favor" class="brand-favor">
<i class="iconfont{{#if coled}} coled{{/if}}">&#xe616;</i>
</span>
</p>
</div>
</div>
{{/ brandBanner}}
<div class="center-content clearfix">
{{> layout/path-nav}}
{{# brandAbout}}
<div class="brand-about">
{{{brandIntro}}}
</div>
{{^}}
<div class="list-left pull-left">
{{> product/left-content}}
</div>
<div class="list-right pull-right">
{{> product/standard-content}}
{{> product/latest-walk}}
</div>
{{/ brandAbout}}
</div>
{{/ list}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="new-sale-page product-page yoho-page">
{{# newSale}}
{{# saleBanner}}
<div class="banner-img" style="height: {{bannerHeight}}px;background:url({{img}}) no-repeat top center;"></div>
{{/ saleBanner}}
<div class="center-content clearfix">
{{> layout/path-nav}}
{{# saleTitle}}
<div class="header-title">
{{name}}
<p class="line-through"></p>
<p class="count-wrap">
<span class="count">共{{count}}个结果</span>
</p>
</div>
{{/ saleTitle}}
<div class="list-left pull-left">
{{> product/left-content}}
</div>
<div class="list-right pull-right">
{{# newMain}}
<div class="new-banner">
<a href="{{bannerHref}}">
<img src="{{banner}}">
</a>
</div>
<div class="new-brands clearfix">
<span class="iconfont pre">&#xe607;</span>
<div class="brands-wrap">
<ul class="brands">
{{# brands}}
<li>
<a href="{{href}}">
<img src="{{logo}}">
</a>
</li>
{{/ brands}}
</ul>
</div>
<span class="iconfont next">&#xe608;</span>
</div>
<div class="new-floor-title">
<span class="date">{{date}}</span>
<span class="title">{{title}}</span>
</div>
{{/ newMain}}
{{> product/standard-content}}
</div>
</div>
{{/ newSale}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -84,11 +84,11 @@
{{> product/good}}
{{/each}}
{{# hasNextPage}}
<div class="block-next-page">
<a href="{{href}}">
<img src="{{src}}" alt=""/>
</a>
</div>
<div class="block-next-page">
<a href="{{href}}">
<img src="{{src}}" alt=""/>
</a>
</div>
{{/ hasNextPage}}
<div class="good-item-wrapper">
<div class="good-info-main"></div>
... ...
... ... @@ -136,7 +136,7 @@ function picCaptchaAjaxFn(page, callback) {
type: 'POST',
url: url,
data: {
code: $ca.val()
verifyCode: $ca.val()
//mobile: $pn.val(),
//area: $region.text().split('+')[1]
... ... @@ -169,7 +169,7 @@ function msgCaptchaAjaxFn(page, callback) {
type: 'POST',
url: url,
data: {
code: $ca.val(),
verifyCode: $ca.val(),
mobile: $pn.val(),
area: $region.text().split('+')[1]
}
... ... @@ -465,7 +465,7 @@ exports.init = function(page) {
$regionSelect.change(function() {
$region.text('+' + $('#region').val());
$region.text($('#region').val());
validateRule(page, $pn, showErrTip); //验证
});
... ... @@ -493,7 +493,7 @@ exports.init = function(page) {
data: {
area: $region.text().split('+')[1],
mobile: $pn.val(),
code: $ca.val()
verifyCode: $ca.val()
}
}).then(function(data) {
if (data.code === 200) {
... ...
... ... @@ -259,9 +259,12 @@ if ($udPrice.length > 0) {
//【高级选项】鼠标移入显示子项
$seniorAttrWrap.on('mouseenter', '.attr', function() {
var index = $(this).addClass('hover').index();
var $this = $(this);
var index = $this.index();
$this.addClass('hover').siblings().removeClass('hover');
$seniorSubWrap.children('.senior-sub:eq(' + index + ')').removeClass('hide');
$seniorSubWrap.children('.senior-sub:eq(' + index + ')').removeClass('hide').siblings().addClass('hide');
}).on('mouseleave', '.attr', function() {
var $this = $(this),
index = $this.index();
... ... @@ -296,4 +299,4 @@ $('.senior-sub').on('click', '.multi-select', function() {
clearTimeout(seniorHoverTime);
}).on('mouseleave', function() {
hideSeniorPanel();
});
\ No newline at end of file
});
... ...
... ... @@ -265,6 +265,7 @@
top: 39px;
background: #fff;
border: 1px solid #eaeceb;
z-index: 2;
ul {
max-width: 950px;
... ...
... ... @@ -5,16 +5,17 @@
*/
.product-search-page {
@import "shop-entry";
.goods-container {
height: auto;
padding: 25px 0 0 0;
position: relative;
width: 1150px + 10px;//每列增加右边距
}
@import "shop-entry";
.good-info {
width: 222px;
}
}
}
... ...
... ... @@ -54,14 +54,21 @@
> ul {
position: absolute;
display: none;
width: 42px;
padding: 0 3px;
width: 48px;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
background: #fff;
z-index: 1;
}
li {
padding: 0 3px;
border-bottom: 1px solid #ccc;
&:hover {
background: #376cf7;
color: #fff;
}
}
a {
... ... @@ -84,4 +91,4 @@
color: #f00;
}
}
}
\ No newline at end of file
}
... ...
<?php
<?php
/**
* 启动运行
*
... ... @@ -66,12 +65,11 @@ class Bootstrap extends Bootstrap_Abstract
{
$hostParts = explode('.', $dispatcher->getRequest()->getServer('HTTP_HOST', ''));
$level = count($hostParts) - 1;
/* 根据域名的级别,设置默认的模块、控制器、方法 */
$module = 'Index';
$controller = 'Index';
$action = 'Index';
// 二级域名
if (2 === $level) {
$subDomain = strval($hostParts[0]);
... ... @@ -93,7 +91,9 @@ class Bootstrap extends Bootstrap_Abstract
case 'sale'://促销
$module = 'Product';
$controller = 'sale';
$saleRequest = new Yaf\Request\Http('/product/sale/index');
$dispatcher->setRequest($saleRequest);
break;
default: // 其它(识别为品牌)
$module = 'Product';
$action = 'Brand';
... ... @@ -104,6 +104,7 @@ class Bootstrap extends Bootstrap_Abstract
$dispatcher->getRequest()->module = $module;
$dispatcher->getRequest()->controller = $controller;
$dispatcher->getRequest()->action = $action;
/* 根据对应模块的配置,添加相应的路由规则 */
$iniFile = APPLICATION_PATH . '/configs/routes.' . strtolower($module) . '.ini';
if (file_exists($iniFile)) {
... ...
<?php
use Action\WebAction;
use Action\WebAction;
use Index\HomeModel;
use Plugin\Captcha;
/**
* 女首
*/
... ... @@ -18,4 +18,5 @@ class GirlsController extends WebAction
);
$this->_view->display('index', $data);
}
}
\ No newline at end of file
... ...
... ... @@ -230,12 +230,14 @@ class HomeModel
$sortList = ChannelConfig::$newArrivalSortList[$channel];
// 获取分类列表获取商品信息
$goodsList = SearchData::getSearchDataBySort($params, $sortList);
$pos = 1;
foreach ($goodsList as $goods) {
// 格式化数据
$val = Helpers::formatProduct($goods, true, true, true, 280, 373);
if ($val['price'] == false) {
$val['price'] = $val['salePrice'];
}
$val['url'] = sprintf('%s?channel=%s&from=%s-n_%s', $val['url'], $channel , $channel, $pos++);
//TODO 字段要调整
$val['isFew'] = $val['is_soon_sold_out'];
$val['tags']['isLimit'] = $val['tags']['is_limited'];
... ...
<?php
namespace Product;
use LibModels\Wap\Product\SearchData;
use LibModels\Web\Product\SearchData as WebProduct;
use Plugin\HelperSearch;
use \LibModels\Web\Product\SearchData as Search;
use Plugin\Images;
/**
* sale首页模板数据模型
*
*/
class NewModel
{
public static function getNewSearchData($params, $options)
{
$data = array();
// 调用接口查询商品数据
$result = SearchData::searchElasticByCondition($params);
if (isset($result['code']) && $result['code'] === 200) {
// 调用分类信息
$category = Search::getClassesData();
if (isset($category['code']) && $category['code'] === 200) {
$result['data']['filter']['group_sort'] = $category['data']['sort'];
}
// 调用折扣区间
$discount = Search::getDiscount();
if (isset($discount['code']) && $discount['code'] === 200) {
$result['data']['filter']['discount'] = $discount['data']['discount'];
}
// 调用最新上架
$recent = Search::recentShelve();
if (isset($discount['code']) && $discount['code'] === 200) {
$result['data']['filter']['recent'] = $recent['data']['recent'];
}
//用户浏览记录
$result['data']['filter']['review'] = Search::getRecentReview();
// 组织模板数据
$data = HelperSearch::getList($result, $options);
//new页面模拟数据
$data['newMain'] = array(
'banner' => 'http://img11.static.yhbimg.com/yhb-img01/2015/11/23/07/010a459d41b99a839cba9377532f1c19b2.jpg?imageView/3/w/970/h/200',
'date' => '12月16日',
'title' => '新品到着',
'brands' => array(
array(
'href' => '',
'logo' => 'http://img13.static.yhbimg.com/brandLogo/2012/02/28/15/02b2b5ded161ab31e2e097a327ed475052.jpg?imageView/2/w/170/h/120'
),
array(
'href' => '',
'logo' => 'http://img13.static.yhbimg.com/brandLogo/2012/11/09/09/023721f44182f775d79904010af421331e.jpg?imageView/2/w/170/h/120'
),
array(
'href' => '',
'logo' => 'http://img11.static.yhbimg.com/brandLogo/2012/12/13/17/01408fb72646c8f3fa59d870514f08a356.jpg?imageView/2/w/170/h/120'
),
array(
'href' => '',
'logo' => 'http://img13.static.yhbimg.com/brandLogo/2012/12/24/13/0265b45e37af697c5ba12d5415fb341f27.jpg?imageView/2/w/170/h/120'
),
array(
'href' => '',
'logo' => 'http://img11.static.yhbimg.com/brandLogo/2015/08/11/15/012d09a5cae187af1f6f3ed246b9b5a4fc.jpg?imageView/2/w/170/h/120'
),
array(
'href' => '',
'logo' => 'http://img11.static.yhbimg.com/brandLogo/2015/08/20/16/01047ffb3ca182871821d551af31ac2378.jpg?imageView/2/w/170/h/120'
)
)
);
}
return array(
'productListPage' => true,
'newSale' => $data
);
}
}
... ...
... ... @@ -32,7 +32,7 @@ class SearchModel
$result = SearchData::searchElasticByCondition($condition);
if (isset($result['code']) && $result['code'] === 200) {
// 调用分类信息
$category = SearchData::getClassesData();
$category = SearchData::getClassesData($condition);
if (isset($category['code']) && $category['code'] === 200) {
$result['data']['filter']['group_sort'] = $category['data']['sort'];
}
... ...
... ... @@ -2,7 +2,6 @@
use Action\AbstractAction;
use LibModels\Web\Passport\LoginData;
use Passport\PassportModel as PassportModel;
use Plugin\Helpers;
use Plugin\Partner\Factory;
... ... @@ -62,13 +61,14 @@ class AutosignController extends AbstractAction
$this->go(Factory::create('douban')->getAuthorizeUrl());
}
/**
/**
* 微信网站授权入口
*/
public function wechatAction(){
$url = QINWechat_Sdk_Open::getCode('http://www.yohobuy.com/passport/autosign/wechatback');
$this->helpGo($url);
public function wechatAction()
{
$this->setSession('_TOKEN', '');
$this->go(Factory::create('wechat')->getAuthorizeUrl());
}
/**
... ... @@ -88,7 +88,12 @@ class AutosignController extends AbstractAction
//判定是否需要绑定手机号
if (isset($result['data']['mobile']) && $result['data']['mobile'] == '') {
$this->go(Helpers::url('/passport/bind/index', array('openId' => $userId, 'sourceType' => 'alipay', 'nickname' => $realName)));
$token = Helpers::makeToken($result['data']['uid']);
$this->setSession('_TOKEN', $token);
$this->setSession('_LOGIN_UID', $result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$fillHerf = rawurlencode(Helpers::url('/passport/autouserinfo/userinfo', array('openId' => $userId, 'sourceType' => 'alipay', 'nickname' => $realName)));
$this->go(Helpers::syncUserSession($result['data']['uid'], $fillHerf));
}
$refer = $this->getCookie('refer');
... ... @@ -126,11 +131,6 @@ class AutosignController extends AbstractAction
$result = LoginData::signinByOpenID($partnerInfo['nickname'], $access['openid'], 'qq', $shoppingKey);
}
//判定是否需要绑定手机号
if (isset($result['data']['mobile']) && $result['data']['mobile'] == '') {
$this->go(Helpers::url('/passport/autouserinfo/userinfo', array('openId' => $access['openid'], 'sourceType' => 'qq', 'nickname' => $partnerInfo['nickname'])));
}
$refer = $this->getCookie('refer');
if (empty($refer)) {
$refer = SITE_MAIN . '/?go=1';
... ... @@ -139,6 +139,16 @@ class AutosignController extends AbstractAction
$refer = rawurldecode($refer);
}
//判定是否需要绑定手机号
if (isset($result['data']['mobile']) && $result['data']['mobile'] == '') {
$token = Helpers::makeToken($result['data']['uid']);
$this->setSession('_TOKEN', $token);
$this->setSession('_LOGIN_UID', $result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$fillHerf = rawurlencode(Helpers::url('/passport/autouserinfo/userinfo', array('openId' => $access['openid'], 'sourceType' => 'qq', 'nickname' => $partnerInfo['nickname'])));
$this->go(Helpers::syncUserSession($result['data']['uid'], $fillHerf));
}
if (isset($result['code']) && $result['code'] == 200 && !empty($result['data']['uid'])) {
$token = Helpers::makeToken($result['data']['uid']);
$this->setSession('_TOKEN', $token);
... ... @@ -169,7 +179,12 @@ class AutosignController extends AbstractAction
//判定是否需要绑定手机号
if (isset($result['data']['mobile']) && $result['data']['mobile'] == '') {
// $this->go(Helpers::url('/passport/bind/index', array('openId' => $access['uid'], 'sourceType' => 'sina', 'nickname' => $partnerInfo['screen_name'])));
$token = Helpers::makeToken($result['data']['uid']);
$this->setSession('_TOKEN', $token);
$this->setSession('_LOGIN_UID', $result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$fillHerf = rawurlencode(Helpers::url('/passport/autouserinfo/userinfo', array('openId' => $access['uid'], 'sourceType' => 'sina', 'nickname' => $partnerInfo['screen_name'])));
$this->go(Helpers::syncUserSession($result['data']['uid'], $fillHerf));
}
$refer = $this->getCookie('refer');
... ... @@ -199,18 +214,21 @@ class AutosignController extends AbstractAction
{
$renren = Factory::create('renren');
$access = $renren->getAccessToken();
/* 获取用户的详细信息 */
$partnerInfo = $renren->getUserInfo($access);
$result = array();
if ($partnerInfo && is_array($partnerInfo)) {
if ($access && is_array($access)) {
$shoppingKey = Helpers::getShoppingKeyByCookie();
$result = LoginData::signinByOpenID($partnerInfo['nickname'], $access['uid'], 'renren', $shoppingKey);
$result = LoginData::signinByOpenID($access['user']['name'], $access['user']['id'], 'renren', $shoppingKey);
}
//判定是否需要绑定手机号
if (isset($result['data']['mobile']) && $result['data']['mobile'] == '') {
// $this->go(Helpers::url('/passport/bind/index', array('openId' => $access['uid'], 'sourceType' => 'sina', 'nickname' => $partnerInfo['nick_name'])));
$token = Helpers::makeToken($result['data']['uid']);
$this->setSession('_TOKEN', $token);
$this->setSession('_LOGIN_UID', $result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$fillHerf = rawurlencode(Helpers::url('/passport/autouserinfo/userinfo', array('openId' => $access['user']['id'], 'sourceType' => 'renren', 'nickname' => $access['user']['name'])));
$this->go(Helpers::syncUserSession($result['data']['uid'], $fillHerf));
}
$refer = $this->getCookie('refer');
... ... @@ -238,20 +256,25 @@ class AutosignController extends AbstractAction
*/
public function doubanbackAction()
{
$sina = Factory::create('douban');
$access = $sina->getAccessToken();
$douban = Factory::create('douban');
$access = $douban->getAccessToken();
/* 获取用户的详细信息 */
$partnerInfo = $sina->getUserInfo($access);
$partnerInfo = $douban->getUserInfo($access);
$result = array();
if ($partnerInfo && is_array($partnerInfo)) {
$shoppingKey = Helpers::getShoppingKeyByCookie();
$result = LoginData::signinByOpenID($partnerInfo['nickname'], $access['uid'], 'douban', $shoppingKey);
$result = LoginData::signinByOpenID($partnerInfo['name'], $partnerInfo['uid'], 'douban', $shoppingKey);
}
//判定是否需要绑定手机号
if (isset($result['data']['mobile']) && $result['data']['mobile'] == '') {
// $this->go(Helpers::url('/passport/bind/index', array('openId' => $access['uid'], 'sourceType' => 'sina', 'nickname' => $partnerInfo['screen_name'])));
$token = Helpers::makeToken($result['data']['uid']);
$this->setSession('_TOKEN', $token);
$this->setSession('_LOGIN_UID', $result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$fillHerf =rawurlencode(Helpers::url('/passport/autouserinfo/userinfo', array('openId' => $access['douban_user_id'], 'sourceType' => 'douban', 'nickname' => $partnerInfo['name'])));
$this->go(Helpers::syncUserSession($result['data']['uid'], $fillHerf));
}
$refer = $this->getCookie('refer');
... ... @@ -273,52 +296,51 @@ class AutosignController extends AbstractAction
$this->go($refer);
}
}
/**
* 微信网站授权获取用户信息并登录
* @param string code
*/
public function wechatbackAction(){
$code = $this->helpGquery('code');
$accessToken = QINWechat_Sdk_Open::getAccessToken($code);
$userInfo = array();
if(empty($accessToken)){
$this->helpGo('/signin.html');
}
if(!isset($accessToken['access_token']) || !isset($accessToken['unionid']) || empty($accessToken['access_token']) || empty($accessToken['unionid'])){
$this->helpGo('/signin.html');
}
$userInfo = QINWechat_Sdk_Open::getUserInfo($accessToken['access_token'], $accessToken['unionid']);
if(empty($userInfo)){
$this->helpGo('/signin.html');
}
$this->wechatlogin($userInfo);
}
/**
* 微信登录
* @param array $userInfo
*/
public function wechatlogin($userInfo){
if(empty($userInfo)){
$this->helpGo('/signin.html');
}
try {
$oauthUserInfo = QINAuth_User_Utils::check('wechat', $userInfo['unionid'], $userInfo['nickname'], null, $userInfo);
$auth = QINAuth_Factory::profile('wechat');
$res=$auth->associate($oauthUserInfo['email'], array(
'password' => QINAuth_User_Utils::$defaultPassword,
'open_id' => $userInfo['unionid'],
'nick_name' => $userInfo['nickname']
));
} catch (Exception $e) {
$this->helpSession('passport_space')->__set('error_message', 'wechat' . $e->getMessage());
$this->helpGo('/signin.html');
}
//跳转到
$url = $this->authInfo($res, 'wechat' , $oauthUserInfo['email']);
$this->helpGo($url);
}
public function wechatbackAction()
{
$wechat = Factory::create('wechat');
$access = $wechat->getAccessToken();
/* 获取用户的详细信息 */
$partnerInfo = $wechat->getUserInfo($access);
$result = array();
if ($partnerInfo && is_array($partnerInfo)) {
$shoppingKey = Helpers::getShoppingKeyByCookie();
$result = LoginData::signinByOpenID($partnerInfo['nickname'],$partnerInfo['openid'], 'wechat', $shoppingKey,$partnerInfo['openid']);
}
//判定是否需要绑定手机号
if (isset($result['data']['mobile']) && $result['data']['mobile'] == '') {
$token = Helpers::makeToken($result['data']['uid']);
$this->setSession('_TOKEN', $token);
$this->setSession('_LOGIN_UID', $result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$fillHerf =rawurlencode(Helpers::url('/passport/autouserinfo/userinfo', array('openId' => $partnerInfo['openid'], 'sourceType' => 'wechat', 'nickname' => $partnerInfo['nickname'])));
$this->go(Helpers::syncUserSession($result['data']['uid'], $fillHerf));
}
$refer = $this->getCookie('refer');
if (empty($refer)) {
$refer = SITE_MAIN . '/?go=1';
}
else {
$refer = rawurldecode($refer);
}
if (isset($result['code']) && $result['code'] == 200 && !empty($result['data']['uid'])) {
$token = Helpers::makeToken($result['data']['uid']);
$this->setSession('_TOKEN', $token);
$this->setSession('_LOGIN_UID', $result['data']['uid']);
$this->setCookie('_TOKEN', $token);
$this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
}
else {
$this->go($refer);
}
}
}
... ...
<?php
use Action\WebAction;
use Plugin\Captcha;
class ImagesController extends WebAction
{
/**
* 验证码-生成
*
* @return mixed 验证码图片
*/
public function indexAction()
{
$g = trim($this->get('g'));
$namespace = !empty($g) ? $g : 'passport_istration';
$imgCode = new Captcha();
$imgCode->setWidth(150)->setHeight(50)->setWordLen(4)->generate($namespace);
exit();
}
/**
* 验证码-检测
*
* @param string auth_code (验证码)
* @return string true|false
*/
public function verifyimgcodeAction ()
{
if (strtolower($this->get('auth_code')) !== strtolower(Captcha::getFromSession('passport_istration')))
{
die('false');
}
die('true');
}
<?php
use Action\WebAction;
use Plugin\Captcha;
class ImagesController extends WebAction
{
/**
* 验证码-生成
*
* @return mixed 验证码图片
*/
public function indexAction()
{
$g = trim($this->get('g'));
$namespace = !empty($g) ? $g : 'passport_istration';
$imgCode = new Captcha();
$imgCode->setWidth(150)->setHeight(50)->setWordLen(4)->generate($namespace);
exit();
}
/**
* 验证码-检测
*
* @param string auth_code (验证码)
* @return string true|false
*/
public function verifyimgcodeAction ()
{
if (strtolower($this->get('auth_code')) !== strtolower(Captcha::getFromSession('passport_istration')))
{
die('false');
}
die('true');
}
}
\ No newline at end of file
... ...
... ... @@ -61,15 +61,15 @@ class IndexController extends WebAction
//每页显示商品数
if(!isset($condition['viewNum']) || empty($condition['viewNum'])){
$condition['viewNum'] = 59;
$condition['viewNum'] =60;
}
$view_num_arr = array(60, 100, 200);
if (!in_array($condition['viewNum'], $view_num_arr)) {
$condition['viewNum'] = 59;
$condition['viewNum'] = 60;
}
//每行显示的商品数量
if(!isset($condition['rowNum']) || empty($condition['rowNum'])){
$condition['rowNum'] = 5;
$condition['rowNum'] =5;
}
if ($condition['rowNum'] == 6) {
$imgSize = array(195, 260);
... ... @@ -88,11 +88,13 @@ class IndexController extends WebAction
'gender' => $gender,
'needPd' => 'Y',
'rowNum' => $condition['rowNum'],
'viewNum' => $condition['viewNum'] - 1,
'viewNum' => $condition['viewNum'],
);
$params = $condition + $_GET;
$params = array_filter($params);
//每页记录数减1,下一页占位
$params['viewNum'] = $params['viewNum'] - 1;
$data = Product\BrandsModel::getBrandSearchData($params,$options,$domain,$uid,$brandId,$node);
$cate = array('boys','girls','kids','lifestyle');
$this->setWebNavHeader($cate[$gender-1]);
... ...
... ... @@ -73,11 +73,11 @@ class SaleController extends WebAction
//每页显示商品数
if (!isset($condition['viewNum']) || empty($condition['viewNum'])) {
$condition['viewNum'] = 59;
$condition['viewNum'] = 60;
}
$view_num_arr = array(60, 100, 200);
if (!in_array($condition['viewNum'], $view_num_arr)) {
$condition['viewNum'] = 59;
$condition['viewNum'] = 60;
}
//每行显示的商品数量
if (!isset($condition['rowNum']) || empty($condition['rowNum'])) {
... ... @@ -100,13 +100,15 @@ class SaleController extends WebAction
'gender' => $gender,
'needPd' => 'Y',
'rowNum' => $condition['rowNum'],
'viewNum' => $condition['viewNum'] - 1,
'viewNum' => $condition['viewNum'],
'specialsale_id' => 'Y'
);
$params = $condition + $_GET;
$params['attribute_not'] = 2;
$params = array_filter($params);
//每页记录数减1,下一页占位
$params['viewNum'] = $params['viewNum'] - 1;
$data = Product\SaleModel::getSaleSearchData($params, $options, $specialInfo);
$cate = array('boys', 'girls', 'kids', 'lifestyle');
... ...
... ... @@ -60,7 +60,7 @@ class SearchController extends WebAction
if (!$price[0]) {
$price[0] = 0;
}
if ($price[1]) {
if (!$price[1]) {
$price[1] = 99999;
}
$condition['price'] = implode(',', $price);
... ...
<?php
use Action\WebAction;
use LibModels\Web\Product\SaleData;
/**
* new页
*
*/
class NewController extends WebAction
{
public function indexAction()
{
/* 过滤请求参数 */
$condition = array();
$condition = filter_input_array(INPUT_GET, array(
//'query' => FILTER_SANITIZE_STRING,
'sort' => FILTER_VALIDATE_INT,
'msort' => FILTER_VALIDATE_INT,
'misort' => FILTER_VALIDATE_INT,
'color' => FILTER_VALIDATE_INT,
'size' => FILTER_VALIDATE_INT,
'style' => FILTER_DEFAULT,
'price' => FILTER_DEFAULT,
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,
'shelve_time' => FILTER_DEFAULT,
'isNew' => FILTER_DEFAULT,
'specialoffer' => FILTER_DEFAULT,
'limited' => FILTER_DEFAULT,
'order' => FILTER_DEFAULT,
'viewNum' => FILTER_VALIDATE_INT,
'rowNum' => FILTER_VALIDATE_INT,
'page' => FILTER_VALIDATE_INT,), false);
//字符转码
if (!empty($condition)) {
foreach ($condition as &$value) {
$value = rawurldecode($value);
}
}
//获取性别数据
$gender = $this->get('gender') ? ($this->get('gender') == '2,3' ? 2 : 1) : (!isset($_COOKIE['_Gender']) ? '3' : ($_COOKIE['_Gender'] == '2,3' ? 2 : 1));
$condition['gender'] = $gender;
//每页显示商品数
if (!isset($condition['viewNum']) || empty($condition['viewNum'])) {
$condition['viewNum'] = 60;
}
$view_num_arr = array(60, 100, 200);
if (!in_array($condition['viewNum'], $view_num_arr)) {
$condition['viewNum'] = 60;
}
//每行显示的商品数量
if (!isset($condition['rowNum']) || empty($condition['rowNum'])) {
$condition['rowNum'] = 5;
}
if ($condition['rowNum'] == 6) {
$imgSize = array(195, 260);
$minImgSize = array(50, 67);
} else {
$condition['rowNum'] = 5;
$imgSize = array(235, 314);
$minImgSize = array(60, 80);
}
//搜索词
//$query = $this->get('query');
$condition['needFilter'] = 1;
$options = array(
'imgSize' => $imgSize,
'minImgSize' => $minImgSize,
'gender' => $gender,
'needPd' => 'Y',
'rowNum' => $condition['rowNum'],
'viewNum' => $condition['viewNum'],
'specialsale_id' => 'Y'
);
$params = $condition + $_GET;
$params['attribute_not'] = 2;
$params = array_filter($params);
//每页记录数减1,下一页占位
$params['viewNum'] = $params['viewNum'] - 1;
$data = Product\NewModel::getNewSearchData($params, $options);
$cate = array('boys', 'girls', 'kids', 'lifestyle');
$this->setWebNavHeader($cate[$gender - 1]);
//渲染模板
$this->_view->display('new-sale', $data);
}
}
... ...
<?php
<?php
use Yaf\Application;
define('SITE_MAIN', 'http://web.dev.yohobuy.com'); // 网站主域名
... ...