Authored by hf

fixes bug refs YW-1052

... ... @@ -85,6 +85,8 @@ class PlusstarController extends AbstractAction
$channel = $this->get('yh_channel');
// 标识是不是APP客户端
$isApp = is_numeric($channel);
// 标识是否是微信访问
$isWeixin = stripos($this->server('HTTP_USER_AGENT', ''), 'MicroMessenger') !== false;
// APP访问时通过频道参数判断性别
if ($isApp) {
switch (intval($channel)) {
... ... @@ -99,7 +101,7 @@ class PlusstarController extends AbstractAction
}
$uid = $this->get('uid');
$udid = $this->get('udid');
$this->setSession('uid', $uid);
}
// 从Cookie获取
... ... @@ -138,14 +140,14 @@ class PlusstarController extends AbstractAction
$data['ps']['newArrival']['moreUrl'] = $url;
$data['ps']['newArrival']['naList'] = $brandInfo['getNewProduct'];
$data['ps']['infos'] = array();
// 拼收藏的URL, 一个坑!
// 备注:此处是根据原来逛的代码硬扒过来的
$defaultUrl = Helpers::url('/plustar/brandinfo', array('id' => $id), 'guang');
if ($isApp) {
$url = $defaultUrl;
$url .= '&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo","param":{"id":'
. $id . '}},"requesturl":{"url":"\/guang\/api\/v1\/favorite\/togglebrand","param":{"brand_id":"' . $brandId . '"}},"priority":"Y"}}';
$url .= '&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo","param":{"id":'
. $id . '}},"requesturl":{"url":"\/guang\/api\/v1\/favorite\/togglebrand","param":{"brand_id":"' . $brandId . '"}},"priority":"Y"}}';
} else {
$url = Helpers::url('/signin.html', array('refer' => $defaultUrl));
}
... ... @@ -161,16 +163,16 @@ class PlusstarController extends AbstractAction
}
// 设置头部信息
if (!$isApp) {
if (!$isApp && !$isWeixin) {
$this->setNavHeader($data['ps']['name'], true, SITE_MAIN);
}
// 标识有微信分享
$data['hasWxShare'] = true;
$data['shareLink'] = $defaultUrl;
$data['shareTitle'] = $data['ps']['name'];
$data['shareDesc'] = (mb_strlen($data['ps']['intro'],'utf-8') > 800) ? mb_substr($data['ps']['intro'], 0, 800, 'utf-8') . '...' : $data['ps']['intro'];
$data['shareDesc'] = (mb_strlen($data['ps']['intro'], 'utf-8') > 800) ? mb_substr($data['ps']['intro'], 0, 800, 'utf-8') . '...' : $data['ps']['intro'];
$data['shareImg'] = $data['ps']['logo'];
$brandInfo = array();
... ...
<?php
use Yaf\Application;
define('SITE_MAIN', 'http://mtesth5.yohobuy.com'); // 网站主域名
define('SITE_MAIN', 'http://m.yohobuy.com'); // 网站主域名
define('OLD_MAIN', 'http://m.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.yohobuy.com'); // COOKIE作用域
define('SUB_DOMAIN', '.mtesth5.yohobuy.com'); // 子域名后缀
define('SUB_DOMAIN', '.m.yohobuy.com'); // 子域名后缀
define('USE_CACHE', true); // 缓存的开关
define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
... ...
User-agent: *
Disallow: /
\ No newline at end of file
Disallow:
\ No newline at end of file
... ...