Authored by 郝肖肖

Merge branch 'hotfix/channelPage' into release/4.6

Showing 34 changed files with 1342 additions and 680 deletions
... ... @@ -204,6 +204,7 @@ class PlusstarData
$result['getArticleByBrand'] = array();
$param = Yohobuy::param();
$param['brand_id'] = $brandInfo['data']['brand_id'];
$param['uid'] = $uid;
$param['udid'] = $udid;
$param['limit'] = 3;
$param['client_type'] = $clientType;
... ...
... ... @@ -36,7 +36,7 @@ class RecomData
$param['yh_channel'] = $channel;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param, 3600);
return Yohobuy::get(Yohobuy::API_URL, $param, 300);
}
/**
... ... @@ -55,7 +55,7 @@ class RecomData
$param['yh_channel'] = '3';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param, 3600);
return Yohobuy::get(Yohobuy::API_URL, $param, 300);
}
/**
... ... @@ -74,7 +74,27 @@ class RecomData
$param['yh_channel'] = '4';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param, 3600);
return Yohobuy::get(Yohobuy::API_URL, $param, 300);
}
/**
* 活动模板-商品列表接口
* @param type int $templateId 模板id
* @param type string $order 排序
* @param type int $page 页码
* @param type int $limit 条数
* @return type []
*/
public static function newPreference($templateId, $order = '', $page = 1, $limit = 50)
{
$param = Yohobuy::param();
$param['template_id'] = intval($templateId);
$param['order'] = $order;
$param['page'] = $page;
$param['limit'] = $limit;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL . 'operations/api/v5/activitytemplate/getProduct', $param, 300);
}
}
... ...
... ... @@ -36,7 +36,7 @@ class SearchData
// return 'http://101.200.31.165/yohosearch/search.json';
return 'http://192.168.10.64:8080/yohosearch/search.json';
case 'testing':
return 'http://192.168.102.216:8080/yohosearch/search.json';
return 'http://testing.yohoops.org/yohosearch/search.json';
case 'developer':
default:
return 'http://searchyohoops.yohobuy.com/yohosearch/search.json';
... ...
... ... @@ -215,7 +215,6 @@ class FloorProcess
foreach ($data['list'] as &$one) {
if (isset($one['url'])) {
$one['url'] = Helpers::getFilterUrl($one['url']);
// isset(self::$channel[$type]) && $one['url'] .= '?gender=' . self::$channel[$type];
}
$one['img'] = Helpers::getImageUrl($one['src'], 158, 174);
unset($one['src']);
... ... @@ -226,7 +225,7 @@ class FloorProcess
'src' => 'http://cdn.yoho.cn/myohobuy/assets/img/more-brand.png',
'url' => '/brands?channel=' . $type,
);
if (isset($data['image'])) {
if (!empty($data['image'])) {
$data['moreImg'] = array(
'alt' => $data['image']['alt'],
'src' => Helpers::getImageUrl($data['image']['src'], 320, 172),
... ...
... ... @@ -354,8 +354,8 @@ class Helpers
$result['showTags'] = $showTag;
$result['img'] = isset($articleData['src']) ? self::getImageUrl($articleData['src'], 640, 640) : '';
//逛详情页app跳转url处理 20160601
$result['url'] = self::getUrlSafe($articleData['url']) . '&openby:yohobuy={"action":"go.h5","params":{"param":{"id":"' . $articleData['id'] . '"},"shareparam":{"id":"' . $articleData['id'] . '"},"share":"/guang/api/v1/share/guang","id":' . $articleData['id'] . ',"type":0,"url":"' .'https:'. self::url('/info/index', array(), 'guang') . '","islogin":"N"}}';
//$result['url'] = $articleData['url']; //$isApp ? $articleData['url'] : self::url('/info/index', array('id' => $articleData['id']), 'guang');
$result['url'] = $isApp ? self::getUrlSafe($articleData['url']) . '&openby:yohobuy={"action":"go.h5","params":{"param":{"id":"' . $articleData['id'] . '"},"shareparam":{"id":"' . $articleData['id'] . '"},"share":"/guang/api/v1/share/guang","id":' . $articleData['id'] . ',"type":1,"url":"' .'http:'. self::url('/info/index', array(), 'guang') . '","islogin":"N"}}' : $articleData['url'];
//$result['url'] = $articleData['url']; // ? $articleData['url'] : self::url('/info/index', array('id' => $articleData['id']), 'guang');
if (strrpos($result['url'], 'feature.yoho.cn') || strrpos($result['url'], 'cdn.yoho.cn')) {
$result['url'] = self::transHttpsUrl($result['url']);
... ... @@ -389,7 +389,6 @@ class Helpers
}
//编辑人员 app跳转url处理 20160601
$articleData['author']['url'] = self::getUrlSafe($articleData['author']['url']).'&openby:yohobuy={"action":"go.h5","params":{"param":{"id":"' . $articleData['author']['author_id'] . '"},"share":"","id":' . $articleData['author']['author_id'] . ',"type":0,"islogin":"N","url":"' .'https:'.self::url('/author/index', array(), 'guang') . '"}}';
$articleData['author']['url'] = self::getUrlSafe($articleData['author']['url']);
$result['author'] = $articleData['author'];
if (isset($result['author']['avatar'])) {
$result['author']['avatar'] = strtr($result['author']['avatar'], array('http://' => '//'));
... ...
server
{
listen 80;
server_name huodong.m.yohobuy.com;
root /Data/code/git/yohobuy/yohobuy/huodong.m.yohobuy.com/public;
access_log /Data/logs/access.huodong.m.yohobuy.com.log combined;
error_log /Data/logs/nginx/error.huodong.m.yohobuy.com.log warn;
location / {
root /Data/code/git/yohobuy/yohobuy/huodong.m.yohobuy.com/public;
proxy_redirect off;
proxy_pass http://yohobuy;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location ~* \.(ico|woff|svg|eot|ttf|otf)$ {
expires 30d;
}
location =/crossdomain.xml {
expires 30d;
}
location =/sitemap.xml {
expires 1d;
}
location =/robots.txt {
expires 1d;
}
}
server
{
listen 80;
server_name static.buy.test.yoho.cn;
root /Data/code/git/yohobuy/static;
location ~* \.(ico|woff|svg|eot|ttf|otf)$ {
expires 30d;
}
location =/crossdomain.xml {
expires 30d;
}
location =/sitemap.xml {
expires 1d;
}
location =/robots.txt {
expires 1d;
}
}
server
{
listen 80;
server_name m.yohobuy.com;
#access_log /Data/logs/access.buy.test.yoho.cn.log combined;
error_log /Data/logs/nginx/error.m.yohobuy.com.log warn;
root /Data/code/git/yohobuy/yohobuy/m.yohobuy.com/public;
location ~* \.(ico|woff|svg|eot|ttf|otf)$ {
expires 30d;
}
location =/crossdomain.xml {
expires 7d;
}
location =/sitemap.xml {
expires 1d;
}
location =/robots.txt {
expires 1d;
}
# login and register 301 redirect to https
location = /reg.html {
proxy_redirect off;
proxy_pass http://yohobuy;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location = /signin.html {
proxy_redirect off;
proxy_pass http://yohobuy;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location = /login.html {
proxy_redirect off;
proxy_pass http://yohobuy;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location = /coupon/index {
proxy_redirect off;
proxy_pass http://yohobuywap-node;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location =/appembed {
default_type application/json;
return 200 '{"code":200,"message":"app embed","data":{"open":"N","url":"http://m.yohobuy.com"}}';
}
location =/lb/v1 {
#cc: e0323a9039add2978bf5b49550572c7c oo:e47ca7a09cf6781e29634502345930a7
#acecl:7ea6bdf07376a928c5d4677789c45463 opqcl:kai: 352f028bd6ecf28de1c285c573642659 guang:7ea6bdf07376a928c5d4677789c45463
#srp 62a165d59f8daf42e2df5f3c5aed8a2f krp:17d7a40f313560d4d9a1189a91e45ab9
#boc 94931e4a3036baeecdacb975e10a8ec6 bcc:dc9262a469f6f315f74c087a7b3a7f35
default_type application/json;
return 200 '{"code":200,"message":"Config Success","md5":"1231231231231","data":{"ae":"e0323a9039add2978bf5b49550572c7c","url":"http://m.yohobuy.com","tl":"7ea6bdf07376a928c5d4677789c45463","rp":"62a165d59f8daf42e2df5f3c5aed8a2f","bv":"94931e4a3036baeecdacb975e10a8ec6","dl":"5b2d8b4b242e067616c6cd98851b2306"}}';
}
# 一些静态页面有关
location = /help/shareorder.html {
root /Data/code/git/yohobuy/assets;
expires 7d;
}
location = /emailback.html {
root /Data/code/git/yohobuy/assets;
expires 7d;
}
location = /phoneback.html {
root /Data/code/git/yohobuy/assets;
expires 7d;
}
location = /error.html {
root /Data/code/git/yohobuy/assets;
expires 7d;
}
location ^~ /dist/ {
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://cdn.yoho.cn/;
}
# location / {
# return 301 https://m.yohobuy.com$request_uri;
# }
location / {
proxy_redirect off;
proxy_pass http://yohobuy;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
# 老页面
location =/invite.html {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location =/app.html {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location =/yohood.html {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location ^~ /home/lottery {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location ^~ /home/redenvelopes {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location ^~ /home/orders/tickets {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location ^~ /home/currency/ {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location = /home/orders/cancel {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location ^~ /wechat {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location ^~ /huodong {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location ^~ /download {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location ^~ /events {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location ^~ /appactive {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location ^~ /cart/success {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location ^~ /shopping/success {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location ^~ /shopping/pay/aliwap {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location = /shopping/pay/wechatwap {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location ^~ /passport/syncsignin {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location =/product/index/search {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location ^~ /share_ {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
}
server
{
listen 80;
server_name search.yohoops.org testing.yohoops.org searchyohoops.yohobuy.com;
location / {
proxy_pass http://192.168.102.216:8080/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server
{
listen 80;
server_name *.m.yohobuy.com;
#access_log /Data/logs/access.buy.test.yoho.cn.log combined;
error_log /Data/logs/nginx/error.m.yohobuy.com.log warn;
root /Data/code/git/yohobuy/yohobuy/m.yohobuy.com/public;
location ~* \.(ico|woff|svg|eot|ttf|otf)$ {
expires 30d;
}
location =/crossdomain.xml {
expires 7d;
}
location =/sitemap.xml {
expires 1d;
}
location =/robots.txt {
expires 1d;
}
location = /error.html {
root /Data/code/git/yohobuy/assets;
expires 7d;
}
location ^~ /Passport/session {
proxy_redirect off;
proxy_pass http://192.168.50.69;
proxy_set_header Host m1.yohobuy.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
# location / {
# return 301 https://$host$request_uri;
# }
#
location / {
proxy_redirect off;
proxy_pass http://yohobuy;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
}
# server
# {
# listen 443;
# server_name m.yohobuy.com;
# ssl on;
# ssl_certificate /Data/local/nginx-1.8.0/ssl/server.crt;
# ssl_certificate_key /Data/local/nginx-1.8.0/ssl/server.key;
# root /Data/code/git/yohobuy/yohobuy/m.yohobuy.com/public;
# location = /appembed {
# default_type application/json;
# return 200 '{"code":200,"message":"app embed","data":{"open":"N","url":"http://m.yohobuy.com"}}';
# }
# location = /lb/v1 {
# #cc: e0323a9039add2978bf5b49550572c7c oo:e47ca7a09cf6781e29634502345930a7
# #acecl:7ea6bdf07376a928c5d4677789c45463 opqcl:kai: 352f028bd6ecf28de1c285c573642659 guang:7ea6bdf07376a928c5d4677789c45463
# #srp 62a165d59f8daf42e2df5f3c5aed8a2f krp:17d7a40f313560d4d9a1189a91e45ab9
# #boc 94931e4a3036baeecdacb975e10a8ec6 bcc:dc9262a469f6f315f74c087a7b3a7f35
# default_type application/json;
# return 200 '{"code":200,"message":"Config Success","md5":"1231231231231","data":{"ae":"e0323a9039add2978bf5b49550572c7c","url":"http://m.yohobuy.com","tl":"7ea6bdf07376a928c5d4677789c45463","rp":"62a165d59f8daf42e2df5f3c5aed8a2f","bv":"94931e4a3036baeecdacb975e10a8ec6"}}';
# }
# location = /help/shareorder.html {
# root /Data/code/git/yohobuy/assets;
# expires 7d;
# }
# location = /emailback.html {
# root /Data/code/git/yohobuy/assets;
# expires 7d;
# }
# location = /phoneback.html {
# root /Data/code/git/yohobuy/assets;
# expires 7d;
# }
# location = /error.html {
# root /Data/code/git/yohobuy/assets;
# expires 7d;
# }
# # login and register 301 redirect to https
# location = /reg.html {
# return 301 https://login.m.yohobuy.com$request_uri;
# }
# location = /signin.html {
# return 301 https://login.m.yohobuy.com$request_uri;
# }
# location = /login.html {
# return 301 https://login.m.yohobuy.com$request_uri;
# }
# location ^~ /Passport/session {
# proxy_redirect off;
# proxy_pass http://192.168.50.69;
# proxy_set_header Host m1.yohobuy.com;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Accept-Encoding "gzip";
# }
# location / {
# proxy_redirect off;
# proxy_pass http://yohobuy;
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Accept-Encoding "gzip";
# }
# location ~* \.(ico|woff|svg|eot|ttf|otf)$ {
# expires 30d;
# }
# location =/crossdomain.xml {
# expires 30d;
# }
# location =/sitemap.xml {
# expires 1d;
# }
# location =/robots.txt {
# expires 1d;
# }
# }
# server
# {
# listen 443;
# server_name *.m.yohobuy.com;
# ssl on;
# ssl_certificate /Data/local/nginx-1.8.0/ssl/server.crt;
# ssl_certificate_key /Data/local/nginx-1.8.0/ssl/server.key;
# root /Data/code/git/yohobuy/yohobuy/m.yohobuy.com/public;
# location = /error.html {
# root /Data/code/git/yohobuy/assets;
# expires 7d;
# }
# location ^~ /Passport/session {
# proxy_redirect off;
# proxy_pass http://192.168.50.69;
# proxy_set_header Host m1.yohobuy.com;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Accept-Encoding "gzip";
# }
# location / {
# proxy_redirect off;
# proxy_pass http://yohobuy;
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Accept-Encoding "gzip";
# }
# location ~* \.(ico|woff|svg|eot|ttf|otf)$ {
# expires 30d;
# }
# location =/crossdomain.xml {
# expires 30d;
# }
# location =/sitemap.xml {
# expires 1d;
# }
# location =/robots.txt {
# expires 1d;
# }
# }
server
{
listen 80;
server_name analytics.m.yohobuy.com;
location / {
proxy_redirect off;
proxy_pass http://analytics.yhurl.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location ~* \.(ico|woff|svg|eot|ttf|otf)$ {
expires 30d;
}
location =/crossdomain.xml {
expires 30d;
}
location =/sitemap.xml {
expires 1d;
}
location =/robots.txt {
expires 1d;
}
}
... ...
... ... @@ -215,14 +215,13 @@ function reMarginFooter(fixedElement) {
(function() {
var uid = getUid(),
hasParentBp = false, // 判断是否有父级埋点,如果有,点击子埋点,不处罚父埋点。
basicBpDataLength = 3;
var sendBpData,
basicBpDataLength = 3,
sendBpData,
bindBpEvent;
uid = uid === 0 ? '' : uid;
window._ozuid = uid;//暴露ozuid
window._ozuid = uid; // 暴露ozuid
if (window._yas) {
window._yas(1 * new Date(), '1.0.15', 'yohobuy_m', uid, '', '');
... ... @@ -235,27 +234,32 @@ function reMarginFooter(fixedElement) {
jsonData = {
page: bpIdArr[0],
floor: bpIdArr[1],
data: bpIdArr[2]
data: /_[1|0]$/.test(bpIdArr.join('_')) ? bpIdArr[2] : bpIdArr.slice(2).join('_') //防止值字符串中有_导致的问题
};
window._yas.sendCustomInfo(jsonData, Boolean(parseInt(bpIdArr[3]) || 1));
if (window._yas.sendCustomInfo) {
window._yas.sendCustomInfo(jsonData, Boolean(parseInt(bpIdArr[3]) || 1));
}
}
};
// 绑定埋点点击事件
bindBpEvent = function() {
$(document).off('click').on('click', '.buriedpoint', function(e) {
$('.buriedpoint').off('click');
$(document).on('click', '.buriedpoint', function(e) {
var databpid = $(this).attr('data-bp-id') || '',
bpIdArr = databpid.split('_'),
hasParentBp = false;
bpIdArr = databpid.split('_');
var $target = $(e.target),
partentBpLength = $target.parents('.buriedpoint').length;
if ($(e.target).parents('.buriedpoint').length > 0) {
hasParentBp = true;
}
if (!hasParentBp && bpIdArr && bpIdArr.length >= basicBpDataLength) {
sendBpData(bpIdArr);
}
if ($target.hasClass('buriedpoint') && partentBpLength > 0 ||
partentBpLength >= 2) {
hasParentBp = true;
}
});
};
... ... @@ -268,7 +272,7 @@ function reMarginFooter(fixedElement) {
$(document).on('shouldSendBpData', function(e, dataPbId) {
var bpIdArr;
if (dataPbId && (dataPbId.length && dataPbId.length > 0)) {
if (dataPbId && dataPbId.length && dataPbId.length > 0) {
hasParentBp = false;
bpIdArr = dataPbId.split('_');
sendBpData(bpIdArr);
... ... @@ -3848,6 +3852,10 @@ module.exports = function(specificGender) {
'1,3' : '2,3',
url = '/product/recom/maylike?gender=' + gender;
}
//日韩馆-你可能喜欢的
if ($('.mobile-wrap').hasClass('yoho-channel-page')) {
url = '/product/recom/newPreference?template_id=' + $.queryString().template_id;
}
$curNav = $navList.children('.focus');
... ... @@ -5590,123 +5598,123 @@ $btnNext.on('touchstart', function() {
});
define("js/me/dialog", ["jquery","handlebars","source-map","hammer"], function(require, exports, module){
/*
* @Description: dialog
* @Time: 2015/11/18
* @author: chenglong.wang
*/
var $ = require("jquery"),
Handlebars = require("handlebars"),
Hammer = require("hammer");
var $dialogWrapper,
dialogTpl,
dialogTemplate;
function getInstance() {
if (dialogTpl === undefined) {
dialogTpl = '<div id="dialog-wrapper" class="dialog-wrapper">' +
'<div class="dialog-box">' +
'{{# hasHeader}}' +
'{{/ hasHeader}}' +
'<div class="dialog-content">{{dialogText}}</div>' +
'{{# hasFooter}}' +
'<div class="dialog-footer">' +
'{{# leftBtnText}}' +
'<span class="dialog-left-btn tap-hightlight">{{.}}</span>' +
'{{/ leftBtnText}}' +
'{{# rightBtnText}}' +
'<span class="dialog-right-btn tap-hightlight">{{.}}</span>' +
'{{/ rightBtnText}}' +
'</div>' +
'{{/ hasFooter}}' +
'</div>' +
'</div>';
dialogTemplate = Handlebars.compile(dialogTpl);
}
return dialogTemplate;
}
// fullWithBtn是供详情页获取限购码使用的特殊参数
exports.showDialog = function(data, callback, callbackForLeft, fullWithBtn) {
var dialogTemplate = getInstance(),
dialogStr = dialogTemplate(data),
$dialogBox,
defaultHideDuraton,
dialogWrapperHammer;
$('.dialog-wrapper').remove();
$('body').append($(dialogStr));
$dialogBox = $('.dialog-box');
$dialogWrapper = $('.dialog-wrapper');
dialogWrapperHammer = new Hammer(document.getElementById('dialog-wrapper'));
// 显示
if (data.fast) {
$dialogWrapper.css({
display: 'block'
});
} else {
$dialogWrapper.fadeIn();
}
if (fullWithBtn) {
$('.dialog-wrapper .dialog-footer > span').css('width', '100%');
$('.dialog-wrapper .dialog-content').css({
'padding-left': '1.85rem',
'padding-right': '1.85rem'
});
$dialogWrapper.css('z-index', '10');
}
$dialogBox.css({
top: '50%',
marginTop: -($dialogBox.height() / 2)
});
//隐藏
if (data.autoHide) {
defaultHideDuraton = 1000;
if (data.autoHide > 1) {
defaultHideDuraton = data.autoHide;
}
setTimeout(function() {
$dialogWrapper.fadeOut();
}, defaultHideDuraton);
}
//禁止在dialog上可以上下滚动
$dialogWrapper.on('touchmove', function() {
return false;
});
dialogWrapperHammer.on('tap', function(event) {
if ($(event.target).hasClass('dialog-left-btn')) {
if (typeof callbackForLeft === 'function') {
callbackForLeft();
}
$dialogWrapper.fadeOut();
} else if ($(event.target).hasClass('dialog-right-btn')) {
callback();
}
// 防止出现点透问题
event.preventDefault();
event.srcEvent.stopPropagation();
});
};
exports.hideDialog = function() {
$('.dialog-wrapper').remove();
};
/*
* @Description: dialog
* @Time: 2015/11/18
* @author: chenglong.wang
*/
var $ = require("jquery"),
Handlebars = require("handlebars"),
Hammer = require("hammer");
var $dialogWrapper,
dialogTpl,
dialogTemplate;
function getInstance() {
if (dialogTpl === undefined) {
dialogTpl = '<div id="dialog-wrapper" class="dialog-wrapper">' +
'<div class="dialog-box">' +
'{{# hasHeader}}' +
'{{/ hasHeader}}' +
'<div class="dialog-content">{{dialogText}}</div>' +
'{{# hasFooter}}' +
'<div class="dialog-footer">' +
'{{# leftBtnText}}' +
'<span class="dialog-left-btn tap-hightlight">{{.}}</span>' +
'{{/ leftBtnText}}' +
'{{# rightBtnText}}' +
'<span class="dialog-right-btn tap-hightlight">{{.}}</span>' +
'{{/ rightBtnText}}' +
'</div>' +
'{{/ hasFooter}}' +
'</div>' +
'</div>';
dialogTemplate = Handlebars.compile(dialogTpl);
}
return dialogTemplate;
}
// fullWithBtn是供详情页获取限购码使用的特殊参数
exports.showDialog = function(data, callback, callbackForLeft, fullWithBtn) {
var dialogTemplate = getInstance(),
dialogStr = dialogTemplate(data),
$dialogBox,
defaultHideDuraton,
dialogWrapperHammer;
$('.dialog-wrapper').remove();
$('body').append($(dialogStr));
$dialogBox = $('.dialog-box');
$dialogWrapper = $('.dialog-wrapper');
dialogWrapperHammer = new Hammer(document.getElementById('dialog-wrapper'));
// 显示
if (data.fast) {
$dialogWrapper.css({
display: 'block'
});
} else {
$dialogWrapper.fadeIn();
}
if (fullWithBtn) {
$('.dialog-wrapper .dialog-footer > span').css('width', '100%');
$('.dialog-wrapper .dialog-content').css({
'padding-left': '1.85rem',
'padding-right': '1.85rem'
});
$dialogWrapper.css('z-index', '10');
}
$dialogBox.css({
top: '50%',
marginTop: -($dialogBox.height() / 2)
});
//隐藏
if (data.autoHide) {
defaultHideDuraton = 1000;
if (data.autoHide > 1) {
defaultHideDuraton = data.autoHide;
}
setTimeout(function() {
$dialogWrapper.fadeOut();
}, defaultHideDuraton);
}
//禁止在dialog上可以上下滚动
$dialogWrapper.on('touchmove', function() {
return false;
});
dialogWrapperHammer.on('tap', function(event) {
if ($(event.target).hasClass('dialog-left-btn')) {
if (typeof callbackForLeft === 'function') {
callbackForLeft();
}
$dialogWrapper.fadeOut();
} else if ($(event.target).hasClass('dialog-right-btn')) {
callback();
}
// 防止出现点透问题
event.preventDefault();
event.srcEvent.stopPropagation();
});
};
exports.hideDialog = function() {
$('.dialog-wrapper').remove();
};
});
define("js/passport/bind/code", ["jquery"], function(require, exports, module){
... ... @@ -6253,8 +6261,12 @@ function highlightMainItem() {
var $mainItem = $('.filter-body .classify');
$mainItem.on('touchstart', '.shower', function() {
var bpIdData = $(this).attr('data-bp-id') || '';
$mainItem.removeClass('highlight');
$(this).addClass('highlight');
$(document).trigger('shouldSendBpData', [bpIdData]);
}).on('touchend touchcancel', '.shower', function() {
$(this).removeClass('highlight');
});
... ... @@ -7600,6 +7612,7 @@ $('#likeBtn').on('touchstart', function() {
$('#addtoCart').on('touchstart', function() {
$('.cart-bar').hide();
productCode && chosePanel.setLimitGoodModeWithSknId(productCode, skn);
chosePanel.show();
... ... @@ -7614,6 +7627,11 @@ $('#addtoCart').on('touchstart', function() {
return false;
});
$('#buyLimit').on('touchstart', function() {
tip.show('打开APP可抢购该商品哦~');
return false;
});
});
define("js/cart/chose-panel", ["jquery"], function(require, exports, module){
/**
... ... @@ -9540,7 +9558,7 @@ $subNav.on('touchend touchcancel', function(e) {
nav,
navType,
$active;
var bpIdData = $(this).find('.buriedpoint').attr('data-bp-id') || '';
var bpIdData = $this.attr('data-bp-id') || '';
e.preventDefault();
$(document).trigger('shouldSendBpData', [bpIdData]);
... ... @@ -10356,465 +10374,465 @@ $reaMask.on('touchend', function(event) {
});
define("js/me/fav", ["jquery","hammer","swiper","handlebars","source-map","index"], function(require, exports, module){
/**
* 个人中心--收藏
* @author: chenglong<chenglong.wang@yoho.cn>
* @date: 2015/11/12
*/
var $ = require("jquery"),
Hammer = require("hammer"),
Swiper = require("swiper");
var diaLog = require("js/me/dialog");
var tip = require("js/plugin/tip");
var $navLi = $('#fav-tab > li'),
$favContainer = $('.fav-content > .fav-type'),
swiperObj = {},
favTabHammer,
favContentHammer,
$loadMore = $('.fav-load-more'),
$brandLoadMore = $('.fav-brand-load-more'),
winH = $(window).height(),
footerH = $('#yoho-footer').height(),
$favProductList = $('.fav-product-list'),
$favBrandList = $('.fav-brand-swiper-wrapper'),
pageId = 1,
brandPageId = 1, //收藏品牌的当前页数
lockId = true,
brandLockId = true, //收藏品牌是否可下拉加载更多
brandTab = false; //当前是否停留在收藏品牌页
function showFavTab(index) {
$navLi.filter('.active').removeClass('active');
$navLi.eq(index).addClass('active');
$favContainer.filter('.show').removeClass('show');
$favContainer.eq(index).addClass('show');
}
//初始化swiper
function initSwiper(data) {
var i,
idStrReg = /container-(\d+)['"]{1}/gi,
idReg = /\d+/,
idArr = data.match(idStrReg),
idArrLen = idArr.length,
containerId;
//$swiperList = $('.swiper-container');
for (i = 0; i < idArrLen; i++) {
/*id = $swiperList.eq(i).attr('data-id');
if (!!swiperObj[id]) {
swiperObj[id].destroy(true, true);
}*/
containerId = idArr[i].match(idReg)[0];
swiperObj[containerId] = new Swiper('#swiper-container-' + containerId, {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'li',
wrapperClass: 'swiper-wrapper-' + containerId,
lazyLoading: true,
watchSlidesVisibility: true
});
}
}
// 上拉加载更多
function loadData($parent, url, page) {
if (url === 'favBrand') {
brandLockId = true;
} else {
lockId = true;
}
$.ajax({
method: 'post',
url: '/home/' + url,
data: {
page: page
},
success: function(data) {
var $loadingMask = $parent.closest('.fav-type').find('.fav-content-loading');
if (url === 'favBrand') {
$brandLoadMore.addClass('hide');
} else {
$loadMore.addClass('hide');
}
if (data === ' ') {
$loadingMask.addClass('hide');
$parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
window.rePosFooter();
} else if (data === 'end') {
//处理data等于end时如果loadingMask存在且没有hide样式的情况
if ($loadingMask && !$loadingMask.hasClass('hide')) {
$loadingMask.addClass('hide');
//$parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
}
$parent.closest('.fav-type').find('.fav-load-background')
.removeClass('fav-load-background').html('没有更多了');
// hf: fixes bug to 修改没有数据还调接口,加载错误页面问题
brandLockId = true;
lockId = true;
} else if (data.length > 10) {
$parent.append(data);
//如果有数据loadingMask会被remove掉
$loadingMask.remove();
if (url === 'favBrand') {
initSwiper(data);//如果是收藏品牌需要初始化swiper
brandLockId = false;//请求成功后解锁品牌收藏page++
} else {
lockId = false;//请求成功后解锁商品收藏page++
}
}
window.rePosFooter();
}
});
}
// 如果从品牌收藏入口进入
if ($('#fav-tab').hasClass('brand-tab')) {
showFavTab(1);
loadData($favBrandList, 'favBrand', 1);
brandTab = true;
window.rePosFooter();
} else {
showFavTab(0);
loadData($favProductList, 'favProduct', 1);
brandTab = false;
window.rePosFooter();
}
favTabHammer = new Hammer(document.getElementById('fav-tab'));
favTabHammer.on('tap', function(e) {
var $cur = $(e.target).closest('li'),
index;
if ($cur.length === 0 || $cur.hasClass('active')) {
return;
}
index = $cur.index();
if (index === 0) {
brandTab = false;
if ($favProductList.find('li').length === 0 &&
$favProductList.closest('.fav-type').find('.fav-null-box').hasClass('hide')) {
loadData($favProductList, 'favProduct', 1);
}
} else {
brandTab = true;
if ($favBrandList.find('div').length === 0 &&
$favBrandList.closest('.fav-type').find('.fav-null-box').hasClass('hide')) {
loadData($favBrandList, 'favBrand', 1);
}
}
showFavTab(index);
window.rePosFooter();
});
//删除收藏的商品
favContentHammer = new Hammer(document.getElementById('fav-content'));
favContentHammer.on('tap', function(e) {
var id = '';
if (!$(e.target).hasClass('del-fav')) {
return;
}
diaLog.showDialog({
dialogText: '您确定要取消收藏吗?',
hasFooter: {
leftBtnText: '取消',
rightBtnText: '确定'
}
}, function() {
id = $(e.target).closest('li').attr('data-id');
$.ajax({
method: 'post',
url: '/home/favoriteDel',
data: {
id: id
}
}).then(function(data) {
if (data.code === 200) {
diaLog.showDialog({
autoHide: true,
fast: true,
dialogText: '已经取消收藏'
});
$(e.target).closest('li').remove();
} else if (data.code === 400) {
diaLog.showDialog({
autoHide: true,
fast: true,
dialogText: data.message
});
} else {
diaLog.showDialog({
autoHide: true,
fast: true,
dialogText: '取消收藏失败'
});
}
}).fail(function() {
//TODO
diaLog.showDialog({
autoHide: true,
dialogText: '网络错误~'
});
});
});
});
function scrollHandler() {
//距离底部未1/4列表高度+底部高度的时候加载更多
if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $favBrandList.height() - footerH) {
if (brandTab) {
$brandLoadMore.filter('.hide').removeClass('hide');
if (!brandLockId) {
brandPageId++;
loadData($favBrandList, 'favBrand', brandPageId);
}
} else {
$loadMore.filter('.hide').removeClass('hide');
if (!lockId) {
pageId++;
loadData($favProductList, 'favProduct', pageId);
}
}
}
}
//srcoll to load more
$(window).scroll(scrollHandler);
$(document).on('touchend', '.swiper-header', function() {
var url = $(this).find('.fav-more').attr('href');
if (url) {
window.location.href = url;
}
});
$('.invalidGoods').on('touchstart touchend', function(e) {
var $this = $(e.target).closest('span');
if ($this.hasClass('del-fav')) {
return;
}
tip.show('商品已下架');
return false;
});
/**
* 个人中心--收藏
* @author: chenglong<chenglong.wang@yoho.cn>
* @date: 2015/11/12
*/
var $ = require("jquery"),
Hammer = require("hammer"),
Swiper = require("swiper");
var diaLog = require("js/me/dialog");
var tip = require("js/plugin/tip");
var $navLi = $('#fav-tab > li'),
$favContainer = $('.fav-content > .fav-type'),
swiperObj = {},
favTabHammer,
favContentHammer,
$loadMore = $('.fav-load-more'),
$brandLoadMore = $('.fav-brand-load-more'),
winH = $(window).height(),
footerH = $('#yoho-footer').height(),
$favProductList = $('.fav-product-list'),
$favBrandList = $('.fav-brand-swiper-wrapper'),
pageId = 1,
brandPageId = 1, //收藏品牌的当前页数
lockId = true,
brandLockId = true, //收藏品牌是否可下拉加载更多
brandTab = false; //当前是否停留在收藏品牌页
function showFavTab(index) {
$navLi.filter('.active').removeClass('active');
$navLi.eq(index).addClass('active');
$favContainer.filter('.show').removeClass('show');
$favContainer.eq(index).addClass('show');
}
//初始化swiper
function initSwiper(data) {
var i,
idStrReg = /container-(\d+)['"]{1}/gi,
idReg = /\d+/,
idArr = data.match(idStrReg),
idArrLen = idArr.length,
containerId;
//$swiperList = $('.swiper-container');
for (i = 0; i < idArrLen; i++) {
/*id = $swiperList.eq(i).attr('data-id');
if (!!swiperObj[id]) {
swiperObj[id].destroy(true, true);
}*/
containerId = idArr[i].match(idReg)[0];
swiperObj[containerId] = new Swiper('#swiper-container-' + containerId, {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'li',
wrapperClass: 'swiper-wrapper-' + containerId,
lazyLoading: true,
watchSlidesVisibility: true
});
}
}
// 上拉加载更多
function loadData($parent, url, page) {
if (url === 'favBrand') {
brandLockId = true;
} else {
lockId = true;
}
$.ajax({
method: 'post',
url: '/home/' + url,
data: {
page: page
},
success: function(data) {
var $loadingMask = $parent.closest('.fav-type').find('.fav-content-loading');
if (url === 'favBrand') {
$brandLoadMore.addClass('hide');
} else {
$loadMore.addClass('hide');
}
if (data === ' ') {
$loadingMask.addClass('hide');
$parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
window.rePosFooter();
} else if (data === 'end') {
//处理data等于end时如果loadingMask存在且没有hide样式的情况
if ($loadingMask && !$loadingMask.hasClass('hide')) {
$loadingMask.addClass('hide');
//$parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
}
$parent.closest('.fav-type').find('.fav-load-background')
.removeClass('fav-load-background').html('没有更多了');
// hf: fixes bug to 修改没有数据还调接口,加载错误页面问题
brandLockId = true;
lockId = true;
} else if (data.length > 10) {
$parent.append(data);
//如果有数据loadingMask会被remove掉
$loadingMask.remove();
if (url === 'favBrand') {
initSwiper(data);//如果是收藏品牌需要初始化swiper
brandLockId = false;//请求成功后解锁品牌收藏page++
} else {
lockId = false;//请求成功后解锁商品收藏page++
}
}
window.rePosFooter();
}
});
}
// 如果从品牌收藏入口进入
if ($('#fav-tab').hasClass('brand-tab')) {
showFavTab(1);
loadData($favBrandList, 'favBrand', 1);
brandTab = true;
window.rePosFooter();
} else {
showFavTab(0);
loadData($favProductList, 'favProduct', 1);
brandTab = false;
window.rePosFooter();
}
favTabHammer = new Hammer(document.getElementById('fav-tab'));
favTabHammer.on('tap', function(e) {
var $cur = $(e.target).closest('li'),
index;
if ($cur.length === 0 || $cur.hasClass('active')) {
return;
}
index = $cur.index();
if (index === 0) {
brandTab = false;
if ($favProductList.find('li').length === 0 &&
$favProductList.closest('.fav-type').find('.fav-null-box').hasClass('hide')) {
loadData($favProductList, 'favProduct', 1);
}
} else {
brandTab = true;
if ($favBrandList.find('div').length === 0 &&
$favBrandList.closest('.fav-type').find('.fav-null-box').hasClass('hide')) {
loadData($favBrandList, 'favBrand', 1);
}
}
showFavTab(index);
window.rePosFooter();
});
//删除收藏的商品
favContentHammer = new Hammer(document.getElementById('fav-content'));
favContentHammer.on('tap', function(e) {
var id = '';
if (!$(e.target).hasClass('del-fav')) {
return;
}
diaLog.showDialog({
dialogText: '您确定要取消收藏吗?',
hasFooter: {
leftBtnText: '取消',
rightBtnText: '确定'
}
}, function() {
id = $(e.target).closest('li').attr('data-id');
$.ajax({
method: 'post',
url: '/home/favoriteDel',
data: {
id: id
}
}).then(function(data) {
if (data.code === 200) {
diaLog.showDialog({
autoHide: true,
fast: true,
dialogText: '已经取消收藏'
});
$(e.target).closest('li').remove();
} else if (data.code === 400) {
diaLog.showDialog({
autoHide: true,
fast: true,
dialogText: data.message
});
} else {
diaLog.showDialog({
autoHide: true,
fast: true,
dialogText: '取消收藏失败'
});
}
}).fail(function() {
//TODO
diaLog.showDialog({
autoHide: true,
dialogText: '网络错误~'
});
});
});
});
function scrollHandler() {
//距离底部未1/4列表高度+底部高度的时候加载更多
if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $favBrandList.height() - footerH) {
if (brandTab) {
$brandLoadMore.filter('.hide').removeClass('hide');
if (!brandLockId) {
brandPageId++;
loadData($favBrandList, 'favBrand', brandPageId);
}
} else {
$loadMore.filter('.hide').removeClass('hide');
if (!lockId) {
pageId++;
loadData($favProductList, 'favProduct', pageId);
}
}
}
}
//srcoll to load more
$(window).scroll(scrollHandler);
$(document).on('touchend', '.swiper-header', function() {
var url = $(this).find('.fav-more').attr('href');
if (url) {
window.location.href = url;
}
});
$('.invalidGoods').on('touchstart touchend', function(e) {
var $this = $(e.target).closest('span');
if ($this.hasClass('del-fav')) {
return;
}
tip.show('商品已下架');
return false;
});
});
define("js/me/suggest", ["jquery","hammer","lazyload","handlebars","source-map"], function(require, exports, module){
/**
* 个人中心--意见反馈
* @author: chenglong<chenglong.wang@yoho.cn>
* @date: 2015/11/12
*/
var $ = require("jquery"),
Hammer = require("hammer"),
lazyLoad = require("lazyload"),
Handlebars = require("handlebars");
var diaLog = require("js/me/dialog");
var $uploadImgList = $('.upload-img-list'),
headerNavHammer,
formHammer,
imgTpl,
imgTemplate,
$likeBtn = $('.suggest-item .like-btn'),
$disLikeBtn = $('.suggest-item .dislike-btn'),
$imgAdd = $('.img-add'),
imgStr = '',
uploadImgNum = 0;
require("js/me/jquery.upload");
imgTpl = '{{# imgList}}' +
'<li>' +
'{{# imgUrl}}<img src="{{.}}" />' +
'<span class="upload-img-remove"></span>{{/ imgUrl}}' +
'</li>' +
'{{/ imgList}}';
imgTemplate = Handlebars.compile(imgTpl);
$('#upload-img').upload({
auto: true,
fileType: 'image/*',
uploadScript: '/home/suggestimgUpload',
fileObjName: 'fileData',
fileSizeLimit: 300,
height: '100%',
width: '100%',
multi: false,
onAddQueueItem: function(files) {
//TODO
$uploadImgList.html(imgTemplate({
imgList: true
}));
},
onUploadComplete: function(file, data) {
$uploadImgList.html('');
imgStr = JSON.parse(data).imgList[0].imgRelUrl;
$uploadImgList.html(imgTemplate(JSON.parse(data)));
$imgAdd.hide();
uploadImgNum++;
}
});
lazyLoad();
headerNavHammer = new Hammer(document.getElementById('yoho-header'));
headerNavHammer.on('tap', function(e) {
var suggestText = $('#suggest-textarea').val(),
textReg = /\S+/;
if ($(e.target).hasClass('nav-btn')) {
if (!textReg.test(suggestText)) {
diaLog.showDialog({
autoHide: true,
dialogText: '意见不能为空'
});
return;
}
$.ajax({
method: 'post',
url: '/home/savesuggest',
data: {
content: suggestText,
image: imgStr
}
}).then(function(data) {
if (data.code === 200) {
diaLog.showDialog({
autoHide: true,
dialogText: '提交成功'
});
setTimeout(function() {
location.pathname = 'home/suggest';
}, 2000);
} else {
diaLog.showDialog({
autoHide: true,
dialogText: '提交失败~'
});
}
}).fail(function() {
diaLog.showDialog({
autoHide: true,
dialogText: '网络错误~'
});
});
}
});
if (document.getElementById('img-form') !== null) {
formHammer = new Hammer(document.getElementById('img-form'));
formHammer.on('tap', function(e) {
if ($(e.target).hasClass('upload-img-remove')) {
$uploadImgList.html('');
imgStr = '';
uploadImgNum--;
setTimeout(function() {
$imgAdd.show();
}, 50);
}
});
}
// 点赞与取消点赞
$likeBtn.bind('click', function() {
var id = $(this).closest('.suggest-item').attr('data-id'),
$that = $(this);
$.ajax({
method: 'post',
url: '/home/upAndDown',
data: {
suggest_id: id,
reliable: 1
}
}).then(function(data) {
if (data.code === 200) {
$that.closest('.suggest-type').removeClass('show');
$that.closest('.suggest-item').find('.suggest-good').addClass('show');
}
}).fail(function(data) {
//TODO
diaLog.showDialog({
autoHide: true,
dialogText: '网络错误~'
});
});
});
$disLikeBtn.bind('click', function() {
var id = $(this).closest('.suggest-item').attr('data-id'),
$that = $(this);
$.ajax({
method: 'post',
url: '/home/upAndDown',
data: {
suggest_id: id,
reliable: 2
}
}).then(function(data) {
if (data.code === 200) {
$that.closest('.suggest-type').removeClass('show');
$that.closest('.suggest-item').find('.suggest-bad').addClass('show');
}
}).fail(function(data) {
//TODO
diaLog.showDialog({
autoHide: true,
dialogText: '网络错误~'
});
});
/**
* 个人中心--意见反馈
* @author: chenglong<chenglong.wang@yoho.cn>
* @date: 2015/11/12
*/
var $ = require("jquery"),
Hammer = require("hammer"),
lazyLoad = require("lazyload"),
Handlebars = require("handlebars");
var diaLog = require("js/me/dialog");
var $uploadImgList = $('.upload-img-list'),
headerNavHammer,
formHammer,
imgTpl,
imgTemplate,
$likeBtn = $('.suggest-item .like-btn'),
$disLikeBtn = $('.suggest-item .dislike-btn'),
$imgAdd = $('.img-add'),
imgStr = '',
uploadImgNum = 0;
require("js/me/jquery.upload");
imgTpl = '{{# imgList}}' +
'<li>' +
'{{# imgUrl}}<img src="{{.}}" />' +
'<span class="upload-img-remove"></span>{{/ imgUrl}}' +
'</li>' +
'{{/ imgList}}';
imgTemplate = Handlebars.compile(imgTpl);
$('#upload-img').upload({
auto: true,
fileType: 'image/*',
uploadScript: '/home/suggestimgUpload',
fileObjName: 'fileData',
fileSizeLimit: 300,
height: '100%',
width: '100%',
multi: false,
onAddQueueItem: function(files) {
//TODO
$uploadImgList.html(imgTemplate({
imgList: true
}));
},
onUploadComplete: function(file, data) {
$uploadImgList.html('');
imgStr = JSON.parse(data).imgList[0].imgRelUrl;
$uploadImgList.html(imgTemplate(JSON.parse(data)));
$imgAdd.hide();
uploadImgNum++;
}
});
lazyLoad();
headerNavHammer = new Hammer(document.getElementById('yoho-header'));
headerNavHammer.on('tap', function(e) {
var suggestText = $('#suggest-textarea').val(),
textReg = /\S+/;
if ($(e.target).hasClass('nav-btn')) {
if (!textReg.test(suggestText)) {
diaLog.showDialog({
autoHide: true,
dialogText: '意见不能为空'
});
return;
}
$.ajax({
method: 'post',
url: '/home/savesuggest',
data: {
content: suggestText,
image: imgStr
}
}).then(function(data) {
if (data.code === 200) {
diaLog.showDialog({
autoHide: true,
dialogText: '提交成功'
});
setTimeout(function() {
location.pathname = 'home/suggest';
}, 2000);
} else {
diaLog.showDialog({
autoHide: true,
dialogText: '提交失败~'
});
}
}).fail(function() {
diaLog.showDialog({
autoHide: true,
dialogText: '网络错误~'
});
});
}
});
if (document.getElementById('img-form') !== null) {
formHammer = new Hammer(document.getElementById('img-form'));
formHammer.on('tap', function(e) {
if ($(e.target).hasClass('upload-img-remove')) {
$uploadImgList.html('');
imgStr = '';
uploadImgNum--;
setTimeout(function() {
$imgAdd.show();
}, 50);
}
});
}
// 点赞与取消点赞
$likeBtn.bind('click', function() {
var id = $(this).closest('.suggest-item').attr('data-id'),
$that = $(this);
$.ajax({
method: 'post',
url: '/home/upAndDown',
data: {
suggest_id: id,
reliable: 1
}
}).then(function(data) {
if (data.code === 200) {
$that.closest('.suggest-type').removeClass('show');
$that.closest('.suggest-item').find('.suggest-good').addClass('show');
}
}).fail(function(data) {
//TODO
diaLog.showDialog({
autoHide: true,
dialogText: '网络错误~'
});
});
});
$disLikeBtn.bind('click', function() {
var id = $(this).closest('.suggest-item').attr('data-id'),
$that = $(this);
$.ajax({
method: 'post',
url: '/home/upAndDown',
data: {
suggest_id: id,
reliable: 2
}
}).then(function(data) {
if (data.code === 200) {
$that.closest('.suggest-type').removeClass('show');
$that.closest('.suggest-item').find('.suggest-bad').addClass('show');
}
}).fail(function(data) {
//TODO
diaLog.showDialog({
autoHide: true,
dialogText: '网络错误~'
});
});
});
});
define("js/me/jquery.upload", ["jquery"], 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.
... ... @@ -197,14 +197,13 @@ function reMarginFooter(fixedElement) {
(function() {
var uid = getUid(),
hasParentBp = false, // 判断是否有父级埋点,如果有,点击子埋点,不处罚父埋点。
basicBpDataLength = 3;
var sendBpData,
basicBpDataLength = 3,
sendBpData,
bindBpEvent;
uid = uid === 0 ? '' : uid;
window._ozuid = uid;//暴露ozuid
window._ozuid = uid; // 暴露ozuid
if (window._yas) {
window._yas(1 * new Date(), '1.0.15', 'yohobuy_m', uid, '', '');
... ... @@ -217,27 +216,32 @@ function reMarginFooter(fixedElement) {
jsonData = {
page: bpIdArr[0],
floor: bpIdArr[1],
data: bpIdArr[2]
data: /_[1|0]$/.test(bpIdArr.join('_')) ? bpIdArr[2] : bpIdArr.slice(2).join('_') //防止值字符串中有_导致的问题
};
window._yas.sendCustomInfo(jsonData, Boolean(parseInt(bpIdArr[3]) || 1));
if (window._yas.sendCustomInfo) {
window._yas.sendCustomInfo(jsonData, Boolean(parseInt(bpIdArr[3]) || 1));
}
}
};
// 绑定埋点点击事件
bindBpEvent = function() {
$(document).off('click').on('click', '.buriedpoint', function(e) {
$('.buriedpoint').off('click');
$(document).on('click', '.buriedpoint', function(e) {
var databpid = $(this).attr('data-bp-id') || '',
bpIdArr = databpid.split('_'),
hasParentBp = false;
bpIdArr = databpid.split('_');
var $target = $(e.target),
partentBpLength = $target.parents('.buriedpoint').length;
if ($(e.target).parents('.buriedpoint').length > 0) {
hasParentBp = true;
}
if (!hasParentBp && bpIdArr && bpIdArr.length >= basicBpDataLength) {
sendBpData(bpIdArr);
}
if ($target.hasClass('buriedpoint') && partentBpLength > 0 ||
partentBpLength >= 2) {
hasParentBp = true;
}
});
};
... ... @@ -250,7 +254,7 @@ function reMarginFooter(fixedElement) {
$(document).on('shouldSendBpData', function(e, dataPbId) {
var bpIdArr;
if (dataPbId && (dataPbId.length && dataPbId.length > 0)) {
if (dataPbId && dataPbId.length && dataPbId.length > 0) {
hasParentBp = false;
bpIdArr = dataPbId.split('_');
sendBpData(bpIdArr);
... ...
... ... @@ -46,6 +46,10 @@ module.exports = function(specificGender) {
'1,3' : '2,3',
url = '/product/recom/maylike?gender=' + gender;
}
//日韩馆-你可能喜欢的
if ($('.mobile-wrap').hasClass('yoho-channel-page')) {
url = '/product/recom/newPreference?template_id=' + $.queryString().template_id;
}
$curNav = $navList.children('.focus');
... ...
... ... @@ -29,8 +29,12 @@ function highlightMainItem() {
var $mainItem = $('.filter-body .classify');
$mainItem.on('touchstart', '.shower', function() {
var bpIdData = $(this).attr('data-bp-id') || '';
$mainItem.removeClass('highlight');
$(this).addClass('highlight');
$(document).trigger('shouldSendBpData', [bpIdData]);
}).on('touchend touchcancel', '.shower', function() {
$(this).removeClass('highlight');
});
... ...
... ... @@ -41,6 +41,7 @@ var navtabEle = document.getElementById('nav-tab'),
$('#feedback-content .consult-content').removeClass('hide');
}
$('.goods-consults .consult-item:lt(2)').removeClass('hide');
})();
if (navtabHammer) {
... ... @@ -91,8 +92,7 @@ if ($('.goods-consults-page').length > 0) {
if (readmoreHammer) {
readmoreHammer.on('tap', function() {
$('.readmore').hide();
$('.goods-consults.customer-consults').removeClass('customer-consults');
$('.goods-consults').find('.consult-item').removeClass('hide');
return false;
});
}
... ...
... ... @@ -68,6 +68,7 @@ $('#likeBtn').on('touchstart', function() {
$('#addtoCart').on('touchstart', function() {
$('.cart-bar').hide();
productCode && chosePanel.setLimitGoodModeWithSknId(productCode, skn);
chosePanel.show();
... ... @@ -81,3 +82,8 @@ $('#addtoCart').on('touchstart', function() {
return false;
});
$('#buyLimit').on('touchstart', function() {
tip.show('打开APP可抢购该商品哦~');
return false;
});
... ...
... ... @@ -600,7 +600,7 @@ $subNav.on('touchend touchcancel', function(e) {
nav,
navType,
$active;
var bpIdData = $(this).find('.buriedpoint').attr('data-bp-id') || '';
var bpIdData = $this.attr('data-bp-id') || '';
e.preventDefault();
$(document).trigger('shouldSendBpData', [bpIdData]);
... ...
... ... @@ -197,5 +197,9 @@
.clearfix{
margin-left: 30px;
}
.left-icon {
font-size: 24px;
}
}
}
\ No newline at end of file
... ...
... ... @@ -40,7 +40,6 @@
}
.owner-info {
border-bottom: 1px solid #e0e0e0;
line-height: 1.5;
}
.range{
... ... @@ -207,26 +206,23 @@
visibility: hidden;
.reason-box {
border-bottom: solid 1px #CCCCCC;
border-bottom: 1px solid #ccc;
font: inherit;
vertical-align: baseline;
position: absolute;
left: 50%;
top: 50%;
margin-left: -270px;
margin-top: -290px;
width: 540px;
height:580px;
bottom: 0;
width: 100%;
height: 380px;
color: #444;
background: #fff;
border-radius: 10px;
padding-bottom: 20px;
.box-head {
height: 60px;
line-height: 60px;
text-align: right;
font-size: 36px;
font-size: 24px;
background: rgb(240, 240, 240);
padding-right: 30px;
}
... ... @@ -234,15 +230,17 @@
.box-main {
background: #FFFFFF;
padding: 20px;
height:480px;
height:300px;
.active-mask {
width: 500px;
height: 60px;
position: absolute;
left: 50%;
top: 50%;
margin-top: -44px;
height: 88px;
margin-top: -18px;
margin-left: -250px;
z-index: 8;
width: 500px;
background: rgba(255, 255, 255, 0.1);
border-bottom: 1px solid rgb(223,224,224);
border-top: 1px solid rgb(223,224,224);
... ... @@ -253,18 +251,16 @@
text-align: center;
background: #FFF;
color: rgba(0, 0, 0, .5);
font-size: 38px;
font-size: 28px;
}
.swiper-slide-active {
padding-top: 0;
font-style: normal;
font-size: 38px;
color: rgb(0,0,0);
line-height: 78px;
font-size: 32px;
color: rgb(0, 0, 0);
line-height: 58px;
}
}
}
... ...
... ... @@ -12,19 +12,15 @@
visibility: hidden;
.reason-box {
border-bottom: solid 1px #CCCCCC;
border-bottom: 1px solid #ccc;
font: inherit;
vertical-align: baseline;
position: absolute;
left: 50%;
top: 50%;
margin-left: -270px;
margin-top: -290px;
width: 540px;
height:580px;
bottom: 0;
width: 100%;
height: 380px;
color: #444;
background: #fff;
border-radius: 10px;
padding-bottom: 20px;
.box-head {
... ... @@ -39,15 +35,17 @@
.box-main {
background: #FFFFFF;
padding: 20px;
height:480px;
height:300px;
.active-mask {
width: 500px;
height: 60px;
position: absolute;
left: 50%;
top: 50%;
margin-top: -44px;
height: 88px;
margin-top: -18px;
margin-left: -250px;
z-index: 8;
width: 500px;
background: rgba(255, 255, 255, 0.1);
border-bottom: 1px solid rgb(223,224,224);
border-top: 1px solid rgb(223,224,224);
... ... @@ -58,15 +56,15 @@
text-align: center;
background: #FFF;
color: rgba(0, 0, 0, .5);
font-size: 38px;
font-size: 28px;
}
.swiper-slide-active {
padding-top: 0;
font-style: normal;
font-size: 38px;
color: rgb(0,0,0);
line-height: 78px;
font-size: 32px;
color: rgb(0, 0, 0);
line-height: 58px;
}
}
}
... ...
... ... @@ -68,12 +68,13 @@
text-overflow: ellipsis;
white-space: nowrap;
}
.brand-name {
width: 60%;
font-size: 28px;
width: 40%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
position: absolute;
}
.brand-thumb {
... ... @@ -85,7 +86,6 @@
}
.entry {
width: 150px;
color: #999;
font-size: 28px;
float: right;
... ...
... ... @@ -14,6 +14,7 @@
.shop-back-img {
height: 100%;
width: 100%;
}
}
... ...
... ... @@ -32,23 +32,24 @@
</div>
{{/if}}
<div class="history-search local-search">
<h3><span class="iconfont">&#xe64a;</span>最近搜索
<h3><span class="iconfont left-icon">&#xe64a;</span>最近搜索
<button id="clear-history" class="clear-icon iconfont">&#xe64c;</button>
</h3>
<ul class="history clearfix local-history">
</ul>
</div>
<div class="hot-search">
<h3><span class="iconfont">&#xe64b;</span>热门搜索</h3>
<ul class="hot clearfix">
{{# hot}}
<li>
<a href="{{url}}" brandName="{{name}}"">{{name}}</a>
</li>
{{/ hot}}
</ul>
</div>
{{#if hot}}
<div class="hot-search">
<h3><span class="iconfont left-icon">&#xe64b;</span>热门搜索</h3>
<ul class="hot clearfix">
{{# hot}}
<li>
<a href="{{url}}" brandName="{{name}}"">{{name}}</a>
</li>
{{/ hot}}
</ul>
</div>
{{/if}}
</div>
</div>
... ...
... ... @@ -38,10 +38,10 @@
</div>
<div id="load-more-info" class="load-more-info">
<div class="loading status">
<div class="loading status hide">
正在加载...
</div>
<span class="no-more status hide">没有更多啦</span>
<span class="no-more status">没有更多啦</span>
</div>
<input id="gender" type="hidden" value={{gender}}>
{{/ guang}}
... ...
... ... @@ -20,10 +20,10 @@
</div>
<div id="load-more-info" class="load-more-info">
<div class="loading status">
<div class="loading status hide">
正在加载...
</div>
<span class="no-more status hide">没有更多啦</span>
<span class="no-more status">没有更多啦</span>
</div>
{{#if tag}}
... ...
... ... @@ -8,7 +8,7 @@
{{# consults}}
<div class="goods-consults customer-consults" id="goods-consults">
{{#list}}
<div class="consult-item" data-id="{{id}}">
<div class="consult-item hide" data-id="{{id}}">
<div class="question">
<span class="iconfont">&#xe644;</span>
<p>
... ...
... ... @@ -152,7 +152,7 @@
{{/if}}
{{#if canBuyLimit}}
<a href="javascript:;" id="addtoCart" class="addto-cart">立即购买</a>
<a href="javascript:;" id="buyLimit" class="addto-cart">立即购买</a>
{{/if}}
{{#if noLimitCode}}
... ...
... ... @@ -91,7 +91,7 @@
<div class="popularity-title">
人气单品
<a class="more" href="{{more_url}}">&#xe618;</a>
<a class="more buriedpoint" href="{{more_url}}" data-bp-id="shop_popularity_{{more_url}}">&#xe618;</a>
</div>
<ul class="product-list">
... ...
... ... @@ -3,14 +3,14 @@
<div class="filter-body">
<ul class="classify">
{{#each classify}}
<li class="buriedpoint classify-item{{#if @first}} active{{/if}}" data-bp-id="filter_classify_{{name}}_1">
<p class="shower{{#if default}} default{{/if}}">
<li class="classify-item{{#if @first}} active{{/if}}">
<p class="buriedpoint shower{{#if default}} default{{/if}}" data-bp-id="filter_classify_{{title}}_1">
<span class="title">{{title}}:</span>
{{name}}
</p>
<ul class="sub-classify" data-type={{dataType}}>
{{# subs}}
<li class="buriedpoint sub-item{{#if chosed}} chosed{{/if}}" data-id={{dataId}} data-bp-id="filter_subclassify_{{name}}_1">
<li class="buriedpoint sub-item{{#if chosed}} chosed{{/if}}" data-id="{{dataId}}" data-bp-id="filter_subclassify_{{name}}_1">
{{name}}
<i class="iconfont chosed-icon">&#xe617;</i>
</li>
... ...
... ... @@ -17,7 +17,7 @@
<img class="brand-thumb" src={{thumb}}>
<span class="brand-name">{{name}}</span>
<span class="entry">
进入品牌
进入店铺
<i class="iconfont">&#xe614;</i>
</span>
</a>
... ...
... ... @@ -295,8 +295,11 @@ class UserModel
$brand['brandName'] = $val['brand_name'];
$brand['update'] = $val['new_product_num'];
$brand['discount'] = $val['product_discount_num'];
$brand['link'] = Helpers::url('', array(), $val['brand_domain']);
if ($val['brandOrShopType'] == 'brandOrShopType') {
$brand['link'] = Helpers::url('/product/index/brand', array('shop_id' => $val['shop_id']));
} else {
$brand['link'] = Helpers::url('', array(), $val['brand_domain']);
}
// 处理品牌产品
$product = array();
foreach ($val['new_product'] as $one) {
... ...
... ... @@ -61,7 +61,7 @@ class InfoController extends AbstractAction
//guang双头部的问题 20160601
$authorTmp = explode("?id=", $detail['getAuthor']['url']);
$authorId=$authorTmp[1];
$data['guang']['author']['url'] = Helpers::getUrlSafe($detail['getAuthor']['url']) .'&openby:yohobuy={"action":"go.h5","params":{"param":{"id":"' . $authorId . '"},"share":"","id":' .$authorId . ',"type":0,"islogin":"N","url":"'.'https:'.Helpers::url('/author/index', array(), 'guang').'"}}';
$data['guang']['author']['url'] = Helpers::getUrlSafe($detail['getAuthor']['url']) .'&openby:yohobuy={"action":"go.h5","params":{"param":{"id":"' . $authorId . '"},"share":"","id":' .$authorId . ',"type":0,"islogin":"N","url":"'.'http:'.Helpers::url('/author/index', array(), 'guang').'"}}';
}
$data['detail'] = array();
... ...
... ... @@ -4,6 +4,7 @@ use Action\AbstractAction;
use LibModels\Wap\Guang\PlusstarData;
use Plugin\Helpers;
use Plugin\Images;
use Plugin\UdpLog;
/**
* 明星品牌和原创品牌
... ... @@ -119,6 +120,7 @@ class PlusstarController extends AbstractAction
} catch (\Exception $e) {
// do nothing
}
UdpLog::info('==$brandInfo==', $brandInfo);
if (empty($brandInfo['getBrandInfo']['data']['brand_id'])) {
break;
}
... ... @@ -164,7 +166,16 @@ class PlusstarController extends AbstractAction
// 相关文章
foreach ($brandInfo['getArticleByBrand'] as $value) {
$result = Helpers::formatArticle($value, false, $isApp, false, $uid);
$result = Helpers::formatArticle($value, false, false, false, $uid);
// $result = array(
// 'id' => $value['id'],
// 'url' => $value['id'],
// 'title' => $value['id'],
// 'pageView' => $value['id'],
// 'img' => $value['src'],
// 'text' => $value['intro'],
// 'publishTime' => $value['publish_time']
// );
if (!$isApp) {
$result['like'] = $value['like'];
}
... ...
... ... @@ -163,5 +163,47 @@ class RecomController extends AbstractAction
$this->_view->display('maylikelife', $data);
}
/**
* 日韩馆-你可能喜欢的
*/
public function newPreferenceAction()
{
$data = array();
do {
/* 判断是否是AJAX请求 */
if (!$this->isAjax()) {
break;
}
//模板id
$templateId = $this->get('template_id', 0);
/* 创意生活只有一页数据 */
$page = intval($this->get('page', 1));
if (empty($page) || empty($templateId)) {
break;
}
/* 取可能喜欢的数据 */
$recom = RecomData::newPreference($templateId, '', $page);
/* 构建人气单品数据 */
if (empty($recom) || empty($recom['data']['product_list'])) {
break;
}
$data = array();
$build = array();
$build['show'] = true;
foreach ($recom['data']['product_list'] as $value) {
$build['goods'][] = Helpers::formatProduct($value, true, false, false);
}
$data['goodsContainer'][] = $build;
} while (false);
$this->_view->display('maylikelife', $data);
}
}
... ...