Authored by 周少峰

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

... ... @@ -472,11 +472,17 @@ class WebAction extends Controller_Abstract
} else {
$channel = \Index\HomeModel::getSwitchChannel();
}
if(APPLICATION_ENV == 'production' || APPLICATION_ENV == 'preview') {
$apiDomain = 'http://api.open.yohobuy.com';
} else {
$apiDomain = 'http://test.open.yohobuy.com';
}
$header = array(
'navbars'=> \Index\HomeModel::getNavBars($channel),
'gobytype'=> 'gobuy'.$channel,
'searchcate'=>'searchcate'.$channel,
'header'=> true,
'apiDomain'=>''
);
$this->_view->assign('headerdata', $header);
}
... ...
... ... @@ -23,17 +23,17 @@ class Yohobuy
// const SERVICE_URL = 'http://service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// 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/';
// const API_OLD = 'http://api2.open.yohobuy.com/';
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/';
const API_OLD = 'http://api2.open.yohobuy.com/';
/* 测试环境 */
const API_URL = 'http://testapi.yoho.cn:28078/'; // 'http://192.168.102.205:8080/gateway/'
const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const API_OLD = 'http://test2.open.yohobuy.com/';
// const API_URL = 'http://testapi.yoho.cn:28078/'; // 'http://192.168.102.205:8080/gateway/'
// const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_OLD = 'http://test2.open.yohobuy.com/';
/* 预览环境 */
// const API_URL = 'http://preapi.yoho.cn/';
... ...
... ... @@ -18,24 +18,45 @@ class SearchData extends \LibModels\Wap\Product\SearchData
switch (APPLICATION_ENV) {
case 'release':
if ($type == 'sort') {
return 'http://100.98.132.63/yohosearch/sortgroup.json';
return 'http://101.201.178.220/yohosearch/sortgroup.json';
}
elseif ($type == 'discount') {
return 'http://100.98.132.63/yohosearch/discount.json';
return 'http://101.201.178.220/yohosearch/discount.json';
}
elseif ($type == 'recent') {
return 'http://100.98.132.63/yohosearch/recent.json';
return 'http://101.201.178.220/yohosearch/recent.json';
}
elseif ($type == 'suggest') {
//return 'http://101.200.31.165/yohosearch/suggest.json';
return 'http://100.98.132.63/yohosearch/suggest.json';
return 'http://101.201.178.220/yohosearch/suggest.json';
}
else if($type == 'new-shelve') {
return 'http://101.201.178.220/yohosearch/new-shelve.json';
}
elseif ($type == 'shop') {
return 'http://100.98.132.63/yohosearch/shops.json';
return 'http://101.201.178.220/yohosearch/shops.json';
}
return 'http://100.98.132.63/yohosearch/search.json';
case 'test':
return 'http://101.201.178.220/yohosearch/search.json';
case 'preview':
if ($type == 'sort') {
return 'http://101.200.31.165/yohosearch/sortgroup.json';
}
elseif ($type == 'discount') {
return 'http://101.200.31.165/yohosearch/discount.json';
}
elseif ($type == 'recent') {
return 'http://101.200.31.165/yohosearch/recent.json';
}
elseif ($type == 'suggest') {
return 'http://101.200.31.165/yohosearch/suggest.json';
}
else if($type == 'new-shelve') {
return 'http://101.200.31.165/yohosearch/new-shelve.json';
}
elseif ($type == 'shop') {
return 'http://101.200.31.165/yohosearch/shops.json';
}
return 'http://101.200.31.165/yohosearch/search.json';
case 'test':
case 'developer':
default:
if ($type == 'sort') {
... ... @@ -54,6 +75,9 @@ class SearchData extends \LibModels\Wap\Product\SearchData
// return 'http://101.200.31.165/yohosearch/suggest.json';
return 'http://182.92.99.119:8080/yohosearch/suggest.json';
}
else if($type == 'new-shelve') {
return 'http://182.92.99.119:8080/yohosearch/new-shelve.json';//'http://182.92.99.119:8080/yohosearch/new-shelve.json';
}
elseif ($type == 'shop') {
//return 'http://101.200.31.165/yohosearch/shops.json';
return 'http://182.92.99.119:8080/yohosearch/shops.json';
... ... @@ -174,8 +198,13 @@ class SearchData extends \LibModels\Wap\Product\SearchData
foreach ($sortList as $key => $value) {
$lastIndex = $value['viewNum'] - 1;
// 业务逻辑:一个品类不满指定个数时,前台不显示
if (!empty($searchd[$key]) && isset($searchd[$key]['product_list'][$lastIndex])) {
$data = array_merge($data, $searchd[$key]['product_list']);
if (!empty($searchd[$key])) {
if(isset($searchd[$key]['product_list'][$lastIndex])) {//search
$data = array_merge($data, $searchd[$key]['product_list']);
}
else if(isset($searchd[$key][$lastIndex])) {//new-shelve
$data = array_merge($data, $searchd[$key]);
}
}
}
// 用完清空不使用的变量
... ... @@ -197,7 +226,7 @@ class SearchData extends \LibModels\Wap\Product\SearchData
$option = array();
foreach ($sortList as $key => $value) {
$option = $params + $value;
$urlList[$key] = Yohobuy::httpBuildQuery(self::getUrl('search'), $option);
$urlList[$key] = Yohobuy::httpBuildQuery(self::getUrl('new-shelve'), $option);
}
return $urlList;
}
... ...
... ... @@ -466,7 +466,7 @@ class Process
$typeKey = sprintf("%s_%s", $type, $key + 2);
$cacheKey = sprintf("%s_%s", WebCacheConfig::KEY_WEB_INDEX_BRANDS_LIST_DATA, $typeKey);
Cache::set($cacheKey, $floor, 86400);
$result['preferenceBrands']['brandUrl'] = Helpers::url('/common/getIndexResourceBrand', array('type' => $typeKey));
$result['preferenceBrands']['brandUrl'] = Helpers::url('/common/getIndexResourceBrand', array('type' => $typeKey),'');
unset($data[$key], $data[$key + 1], $data[$key + 2]);
}
}
... ... @@ -829,7 +829,7 @@ class Process
$typeKey = sprintf("%s_%s", $type, $key);
$cacheKey = sprintf("%s_%s", WebCacheConfig::KEY_WEB_INDEX_BRANDS_LIST_DATA, $typeKey);
Cache::set($cacheKey, $floor, 86400);
$result['hotBrands']['brandUrl'] = Helpers::url('/common/getIndexResourceBrand', array('type' => $typeKey));
$result['hotBrands']['brandUrl'] = Helpers::url('/common/getIndexResourceBrand', array('type' => $typeKey),'');
}
return $result;
}
... ...
... ... @@ -85,4 +85,5 @@
{{/ newArrivls}}
{{/ boys}}
</div>
<script>__custom = {"yopid":"index"};</script>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -2,14 +2,23 @@
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W958MG" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>
var _hmt = _hmt || [];
var _gaq = _gaq || [];
(function() {
function async_load(){
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-W958MG');
(function() {
_gaq.push(['_setAccount', 'UA-48997038-32']);
_gaq.push(['_trackPageview']);
var ga = document.createElement('script');
ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?c6ee7218b8321cb65fb2e98f284d8311";
hm.async = 1;
... ... @@ -30,6 +39,17 @@ var _hmt = _hmt || [];
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
(function() {
var hm = document.createElement("script");
hm.src = "http://static.criteo.net/js/ld/ld.js";
hm.async = 1;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
var u = _ozuid || "";
u = (u == 0) ? "" : u;
window.criteo_q = window.criteo_q || [];
window.criteo_q.push({event: "setAccount", account: 16184 },{event: "setCustomerId", id: u},{event: "setSiteType", type: "d" },{event: "viewHome" });
})();
}
if (window.addEventListener) {
window.addEventListener('load', async_load, false);
... ...
... ... @@ -10,6 +10,8 @@
<title>{{title}}</title>
<link rel="dns-prefetch" href="//cdn.yoho.cn">
<link rel="dns-prefetch" href="//static.yohobuy.com">
<link rel="dns-prefetch" href="//img10.static.yhbimg.com">
<link rel="dns-prefetch" href="//img11.static.yhbimg.com">
<link rel="dns-prefetch" href="//img12.static.yhbimg.com">
<link rel="dns-prefetch" href="//img13.static.yhbimg.com">
{{#if rlsEnv}}
... ...
... ... @@ -273,7 +273,7 @@
\{\{/need_pay_gifts\}\}
</ul>
<ul class="activity-list">
\{{#equalone has_promotion\}\}
\{{#if has_promotion\}\}
<li class="activity-item">
<span class="activity-name">活动</span>
<h3 class="activity-content">
... ... @@ -286,13 +286,13 @@
\{\{/equalone\}\}
</h3>
</li>
\{\{/equalone\}\}
\{\{#equalone fit_free_shipping \}\}
\{\{/if\}\}
\{\{#if fit_free_shipping \}\}
<li class="activity-item">
<span class="activity-name">免运费</span>
<h3 class="activity-content">全场满 499免运费</h3>
</li>
\{\{/equalone\}\}
\{\{/if\}\}
</ul>
</div>
<div class="gobuy-notempty-footer">
... ... @@ -317,7 +317,7 @@
<span class="has">\{\{vip.curYearCost\}\}</span>
<span class="total">\{\{vip.nextVipInfo.needCost\}\}</span>
</div>
<p class="\{\{#equalzero it.vip.curYearCostPer\}\}integrate\{\{/equalzero\}\}" style="width: \{\{vip.curYearCostPer\}\}%;"></p>
<p class="\{\{#unless vip.curYearCostPer\}\}integrate\{\{/unless\}\}" style="width: \{\{vip.curYearCostPer\}\}%;"></p>
</div>
<span class="cardcate float-left">\{\{vip.nextVipInfo.title\}\}</span>
</div>
... ... @@ -360,5 +360,6 @@
</div>
</script>
</div>
<input id="api-domain" type="hidden" value="{{apiDomain}}">
{{/headerdata}}
... ...
... ... @@ -3,145 +3,127 @@
</script>
{{!-- 正常头部 --}}
{{#headerdata}}
<script>
seajs.use('js/header');
</script>
<script>
seajs.use('js/header');
</script>
{{/headerdata}}
{{!-- 简单头部 --}}
{{#simpleHeader}}
<script>
seajs.use('js/simple-header');
</script>
<script>
seajs.use('js/simple-header');
</script>
{{/simpleHeader}}
{{!-- 首页 --}}
{{#if boysHomePage}}
<script>
seajs.use('js/home/home');
</script>
<script>
seajs.use('js/home/home');
</script>
{{/if}}
{{!-- 搜索 --}}
{{#if searchListPage}}
<script>
seajs.use('js/product/brand');
seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
product.init(5);
window.onresize = function () {
setTimeout(function () {
product.init(5);
}, 300);
};
});
</script>
<script>
seajs.use('js/product/brand');
seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
product.init(5);
window.onresize = function () {
setTimeout(function () {
product.init(5);
}, 300);
};
});
</script>
{{/if}}
{{!-- 列表 --}}
{{#if productListPage}}
<script>
seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
<script>
seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
product.init(4);
window.onresize = function () {
setTimeout(function () {
product.init(4);
}, 300);
};
product.init(4);
window.onresize = function () {
setTimeout(function () {
product.init(4);
}, 300);
};
});
</script>
});
</script>
{{/if}}
{{!-- 商品详情页 --}}
{{#if productDetailPage}}
<script>
seajs.use('js/product/item');
</script>
<script>
seajs.use('js/product/item');
</script>
{{/if}}
{{!-- 逛 --}}
{{#if guangIndexPage}}
<script>
seajs.use('js/guang/index');
</script>
<script>
seajs.use('js/guang/index');
</script>
{{/if}}
{{!-- 逛详情页 --}}
{{#if guangDetailPage}}
<script>
seajs.use('js/guang/detail');
</script>
<script>
seajs.use('js/guang/detail');
</script>
{{/if}}
{{!-- 逛列表页 --}}
{{#if guangListPage}}
<script>
seajs.use('js/guang/list');
</script>
<script>
seajs.use('js/guang/list');
</script>
{{/if}}
{{!-- SALE --}}
{{#if saleIndexPage}}
<script>
seajs.use('js/sale/index');
</script>
<script>
seajs.use('js/sale/index');
</script>
{{/if}}
{{!-- sale列表 --}}
{{#if saleListPage}}
<script>
seajs.use(['js/product/list', 'js/product/product', 'js/sale/banner'], function (list, product) {
product.init(4);
window.onresize = function () {
setTimeout(function () {
product.init(4);
}, 300);
};
});
</script>
{{/if}}
{{!-- sale 分类列表 --}}
{{#if saleCatPage}}
<script>
seajs.use(['js/product/list', 'js/product/product', 'js/sale/banner'], function (list, product) {
product.init(4);
window.onresize = function () {
setTimeout(function () {
product.init(4);
}, 300);
};
});
</script>
{{/if}}
{{!-- 登录注册找回密码--}}
{{#if loginPage}}
<script>
seajs.use('js/passport/login');
</script>
<script>
seajs.use('js/passport/login');
</script>
{{/if}}
{{!-- 第三方绑定--}}
{{#if thirdLogin}}
<script>
seajs.use('js/passport/thirdlogin');
</script>
<script>
seajs.use('js/passport/thirdlogin');
</script>
{{/if}}
{{!-- 注册页--}}
{{#if registerPage}}
<script>
seajs.use('js/passport/reg', function (reg) {
reg.init('reg');
});
</script>
<script>
seajs.use('js/passport/reg', function (reg) {
reg.init('reg');
});
</script>
{{/if}}
{{!-- 第三方登录完善信息页--}}
{{#if thirdPage}}
<script>
... ... @@ -150,43 +132,39 @@
});
</script>
{{/if}}
{{!-- 找回密码--}}
{{#if backPage}}
<script>
seajs.use('js/passport/back');
</script>
<script>
seajs.use('js/passport/back');
</script>
{{/if}}
{{!-- 重置密码--}}
{{#if resetPage}}
<script>
seajs.use('js/passport/reset');
</script>
<script>
seajs.use('js/passport/reset');
</script>
{{/if}}
{{!-- 验证手机 --}}
{{#if vertificationPage}}
<script>
seajs.use('js/passport/vertification');
</script>
<script>
seajs.use('js/passport/vertification');
</script>
{{/if}}
{{!-- 热销排行--}}
{{#if hotrankPage}}
<script>
seajs.use('js/product/hotrank');
</script>
<script>
seajs.use('js/product/hotrank');
</script>
{{/if}}
{{!-- 品牌页 --}}
{{#if brandsHomePage}}
<script>
seajs.use('js/brand/index');
</script>
<script>
seajs.use('js/brand/index');
</script>
{{/if}}
{{!-- 订单保存--}}
{{#if orderSavePage}}
<script>
seajs.use('js/order/save');
</script>
<script>
seajs.use('js/order/save');
</script>
{{/if}}
... ...
... ... @@ -331,7 +331,7 @@ var handlebars = require("handlebars");
var json2 = require("index");
var vipInfoCombine = null; //用户信息编译模板
var loginInfoCombine = null; //登录信息编译模板
var apiDomain = 'http://test.open.yohobuy.com/'; //获取数据的地址http://api.open.yohobuy.com
var apiDomain = $('#api-domain').val(); //获取数据的地址
var cartTpl = ''; //购物车模板
/**
* 搜寻的时候过滤非法字符(+-/:等非法字符单独出现)
... ... @@ -388,6 +388,8 @@ var bannerMap = {
};
var cookieMap = {};
$('#api-domain').remove(); //删除信息表单
function getSource(column, postition, event) {
try {
dataLayer.push({
... ... @@ -1747,6 +1749,10 @@ function actionVipInfo(_data) {
if (typeof vipInfo === undefined || vipInfo.length < 1) {
return false;
}
if (vipInfo.vip.curVipInfo.curLevel === '3') {
vipInfo.vip3 = true;
}
$('#myYohoBox').mouseenter(function() {
$(this).addClass('acttags');
$('#myYohoBox .myyoho-info').show().html(vipInfoCombine(vipInfo));
... ... @@ -3500,49 +3506,49 @@ var $ = require("jquery");
}($));
});
define("js/common/accordion", ["jquery"], function(require, exports, module){
var Slide = require("js/common/yohoui/YH.slide");
var $ = require("jquery");
var $contain = $('.slide-accordion');
var $item = $contain.find('li');
var $width = $item.width();
var $spn = parseInt($('.home-page').width()) === 1150 ? (120 + 5) : (102 + 5);
var slide;
function switchfun(to) {
$item.each(function(index) {
$(this).css('zIndex', index);
if (index <= to) {
$(this).stop().animate({
left: index * $spn
}, 400);
} else {
$(this).stop().animate({
left: (to) * $spn + $width + $spn * (index - to - 1)
}, 400);
}
});
}
switchfun(0);
slide = new Slide({
length: 5,
loop: false,
auto: false,
timeout: 2,
index: 0
});
slide.on('change', function(data) {
switchfun(data.to);
});
$item.mouseover(function() {
slide.go($(this).index());
});
var Slide = require("js/common/yohoui/YH.slide");
var $ = require("jquery");
var $contain = $('.slide-accordion');
var $item = $contain.find('li');
var $width = $item.width();
var $spn = parseInt($('.home-page').width()) === 1150 ? (120 + 5) : (102 + 5);
var slide;
function switchfun(to) {
$item.each(function(index) {
$(this).css('zIndex', index);
if (index <= to) {
$(this).stop().animate({
left: index * $spn
}, 400);
} else {
$(this).stop().animate({
left: (to) * $spn + $width + $spn * (index - to - 1)
}, 400);
}
});
}
switchfun(0);
slide = new Slide({
length: 5,
loop: false,
auto: false,
timeout: 2,
index: 0
});
slide.on('change', function(data) {
switchfun(data.to);
});
$item.mouseover(function() {
slide.go($(this).index());
});
slide.init();
});
define("js/common/yohoui/YH.slide", [], function(require, exports, module){
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -8,7 +8,7 @@ var handlebars = require('yoho.handlebars');
var json2 = require('json2');
var vipInfoCombine = null; //用户信息编译模板
var loginInfoCombine = null; //登录信息编译模板
var apiDomain = 'http://test.open.yohobuy.com/'; //获取数据的地址http://api.open.yohobuy.com
var apiDomain = $('#api-domain').val(); //获取数据的地址
var cartTpl = ''; //购物车模板
/**
* 搜寻的时候过滤非法字符(+-/:等非法字符单独出现)
... ... @@ -65,6 +65,8 @@ var bannerMap = {
};
var cookieMap = {};
$('#api-domain').remove(); //删除信息表单
function getSource(column, postition, event) {
try {
dataLayer.push({
... ...
... ... @@ -120,7 +120,7 @@
}
.tpl-brands{
width: 378px;
height: 504px;
height: 512px;
li a{
height: 248px;
}
... ... @@ -213,6 +213,7 @@
.goods-container{
margin-right:-10px;
width: inherit;
padding-top: 0;
.good-info{
margin-bottom:0px;
}
... ...
<?php
use Action\WebAction;
use Index\HomeModel;
use Configs\WebCacheConfig;
... ... @@ -16,23 +17,23 @@ class CommonController extends WebAction
public function getIndexResourceBrandAction()
{
$data = array();
do {
if (!$this->isAjax()) {
break;
}
$type = $this->get('type');
if (empty($type)) {
break;
}
// 首页资源品牌,采用内存存储
$key = WebCacheConfig::KEY_WEB_INDEX_BRANDS_LIST_DATA . '_' . $type;
// array('logoBrand'=>'','moreBrand'=>'')
$data = Cache::get($key);
}
while (false);
} while (false);
$this->echoJson($data);
}
... ... @@ -49,7 +50,7 @@ class CommonController extends WebAction
$result = array();
do {
/* 判断是不是AJAX请求 */
if (! $this->isAjax()) {
if (!$this->isAjax()) {
break;
}
$channels = array(
... ... @@ -61,7 +62,7 @@ class CommonController extends WebAction
$channel = $this->post('type', '');
$pageIndex = (int) $this->post('pageIndex', 0);
$pageCount = (int) $this->post('pageCount', 8);
if (! in_array($channel, $channels)) {
if (!in_array($channel, $channels)) {
break;
}
... ... @@ -69,7 +70,7 @@ class CommonController extends WebAction
if (empty($data)) {
break;
}
if ($pageIndex < 0) {
$pageIndex = 0;
}
... ... @@ -87,55 +88,46 @@ class CommonController extends WebAction
$data = array();
} while (false);
$this->echoJson($result);
}
/**
/**
* 获取资源位banner
*
* @return jsonp
*/
public function getbannerAction()
{
$url = 'http://service.api.yohobuy.com/operations/api/v4/resource/get?';
$content_code = $this->get('content_code', '');
$client_type = $this->get('client_type', 'web');
$contentCode = $this->get('content_code', '');
$callback = $this->get('callback', '');
$width = $this->get('width', '');
$height = $this->get('height', '');
$params = array(
'content_code' => $content_code,
'client_type' => $client_type
);
$data = IndexData::getResourceData($content_code);//Yohobuy::get($url.http_build_query($params));
if(empty($data['data']))
{
$data = IndexData::getResourceData($contentCode);
if (empty($data['data'])) {
return $this->helpJsonCallbackResult($callback, 200, '没有数据', '');
}
else
{
} else {
$banner = '';
if(isset($data['data'][0]['data']))
{
if($data['data'][0]['template_name'] == 'single_image') {
if (isset($data['data'][0]['data'])) {
if ($data['data'][0]['template_name'] == 'single_image') {
$banner = current($data['data'][0]['data']);
} else if($data['data'][0]['template_name'] == 'single_name_image') {
} else if ($data['data'][0]['template_name'] == 'single_name_image') {
$banner = $data['data'][0]['data'];
}
if(!empty($banner)) {
if(empty($width) || empty($height) ) {
$width = 2600;//通栏广告
$height = 60;
if (!empty($banner)) {
if (empty($width) || empty($height)) {
$width = 2600; //通栏广告
$height = 60;
}
$banner['src'] = Images::getImageUrl($banner['src'], $width, $height ,2);
//str_replace('?imageView/{mode}/w/{width}/h/{height}', '', $banner['src']);
$banner['src'] = Images::getImageUrl($banner['src'], $width, $height, 2);
//str_replace('?imageView/{mode}/w/{width}/h/{height}', '', $banner['src']);
}
}
return $this->helpJsonCallbackResult($callback, $data['code'], $data['message'], $banner);
}
return $this->helpJsonCallbackResult($callback, $data['code'], $data['message'], $banner);
}
/**
* 获取邮件订阅
*
... ... @@ -148,14 +140,14 @@ class CommonController extends WebAction
$uid = intval($this->get('uid', '0'));
$data = array();
//验证邮件
if(Helpers::verifyEmail($email)) {
if (Helpers::verifyEmail($email)) {
$data = IndexData::emailSubscriber($email, $uid);
return $this->helpJsonCallbackResult($callback, $data['code'], $data['message'], $data['data']);
} else {
return $this->helpJsonCallbackResult($callback, 403, '订阅失败', '');
}
}
/**
* 意见反馈
*
... ... @@ -168,7 +160,7 @@ class CommonController extends WebAction
$question_id = intval($this->get('question_id', 0));
$answer = trim($this->get('answer'));
$solution = intval($this->get('solution', 0));
if(!empty($feedback_id) || !empty($question_id) || !empty($answer) || !empty($solution)) {
if (!empty($feedback_id) || !empty($question_id) || !empty($answer) || !empty($solution)) {
$data = IndexData::suggestFeedback($feedback_id, $question_id, $answer, $solution);
return $this->helpJsonCallbackResult($callback, $data['code'], $data['message'], $data['data']);
} else {
... ... @@ -179,7 +171,6 @@ class CommonController extends WebAction
/*
* 简单头部
*/
public function getSimpleHeaderAction()
{
$result = array();
... ... @@ -190,12 +181,11 @@ class CommonController extends WebAction
}
//获取用户
$uid = $this->getUid(true);
$uid = $this->getUid(false);
if (!$uid) {
$isLogin = false;
$username = '';
}
else {
} else {
$isLogin = true;
$username = $this->_uname;
}
... ... @@ -212,8 +202,7 @@ class CommonController extends WebAction
'userCenter' => Helpers::url('/home?t=' . time()), //用户中心链接
'logout' => Helpers::url('/logout.html?t=' . time()), //退出
);
}
else {
} else {
$tool+=array(
'login' => Helpers::url('/signin.html'), //登录链接,已登录不传
'register' => Helpers::url('/reg.html'), //注册链接,已登录不传
... ... @@ -233,10 +222,9 @@ class CommonController extends WebAction
'code' => 200,
'data' => $simpleHeader
);
}
while (false);
} while (false);
$this->echoJson($result);
}
}
\ No newline at end of file
}
... ...
... ... @@ -33,17 +33,22 @@ class HomeModel
/* COOKIE标识访问的是创意生活频道 */
const COOKIE_NAME_LIFESTYLE = 'lifestyle';
//release: test:
//boys:79372627eee75d73afe7f9bac91e5ce6, c15bf0cbfbd4893fd70c869c991f6d3d
//girls: 75215008957605c05e8cd375eac4f817, a519ba44ef3a85cf3c05e405c6ba8e53
//kids:d71f4b27f2a7229fbb31a4bc490a6f36,a7741b94e8bb9d56d0d36e00c05956f7
//lifestyle:8a341ca7eacc069ba80f02dec80eaf34,1b053fd044834f5c86d5eb15fb237af9
// 男首首页
const CODE_BOYS_CHANNEL = 'c15bf0cbfbd4893fd70c869c991f6d3d';
const CODE_BOYS_CHANNEL = '79372627eee75d73afe7f9bac91e5ce6';//'c15bf0cbfbd4893fd70c869c991f6d3d';
// 女首首页
const CODE_GIRLS_CHANNEL = 'a519ba44ef3a85cf3c05e405c6ba8e53';//'4d897f3b8eec0c465db0125e5b1f9edf';
// 'a519ba44ef3a85cf3c05e405c6ba8e53';
const CODE_GIRLS_CHANNEL = '75215008957605c05e8cd375eac4f817';//'a519ba44ef3a85cf3c05e405c6ba8e53';
// 潮童首页
const CODE_KIDS_CHANNEL = 'a7741b94e8bb9d56d0d36e00c05956f7';//'331994d6fa8dc87f92a26dd45c0aa071';
// 'a7741b94e8bb9d56d0d36e00c05956f7';
const CODE_KIDS_CHANNEL = 'd71f4b27f2a7229fbb31a4bc490a6f36';//'a7741b94e8bb9d56d0d36e00c05956f7';
// 创意生活新
const CODE_LIFESTYLE_CHANNEL = '1b053fd044834f5c86d5eb15fb237af9';
const CODE_LIFESTYLE_CHANNEL = '8a341ca7eacc069ba80f02dec80eaf34';//'8a341ca7eacc069ba80f02dec80eaf34';
// 创意生活
const CODE_LIFESTYLE_CHANNEL_1 = '380c38155fd8beee10913a3f5b462da6';
... ... @@ -249,7 +254,7 @@ class HomeModel
{
$key = WebCacheConfig::KEY_WEB_HOME_CHANNEL_NEWARRIVAL_DATA . '_' . $channel;
//缓存数据
$result = Cache::get($key);
$result = '';//Cache::get($key);
if (empty($result)) {
$params = array(
'order' => 's_t_desc',
... ...