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
fa8b7acdb9ba28690831d74791bb891a417a5522
1 parent
60b85e39
fixes bug to guang and search
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
265 additions
and
107 deletions
compile/m.yohobuy.com/768212291fbc9015aa187a5044ac8c9b.php
library/LibModels/Wap/Guang/DetailData.php
library/LibModels/Wap/Guang/PlusstarData.php
library/Plugin/TemplateLayout.php
script/nginx/conf/vhosts/nginx.test.yohobuy.conf
static/js/guang/detail.js
static/package.json
template/m.yohobuy.com/actions/guang/info/index.phtml
template/m.yohobuy.com/actions/guang/plusstar/detail.phtml
template/m.yohobuy.com/partials/layout/use.phtml
yohobuy/m.yohobuy.com/application/controllers/Search.php
yohobuy/m.yohobuy.com/application/modules/Guang/controllers/Info.php
yohobuy/m.yohobuy.com/application/modules/Guang/controllers/Plusstar.php
yohobuy/m.yohobuy.com/configs/application.developer.ini
yohobuy/m.yohobuy.com/configs/application.preview.ini
yohobuy/m.yohobuy.com/configs/application.production.ini
yohobuy/m.yohobuy.com/configs/application.testing.ini
compile/m.yohobuy.com/768212291fbc9015aa187a5044ac8c9b.php
View file @
fa8b7ac
...
...
@@ -135,7 +135,6 @@
'
.
'<script>
seajs.use(\'js/common\');
</script>
'
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'psList'
))))
?
'<script>
seajs.use(\'js/guang/plus-star/list\');
</script>
...
...
@@ -151,8 +150,12 @@
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'guangDetail'
))))
?
'<script>
seajs.use(\'js/guang/detail\');
</script>
'
:
''
)
.
'
'
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'regIndex'
))))
?
'<script>
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'guangEzine'
))))
?
'<script>
seajs.use(\'js/guang/detail\', function(detail) {
detail.init(true);
});
</script>
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'regIndex'
))))
?
'<script>
seajs.use(\'js/passport/register/register\');
</script>
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'regCode'
))))
?
'<script>
...
...
@@ -161,15 +164,13 @@
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'regPwd'
))))
?
'<script>
seajs.use(\'js/passport/register/password\');
</script>
'
:
''
)
.
'
'
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'loginIndex'
))))
?
'<script>
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'loginIndex'
))))
?
'<script>
seajs.use(\'js/passport/login/login\');
</script>
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'loginInternational'
))))
?
' <script>
seajs.use(\'js/passport/login/international\');
</script>
'
:
''
)
.
'
'
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'backEmail'
))))
?
'<script>
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'loginInternational'
))))
?
'<script>
seajs.use(\'js/passport/login/international\');
</script>
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'backEmail'
))))
?
'<script>
seajs.use(\'js/passport/back/email\');
</script>
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'backEmailSuccess'
))))
?
'<script>
...
...
@@ -184,13 +185,11 @@
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'backNewPwd'
))))
?
'<script>
seajs.use(\'js/passport/back/new-password\');
</script>
'
:
''
)
.
'
'
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'channelPage'
))))
?
'<script>
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'channelPage'
))))
?
'<script>
seajs.use(\'js/index/channel\');
seajs.use(\'js/index/footer\');
</script>
'
:
''
)
.
'
'
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'grilsHomePage'
))))
?
'<script>
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'grilsHomePage'
))))
?
'<script>
seajs.use(\'js/home/home\', function(h) {
h.set(\'girls\');
});
...
...
@@ -214,42 +213,34 @@
});
seajs.use(\'js/index/footer\');
</script>
'
:
''
)
.
'
'
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'newArrivalPage'
))))
?
'<script>
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'newArrivalPage'
))))
?
'<script>
seajs.use(\'js/product/newsale/newarrival\');
seajs.use(\'js/index/footer\');
</script>
'
:
''
)
.
'
'
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'discountPage'
))))
?
'<script>
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'discountPage'
))))
?
'<script>
seajs.use(\'js/product/newsale/discount\');
seajs.use(\'js/index/footer\');
</script>
'
:
''
)
.
'
'
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'goodListPage'
))))
?
'<script>
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'goodListPage'
))))
?
'<script>
seajs.use(\'js/product/list\');
seajs.use(\'js/index/footer\');
</script>
'
:
''
)
.
'
'
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'goodsDetailPage'
))))
?
'<script>
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'goodsDetailPage'
))))
?
'<script>
seajs.use(\'js/product/detail/detail\');
</script>
'
:
''
)
.
'
'
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'categoryPage'
))))
?
'<script>
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'categoryPage'
))))
?
'<script>
seajs.use(\'js/category/index\');
seajs.use(\'js/index/footer\');
</script>
'
:
''
)
.
'
'
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'brandPage'
))))
?
'<script>
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'brandPage'
))))
?
'<script>
seajs.use(\'js/category/brand\');
seajs.use(\'js/index/footer\');
</script>
'
:
''
)
.
'
'
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'searchPage'
))))
?
'<script>
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'searchPage'
))))
?
'<script>
seajs.use(\'js/index/search\');
seajs.use(\'js/index/footer\');
</script>
'
:
''
)
.
'
'
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'shoppingCartPage'
))))
?
'<script>
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'shoppingCartPage'
))))
?
'<script>
seajs.use(\'js/shopping-cart/cart\');
</script>
'
:
''
)
.
''
.
((
Plugin\LCRun3
::
ifvar
(
$cx
,
Plugin\LCRun3
::
v
(
$cx
,
$in
,
array
(
'giftAdvancePage'
))))
?
'<script>
...
...
library/LibModels/Wap/Guang/DetailData.php
View file @
fa8b7ac
...
...
@@ -39,7 +39,7 @@ class DetailData
$clientType
=
$isApp
?
'iphone'
:
'h5'
;
// 获取资讯
$article
=
Yohobuy
::
yarClient
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_PACKAGE_ARTICLE
,
'getArticle'
,
array
(
$id
,
$clientType
)
,
3600
);
$article
=
Yohobuy
::
yarClient
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_PACKAGE_ARTICLE
,
'getArticle'
,
array
(
$id
,
$clientType
));
if
(
!
isset
(
$article
[
'author_id'
]))
{
return
$result
;
}
...
...
@@ -72,5 +72,48 @@ class DetailData
return
$result
;
}
/**
* 逛资讯详情页数据封装 (专为YOHO!潮流志APP提供)
*
* @param int $id 内容ID
* @param bool $isApp 标识是否是APP访问
* @return array
*/
public
static
function
packageFoEzine
(
$id
,
$isApp
=
false
)
{
$result
=
array
();
$result
[
'getAuthor'
]
=
array
();
$result
[
'getArticle'
]
=
array
();
$result
[
'getArticleContent'
]
=
array
();
$result
[
'getBrand'
]
=
array
();
$result
[
'getOtherArticle'
]
=
array
();
// 客户端类型
$clientType
=
$isApp
?
'iphone'
:
'h5'
;
// 获取资讯
$article
=
Yohobuy
::
yarClient
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_PACKAGE_ARTICLE
,
'getArticle'
,
array
(
$id
,
$clientType
));
if
(
!
isset
(
$article
[
'author_id'
]))
{
return
$result
;
}
$result
[
'getArticle'
]
=
$article
;
// 获取资讯内容
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
,
$clientType
),
function
(
$retval
)
use
(
&
$result
)
{
$result
[
'getBrand'
]
=
empty
(
$retval
)
?
array
()
:
$retval
;
});
// 调用发起请求
Yohobuy
::
yarConcurrentLoop
();
return
$result
;
}
}
...
...
library/LibModels/Wap/Guang/PlusstarData.php
View file @
fa8b7ac
...
...
@@ -125,7 +125,7 @@ class PlusstarData
$result
[
'getArticleByBrand'
]
=
array
();
// 品牌详情信息
$brandInfo
=
Yohobuy
::
yarClient
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_BRANDINFO_PLUSSTAR
,
'getBrandInfo'
,
array
(
array
(
'id'
=>
$id
))
);
$brandInfo
=
Yohobuy
::
yarClient
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_BRANDINFO_PLUSSTAR
,
'getBrandInfo'
,
array
(
array
(
'id'
=>
$id
))
,
3600
);
// 缓存1小时
if
(
!
isset
(
$brandInfo
[
'data'
][
'brand_id'
]))
{
return
$result
;
}
else
{
...
...
@@ -160,7 +160,7 @@ class PlusstarData
$param
[
'gender'
]
=
$gender
;
$param
[
'order'
]
=
's_t_desc'
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
$newProduct
=
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
$newProduct
=
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
,
1800
);
// 缓存30分钟
if
(
empty
(
$newProduct
[
'data'
][
'product_list'
]))
{
break
;
}
...
...
library/Plugin/TemplateLayout.php
View file @
fa8b7ac
...
...
@@ -143,7 +143,7 @@ class TemplateLayout implements View_Interface
// 模板编译成PHP文件所存放的目录
$compilePath
=
$config
->
template
->
compile
;
// 模板编译成PHP文件所存放的文件路径
$compilePhp
=
$compilePath
.
'/'
.
$makeKey
.
'.php'
;
$compilePhp
=
$compilePath
.
'/'
.
$makeKey
.
'.php'
;
// 已渲染过该模板,则直接引PHP文件
if
(
is_readable
(
$compilePhp
))
{
...
...
script/nginx/conf/vhosts/nginx.test.yohobuy.conf
View file @
fa8b7ac
...
...
@@ -201,6 +201,14 @@ server
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
Accept
-
Encoding
"gzip"
;
}
location
^~ /
info
/
mini
{
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
^~ /
plustar
{
proxy_redirect
off
;
proxy_pass
http
://
yohobuy
;
...
...
static/js/guang/detail.js
View file @
fa8b7ac
...
...
@@ -5,22 +5,22 @@
*/
var
$
=
require
(
'jquery'
),
ellipsis
=
require
(
'mlellipsis'
),
lazyLoad
=
require
(
'yoho.lazyload'
),
IScroll
=
require
(
'iscroll/iscroll-probe'
);
ellipsis
=
require
(
'mlellipsis'
),
lazyLoad
=
require
(
'yoho.lazyload'
),
IScroll
=
require
(
'iscroll/iscroll-probe'
);
var
$authorIntro
=
$
(
'.author .intro'
);
var
isEzinPage
=
false
,
isIphone
=
navigator
.
userAgent
.
indexOf
(
'iPhone'
)
>
0
?
true
:
false
;
isIphone
=
navigator
.
userAgent
.
indexOf
(
'iPhone'
)
>
0
?
true
:
false
;
var
hasCollocationBlock
=
$
(
'.collocation-block'
).
length
>
0
?
true
:
false
;
//collocation block variable
var
thumbWidth
=
0
,
$fixedThumbContainer
=
$
(
''
),
$coBlock
,
$thumbContainer
,
$thumbs
,
$prods
,
scrollToEl
;
$fixedThumbContainer
=
$
(
''
),
$coBlock
,
$thumbContainer
,
$thumbs
,
$prods
,
scrollToEl
;
var
scrollToEl
=
document
.
querySelector
(
'#wrapper .collocation-block'
);
...
...
@@ -36,7 +36,7 @@ require('../plugin/wx-share')();
*/
function
posCollocationArrow
(
$curCo
)
{
var
left
=
$curCo
.
offset
().
left
,
bgPos
=
-
winW
+
left
+
(
thumbWidth
/
2
)
+
'px'
;
bgPos
=
-
winW
+
left
+
(
thumbWidth
/
2
)
+
'px'
;
$thumbContainer
.
css
({
backgroundPosition
:
bgPos
+
' bottom'
...
...
@@ -52,9 +52,9 @@ function posCollocationArrow($curCo) {
//搭配thumb的touch事件句柄
function
thumbTouchEvt
(
e
)
{
var
$curCo
=
$
(
e
.
currentTarget
),
index
=
$curCo
.
index
(),
$brother
,
$brotherCo
,
$curProds
;
index
=
$curCo
.
index
(),
$brother
,
$brotherCo
,
$curProds
;
if
(
$curCo
.
hasClass
(
'focus'
))
{
return
;
...
...
@@ -118,7 +118,7 @@ $('.info-list .title, .one-good .reco-name').each(function() {
//offset.left约等于marginLeft的值则表示介绍被换行,则清除intro的paddingTop让其更靠近头像和作者名
if
(
$authorIntro
.
offset
()
&&
(
parseInt
(
$authorIntro
.
offset
().
left
,
10
)
===
parseInt
(
$authorIntro
.
css
(
'margin-left'
),
10
)))
{
parseInt
(
$authorIntro
.
css
(
'margin-left'
),
10
)))
{
$authorIntro
.
css
(
'padding-top'
,
0
);
}
...
...
@@ -133,8 +133,8 @@ if (hasCollocationBlock) {
if
(
isIphone
)
{
$fixedThumbContainer
=
$
(
'#wrapper'
)
.
after
(
$thumbContainer
.
clone
().
addClass
(
'fixed-thumb-container fixed-bottom'
))
.
next
(
'.thumb-container'
);
.
after
(
$thumbContainer
.
clone
().
addClass
(
'fixed-thumb-container fixed-bottom'
))
.
next
(
'.thumb-container'
);
//load img of fixed thumb container
lazyLoad
(
$fixedThumbContainer
.
find
(
'.lazy'
),
{
...
...
@@ -155,7 +155,7 @@ if (hasCollocationBlock) {
/**
* 初始化页面参数
*/
exports
.
init
=
function
(
flag
)
{
exports
.
init
=
function
(
flag
)
{
if
(
flag
===
true
)
{
isEzinPage
=
true
;
}
...
...
@@ -177,7 +177,7 @@ window.onload = function() {
click
:
true
});
document
.
addEventListener
(
'touchmove'
,
function
(
e
)
{
document
.
addEventListener
(
'touchmove'
,
function
(
e
)
{
e
.
preventDefault
();
},
false
);
...
...
@@ -202,34 +202,34 @@ window.onload = function() {
if
(
sTop
<=
cbTop
-
winH
+
tcH
)
{
if
(
classList
.
indexOf
(
'fixed-bottom'
)
===
-
1
)
{
$fixedThumbContainer
.
addClass
(
'fixed-bottom'
)
.
removeClass
(
'hide'
);
.
addClass
(
'fixed-bottom'
)
.
removeClass
(
'hide'
);
}
}
else
if
(
sTop
<=
cbTop
)
{
if
(
classList
.
indexOf
(
'hide'
)
===
-
1
)
{
$fixedThumbContainer
.
addClass
(
'hide'
)
.
removeClass
(
'fixed-bottom fixed-top'
);
.
addClass
(
'hide'
)
.
removeClass
(
'fixed-bottom fixed-top'
);
}
}
else
if
(
sTop
<=
cbTop
+
cbH
-
tcH
)
{
if
(
classList
.
indexOf
(
'fixed-top'
)
===
-
1
)
{
$fixedThumbContainer
.
addClass
(
'fixed-top'
)
.
removeClass
(
'hide absolute'
)
.
css
(
'top'
,
''
);
.
addClass
(
'fixed-top'
)
.
removeClass
(
'hide absolute'
)
.
css
(
'top'
,
''
);
}
}
else
if
(
sTop
<=
cbTop
+
cbH
)
{
if
(
classList
.
indexOf
(
'absolute'
)
===
-
1
)
{
$fixedThumbContainer
.
addClass
(
'absolute'
)
.
removeClass
(
'fixed-top hide'
);
.
addClass
(
'absolute'
)
.
removeClass
(
'fixed-top hide'
);
}
fixedThumbDom
.
style
.
top
=
cbTop
+
cbH
-
tcH
-
sTop
+
'px'
;
}
else
if
(
sTop
>
cbTop
+
cbH
)
{
if
(
classList
.
indexOf
(
'hide'
)
===
-
1
)
{
$fixedThumbContainer
.
addClass
(
'hide'
)
.
removeClass
(
'absolute'
);
.
addClass
(
'hide'
)
.
removeClass
(
'absolute'
);
}
}
$scroller
.
trigger
(
'scroll'
);
...
...
static/package.json
View file @
fa8b7ac
{
"name"
:
"yohobuy"
,
"version"
:
"1.1.
4
"
,
"version"
:
"1.1.
5
"
,
"description"
:
"yohobuy statics"
,
"keywords"
:
[],
"homepage"
:
""
,
...
...
template/m.yohobuy.com/actions/guang/info/index.phtml
View file @
fa8b7ac
...
...
@@ -154,10 +154,10 @@
</div>
{
{!--
wx-share
--
}
}
<input
id=
"shareLink"
type=
"hidden"
value=
{
{shareLink
}
}>
<input
id=
"shareImg"
type=
"hidden"
value=
{
{shareImg
}
}>
<input
id=
"shareTitle"
type=
"hidden"
value=
{
{shareTitle
}
}>
<input
id=
"shareDesc"
type=
"hidden"
value=
{
{shareDesc
}
}>
<input
id=
"shareLink"
type=
"hidden"
value=
"{{shareLink}}"
>
<input
id=
"shareImg"
type=
"hidden"
value=
"{{shareImg}}"
>
<input
id=
"shareTitle"
type=
"hidden"
value=
"{{shareTitle}}"
>
<input
id=
"shareDesc"
type=
"hidden"
value=
"{{shareDesc}}"
>
{
{/
guang
}
}
</div>
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/guang/plusstar/detail.phtml
View file @
fa8b7ac
...
...
@@ -52,13 +52,13 @@
</div>
{
{/if
}
}
<input
id=
"jump-to-app"
type=
"hidden"
value=
{
{jumpToApp
}
}
>
<input
id=
"jump-to-app"
type=
"hidden"
value=
"{{jumpToApp}}"
>
{
{!--
wx-share
--
}
}
<input
id=
"shareLink"
type=
"hidden"
value=
{
{shareLink
}
}>
<input
id=
"shareImg"
type=
"hidden"
value=
{
{shareImg
}
}>
<input
id=
"shareTitle"
type=
"hidden"
value=
{
{shareTitle
}
}>
<input
id=
"shareDesc"
type=
"hidden"
value=
{
{shareDesc
}
}>
<input
id=
"shareLink"
type=
"hidden"
value=
"{{shareLink}}"
>
<input
id=
"shareImg"
type=
"hidden"
value=
"{{shareImg}}"
>
<input
id=
"shareTitle"
type=
"hidden"
value=
"{{shareTitle}}"
>
<input
id=
"shareDesc"
type=
"hidden"
value=
"{{shareDesc}}"
>
{
{/
ps
}
}
</div>
{
{>layout/footer
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/layout/use.phtml
View file @
fa8b7ac
<script>
seajs.use('js/common');
</script>
{{!-- 逛(PLUS+STAR) --}}
{{#if psList}}
<script>
...
...
@@ -28,7 +27,13 @@
seajs.use('js/guang/detail');
</script>
{{/if}}
{{#if guangEzine}}
<script>
seajs.use('js/guang/detail', function(detail) {
detail.init(true);
});
</script>
{{/if}}
{{!-- 注册 --}}
{{#if regIndex}}
<script>
...
...
@@ -45,7 +50,6 @@
seajs.use('js/passport/register/password');
</script>
{{/if}}
{{!-- 登陆 --}}
{{#if loginIndex}}
<script>
...
...
@@ -53,11 +57,10 @@
</script>
{{/if}}
{{#if loginInternational}}
<script>
seajs.use('js/passport/login/international');
</script>
<script>
seajs.use('js/passport/login/international');
</script>
{{/if}}
{{!-- 密码找回 --}}
{{#if backEmail}}
<script>
...
...
@@ -84,7 +87,6 @@
seajs.use('js/passport/back/new-password');
</script>
{{/if}}
{{!-- 频道选择页 --}}
{{#if channelPage}}
<script>
...
...
@@ -92,7 +94,6 @@
seajs.use('js/index/footer');
</script>
{{/if}}
{{!-- 首页 --}}
{{#if grilsHomePage}}
<script>
...
...
@@ -126,7 +127,6 @@
seajs.use('js/index/footer');
</script>
{{/if}}
{{!-- 新品到着 --}}
{{#if newArrivalPage}}
<script>
...
...
@@ -134,7 +134,6 @@
seajs.use('js/index/footer');
</script>
{{/if}}
{{!-- 折扣专区 --}}
{{#if discountPage}}
<script>
...
...
@@ -142,7 +141,6 @@
seajs.use('js/index/footer');
</script>
{{/if}}
{{!-- 商品列表 --}}
{{#if goodListPage}}
<script>
...
...
@@ -150,14 +148,12 @@
seajs.use('js/index/footer');
</script>
{{/if}}
{{!-- 商品详情 --}}
{{#if goodsDetailPage}}
<script>
seajs.use('js/product/detail/detail');
</script>
{{/if}}
{{!-- 品类 --}}
{{#if categoryPage}}
<script>
...
...
@@ -165,7 +161,6 @@
seajs.use('js/index/footer');
</script>
{{/if}}
{{!-- 品牌 --}}
{{#if brandPage}}
<script>
...
...
@@ -173,7 +168,6 @@
seajs.use('js/index/footer');
</script>
{{/if}}
{{!-- 搜索 --}}
{{#if searchPage}}
<script>
...
...
@@ -181,7 +175,6 @@
seajs.use('js/index/footer');
</script>
{{/if}}
{{!-- 购物车 --}}
{{#if shoppingCartPage}}
<script>
...
...
yohobuy/m.yohobuy.com/application/controllers/Search.php
View file @
fa8b7ac
...
...
@@ -51,6 +51,9 @@ class SearchController extends AbstractAction
$condition
[
'p_d'
]
=
rawurldecode
(
$condition
[
'discount'
]);
unset
(
$condition
[
'discount'
]);
}
if
(
isset
(
$condition
[
'query'
]))
{
$condition
[
'query'
]
=
rawurlencode
(
$condition
[
'query'
]);
}
// 标识用户是否有输入搜索内容
$haveQuery
=
$query
!==
null
;
...
...
@@ -221,6 +224,10 @@ class SearchController extends AbstractAction
if
(
isset
(
$condition
[
'gender'
]))
{
$condition
[
'gender'
]
=
rawurldecode
(
$condition
[
'gender'
]);
}
if
(
isset
(
$condition
[
'query'
]))
{
$condition
[
'query'
]
=
rawurldecode
(
$condition
[
'query'
]);
}
// 转换排序方式
$type
=
$this
->
get
(
'type'
,
''
);
$order
=
$this
->
get
(
'order'
,
0
);
...
...
yohobuy/m.yohobuy.com/application/modules/Guang/controllers/Info.php
View file @
fa8b7ac
...
...
@@ -47,10 +47,6 @@ class InfoController extends AbstractAction
return
;
}
$data
=
array
();
$data
[
'guangDetail'
]
=
true
;
// 模板中使用JS的标识
$data
[
'guang'
][
'id'
]
=
$id
;
// 作者信息数据
if
(
isset
(
$detail
[
'getAuthor'
][
'name'
]))
{
$data
[
'guang'
][
'author'
]
=
array
();
...
...
@@ -204,20 +200,140 @@ class InfoController extends AbstractAction
* @param type "fav"表示收藏 或者 "cancel"表示取消收藏
* @return json
*/
public
function
collect
Action
()
public
function
mini
Action
()
{
do
{
if
(
!
$this
->
isAjax
())
{
break
;
$id
=
$this
->
get
(
'id'
);
// 判断参数是否有效, 无效会跳转到错误页面
if
(
!
is_numeric
(
$id
))
{
$this
->
error
();
}
$data
=
array
();
$data
[
'guangEzine'
]
=
true
;
// 模板中使用JS的标识
$data
[
'guang'
][
'id'
]
=
$id
;
// 获取详情内容信息, 异常则跳到错误页面
$detail
=
DetailData
::
packageFoEzine
(
$id
,
true
);
if
(
empty
(
$detail
[
'getArticle'
]))
{
$this
->
_view
->
display
(
'index'
,
$data
);
return
;
}
$data
[
'detail'
]
=
array
();
$data
[
'detail'
][
'title'
]
=
$detail
[
'getArticle'
][
'article_title'
];
$data
[
'detail'
][
'publishTime'
]
=
$detail
[
'getArticle'
][
'publishTime'
];
$data
[
'detail'
][
'pageView'
]
=
$detail
[
'getArticle'
][
'pageViews'
];
$data
[
'detail'
][
'content'
]
=
array
();
if
(
!
empty
(
$detail
[
'getArticleContent'
]))
{
$build
=
array
();
$good
=
array
();
$skns
=
array
();
$product
=
array
();
foreach
(
$detail
[
'getArticleContent'
]
as
$value
)
{
$build
=
array
();
// 文字
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'
][
'data'
]))
{
$imgs
=
$value
[
'smallPic'
][
'data'
];
$build
[
'smallImage'
]
=
array
(
array
(
'src'
=>
Helpers
::
getImageUrl
(
$imgs
[
0
][
'src'
],
315
,
420
)
),
array
(
'src'
=>
Helpers
::
getImageUrl
(
$imgs
[
1
][
'src'
],
315
,
420
)
)
);
}
// 相关推荐
elseif
(
isset
(
$value
[
'goods'
][
'data'
]))
{
$good
=
array
();
// 遍历取得SKN
$skns
=
array
();
foreach
(
$value
[
'goods'
][
'data'
]
as
$goods
)
{
$skns
[]
=
$goods
[
'id'
];
}
// 通过SKN获取商品信息
$product
=
ListData
::
productInfoBySkns
(
$skns
);
if
(
!
empty
(
$product
[
'data'
][
'product_list'
]))
{
foreach
(
$product
[
'data'
][
'product_list'
]
as
$i
=>
$goods
)
{
// 最多显示4个
if
(
$i
>
3
)
{
break
;
}
$good
[]
=
Helpers
::
formatProduct
(
$goods
,
false
,
true
,
true
,
235
,
314
,
true
);
}
}
// 没有商品
if
(
!
isset
(
$i
))
{
continue
;
}
// 单个商品
elseif
(
$i
===
0
&&
isset
(
$good
[
0
]))
{
$build
[
'relatedReco'
]
=
$good
[
0
];
}
// 多个商品
else
{
$build
[
'relatedReco'
]
=
$good
;
}
}
// 悬停浮动商品
elseif
(
isset
(
$value
[
'goodsGroup'
][
'data'
]))
{
foreach
(
$value
[
'goodsGroup'
][
'data'
]
as
$goods
)
{
$good
=
array
();
$good
[
'thumb'
]
=
Helpers
::
getImageUrl
(
$goods
[
'cover'
][
'cover'
],
235
,
314
);
$good
[
'type'
]
=
Helpers
::
getProductIcon
(
$goods
[
'cover'
][
'maxSortId'
]);
$good
[
'goods'
]
=
array
();
$skns
=
array
();
foreach
(
$goods
[
'list'
]
as
$mini
)
{
$skns
[]
=
$mini
[
'id'
];
}
// 通过SKN获取商品信息
$product
=
ListData
::
productInfoBySkns
(
$skns
);
if
(
!
empty
(
$product
[
'data'
][
'product_list'
]))
{
foreach
(
$product
[
'data'
][
'product_list'
]
as
$i
=>
$goods
)
{
$good
[
'goods'
][]
=
Helpers
::
formatProduct
(
$goods
,
false
,
true
,
true
,
235
,
314
,
true
);
}
$build
[
'collocation'
][]
=
$good
;
}
}
}
$data
[
'detail'
][
'content'
][]
=
$build
;
}
}
// 相关品牌
if
(
!
empty
(
$detail
[
'getBrand'
]))
{
$data
[
'relatedBrand'
]
=
$detail
[
'getBrand'
];
}
$id
=
$this
->
get
(
'id'
);
$type
=
$this
->
get
(
'type'
);
// 收藏
if
(
$type
==
'fav'
)
{
// 分享参数
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
);
}
}
while
(
false
);
}
// 标识有微信分享
$data
[
'hasWxShare'
]
=
true
;
$this
->
_view
->
display
(
'index'
,
$data
);
$detail
=
array
();
$data
=
array
();
}
}
...
...
yohobuy/m.yohobuy.com/application/modules/Guang/controllers/Plusstar.php
View file @
fa8b7ac
...
...
@@ -177,7 +177,7 @@ class PlusstarController extends AbstractAction
$data
[
'shareLink'
]
=
$defaultUrl
;
$data
[
'shareTitle'
]
=
$data
[
'ps'
][
'name'
];
$data
[
'shareDesc'
]
=
(
mb_strlen
(
$data
[
'ps'
][
'intro'
],
'utf-8'
)
>
120
)
?
mb_substr
(
$data
[
'ps'
][
'intro'
],
0
,
120
,
'utf-8'
)
.
'...'
:
$data
[
'ps'
][
'intro'
];
$data
[
'shareDesc'
]
=
(
mb_strlen
(
$data
[
'ps'
][
'intro'
],
'utf-8'
)
>
120
)
?
trim
(
strip_tags
(
mb_substr
(
$data
[
'ps'
][
'intro'
],
0
,
120
,
'utf-8'
))
)
.
'...'
:
$data
[
'ps'
][
'intro'
];
$data
[
'shareImg'
]
=
$data
[
'ps'
][
'logo'
];
$brandInfo
=
array
();
...
...
yohobuy/m.yohobuy.com/configs/application.developer.ini
View file @
fa8b7ac
...
...
@@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path
=
ROOT_PATH "/assets"
; 应用的版本号
application.version
=
"1.1.
4
"
application.version
=
"1.1.
5
"
; 网站SEO信息
application.seo.title
=
"Yoho!Buy有货"
...
...
yohobuy/m.yohobuy.com/configs/application.preview.ini
View file @
fa8b7ac
...
...
@@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path
=
ROOT_PATH "/assets"
; 应用的版本号
application.version
=
"1.1.
4
"
application.version
=
"1.1.
5
"
; 网站SEO信息
application.seo.title
=
"Yoho!Buy有货"
...
...
yohobuy/m.yohobuy.com/configs/application.production.ini
View file @
fa8b7ac
...
...
@@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path
=
ROOT_PATH "/assets"
; 应用的版本号
application.version
=
"1.1.
4
"
application.version
=
"1.1.
5
"
; 网站SEO信息
application.seo.title
=
"Yoho!Buy有货"
...
...
yohobuy/m.yohobuy.com/configs/application.testing.ini
View file @
fa8b7ac
...
...
@@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path
=
ROOT_PATH "/assets"
; 应用的版本号
application.version
=
"1.1.
4
"
application.version
=
"1.1.
5
"
; 网站SEO信息
application.seo.title
=
"Yoho!Buy有货"
...
...
Please
register
or
login
to post a comment