Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOOD
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
2586703@qq.com
10 years ago
Commit
45856392655d10d0d908c1dd78997e6758f06396
2 parents
f4e138ea
78974378
master
...
develop
release_v1.3
release_v1.4
release_v1.5
release_v4
test
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohood
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
88 additions
and
19 deletions
res/js/mobile.js
website/config/Defines.class.php
website/lib/utils/StringHelper.class.php
website/view/script/activity/planmobile.php
website/view/script/brand/detail.php
website/view/script/news/detail.php
website/view/widget/news/list.php
website/view/widget/news/listmobile.php
res/js/mobile.js
View file @
4585639
...
...
@@ -132,7 +132,7 @@ define('mobile', function(require, exports) {
$
(
'.search-wrap input'
).
focus
().
addClass
(
'hasVal'
);
});
//获取所有品牌
$
(
".all_brand"
).
live
(
"
tap
"
,
function
()
{
$
(
".all_brand"
).
live
(
"
click
"
,
function
()
{
$
(
"input[type='text']"
).
val
(
""
);
getBrand
();
});
...
...
@@ -198,17 +198,17 @@ define('mobile', function(require, exports) {
share
.
init
({
shareUrl
:
shareUrl
,
img
:
shareCover
,
sinaText
:
'【YOHOOD 2015】'
+
detailTitle
.
text
()
+
'
\r\n'
+
detailSubtitle
.
text
()
+
'
@YOHO潮流志'
,
sinaText
:
'【YOHOOD 2015】'
+
detailTitle
.
text
()
+
'@YOHO潮流志'
,
fbTextFunction
:
function
()
{
return
{
des
:
'【YOHOOD 2015】'
+
detailTitle
.
text
()
+
'\r\n'
+
detailSubtitle
.
text
(),
name
:
'【YOHOOD 2015】'
+
detailTitle
.
text
()
+
'\r\n'
+
detailSubtitle
.
text
(),
caption
:
'【YOHOOD 2015】'
+
detailTitle
.
text
()
+
'\r\n'
+
detailSubtitle
.
text
(),
des
:
'【YOHOOD 2015】'
+
detailTitle
.
text
(),
name
:
'【YOHOOD 2015】'
+
detailTitle
.
text
(),
caption
:
'【YOHOOD 2015】'
+
detailTitle
.
text
(),
url
:
location
.
href
}
},
tweetText
:
'【YOHOOD 2015】'
+
detailTitle
.
text
()
+
'\r\n'
+
detailSubtitle
.
text
(),
qqText
:
'【YOHOOD 2015】'
+
detailTitle
.
text
()
+
' '
+
detailSubtitle
.
text
()
+
'#YOHOOD 2015'
tweetText
:
'【YOHOOD 2015】'
+
detailTitle
.
text
(),
qqText
:
'【YOHOOD 2015】'
+
detailTitle
.
text
()
+
'#YOHOOD 2015'
});
};
...
...
website/config/Defines.class.php
View file @
4585639
...
...
@@ -111,7 +111,7 @@ class Config_Defines
// 静态资源目录
define
(
'SITE_RES'
,
'http://res.test.yohood.yoho.cn'
);
// 主站
define
(
'SITE_MAIN'
,
'http://yoho
buy
.yohobuy.com'
);
define
(
'SITE_MAIN'
,
'http://yoho
od
.yohobuy.com'
);
define
(
'QINIU_UPLOAD_STATE'
,
true
);
define
(
'QINIU_UPLOAD_CLASS'
,
'Lib_Utils_QiniuUpload'
);
define
(
'QINIU_UPLOAD_ACCESSKEY'
,
'cY9B5ZgON_7McTS5zV5nTeRyQ98MOcVD7W4eGVbE'
);
...
...
website/lib/utils/StringHelper.class.php
View file @
4585639
...
...
@@ -719,7 +719,45 @@ class Lib_Utils_StringHelper
$ar
[
$k
]
=
iconv
(
"UCS-2"
,
"UTF-8"
,
pack
(
"H4"
,
substr
(
$v
,
-
4
)
)
);
return
join
(
""
,
$ar
);
}
/**
* 截取完整英文
*
* @param string $string
* @param int $length
* @param $etc
* @return string
*/
public
static
function
substr_full_en
(
$string
,
$length
=
280
,
$etc
=
'...'
)
{
$chars
=
$string
;
$tmp
=
$i
=
$n
=
$m
=
$l
=
0
;
$length
/=
2
;
if
(
mb_strwidth
(
$string
,
'UTF-8'
)
<=
$length
)
return
$string
;
do
{
if
(
preg_match
(
"/[0-9a-zA-Z]/"
,
@
$chars
[
$i
]))
//纯英文
{
$m
++
;
$tmp
++
;
}
else
//非英文字节
{
$n
++
;
$tmp
=
0
;
}
$k
=
$n
/
3
+
$m
/
2
;
$l
=
$n
/
3
+
$m
;
//最终截取长度;$l = $n/3+$m
$i
++
;
}
while
(
$k
<
$length
);
if
(
preg_match
(
"/[0-9a-zA-Z]/"
,
@
$chars
[
$i
-
1
]))
//英文是不是完整的
{
$l
=
$l
-
$tmp
;
}
return
mb_substr
(
$string
,
0
,
$l
,
'utf-8'
)
.
$etc
;
//保证不会出现乱码
}
/**
* 获取货币
*
...
...
website/view/script/activity/planmobile.php
View file @
4585639
...
...
@@ -16,8 +16,11 @@
</ul>
</div>
<div
class=
"scene-content"
>
<div
class=
"main-layout current clearfix"
>
<?php
foreach
(
$this
->
view
->
topics
as
$topic
)
:?>
<?php
if
(
$this
->
view
->
currentday
>
time
())
:?>
<
img
src
=
"<?php echo SITE_RES.'/images/yohood/comingsoon.jpg';?>"
style
=
"width:100%;"
/>
<?
php
else
:?>
<
div
class
="
main
-
layout
current
clearfix
">
<?php foreach(
$this->view
->topics as
$topic
):?>
<div class="
layout
-
section
current
">
<div class="
scene
-
title
">
<h4 class="
scene
-
intro
"><span></span><?php echo
$topic['title']
;?></h4>
...
...
@@ -42,9 +45,12 @@
</div>
<?php
endforeach
;
?>
</div>
<?php
endforeach
;
?>
</div>
<?php
endforeach
;
?>
</div>
<?php
endif
;
?>
</div>
<?php
$this
->
_endblock
();
?>
<?php
$this
->
_block
(
'js'
);
?>
<script
type=
"text/javascript"
>
...
...
website/view/script/brand/detail.php
View file @
4585639
...
...
@@ -19,7 +19,7 @@
<div class="
post
-
list
main
-
layout
">
<div class="
layout
-
item
tiled
">
<div class="
image
-
box
">
<a href="
<?
php
echo
url
(
'news/detail'
,
array
(
'id'
=>
$val
[
'id'
]))
?>
" title="
<?php
echo
$val
[
'title'
]
?>
">
<a href="
<?
php
echo
url
(
'news/detail'
,
array
(
'id'
=>
$val
[
'id'
]))
?>
" title="
<?php
echo
$val
[
'title'
]
?>
"
target="_blank"
>
<img
src=
"
<?php
echo
Lib_Images
::
getImageUrl
(
$val
[
'thumb'
],
'0230x0230'
,
'fragmentimg'
);
?>
"
alt=
""
style=
"height:230px;width:230px;"
>
<?php
if
(
trim
(
$val
[
'tag'
])
==
'视频'
)
:?>
<
i
class
="
play
-
icon
"></i>
...
...
@@ -28,7 +28,7 @@
</div>
<div class="
content
">
<h2 <?php echo
$val['main_title_type']
== 1 ? 'class="
volupia
"':'';?>>
<a href="
<?
php
echo
url
(
'news/detail'
,
array
(
'id'
=>
$val
[
'id'
]))
?>
">
<a href="
<?
php
echo
url
(
'news/detail'
,
array
(
'id'
=>
$val
[
'id'
]))
?>
"
target="_blank"
>
<?php
echo
Util_StringHelper
::
substr_cn
(
$val
[
'title'
],
46
);
?>
</a>
</h2>
...
...
website/view/script/news/detail.php
View file @
4585639
...
...
@@ -43,7 +43,33 @@
</div>
<?php
endif
;
?>
<div
class=
"text-body"
>
<?php
echo
$this
->
view
->
info
[
'content'
]
?>
<?php
if
(
preg_match
(
'/ipad/i'
,
$_SERVER
[
'HTTP_USER_AGENT'
]))
{
$temps
=
$videoMatches
=
array
();
@
preg_match_all
(
"@<embed([^>]*)\s*src=
\"
http:\/\/res\.yoho\.cn\/res\/yohood\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4)
\"
@"
,
$this
->
view
->
info
[
'content'
],
$videoMatches1
);
@
preg_match_all
(
"@<embed([^>]*)\s*src=
\"
http:\/\/res\.yohood\.test\.yoho\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)
\"
@iU"
,
$this
->
view
->
info
[
'content'
],
$videoMatches2
);
@
preg_match_all
(
"@<embed([^>]*)\s*src=
\"
http:\/\/res\.yohood\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)
\"
@iU"
,
$this
->
view
->
info
[
'content'
],
$videoMatches3
);
$temps
[]
=
$videoMatches1
;
$temps
[]
=
$videoMatches2
;
$temps
[]
=
$videoMatches3
;
foreach
(
$temps
as
$temp
)
{
if
(
!
empty
(
$temp
[
2
]))
{
$videoMatches
=
$temp
;
}
}
if
(
!
empty
(
$videoMatches
[
2
]))
{
$video
=
current
(
$videoMatches
[
2
]);
$videoHtml
=
'<video controls="controls" preload="auto" poster="'
.
Lib_Images
::
getImageUrl
(
$this
->
view
->
info
[
'thumb'
],
'0650x0390'
,
'fragmentimg'
,
'autoCrop'
)
.
'" width="660" height="390"><source src="'
.
$video
.
'" type="video/mp4" /></video>'
;
$this
->
view
->
info
[
'content'
]
=
preg_replace
(
'@<(object.*?)>(.*?)<(\/object.*?)>@si'
,
$videoHtml
,
$this
->
view
->
info
[
'content'
]);
$this
->
view
->
info
[
'content'
]
=
preg_replace
(
'@<(embed.*?)>@si'
,
$videoHtml
,
$this
->
view
->
info
[
'content'
]);
}
}
echo
$this
->
view
->
info
[
'content'
];
?>
</div>
<div
class=
"related-post detail-related-post"
>
<h3>
相关推荐
</h3>
...
...
website/view/widget/news/list.php
View file @
4585639
<?php
foreach
(
$list
as
$news
)
:
$title
=
Util_StringHelper
::
substr_cn
(
$news
[
'title'
],
90
);
$description
=
Lib_Utils_StringHelper
::
substr_
cn
(
Lib_Utils_StringHelper
::
stripTags
(
$news
[
'content'
]),
68
);
$description
=
Lib_Utils_StringHelper
::
substr_
full_en
(
Lib_Utils_StringHelper
::
stripTags
(
$news
[
'content'
]),
80
);
$height
=
$width
=
0
;
$thumb_size
=
json_decode
(
$news
[
'thumb_size'
],
true
);
if
(
$news
[
'thumb'
])
...
...
website/view/widget/news/listmobile.php
View file @
4585639
<?php
foreach
(
$list
as
$news
)
:
$title
=
Util_StringHelper
::
substr_cn
(
$news
[
'title'
],
90
);
$description
=
Lib_Utils_StringHelper
::
substr_cn
(
Lib_Utils_StringHelper
::
stripTags
(
$news
[
'content'
]),
68
);
$height
=
$width
=
0
;
$description
=
Lib_Utils_StringHelper
::
substr_full_en
(
Lib_Utils_StringHelper
::
stripTags
(
$news
[
'content'
]),
72
);
$thumb_size
=
json_decode
(
$news
[
'thumb_size'
],
true
);
if
(
empty
(
$news
[
'client_thumb'
]))
{
...
...
Please
register
or
login
to post a comment