Authored by Rock Zhang

修改男女首页底部banner的处理方式

... ... @@ -14,11 +14,11 @@ class Helpers
* 备注:所有的URL构建都尽量使用该方法,便于以后维护.
*
* @param string $uri 如 "/passport/reg/index"
* @param array $param 参数项 array(key1 => value1, key2 => value2,)
* @param array $param 参数项 array(key1 => value1, key2 => value2,),默认为array()
* @param string $module 模块名 如"index"表示默认, "guang"表示逛,"list"表示商品列表,"search"表示搜索
* @return string
*/
public static function url($uri, $param, $module = 'index')
public static function url($uri, $param = array(), $module = 'index')
{
$url = '';
... ...
... ... @@ -87,10 +87,10 @@ $(window).scroll(function () {
type: 'GET',
url: url,
success: function(data) {
if (data && data[0] && data[0].banner[0]) {
if (data) {
$('#load-more-img').show();
$('#load-more-img a').attr('url', data[0].banner[0].url);
$('#load-more-img a > img').attr('src', data[0].banner[0].img);
$('#load-more-img a').attr('href', data.url);
$('#load-more-img a > img').attr('src', data.img);
}
},
error: function() {
... ...
... ... @@ -46,9 +46,9 @@ class HomeModel
const COOKIE_NAME_LIFESTYLE = 'lifestyle';
/* COOKIE标识访问的是男生频道底部Banner */
const COOKIE_NAME_BOYS_BOTTOM_BANNER = '8c48745a39373d621bf5fd80edf59b5e';
const CODE_NAME_BOYS_BOTTOM_BANNER = '8c48745a39373d621bf5fd80edf59b5e';
/* COOKIE标识访问的是女生频道频道底部Banner */
const COOKIE_NAME_GIRLS_BOTTOM_BANNER = 'c63939b2ad458e9cb51147940c1da2e5';
const CODE_NAME_GIRLS_BOTTOM_BANNER = 'c63939b2ad458e9cb51147940c1da2e5';
/**
* 选择频道
... ... @@ -125,10 +125,10 @@ class HomeModel
{
$result = false;
if($channel == 2) {
$resource = self::COOKIE_NAME_GIRLS_BOTTOM_BANNER;
$resource = self::CODE_NAME_GIRLS_BOTTOM_BANNER;
$cache = CacheConfig::KEY_ACTION_GRILS_BOTTOM_BANNER;
} else {
$resource = self::COOKIE_NAME_BOYS_BOTTOM_BANNER;
$resource = self::CODE_NAME_BOYS_BOTTOM_BANNER;
$cache = CacheConfig::KEY_ACTION_BOYS_BOTTOM_BANNER;
}
... ... @@ -143,13 +143,14 @@ class HomeModel
// 调用接口获取数据
$banner = IndexData::getBannerStart($resource);
if (isset($banner['code']) && $banner['code'] == 200) {
// 构建数据
$data = array();
$result = array();
// 处理数据
foreach ($banner['data'] as $val) {
$data['list'][] = $val;
foreach ($val['data'] as $single) {
$result['url'] = ($channel === 2) ? Helpers::url('/boys') : Helpers::url('/girls');
$result['img'] = Helpers::getImageUrl($single['src'], 640, 200);
}
}
$result = FloorProcess::getContent($data, $channel);
}
if (USE_CACHE) {
... ...