Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
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
梁志锋
9 years ago
Commit
79d8e440950daad52b928489942441614ae16ac1
2 parents
90054b9b
cdba8ba7
Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
85 additions
and
43 deletions
library/Action/AbstractAction.php
library/LibModels/Wap/Category/FocusData.php
library/LibModels/Wap/Guang/PlusstarData.php
library/LibModels/Wap/Product/BrandData.php
library/Plugin/Helpers.php
static/js/index/channel.js
static/sass/category/_brand.scss
static/sass/home/_side-nav.scss
static/sass/index.scss
static/sass/index/_index.scss
static/sass/index/_search.scss
yohobuy/m.yohobuy.com/application/models/Index/Home.php
yohobuy/m.yohobuy.com/application/models/Index/Side.php
yohobuy/m.yohobuy.com/application/models/Product/List.php
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Opt.php
library/Action/AbstractAction.php
View file @
79d8e44
...
...
@@ -100,6 +100,18 @@ class AbstractAction extends Controller_Abstract
{
return
$this
->
_request
->
getParam
(
$key
,
$default
);
}
/**
* 封装一下获取服务器的参数
*
* @param String $key
* @param mixed $default
* @return mixed
*/
protected
function
server
(
$key
,
$default
=
null
)
{
return
$this
->
_request
->
getServer
(
$key
,
$default
);
}
/**
* 关闭模板自动渲染
...
...
library/LibModels/Wap/Category/FocusData.php
View file @
79d8e44
<?php
namespace
LibModels\Wap\Category
;
use
Api\Yohobuy
;
...
...
@@ -15,26 +16,28 @@ use Api\Sign;
*/
class
FocusData
{
/**
* 获取关注数据
*
* @param integ $uid 用户ID
* @param string $gender 性别
* @param integer $limit 读取数目限制,默认为10
* @param integer $page 读取分页限制,默认为1
* @return array 关注数据
*/
/**
* 获取关注数据
*
* @param integ $uid 用户ID
* @param string $gender 性别
* @param integer $limit 读取数目限制,默认为10
* @param integer $page 读取分页限制,默认为1
* @return array 关注数据
*/
public
static
function
getFocusData
(
$uid
,
$gender
,
$limit
=
10
,
$page
=
1
)
{
// 构建必传参数
$param
=
Yohobuy
::
param
();
$param
[
'uid'
]
=
$uid
;
$param
[
'gender'
]
=
$gender
;
$param
[
'limit'
]
=
$limit
;
$param
[
'page'
]
=
$page
;
// 构建必传参数
$param
=
Yohobuy
::
param
();
$param
[
'uid'
]
=
$uid
;
$param
[
'gender'
]
=
$gender
;
$param
[
'limit'
]
=
$limit
;
$param
[
'page'
]
=
$page
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
SERVICE_URL
.
'guang/api/v1/attention/getlist'
,
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
SERVICE_URL
.
'guang/api/v1/attention/getlist'
,
$param
);
}
}
...
...
library/LibModels/Wap/Guang/PlusstarData.php
View file @
79d8e44
...
...
@@ -58,7 +58,7 @@ class PlusstarData
$build
[
'client_secret'
]
=
Sign
::
getSign
(
$build
);
$urlList
[
'all'
]
=
Yohobuy
::
httpBuildQuery
(
$url
,
$build
);
return
Yohobuy
::
getMulti
(
$urlList
);
return
Yohobuy
::
getMulti
(
$urlList
,
array
(),
1800
);
// 缓存30分钟
}
/**
...
...
@@ -96,7 +96,7 @@ class PlusstarData
$original
[
'client_secret'
]
=
Sign
::
getSign
(
$original
);
$urlList
[
'original'
]
=
Yohobuy
::
httpBuildQuery
(
$url
,
$original
);
return
Yohobuy
::
getMulti
(
$urlList
);
return
Yohobuy
::
getMulti
(
$urlList
,
array
(),
1800
);
// 缓存30分钟
}
/**
...
...
library/LibModels/Wap/Product/BrandData.php
View file @
79d8e44
...
...
@@ -33,7 +33,7 @@ class BrandData
$param
[
'type'
]
=
'brand'
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
post
(
Yohobuy
::
API_URL
,
$param
,
true
);
return
Yohobuy
::
post
(
Yohobuy
::
API_URL
,
$param
);
}
/**
...
...
@@ -52,7 +52,7 @@ class BrandData
$param
[
'type'
]
=
'brand'
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
post
(
Yohobuy
::
API_URL
,
$param
,
true
);
return
Yohobuy
::
post
(
Yohobuy
::
API_URL
,
$param
);
}
}
...
...
library/Plugin/Helpers.php
View file @
79d8e44
...
...
@@ -33,7 +33,7 @@ class Helpers
$url
=
'http://search'
.
SUB_DOMAIN
;
break
;
case
'index'
:
// 默认
$url
=
''
;
$url
=
SITE_MAIN
;
break
;
default
:
// 其它子域名
$url
=
'http://'
.
$module
.
SUB_DOMAIN
;
...
...
static/js/index/channel.js
View file @
79d8e44
...
...
@@ -8,7 +8,7 @@ var $searchBox = $('.search-box'),
$indexSearch
=
$
(
'.index-search'
),
$indexLogo
=
$
(
'.index-logo'
);
$searchBox
.
find
(
'input'
).
on
(
'focus'
,
function
()
{
function
showBigSearch
()
{
$indexLogo
.
css
({
width
:
0
});
...
...
@@ -19,7 +19,9 @@ $searchBox.find('input').on('focus', function() {
width
:
'15.5rem'
});
$
(
'.clear-text, .no-search'
).
show
();
}).
on
(
'blur'
,
function
()
{
}
function
hideBigSearch
()
{
$indexLogo
.
css
({
width
:
'5.4rem'
});
...
...
@@ -30,12 +32,22 @@ $searchBox.find('input').on('focus', function() {
width
:
'9.6rem'
});
$
(
'.clear-text, .no-search'
).
hide
();
}
$searchBox
.
find
(
'input'
).
on
(
'focus'
,
function
()
{
showBigSearch
();
});
$searchBox
.
find
(
'.clear-text'
).
click
(
function
()
{
$searchBox
.
find
(
'input'
).
val
(
''
).
trigger
(
'focus'
);
$searchBox
.
find
(
'.clear-text'
).
on
(
'touchend'
,
function
()
{
$searchBox
.
find
(
'input'
).
val
(
''
);
});
$searchBox
.
find
(
'.search-icon'
).
click
(
function
()
{
$searchBox
.
find
(
'.search-icon'
).
on
(
'touchend'
,
function
()
{
$indexSearch
.
submit
();
});
$
(
'.no-search'
).
on
(
'touchend'
,
function
()
{
$searchBox
.
find
(
'input'
).
val
(
''
);
hideBigSearch
();
});
window
.
rePosFooter
();
...
...
static/sass/category/_brand.scss
View file @
79d8e44
...
...
@@ -108,7 +108,7 @@
padding
:
0
20rem
/
$pxConvertRem
;
a
{
display
:
block
;
padding-top
:
10rem
/
$pxConvertRem
;
//
padding-top: 10rem / $pxConvertRem;
height
:
76rem
/
$pxConvertRem
;
line-height
:
76rem
/
$pxConvertRem
;
font-size
:
28rem
/
$pxConvertRem
;
...
...
@@ -116,13 +116,14 @@
border-top
:
1px
solid
#f9f9f9
;
i
{
display
:
inline-block
;
margin-top
:
-4rem
/
$pxConvertRem
;
margin-left
:
24rem
/
$pxConvertRem
;
width
:
58rem
/
$pxConvertRem
;
height
:
38rem
/
$pxConvertRem
;
text-align
:
center
;
vertical-align
:
middle
;
font-size
:
18rem
/
$pxConvertRem
;
line-height
:
3
9
rem
/
$pxConvertRem
;
line-height
:
3
8
rem
/
$pxConvertRem
;
color
:
#fff
;
border-radius
:
50rem
/
$pxConvertRem
;;
}
...
...
static/sass/home/_side-nav.scss
View file @
79d8e44
...
...
@@ -4,12 +4,12 @@
position
:
fixed
;
top
:
0
;
bottom
:
0
;
// left: 0
;
left
:
-540rem
/
$pxConvertRem
;
right
:
640rem
/
$pxConvertRem
;
width
:
540rem
/
$pxConvertRem
;
z-index
:
-1
;
overflow
:
hidden
;
@include
transition
(
right
.3s
);
@include
transition
(
all
.3s
);
ul
{
background
:
#f0f0f0
;
...
...
@@ -107,6 +107,7 @@
}
.side-nav.on
{
left
:
0
;
right
:
100rem
/
$pxConvertRem
;
z-index
:
3
;
}
...
...
static/sass/index.scss
View file @
79d8e44
...
...
@@ -45,6 +45,13 @@ a {
text-decoration
:
none
;
outline
:
none
;
color
:
#000
;
&
:link
,
&
:visted
,
&
:hover
,
&
:active
{
color
:
#000
;
}
}
*
:focus
{
...
...
static/sass/index/_index.scss
View file @
79d8e44
...
...
@@ -24,7 +24,8 @@
width
:
384rem
/
$pxConvertRem
;
height
:
112rem
/
$pxConvertRem
;
overflow
:
hidden
;
transition
:
width
400ms
;
z-index
:
3
;
@include
transition
(
width
.4s
);
.search-box
{
float
:
left
;
position
:
relative
;
...
...
@@ -96,10 +97,10 @@
min-height
:
800rem
/
$pxConvertRem
;
.index-channel-list
{
padding-top
:
50%
;
margin-top
:
-
50%
;
width
:
100%
;
position
:
absolute
;
top
:
-180rem
/
$pxConvertRem
;
top
:
50%
;
.list-item
{
display
:
block
;
...
...
@@ -114,6 +115,9 @@
background
:
#000
;
border
:
4px
solid
#fff
;
font-weight
:
bold
;
&
:last-child
{
margin-bottom
:
0
;
}
}
.lighter
{
font-weight
:
lighter
;
...
...
static/sass/index/_search.scss
View file @
79d8e44
...
...
@@ -41,10 +41,6 @@
.search-items
{
padding
:
20px
10px
;
a
{
color
:
#000
;
}
h3
{
font-size
:
12px
;
margin-bottom
:
10px
;
...
...
yohobuy/m.yohobuy.com/application/models/Index/Home.php
View file @
79d8e44
...
...
@@ -160,7 +160,7 @@ class HomeModel
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else
{
Cache
::
set
(
$cache
,
$result
);
Cache
::
set
(
$cache
,
$result
);
}
}
...
...
yohobuy/m.yohobuy.com/application/models/Index/Side.php
View file @
79d8e44
...
...
@@ -59,7 +59,7 @@ class SideModel
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else
{
Cache
::
set
(
CacheConfig
::
KEY_COMMON_SIDE_NAV
,
$result
,
3600
);
// 缓存1小时
Cache
::
set
(
CacheConfig
::
KEY_COMMON_SIDE_NAV
,
$result
);
}
}
...
...
yohobuy/m.yohobuy.com/application/models/Product/List.php
View file @
79d8e44
...
...
@@ -57,7 +57,7 @@ class ListModel
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else
{
Cache
::
set
(
$key
,
$result
,
600
);
// 缓存1
0分钟
Cache
::
set
(
$key
,
$result
,
1800
);
// 缓存3
0分钟
}
}
...
...
@@ -140,7 +140,7 @@ class ListModel
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else
{
Cache
::
set
(
$key
,
$result
,
600
);
// 缓存1
0分钟
Cache
::
set
(
$key
,
$result
,
1800
);
// 缓存3
0分钟
}
}
...
...
@@ -186,7 +186,7 @@ class ListModel
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else
{
Cache
::
set
(
$key
,
$result
,
10800
);
// 缓存3
小时
Cache
::
set
(
$key
,
$result
);
// 缓存1
小时
}
}
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Opt.php
View file @
79d8e44
...
...
@@ -2,6 +2,7 @@
use
Action\AbstractAction
;
use
LibModels\Wap\Product\BrandData
;
use
Plugin\Helpers
;
/**
* 商品操作相关的控制器
...
...
@@ -56,6 +57,11 @@ class OptController extends AbstractAction
}
while
(
false
);
if
(
isset
(
$result
[
'code'
])
&&
$result
[
'code'
]
==
412
)
{
$referer
=
$this
->
server
(
'HTTP_REFERER'
,
SITE_MAIN
);
$result
[
'data'
]
=
Helpers
::
url
(
'/signin.html'
,
array
(
'refer'
=>
$referer
));
}
$this
->
echoJson
(
$result
);
}
...
...
Please
register
or
login
to post a comment