Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
hf
9 years ago
Commit
bb301085fb858e7d6017ed57ff2ab0850fcc4bb9
1 parent
7f0c268f
modify guang detail page to support app
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
247 additions
and
122 deletions
library/Action/AbstractAction.php
library/LibModels/Wap/Guang/DetailData.php
library/LibModels/Wap/Guang/ListData.php
library/Plugin/Helpers.php
library/Plugin/TemplateLayout.php
static/js/guang/list.js
template/m.yohobuy.com/actions/guang/index/list.phtml
template/m.yohobuy.com/partials/layout/header.phtml
yohobuy/m.yohobuy.com/application/modules/Guang/controllers/Index.php
yohobuy/m.yohobuy.com/application/modules/Guang/controllers/Info.php
yohobuy/m.yohobuy.com/configs/application.developer.ini
yohobuy/m.yohobuy.com/configs/application.production.ini
yohobuy/m.yohobuy.com/configs/application.testing.ini
yohobuy/m.yohobuy.com/configs/routes.index.ini
yohobuy/m.yohobuy.com/configs/routes.product.ini
library/Action/AbstractAction.php
View file @
bb30108
...
...
@@ -304,7 +304,7 @@ class AbstractAction extends Controller_Abstract
*/
protected
function
setDescription
(
$description
)
{
$this
->
_view
->
assign
(
'description'
,
$description
);
$this
->
_view
->
assign
(
'description'
,
$description
.
' '
);
}
/**
...
...
library/LibModels/Wap/Guang/DetailData.php
View file @
bb30108
...
...
@@ -20,8 +20,12 @@ class DetailData
/**
* 逛资讯详情页数据封装
*
* @param int $id 内容ID
* @param bool $isApp 标识是否是APP访问
* @return array
*/
public
static
function
package
(
$id
)
public
static
function
package
(
$id
,
$isApp
=
false
)
{
$result
=
array
();
$result
[
'getAuthor'
]
=
array
();
...
...
@@ -30,8 +34,11 @@ class DetailData
$result
[
'getBrand'
]
=
array
();
$result
[
'getOtherArticle'
]
=
array
();
// 客户端类型
$clientType
=
$isApp
?
'iphone'
:
'h5'
;
// 获取资讯
$article
=
Yohobuy
::
yarClient
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_PACKAGE_ARTICLE
,
'getArticle'
,
array
(
$id
));
$article
=
Yohobuy
::
yarClient
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_PACKAGE_ARTICLE
,
'getArticle'
,
array
(
$id
,
$clientType
));
if
(
!
isset
(
$article
[
'tag'
]))
{
return
$result
;
}
...
...
@@ -40,22 +47,22 @@ class DetailData
}
// 获取作者信息
Yohobuy
::
yarConcurrentCall
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_PACKAGE_AUTHOR
,
'getAuthor'
,
array
(
$article
[
'author_id'
]),
function
(
$retval
)
use
(
&
$result
)
{
Yohobuy
::
yarConcurrentCall
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_PACKAGE_AUTHOR
,
'getAuthor'
,
array
(
$article
[
'author_id'
]
,
$clientType
),
function
(
$retval
)
use
(
&
$result
)
{
$result
[
'getAuthor'
]
=
empty
(
$retval
)
?
array
()
:
$retval
;
});
// 获取资讯内容
Yohobuy
::
yarConcurrentCall
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_PACKAGE_ARTICLE
,
'getArticleContent'
,
array
(
$id
),
function
(
$retval
)
use
(
&
$result
)
{
Yohobuy
::
yarConcurrentCall
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_PACKAGE_ARTICLE
,
'getArticleContent'
,
array
(
$id
,
$clientType
),
function
(
$retval
)
use
(
&
$result
)
{
$result
[
'getArticleContent'
]
=
empty
(
$retval
)
?
array
()
:
$retval
;
});
// 获取资讯相关的品牌
Yohobuy
::
yarConcurrentCall
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_PACKAGE_ARTICLE
,
'getBrand'
,
array
(
$id
),
function
(
$retval
)
use
(
&
$result
)
{
Yohobuy
::
yarConcurrentCall
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_PACKAGE_ARTICLE
,
'getBrand'
,
array
(
$id
,
$clientType
),
function
(
$retval
)
use
(
&
$result
)
{
$result
[
'getBrand'
]
=
empty
(
$retval
)
?
array
()
:
$retval
;
});
// 获取资讯相关的其它资讯
Yohobuy
::
yarConcurrentCall
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_PACKAGE_ARTICLE
,
'getOtherArticle'
,
array
(
$article
[
'tag'
],
$id
,
0
,
3
),
function
(
$retval
)
use
(
&
$result
)
{
Yohobuy
::
yarConcurrentCall
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_PACKAGE_ARTICLE
,
'getOtherArticle'
,
array
(
$article
[
'tag'
],
$id
,
0
,
3
,
$clientType
),
function
(
$retval
)
use
(
&
$result
)
{
$result
[
'getOtherArticle'
]
=
empty
(
$retval
)
?
array
()
:
$retval
;
});
...
...
library/LibModels/Wap/Guang/ListData.php
View file @
bb30108
...
...
@@ -58,7 +58,7 @@ class ListData
if
(
isset
(
$sortId
))
{
$param
[
'sort_id'
]
=
$sortId
;
}
if
(
isset
(
$tag
))
{
if
(
!
empty
(
$tag
))
{
$param
[
'tag'
]
=
$tag
;
}
if
(
isset
(
$authorId
)
&&
is_numeric
(
$authorId
))
{
...
...
@@ -110,7 +110,7 @@ class ListData
$result
=
array
();
if
(
is_numeric
(
$id
))
{
$result
=
Yohobuy
::
yarClient
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_AUTHOR
,
'getAuthor'
,
array
(
$id
)
);
$result
=
Yohobuy
::
yarClient
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_AUTHOR
,
'getAuthor'
,
array
(
$id
)
,
3600
);
// 缓存1小时
}
return
$result
;
...
...
library/Plugin/Helpers.php
View file @
bb30108
...
...
@@ -35,7 +35,7 @@ class Helpers
case
'index'
:
// 默认
$url
=
''
;
break
;
default
:
default
:
// 其它子域名
$url
=
'http://'
.
$module
.
SUB_DOMAIN
;
}
$url
.=
$uri
;
...
...
@@ -48,6 +48,7 @@ class Helpers
/**
* 根据尺寸获得图片url
*
* @param string $url 路径
* @param integer $width 图片宽度
* @param integer $height 图片高度
...
...
@@ -60,7 +61,7 @@ class Helpers
}
/**
* 获取过滤后的URL链接
* 获取过滤
APP里附加参数
后的URL链接
*
* @param string $url 路径
* @return string 去除掉如&openby:yohobuy={"action":"go.brand"}这样的APP附加参数
...
...
@@ -117,6 +118,31 @@ class Helpers
}
/**
* 获取商品的ICON
*
* @param int $type
* @return array
*/
public
static
function
getProductIcon
(
$type
)
{
static
$icons
=
array
(
1
=>
'cloth'
,
3
=>
'pants'
,
4
=>
'dress'
,
6
=>
'shoe'
,
7
=>
'bag'
,
10
=>
'lamp'
,
241
=>
'headset'
,
8
=>
'watch'
,
360
=>
'swim-suit'
,
308
=>
'under'
);
$type
=
intval
(
$type
);
return
isset
(
$icons
[
$type
])
?
$icons
[
$type
]
:
''
;
}
/**
* 格式化商品信息
*
* @param array $productData 需要格式化的商品数据
...
...
@@ -127,7 +153,6 @@ class Helpers
*/
public
static
function
formatProduct
(
$productData
,
$showTags
=
true
,
$showNew
=
true
,
$showSale
=
true
)
{
// 商品信息有问题,则不显示
if
(
!
isset
(
$productData
[
'product_skn'
])
||
!
isset
(
$productData
[
'goods_list'
][
0
]))
{
return
false
;
...
...
@@ -152,9 +177,9 @@ class Helpers
$result
[
'price'
]
=
$productData
[
'market_price'
];
$result
[
'salePrice'
]
=
$productData
[
'sales_price'
];
$result
[
'is_soon_sold_out'
]
=
(
$productData
[
'is_soon_sold_out'
]
===
'Y'
);
$result
[
'url'
]
=
OLD_MAIN
.
'/product/pro_'
.
$productData
[
'product_id'
]
.
'_'
.
$productData
[
'goods_list'
][
0
][
'goods_id'
]
.
'/'
.
$productData
[
'cn_alphabet'
]
.
'.html'
;
$result
[
'url'
]
=
OLD_MAIN
.
'/product/pro_'
.
$productData
[
'product_id'
]
.
'_'
.
$productData
[
'goods_list'
][
0
][
'goods_id'
]
.
'/'
.
$productData
[
'cn_alphabet'
]
.
'.html'
;
if
(
$showTags
)
{
$result
[
'tags'
]
=
array
();
...
...
@@ -190,7 +215,7 @@ class Helpers
$result
[
'id'
]
=
$articleData
[
'id'
];
$result
[
'showTags'
]
=
$showTag
;
$result
[
'img'
]
=
self
::
getImageUrl
(
$articleData
[
'src'
],
640
,
640
);
$result
[
'url'
]
=
$isApp
&&
!
empty
(
$articleData
[
'url'
])
?
$articleData
[
'url'
]
:
'/info/index?id='
.
$articleData
[
'id'
]
;
$result
[
'url'
]
=
$isApp
?
$articleData
[
'url'
]
:
self
::
url
(
'/info/index'
,
array
(
'id'
=>
$articleData
[
'id'
]),
'guang'
)
;
$result
[
'title'
]
=
$articleData
[
'title'
];
$result
[
'text'
]
=
$articleData
[
'intro'
];
$result
[
'publishTime'
]
=
$articleData
[
'publish_time'
];
...
...
@@ -402,29 +427,4 @@ class Helpers
return
false
;
}
/**
* 获取商品的ICON
*
* @param int $type
* @return array
*/
public
static
function
getProductIcon
(
$type
)
{
static
$icons
=
array
(
1
=>
'cloth'
,
3
=>
'pants'
,
4
=>
'dress'
,
6
=>
'shoe'
,
7
=>
'bag'
,
10
=>
'lamp'
,
241
=>
'headset'
,
8
=>
'watch'
,
360
=>
'swim-suit'
,
308
=>
'under'
);
$type
=
intval
(
$type
);
return
isset
(
$icons
[
$type
])
?
$icons
[
$type
]
:
''
;
}
}
...
...
library/Plugin/TemplateLayout.php
View file @
bb30108
...
...
@@ -20,6 +20,7 @@ use Plugin\LightnCandy;
class
TemplateLayout
implements
View_Interface
{
/* 模板变量 */
protected
$_tpl_vars
;
/* 模板目录 */
protected
$_tpl_dir
;
...
...
@@ -49,7 +50,7 @@ class TemplateLayout implements View_Interface
// 清空指定的变更值
if
(
isset
(
$this
->
_tpl_vars
[
$name
]))
{
unset
(
$this
->
_tpl_vars
[
$name
]);
}
}
// 清空整个变量值
else
{
$this
->
_tpl_vars
=
array
();
...
...
@@ -118,6 +119,23 @@ class TemplateLayout implements View_Interface
// 应用版本号
$tpl_vars
[
'version'
]
=
$config
->
version
;
// SEO相关的标题、关键词、描述内容信息
if
(
isset
(
$tpl_vars
[
'title'
]))
{
$tpl_vars
[
'title'
]
.=
$config
->
seo
->
title
;
}
else
{
$tpl_vars
[
'title'
]
=
$config
->
seo
->
title
;
}
if
(
isset
(
$tpl_vars
[
'keywords'
]))
{
$tpl_vars
[
'keywords'
]
.=
$config
->
seo
->
keywords
;
}
else
{
$tpl_vars
[
'keywords'
]
=
$config
->
seo
->
keywords
;
}
if
(
isset
(
$tpl_vars
[
'description'
]))
{
$tpl_vars
[
'description'
]
.=
$config
->
seo
->
description
;
}
else
{
$tpl_vars
[
'description'
]
=
$config
->
seo
->
description
;
}
// 取得模板的最后修改时间戳
$lastModifyTime
=
filemtime
(
$viewName
);
// 使用MD5生成唯一的键名
...
...
@@ -136,11 +154,11 @@ class TemplateLayout implements View_Interface
else
{
$template
=
file_get_contents
(
$viewName
,
false
,
null
);
$phpStr
=
LightnCandy
::
compile
(
$template
,
array
(
// DEBUG: LightnCandy::FLAG_RENDER_DEBUG | LightnCandy::FLAG_ERROR_EXCEPTION
'flags'
=>
LightnCandy
::
FLAG_RENDER_DEBUG
|
LightnCandy
::
FLAG_ERROR_EXCEPTION
|
LightnCandy
::
FLAG_MUSTACHE
|
LightnCandy
::
FLAG_HANDLEBARS
,
// 使用MUSTACHE和HANDLEBARS的模板格式
'basedir'
=>
array
(
$config
->
template
->
partials
),
// 模板里使用 {{> partial_name}} 时查找的目录
'fileext'
=>
array
(
$tplExt
),
// 允许查找文件的后缀
'lcrun'
=>
'Plugin\LCRun3'
,
// 指定编译模板的runtime
// DEBUG: LightnCandy::FLAG_RENDER_DEBUG | LightnCandy::FLAG_ERROR_EXCEPTION
'flags'
=>
LightnCandy
::
FLAG_RENDER_DEBUG
|
LightnCandy
::
FLAG_ERROR_EXCEPTION
|
LightnCandy
::
FLAG_MUSTACHE
|
LightnCandy
::
FLAG_HANDLEBARS
,
// 使用MUSTACHE和HANDLEBARS的模板格式
'basedir'
=>
array
(
$config
->
template
->
partials
),
// 模板里使用 {{> partial_name}} 时查找的目录
'fileext'
=>
array
(
$tplExt
),
// 允许查找文件的后缀
'lcrun'
=>
'Plugin\LCRun3'
,
// 指定编译模板的runtime
));
// 文件流方式读取PHP方法
$renderer
=
LightnCandy
::
prepare
(
$phpStr
);
...
...
@@ -151,8 +169,7 @@ class TemplateLayout implements View_Interface
// 装载内容,调用PHP函数
try
{
$result
=
$renderer
(
$tpl_vars
);
}
catch
(
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
$result
=
''
;
}
...
...
@@ -227,12 +244,12 @@ class TemplateLayout implements View_Interface
public
function
setScriptPath
(
$path
)
{
$result
=
false
;
if
(
is_dir
(
$path
))
{
$this
->
_tpl_dir
=
$path
;
$result
=
true
;
}
return
$result
;
}
...
...
static/js/guang/list.js
View file @
bb30108
...
...
@@ -14,9 +14,11 @@ var winH = $(window).height(),
var
$author
=
$
(
'#author-infos'
);
var
$tag
=
$
(
'#tag'
);
var
$gender
=
$
(
'#gender'
);
var
$isApp
=
$
(
'#isApp'
);
var
setting
=
{
page
:
1
,
page
:
2
,
end
:
false
};
...
...
@@ -32,7 +34,9 @@ if ($author.length > 0) {
if
(
$tag
.
length
>
0
)
{
$
.
extend
(
setting
,
{
tag
:
$tag
.
val
()
tag
:
$tag
.
val
(),
gender
:
$gender
.
val
(),
isApp
:
$isApp
.
val
()
});
}
...
...
template/m.yohobuy.com/actions/guang/index/list.phtml
View file @
bb30108
{
{>
layout/header
}
}
<div
class=
"guang-list-page guang-page yoho-page"
>
{
{#
guang
}
}
{
{#
author
}
}
<div
id=
"author-infos"
class=
"editor-header clearfix"
data-id=
{
{id
}
}>
<div
class=
"avatar"
>
<img
src=
"{{avatar}}"
>
</div>
<div
class=
"text"
>
<p
class=
"name"
>
{
{name
}
}</p>
<p
class=
"info"
>
{
{info
}
}</p>
</div>
</div>
{
{/
author
}
}
<div
id=
"info-list"
class=
"info-list"
>
{
{#
infos
}
}
{
{>
guang/info
}
}
{
{/
infos
}
}
{
{#
guang
}
}
{
{#
author
}
}
<div
id=
"author-infos"
class=
"editor-header clearfix"
data-id=
{
{id
}
}>
<div
class=
"avatar"
>
<img
src=
"{{avatar}}"
>
</div>
<div
class=
"text"
>
<p
class=
"name"
>
{
{name
}
}</p>
<p
class=
"info"
>
{
{info
}
}</p>
</div>
</div>
{
{/
author
}
}
<div
id=
"info-list"
class=
"info-list"
>
{
{#
infos
}
}
{
{>
guang/info
}
}
{
{/
infos
}
}
</div>
<div
id=
"load-more-info"
class=
"load-more-info"
>
<div
class=
"loading status"
>
正在加载...
</div>
<span
class=
"no-more status hide"
>没有更多啦</span>
<div
id=
"load-more-info"
class=
"load-more-info"
>
<div
class=
"loading status"
>
正在加载...
</div>
{
{#if
tag
}
}
<input
id=
"tag"
type=
"hidden"
value=
{
{tag
}
}>
{
{/if
}
}
{
{/
guang
}
}
<span
class=
"no-more status hide"
>没有更多啦</span>
</div>
{
{#if
tag
}
}
<input
id=
"tag"
type=
"hidden"
value=
{
{tag
}
}>
{
{/if
}
}
{
{#if
gender
}
}
<input
id=
"gender"
type=
"hidden"
value=
{
{gender
}
}>
{
{/if
}
}
{
{#if
isApp
}
}
<input
id=
"isApp"
type=
"hidden"
value=
{
{isApp
}
}>
{
{/if
}
}
{
{/
guang
}
}
</div>
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/layout/header.phtml
View file @
bb30108
...
...
@@ -2,9 +2,9 @@
<html>
<head>
<meta
charset=
"utf-8"
>
<title>
{{title}}Yoho!Buy有货
</title>
<meta
name=
"keywords"
content=
"{{keywords}}Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"
>
<meta
name=
"description"
content=
"{{description}}YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"
>
<title>
{{title}}
</title>
<meta
name=
"keywords"
content=
"{{keywords}}"
>
<meta
name=
"description"
content=
"{{description}}"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
>
<meta
http-equiv=
"cleartype"
content=
"on"
>
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black"
/>
...
...
yohobuy/m.yohobuy.com/application/modules/Guang/controllers/Index.php
View file @
bb30108
...
...
@@ -23,9 +23,13 @@ class IndexController extends AbstractAction
$uid
=
$this
->
getUid
();
$udid
=
$this
->
getUdid
();
$type
=
$this
->
get
(
'id'
,
0
);
$gender
=
rawurldecode
(
$this
->
get
(
'gender'
,
'1,2,3'
));
$type
=
$this
->
get
(
'id'
,
0
);
$gender
=
$this
->
get
(
'gender'
,
'1,2,3'
);
if
(
is_string
(
$gender
))
{
$gender
=
rawurldecode
(
$gender
);
}
// // 设置侧边栏逛的默认选中状态
// if ($gender === '1,3') {
// $this->setNavSide('boys');
...
...
@@ -51,19 +55,36 @@ class IndexController extends AbstractAction
$tag
=
$this
->
get
(
'query'
);
$channel
=
$this
->
get
(
'yh_channel'
);
// 标识是不是APP客户端
$isApp
=
is_numeric
(
$channel
);
// APP访问时通过频道参数判断性别
if
(
$isApp
)
{
switch
(
intval
(
$channel
))
{
case
1
:
// 男
$gender
=
'1,3'
;
break
;
case
2
:
// 女
$gender
=
'2,3'
;
break
;
default
:
// 所有
$gender
=
'1,2,3'
;
}
}
// 从Cookie获取
else
{
$gender
=
Helpers
::
getGenderByCookie
();
$this
->
setNavHeader
(
$tag
,
true
,
SITE_MAIN
);
}
// 标签聚合内容列表
$article
=
ListData
::
article
(
''
,
0
,
$uid
,
$udid
,
1
,
$tag
);
$article
=
ListData
::
article
(
$gender
,
0
,
$uid
,
$udid
,
1
,
$tag
);
// 标签聚合内容不存在, 跳到错误页面
if
(
empty
(
$article
[
'data'
][
'list'
][
'artList'
]))
{
$this
->
error
();
}
// 标识是不是APP客户端
$isApp
=
isset
(
$channel
);
$this
->
setTitle
(
$tag
);
if
(
!
$isApp
)
{
$this
->
setNavHeader
(
$tag
,
true
,
SITE_MAIN
);
}
$data
=
array
();
// 模板中使用JS的标识
...
...
@@ -78,6 +99,8 @@ class IndexController extends AbstractAction
// 分页需要的参数
$data
[
'guang'
][
'tag'
]
=
$tag
;
$data
[
'guang'
][
'gender'
]
=
$gender
;
$data
[
'guang'
][
'isApp'
]
=
$isApp
?
1
:
0
;
$this
->
_view
->
display
(
'list'
,
$data
);
}
...
...
@@ -99,14 +122,31 @@ class IndexController extends AbstractAction
if
(
!
isset
(
$author
[
'name'
]))
{
$this
->
error
();
}
// 标识是不是APP客户端
$isApp
=
isset
(
$channel
);
$this
->
setTitle
(
'编辑简介'
);
if
(
!
$isApp
)
{
$isApp
=
is_numeric
(
$channel
);
// APP访问时通过频道参数判断性别
if
(
$isApp
)
{
switch
(
intval
(
$channel
))
{
case
1
:
// 男
$gender
=
'1,3'
;
break
;
case
2
:
// 女
$gender
=
'2,3'
;
break
;
default
:
// 所有
$gender
=
'1,2,3'
;
}
}
// 从Cookie获取
else
{
$gender
=
Helpers
::
getGenderByCookie
();
$this
->
setNavHeader
(
'编辑简介'
,
true
,
SITE_MAIN
);
}
$this
->
setTitle
(
'编辑简介'
);
$uid
=
$this
->
getUid
();
$udid
=
$this
->
getUdid
();
...
...
@@ -122,15 +162,18 @@ class IndexController extends AbstractAction
$data
[
'author'
][
'id'
]
=
$id
;
// 标签聚合内容列表
$article
=
ListData
::
article
(
''
,
0
,
$uid
,
$udid
,
1
,
null
,
$id
);
$article
=
ListData
::
article
(
$gender
,
0
,
$uid
,
$udid
,
1
,
null
,
$id
);
// 构建资讯文章内容
if
(
!
empty
(
$article
[
'data'
][
'list'
][
'artList'
]))
{
$build
=
array
();
foreach
(
$article
[
'data'
][
'list'
][
'artList'
]
as
$article
)
{
$build
[]
=
Helpers
::
formatArticle
(
$article
,
true
,
false
,
false
);
$build
[]
=
Helpers
::
formatArticle
(
$article
,
true
,
$isApp
,
false
);
}
$data
[
'guang'
][
'infos'
]
=
$build
;
}
$data
[
'guang'
][
'gender'
]
=
$gender
;
$data
[
'guang'
][
'isApp'
]
=
$isApp
?
1
:
0
;
$this
->
_view
->
display
(
'list'
,
$data
);
}
...
...
@@ -161,6 +204,7 @@ class IndexController extends AbstractAction
$page
=
$this
->
get
(
'page'
);
$gender
=
$this
->
get
(
'gender'
);
$authorId
=
$this
->
get
(
'authorId'
);
$isApp
=
$this
->
get
(
'isApp'
,
false
);
$showAuthor
=
true
;
if
(
!
empty
(
$sortId
)
&&
!
is_numeric
(
$sortId
))
{
break
;
...
...
@@ -185,7 +229,7 @@ class IndexController extends AbstractAction
$data
=
array
();
$build
=
array
();
foreach
(
$article
[
'data'
][
'list'
][
'artList'
]
as
$article
)
{
$build
[]
=
Helpers
::
formatArticle
(
$article
,
true
,
false
,
$showAuthor
);
$build
[]
=
Helpers
::
formatArticle
(
$article
,
true
,
$isApp
,
$showAuthor
);
}
$data
[
'infos'
]
=
$build
;
...
...
yohobuy/m.yohobuy.com/application/modules/Guang/controllers/Info.php
View file @
bb30108
...
...
@@ -19,34 +19,36 @@ class InfoController extends AbstractAction
public
function
indexAction
()
{
$id
=
$this
->
get
(
'id'
);
// 判断参数是否有效, 无效会跳转到错误页面
if
(
!
is_numeric
(
$id
))
{
$this
->
error
();
}
// 标识是不是APP访问的
$isApp
=
null
!==
$this
->
get
(
'app_version'
,
null
);
// 获取详情内容信息, 异常则跳到错误页面
$detail
=
DetailData
::
package
(
$id
);
$detail
=
DetailData
::
package
(
$id
,
$isApp
);
if
(
empty
(
$detail
[
'getArticle'
]))
{
$this
->
error
();
}
// WAP上设置头部导航
if
(
null
===
$this
->
get
(
'openby:yohobuy'
,
null
)
)
{
if
(
!
$isApp
)
{
$this
->
setNavHeader
(
'逛'
,
true
,
SITE_MAIN
);
}
$data
=
array
();
$data
[
'guangDetail'
]
=
true
;
// 模板中使用JS的标识
$data
[
'guang'
][
'id'
]
=
$id
;
// 作者信息数据
if
(
isset
(
$detail
[
'getAuthor'
][
'name'
]))
{
$data
[
'guang'
][
'author'
]
=
array
();
$data
[
'guang'
][
'author'
][
'avatar'
]
=
$detail
[
'getAuthor'
][
'avatar'
];
$data
[
'guang'
][
'author'
][
'name'
]
=
$detail
[
'getAuthor'
][
'name'
];
$data
[
'guang'
][
'author'
][
'intro'
]
=
$detail
[
'getAuthor'
][
'author_desc'
];
$data
[
'guang'
][
'author'
][
'url'
]
=
Helpers
::
url
(
'/author/index'
,
array
(
'id'
=>
$detail
[
'getArticle'
][
'author_id'
]),
'guang'
);
$data
[
'guang'
][
'author'
][
'url'
]
=
$isApp
?
$detail
[
'getAuthor'
][
'url'
]
:
Helpers
::
url
(
'/author/index'
,
array
(
'id'
=>
$detail
[
'getArticle'
][
'author_id'
]),
'guang'
);
}
$data
[
'detail'
]
=
array
();
...
...
@@ -54,7 +56,7 @@ class InfoController extends AbstractAction
$data
[
'detail'
][
'publishTime'
]
=
$detail
[
'getArticle'
][
'publishTime'
];
$data
[
'detail'
][
'pageView'
]
=
$detail
[
'getArticle'
][
'pageViews'
];
$data
[
'detail'
][
'content'
]
=
array
();
if
(
!
empty
(
$detail
[
'getArticleContent'
]))
{
$build
=
array
();
$good
=
array
();
...
...
@@ -66,12 +68,11 @@ class InfoController extends AbstractAction
// 文字
if
(
isset
(
$value
[
'text'
]))
{
$build
[
'text'
]
=
$value
[
'text'
][
'data'
][
'text'
];
}
}
// 单张图
elseif
(
isset
(
$value
[
'singleImage'
]))
{
$build
[
'bigImage'
]
=
Helpers
::
getImageUrl
(
$value
[
'singleImage'
][
'data'
][
0
][
'src'
],
640
,
640
);
}
elseif
(
isset
(
$value
[
'smallPic'
]))
{
}
elseif
(
isset
(
$value
[
'smallPic'
][
'data'
]))
{
$imgs
=
$value
[
'smallPic'
][
'data'
];
$build
[
'smallImage'
]
=
array
(
array
(
...
...
@@ -108,7 +109,7 @@ class InfoController extends AbstractAction
// 单个商品
elseif
(
$i
===
0
&&
isset
(
$good
[
0
]))
{
$build
[
'relatedReco'
]
=
$good
[
0
];
}
}
// 多个商品
else
{
$build
[
'relatedReco'
]
=
$good
;
...
...
@@ -135,36 +136,53 @@ class InfoController extends AbstractAction
}
}
}
$data
[
'detail'
][
'content'
][]
=
$build
;
}
}
// 相关品牌
if
(
!
empty
(
$detail
[
'getBrand'
]))
{
$data
[
'relatedBrand'
]
=
$detail
[
'getBrand'
];
}
// 相关标签
if
(
!
empty
(
$detail
[
'getArticle'
][
'tags'
]))
{
foreach
(
$detail
[
'getArticle'
][
'tags'
]
as
$value
)
{
$value
[
'url'
]
=
Helpers
::
url
(
'/tags/index'
,
array
(
'query='
=>
$value
[
'name'
]),
'guang'
);
if
(
!
$isApp
)
{
$value
[
'url'
]
=
Helpers
::
url
(
'/tags/index'
,
array
(
'query='
=>
$value
[
'name'
]),
'guang'
);
}
$data
[
'relatedTag'
][]
=
$value
;
}
}
// 相关文章
if
(
!
empty
(
$detail
[
'getOtherArticle'
]))
{
foreach
(
$detail
[
'getOtherArticle'
]
as
$value
)
{
$value
[
'url'
]
=
Helpers
::
url
(
'/info/index'
,
array
(
'id'
=>
$value
[
'id'
]),
'guang'
);
if
(
!
$isApp
)
{
$value
[
'url'
]
=
Helpers
::
url
(
'/info/index'
,
array
(
'id'
=>
$value
[
'id'
]),
'guang'
);
}
$value
[
'thumb'
]
=
Helpers
::
getImageUrl
(
$value
[
'thumb'
],
279
,
175
);
$data
[
'relatedInfo'
][]
=
$value
;
}
}
// 分享参数
if
(
isset
(
$detail
[
'getArticle'
][
'cover_image'
]))
{
$data
[
'shareLink'
]
=
Helpers
::
url
(
'/info/index'
,
array
(
'id'
=>
$id
),
'guang'
);
$data
[
'shareTitle'
]
=
$detail
[
'getArticle'
][
'article_title'
];
$data
[
'shareDesc'
]
=
$detail
[
'getArticle'
][
'article_summary'
];
if
(
$detail
[
'getArticle'
][
'cover_image_type'
]
==
1
)
{
$data
[
'shareImg'
]
=
Helpers
::
getImageUrl
(
$detail
[
'getArticle'
][
'cover_image'
],
640
,
640
);
}
else
{
$data
[
'shareImg'
]
=
Helpers
::
getImageUrl
(
$detail
[
'getArticle'
][
'cover_image'
],
640
,
320
);
}
}
$this
->
_view
->
display
(
'index'
,
$data
);
$detail
=
array
();
$data
=
array
();
}
}
\ No newline at end of file
}
...
...
yohobuy/m.yohobuy.com/configs/application.developer.ini
View file @
bb30108
...
...
@@ -50,4 +50,9 @@ application.template.ext = ".phtml"
application.assets.path
=
ROOT_PATH "/assets"
; 应用的版本号
application.version
=
"0.0.5"
\ No newline at end of file
application.version
=
"0.0.5"
; 网站SEO信息
application.seo.title
=
"Yoho!Buy有货"
application.seo.keywords
=
"Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"
application.seo.description
=
"YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"
\ No newline at end of file
...
...
yohobuy/m.yohobuy.com/configs/application.production.ini
View file @
bb30108
...
...
@@ -50,4 +50,9 @@ application.template.ext = ".phtml"
application.assets.path
=
ROOT_PATH "/assets"
; 应用的版本号
application.version
=
"0.0.5"
\ No newline at end of file
application.version
=
"0.0.5"
; 网站SEO信息
application.seo.title
=
"Yoho!Buy有货"
application.seo.keywords
=
"Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"
application.seo.description
=
"YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"
\ No newline at end of file
...
...
yohobuy/m.yohobuy.com/configs/application.testing.ini
View file @
bb30108
...
...
@@ -50,4 +50,9 @@ application.template.ext = ".phtml"
application.assets.path
=
ROOT_PATH "/assets"
; 应用的版本号
application.version
=
"0.0.5"
\ No newline at end of file
application.version
=
"0.0.5"
; 网站SEO信息
application.seo.title
=
"Yoho!Buy有货"
application.seo.keywords
=
"Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"
application.seo.description
=
"YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"
\ No newline at end of file
...
...
yohobuy/m.yohobuy.com/configs/routes.index.ini
View file @
bb30108
...
...
@@ -89,4 +89,11 @@ routes.girls.route.module = Index
routes.girls.route.controller
=
Girls
routes.girls.route.action
=
index
; 商品筛选
routes.goodsfilter.type
=
"rewrite"
routes.goodsfilter.match
=
"/search/filter"
routes.goodsfilter.route.module
=
Index
routes.goodsfilter.route.controller
=
Search
routes.goodsfilter.route.action
=
Filter
...
...
yohobuy/m.yohobuy.com/configs/routes.product.ini
0 → 100644
View file @
bb30108
; 商品筛选
routes.goodsfilter.type
=
"rewrite"
routes.goodsfilter.match
=
"/search/filter"
routes.goodsfilter.route.module
=
Index
routes.goodsfilter.route.controller
=
Search
routes.goodsfilter.route.action
=
Filter
\ No newline at end of file
...
...
Please
register
or
login
to post a comment