Authored by xuqi

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

... ... @@ -46,7 +46,7 @@ class LoginData extends \LibModels\Wap\Passport\LoginData
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL2, $param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -2,33 +2,33 @@
namespace LibModels\Web\Product;
use Api\Yohobuy;
use Api\Sign;
/**
* 热销排行
*
* */
*/
class HotrankData extends \LibModels\Wap\Product\SearchData
{
const URI_HOTRANK_RES = '/operations/service/v4/resource';
const URI_HOTRANK_TAG = '/operations/api/v5/resource/get';
{
const URI_HOTRANK_TAG = 'http://test.service.api.yohobuy.com/operations/service/v1/hotranktag';
/**
获取热销排行
* 分类标签
* 获取标签
* $client_type 客户端类型
* $channel 频道类型
*/
public static function getHotranktag($client_type = 'web',$channel = 0, $is_concurrent = true, $callback = '')
public static function getHotranktag($client_type = 'web',$channel = 0,$is_concurrent = true)
{
// 构建必传参数
$params = Yohobuy::param();
$params['client_type'] = 'web';
$params['channel'] =$channel ;
$params['is_concurrent'] = true;
$params['callback'] = $callback;
$params['client_secret'] = Sign::getSign($params);
return Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_HOTRANK_TAG, $params);
$params = array('client_type'=>$client_type,'channel'=>$channel,'is_concurrent' => $is_concurrent);
return Yohobuy::yarClient(self::URI_HOTRANK_TAG, 'getTag',$params);
}
/**
* 通过ID获取标签信息
* $id 标签ID
*/
public static function getTagById($id,$is_concurrent = true)
{
$params['id'] = $id;
return Yohobuy::yarClient(self::URI_HOTRANK_TAG, 'getOneTag',$params);
}
}
\ No newline at end of file
... ...
... ... @@ -834,9 +834,8 @@ class Process
{
$result = array();
$temp = array();
if ($data[$key]['template_name'] == 'custom_brands')
if ($data[$key]['template_name'] == 'custom_brands' || $data[$key]['template_name'] == 'kids_brands')
{
// print_r($data[$key]);
$result = array(
'hotBrands' => array(
'name' => '',
... ... @@ -856,7 +855,6 @@ class Process
{
$width = 185;
$height = 86;
$type = 'lifestyle';
$val['src'] = Images::getImageUrl($val['src'], $width, $height, 2);
$val['url'] = Helpers::transUrl($val['url'], $type);
$floor['logoBrand'][] = array(
... ... @@ -865,11 +863,8 @@ class Process
);
}
$floor['moreBrand'] = 'http://yohobuy.com/brands';
//$floor['moreBrand'] = 'http://yohobuy.com/brands?gender=1,3&openby:yohobuy={"action":"go.list","params":{"actiontype":0,"gender":"1,3"}}';
//print_r($floor);
$type_key = sprintf("%s_%s", $type, $key);
$cacheKey = sprintf("%s_%s", CacheConfig::KEY_INDEX_BRANDS_LIST_DATA, $type_key);
//print_r($cacheKey);
Cache::set($cacheKey, $floor, 7200);
$result['hotBrands']['brandUrl'] = '/common/getIndexResourceBrand?type=' . $type_key;
//print_r($result['hotBrands']['brandUrl']);
... ...
... ... @@ -2,9 +2,14 @@
<div class="new-sale-page product-page yoho-page">
{{# saleList}}
{{# saleBanner}}
<div class="banner-img" style="height: {{bannerHeight}}px;background:url({{img}}) no-repeat top center;"></div>
<div class="sale-list-banner" style="height: {{bannerHeight}}px;">
<ul style="height: {{bannerHeight}}px;">
{{# list}}
<li class="banner-img" style="background:url({{img}}) no-repeat top center;"></li>
{{/ list}}
</ul>
</div>
{{/ saleBanner}}
<div class="center-content clearfix">
{{# saleTitle}}
<div class="header-title">
... ...
... ... @@ -144,7 +144,7 @@
{{!-- sale列表 --}}
{{#if saleListPage}}
<script>
seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
seajs.use(['js/product/list', 'js/product/product', 'js/product/banner'], function (list, product) {
product.init(4);
window.onresize = function () {
... ...
... ... @@ -25,7 +25,7 @@
{{/ tags}}
</div>
<div class="good-detail-img">
<a class="good-thumb" href="{{url}}">
<a class="good-thumb" href="{{url}}" target="_blank">
<img class="lazy" data-original="{{thumb}}">
</a>
{{# isFew}}
... ... @@ -37,7 +37,7 @@
{{/if}}
</div>
<div class="good-detail-text">
<a href="{{url}}">{{name}}</a>
<a href="{{url}}" target="_blank">{{name}}</a>
<p class="price">
{{# marketPrice}}
<span class="market-price">¥{{.}}</span>
... ...
... ... @@ -417,6 +417,18 @@ function pwdFn($obj) {
// Tips: 不可以在获得焦点的时候验证,获得焦点和失去焦点的间隔太小,如果中间存在ajax校验的话会出现问题
// ( ▼-▼ )注册页和信息完善页面接口不同
exports.init = function(page) {
$('#agree-terms').click(function() {
if ($(this).attr('notchecked')) {
console.log(1);
$(this).removeAttr('notchecked');
} else {
console.log(2);
$(this).attr('notchecked', 'true');
}
});
$registerPage.find('.va').keyup(function() {
var j,
... ... @@ -438,7 +450,7 @@ exports.init = function(page) {
}
if (statusLen === 4 && $('#agree-terms').is(':checked')) {
if (statusLen === 4 && !$('#agree-terms').attr('notchecked')) {
$registerBtn.removeClass('disable').removeAttr('disabled');
} else {
$registerBtn.addClass('disable').attr('disabled', 'true');
... ... @@ -515,18 +527,6 @@ exports.init = function(page) {
});
// 防止粘贴密码
/*$('#pwd, #repwd').keydown(function (event) {
console.log(event.ctrlKey);
console.log(isPwd);
console.log(event.keyCode);
if (event.ctrlKey && isPwd && event.keyCode === 86) {
$(this).val(pwdVal);
}
});*/
$pwd[0].onpaste = function() {
return false;
};
... ...
/*
* author: chenglong
*/
var Slide = require('../common/yohoui/YH.slide');
var $ = require('yoho.jquery');
var $contain = $('.sale-list-banner');
var $item = $contain.find('li');
var index = 0;
var pagationStr = '';
var pagationBoxStr = '';
var i;
var current = true;
var slide;
for (i = 0; i < $item.length; i++) {
if (i === 0) {
pagationStr += '<span class="active"></span>';
} else {
pagationStr += '<span></span>';
}
}
pagationBoxStr = '<div class="sale-list-pagation"><div>' + pagationStr + '</div></div>';
$contain.append($(pagationBoxStr));
slide = new Slide({
length: $item.length,
loop: true,
auto: true,
timeout: 2,
index: 0
});
slide.on('change', function(data) {
if (current) {
current = false;
} else {
return;
}
index++;
$('.sale-list-pagation').find('span').removeClass('active');
$item.eq(data.from).animate({
opacity: 0
}, 300);
$item.eq(data.to).css({
zIndex: index
}).animate({
opacity: 1
}, 300, function() {
current = true;
});
$('.sale-list-pagation').find('span').eq(data.to).addClass('active');
});
$contain.hover(function() {
if (current) {
slide.pause();
}
}, function() {
slide.resume();
});
$('.sale-list-pagation span').click(function() {
var index = $(this).index();
if (current) {
slide.go(index);
}
});
slide.init();
\ No newline at end of file
... ...
... ... @@ -117,6 +117,10 @@ $('.logo-brand').logoBrand({
var nowIndex = $(this).index(),
sid = $(this).data('sid');
if ($(this).hasClass('current')) {
return;
}
//处理current样式
$(this).addClass('current').siblings().removeClass('current');
$('.floatlayer').find('li').removeClass('current').eq(nowIndex).addClass('current');
... ... @@ -135,7 +139,11 @@ $('.logo-brand').logoBrand({
$('.floatlayer').on('click', 'li', function() {
var nowIndex = $(this).index();
$('.hot-cate').find('li').trigger('click');
if ($(this).hasClass('current')) {
return;
}
$('.hot-cate').find('li').eq(nowIndex).trigger('click');
//处理current样式
$(this).addClass('current').siblings().removeClass('current');
... ...
... ... @@ -46,6 +46,9 @@
width: 209px;
display: block;
float: left;
position: absolute;
top: 0;
right: 0;
}
&.captcha, &.msg-captcha{
... ...
.new-sale-page {
/*Modify by chenglong.wang at 2016/1/18
*sale列表页面轮播图
*/
.sale-list-banner {
width: 100%;
position: relative;
ul {
overflow: hidden;
width: 100%;
position: relative;
z-index: 1;
li {
width: 100%;
height: 100%;
display: block;
float: left;
position: absolute;
top: 0;
left: 0;
}
}
.sale-list-pagation {
z-index: 2;
position: absolute;
left: 0;
bottom: 50px;
width: 100%;
height: 20px;
text-align: center;
div {
display: inline-block;
}
span {
display: block;
width: 20px;
height: 20px;
background: image_url('product/default-normal.png');
float: left;
margin: 0 10px;
cursor: pointer;
&.active {
background: image_url('product/default-active.png');
}
}
}
}
.header-title {
position: relative;
width: 100%;
... ...
... ... @@ -38,20 +38,14 @@ class BrandsController extends WebAction
*/
public function brandinfoAction()
{
$result = array();
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax()) {
break;
}
$brandId = $this->get('brandId',0);
$uid=$this->getUid(false);
$brandId=144;
BrandsModel::getBrandInfo($brandId, $uid);
$brandId = $this->get('brandId', 0);
$uid = $this->getUid(false);
$data = BrandsModel::getBrandInfo($brandId, $uid);
$result = array(
'code' => 200,
'brand' => $data
... ... @@ -62,9 +56,10 @@ class BrandsController extends WebAction
$this->echoJson($result);
}
/**
* 品牌一览
/*
* 品牌list
*/
public function indexAction()
{
$headerdata = array(
... ...
... ... @@ -7,6 +7,7 @@ use Plugin\HelperSearch;
use LibModels\Web\Product\BrandData;
use Index\HomeModel;
use Product\SearchModel;
use Plugin\Helpers;
/**
* 品牌首页模板数据模型
... ... @@ -108,32 +109,41 @@ class BrandsModel
{
$switchParams = self::switchBrandParams($channel);
$brandTop = array();
/*
* $item1 = array(
'name' => '所有品牌',
'src' => $imgsrc,
'url' => ''
);
*/
$brandAds = array();
$brandList = array();
$res = BrandData::getTopBanner($switchParams['brandCode'], $switchParams['channelType']);
//头部10个品牌图块
if (isset($res['brandTop'][1]['data']['list']) && $res['brandTop'][1]['data']['list']) {
foreach ($res['brandTop'][1]['data']['list'] as $tbk => $tbv) {
$imgUrlTmp = explode("?", $tbv['src']);
$urlTmp = explode("?", $tbv['url']);
$topBrandTmp = array(
'name' => $tbv['name'],
'src' => Helpers::getImageUrl($imgUrlTmp[0], 80, 50, 3),
'url' => str_replace('m.', '', $urlTmp[0]),
);
$brandAds[$tbk] = $topBrandTmp;
}
}
//头部品牌图块
if (isset($res['brandTop'][0]['data']) && $res['brandTop'][0]['data']) {
foreach ($res['brandTop'][0]['data'] as $tk => $tv) {
$imgUrl = explode("?", $tv['src']);
$imgUrlTmp = explode("?", $tv['src']);
$urlTmp = explode("?", $tv['url']);
$topTmp = array(
'name' => $tv['title'],
'src' => $imgUrl[0],
'url' => $tv['url'],
'items' => array()
'src' => $imgUrlTmp[0],
'url' => $urlTmp[0],
'items' => $brandAds
);
$brandTop[$tk] = $topTmp;
}
}
//品牌list
if (isset($res['brandList']['brands']) && $res['brandList']['brands']) {
foreach ($res['brandList']['brands'] as $lk => $lv) {
$listTmp = array();
if (isset($lv) && $lv) {
$listTmp = array();
foreach ($lv as $ltk => $ltv) {
$listTmp[$ltk] = array(
'name' => $ltv['brand_name'],
... ... @@ -158,33 +168,20 @@ class BrandsModel
*/
public static function getBrandInfo($brandId, $uid)
{
$imgsrc = 'http://img11.static.yhbimg.com/goodsimg/2015/10/19/10/01b312c3b7a7efebcd671e73495ff3e306.jpg';
$data = array(
'key' => '1000011',
'icon' => $imgsrc,
'title' => '优显led触控台灯',
'content' => '优显led触控台灯优显led触控台灯优显led触控台灯优显led触控台灯',
'subtitle' => 'AAAAAA',
'imgs' => array(
array(
'src' => $imgsrc
),
array(
'src' => $imgsrc
),
array(
'src' => $imgsrc
)
)
);
$data = array();
$res = BrandData::getBrandIntro($brandId, $uid);
//if(isset($res['data']) && $res['data']){
// $data['key']=$brandId;
// $data['icon']=
//}
var_dump($res);
die();
if (isset($res['data']) && $res['data']) {
$icoUrlTmp = explode("?", $res['data']['brand_ico']) ;
$data = array(
'key' => $res['data']['brand_id'],
'icon' => $icoUrlTmp[0],
'title' => $res['data']['brand_name'],
'content' =>$res['data']['brand_intro'],
'subtitle' => 'FEATURED ITEMS',
'imgs' => array(),
);
}
return $data;
}
/*
... ...
... ... @@ -2,10 +2,9 @@
namespace product;
use Plugin\Images;
use Plugin\Helpers;
use Plugin\Cache;
use Configs\CacheConfig;
use LibModels\Web\Home\IndexData;
use Api\Yohobuy;
//use Plugin\Helpers;
//use LibModels\Web\Home\IndexData;
use \LibModels\Web\Product\HotrankData;
use \LibModels\Web\Product\SearchData;
... ... @@ -14,14 +13,14 @@ class HotrankModel {
/**
* 人气单品 一周热卖
*/
static public function getSearchData($condition, $options)
static public function getSearchData($param,$page,$ajax)
{
// 调用接口查询商品数据
$result = SearchData::searchElasticByCondition($condition);
$result = SearchData::searchElasticByCondition($param);
//print_r($result);
if(!empty($result)){
$res = self::getProductList($result);
$res = self::getProductList($result,$page,$ajax);
if(!empty($res['popular'])){
$data['popular'] = $res['popular'];
}
... ... @@ -37,18 +36,16 @@ class HotrankModel {
/**
* 获取分类标签
*/
static public function getHotranktag($classes)
static public function getHotranktag($client_type,$channel,$is_concurrent)
{
$list = SearchData::getClassesData($classes);
//print_r($list);
$list = \LibModels\Web\Product\HotrankData::getHotranktag($client_type,$channel,$is_concurrent);
$nav = array();
if(!empty($list['data']['sort'])){
foreach($list['data']['sort'] as $li=>$lt){
$nav[$li]['sid'] = $lt['sort_id'];
$nav[$li]['textCn'] = $lt['sort_name'];
if(!empty($list['data']['list'])){
foreach($list['data']['list'] as $li=>$lt){
$nav[$li]['sid'] = $lt['id'];
$nav[$li]['textCn'] = $lt['tag_name'];
}
}
//print_r($nav);
return $nav;
}
... ... @@ -56,8 +53,10 @@ class HotrankModel {
/**
* 人气单品 一周热卖 数据处理
*/
static public function getProductList($result)
static public function getProductList($result,$page,$ajax=0)
{
// 调用发起请求
Yohobuy::yarConcurrentLoop();
/*----product start---------*/
if(empty($result) || empty($result['data']) || empty($result['data']['product_list'])){
return;
... ... @@ -83,26 +82,35 @@ class HotrankModel {
$product_id = empty($val['product_id']) ? '' : $val['product_id'];
$re['url'] = 'http://item.yohobuy.com/product/pro_'.$product_id.'_'.$defaultGoodsId.'.html';
$re['marketPrice'] = (int)$val['market_price'] == (int)$val['sales_price'] ? '' : '¥'.$val['market_price'];
$re['salePrice'] = empty($val['sales_price']) ? '' : '¥'.$val['sales_price'];
$re['name'] = $val['product_name'];
if($key <= 9){
$re['rank'] = $key + 1;
if($key <= 5){
$re['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 378, 504, 2);
$popular['list'][] = $re;
}else{
$re['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
$popular['list'][] = $re;
}
}else{
$re['rank'] = '';
$re['thumb'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
$hot[] = $re;
}
$re['name'] = $val['product_name'];
if($key <= 9 && $page == 1 && $ajax == 0){
$re['rank'] = $key + 1;
if($key <= 5){
$re['price'] = (int)$val['market_price'] == (int)$val['sales_price'] ? '' : '¥'.$val['market_price'];
$re['sPrice'] = empty($val['sales_price']) ? '' : '¥'.$val['sales_price'];
$re['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 378, 504, 2);
$popular['list'][] = $re;
}else{
$re['price'] = (int)$val['market_price'] == (int)$val['sales_price'] ? '' : '¥'.$val['market_price'];
$re['sPrice'] = empty($val['sales_price']) ? '' : '¥'.$val['sales_price'];
$re['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
$popular['list'][] = $re;
}
}else if ($ajax == 1){
$re['marketPrice'] = (int)$val['market_price'] == (int)$val['sales_price'] ? '' : '¥'.$val['market_price'];
$re['salePrice'] = empty($val['sales_price']) ? '' : '¥'.$val['sales_price'];
$re['rank'] = '';
$re['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
$hot[] = $re;
}else{
$re['marketPrice'] = (int)$val['market_price'] == (int)$val['sales_price'] ? '' : '¥'.$val['market_price'];
$re['salePrice'] = empty($val['sales_price']) ? '' : '¥'.$val['sales_price'];
$re['rank'] = '';
$re['thumb'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
$hot[] = $re;
}
}
$popular['name'] = '人气单品';
$hotWeek = array(
'name'=>'一周热卖',
'list'=>$hot,
... ...
... ... @@ -112,6 +112,7 @@ class LoginController extends WebAction
/* 设置登录有效时间30分钟, 防机器刷 */
$expire = $this->getSession('_LOGIN_EXPIRE');
if (empty($expire) || $expire < time()) {
$data = array('code' => 400, 'message' => '页面停留时间过长,请刷新页面', 'data' => '');
break;
}
... ... @@ -135,13 +136,13 @@ class LoginController extends WebAction
}
$refer = $this->getCookie('refer');
if (empty($refer)) {
$refer = SITE_MAIN . '/?go=1';
if (empty($refer) || strstr($refer, 'signin.html') || strstr($refer, 'passport/login/index')) {
$refer = SITE_MAIN;
}
else {
$refer = rawurldecode($refer);
}
$data['data']['session'] = Helpers::syncUserSession($data['data']['uid']);
$data['data']['session'] = Helpers::syncUserSession($data['data']['uid'],$refer);
$data['data']['href'] = $refer;
$token = Helpers::makeToken($data['data']['uid']);
... ...
... ... @@ -2,12 +2,16 @@
use Action\WebAction;
use LibModels\Web\Product\BrandData;
use LibModels\Web\Product\HotrankData;
use \LibModels\Web\Product\HotrankData;
use product\HotrankModel;
use LibModels\Web\Home\IndexData;
class IndexController extends WebAction
{
public $channel;
public $gender;
public $road;//频道
public $code;
/**
* 品牌首页
*/
... ... @@ -53,7 +57,7 @@ class IndexController extends WebAction
}
public function hotrankAction() {
$this->setWebNavHeader(\Index\HomeModel::COOKIE_NAME_LIFESTYLE);
$data = array(
'hotrankPage' => true,
'hotrank' => array(
... ... @@ -261,30 +265,124 @@ class IndexController extends WebAction
)
)
);
$cookie = $this->getCookie('_Channel');
$cookie = 'lifestyle';
$this->channel = isset($cookie) ? $cookie : 'boys';
switch ($this->channel){
case 'boys' :
$this->gender = '1,3';
$this->road = 1;
$this->code = '80d772d8dff25300a2a2e4c97165330c';
break;
case 'girls' :
$this->gender = '2,3';
$this->road = 2;
$this->code = '8df64e505e94edb9881fd1e7efb702e9';
break;
case 'lifestyle' :
$this->gender = '';
$this->road = 4;
$this->code = 'd131aba83a84a6977eee3a7403a713de';
break;
case 'kids' :
$this->gender = '';
$this->road = 3;
$this->code = 'bd6a06a08f8ca9b0db762f78e0bc5b68';
break;
}
$this->setWebNavHeader(\Index\HomeModel::$this->channel);
$data = array( 'hotrankPage' => true,
'footerTop'=> true,
'hotrank' => array()
);
//焦点图 热门品牌
$focus = \Index\HomeModel::getChannelResource('lifestyle', 'd131aba83a84a6977eee3a7403a713de');
//print_r($focus);
$focus = \Index\HomeModel::getChannelResource($this->channel, $this->code);
$data['hotrank']['slide'] = $focus[0]['slide'];
$data['hotrank']['hotBrands'] = $focus[1]['hotBrands'];
//人气单品 一周热卖
$page = 1;
$param = array('order'=>'s_n_desc','viewNum'=>60,'page'=>1,'stocknumber'=>1,'status'=>1,'gender'=>'','attribute_not'=>2);
$publiclist = \product\HotrankModel::getSearchData($param,$page);
$page = $this->get('page',1);
$sort_id = $this->get('sid',0);
$viewNum = 60;
$param = array('order'=>'s_n_desc','viewNum'=>$viewNum,'page'=>$page,'stocknumber'=>1,'status'=>1,'gender'=>$this->gender,'attribute_not'=>2);
if($sort_id != 0){
$param['sort'] = $sort_id;
}
if($this->road == 3){
$param['msort'] = 365;
}elseif($this->road == 4){
$param['msort'] = 10;
}else{
$param['not_maxSortId'] = '10,365';
}
$publiclist = \product\HotrankModel::getSearchData($param,$page,0);
$data['hotrank']['popular'] = $publiclist['popular'];
$data['hotrank']['hotWeek'] = $publiclist['hotWeek'];
//print_r($publiclist);
//分类标签
$classes = array('gender' => 2);
$nav = \product\HotrankModel::getHotranktag($classes);
$data['hotrank']['hotWeek']['nav'] = $nav;
//print_r($data);
$nav = \product\HotrankModel::getHotranktag('web',$this->road,true);
$data['hotrank']['hotWeek']['nav'] = $nav;
$this->_view->display('hotrank', $data);
}
/*
* 一周热卖加载更多
*/
public function getdataAction()
{
$page = $this->get('page',1);
//加载到100个以后停止
if($page > 2)
{
echo json_encode(array('code'=>201,'data'=>''));
exit;
}
$sid = $this->get('sid',1);
$sort = '';
//是否是默认标签
if($sid > 1)
{
//通过ID获取标签信息
$info = \LibModels\Web\Product\HotrankData::getTagById($sid, false);
if(!empty($info['data']))
{
$sort = $info['data']['category_id'];
}
}
$viewNum = 60;
//过滤掉赠品
$param = array('order'=>'s_n_desc','viewNum'=>$viewNum,'page'=>$page,'sort'=>$sort,'stocknumber'=>1,'status'=>1,'gender'=>$this->gender,
'attribute_not'=>2);
if(empty($param['sort']))
{
if($this->road == 3)
{
$param['msort'] = 365;
}elseif($this->road == 4){
$param['msort'] = 10;
}else{
$param['not_maxSortId'] = '10,365';
}
}
$list = \product\HotrankModel::getSearchData($param, $page, 1);
$lister = $list['hotWeek']['list'];
$lister = array_values($lister);
if($sid == 1 && $page == 1)
{
$lister = array_slice($lister, 10, 50);
}else{
$lister = array_slice($lister, 0, 50);
}
$data = array(
'code'=>200,
'data'=>$lister,
);
echo json_encode($data);
exit;
}
}
?>
\ No newline at end of file
... ...
... ... @@ -166,7 +166,32 @@ class Sale1Controller extends WebAction
'saleList' => array(
'saleBanner' => array(
'bannerHeight' => 350,
'img' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/08/02d4c26f19ca2e44359d69d5cff86167fb.jpg'
'list' => array(
array(
'bannerHeight' => 350,
'img' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/08/02d4c26f19ca2e44359d69d5cff86167fb.jpg'
),
array(
'bannerHeight' => 350,
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/06/05/02062366574a01418596caa38a773f6beb.jpg?imageView/1/w/1150/h/450'
),
array(
'bannerHeight' => 350,
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2016/01/06/05/013341a0632177cc3425c3c6082845be57.jpg?imageView/1/w/1150/h/450'
),
array(
'bannerHeight' => 350,
'img' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/08/02d4c26f19ca2e44359d69d5cff86167fb.jpg'
),
array(
'bannerHeight' => 350,
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/06/05/02062366574a01418596caa38a773f6beb.jpg?imageView/1/w/1150/h/450'
),
array(
'bannerHeight' => 350,
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2016/01/06/05/013341a0632177cc3425c3c6082845be57.jpg?imageView/1/w/1150/h/450'
)
)
),
'saleTitle' => array(
'name' => '全部商品',
... ...