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
10 years ago
Commit
38b32b391b4338a0a0223d9767d9bb525f0f26b8
1 parent
35c0201c
run gulp ge to gzip css js
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
52 additions
and
39 deletions
library/Plugin/Helpers.php
static/package.json
yohobuy/m.yohobuy.com/application/models/Category/Class.php
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Newsale.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
library/Plugin/Helpers.php
View file @
38b32b3
...
...
@@ -59,7 +59,7 @@ class Helpers
*/
public
static
function
getFilterUrl
(
$url
)
{
$filter
=
strtr
(
strstr
(
$url
,
'openby:yohobuy='
,
true
),
array
(
'
m.yohobuy.com'
=>
SUB_DO
MAIN
));
$filter
=
strtr
(
strstr
(
$url
,
'openby:yohobuy='
,
true
),
array
(
'
.m.yohobuy.com'
=>
SUB_DOMAIN
,
OLD_MAIN
=>
SITE_
MAIN
));
if
(
$filter
)
{
return
rtrim
(
rtrim
(
$filter
,
'?'
),
'&'
);
}
else
{
...
...
@@ -84,6 +84,28 @@ class Helpers
return
'1,2,3'
;
}
}
/**
* 根据用户访问的COOKIE判断出频道
*
* @return int
*/
public
static
function
getChannelByCookie
()
{
$cookie
=
isset
(
$_COOKIE
[
'_Channel'
])
?
$_COOKIE
[
'_Channel'
]
:
'boys'
;
switch
(
strval
(
$cookie
))
{
case
'boys'
:
// 男
return
1
;
case
'girls'
:
// 女
return
2
;
case
'kids'
:
// 潮童
return
3
;
case
'lifestyle'
:
// 创意生活
return
4
;
default
:
// 其它
return
1
;
}
}
/**
* 格式化商品信息
...
...
static/package.json
View file @
38b32b3
{
"name"
:
"yohobuy"
,
"version"
:
"0.0.
1
"
,
"version"
:
"0.0.
2
"
,
"description"
:
"yohobuy statics"
,
"keywords"
:
[],
"homepage"
:
""
,
...
...
yohobuy/m.yohobuy.com/application/models/Category/Class.php
View file @
38b32b3
...
...
@@ -63,7 +63,10 @@ class ClassModel
$subitem
=
array
();
$subitem
[
'name'
]
=
$value
[
'category_name'
];
$subitem
[
'id'
]
=
$value
[
'relation_parameter'
][
'sort'
];
$subitem
[
'url'
]
=
'/product/list/class?sort='
.
$value
[
'relation_parameter'
][
'sort'
];
$subitem
[
'url'
]
=
Helpers
::
url
(
'/'
,
array
(
'sort'
=>
$value
[
'relation_parameter'
][
'sort'
],
'sort_name'
=>
$value
[
'category_name'
]
),
'list'
);
$item
[
'sub'
][]
=
$subitem
;
}
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Newsale.php
View file @
38b32b3
...
...
@@ -3,6 +3,7 @@
use
Action\AbstractAction
;
use
LibModels\Wap\Product\NewsaleData
;
use
Product\NewsaleModel
;
use
Plugin\Helpers
;
/**
* 新品到着
...
...
@@ -20,8 +21,7 @@ class NewsaleController extends AbstractAction
$this
->
setTitle
(
'新品到着'
);
$this
->
setNavHeader
(
'新品到着'
);
$channel
=
$this
->
getCookie
(
'_Channel'
,
'boys'
);
$this
->
channelTrans
(
$channel
);
$channel
=
Helpers
::
getChannelByCookie
();
$data
=
array
();
$data
[
'newArrivalPage'
]
=
true
;
...
...
@@ -34,7 +34,7 @@ class NewsaleController extends AbstractAction
$data
+=
array
(
'brand'
=>
0
,
'msort'
=>
0
,
'gender'
=>
$this
->
getCookie
(
'_Channel'
,
'boys'
),
'gender'
=>
Helpers
::
getGenderByCookie
(
),
'price'
=>
0
,
'size'
=>
0
,
'dayLimit'
=>
1
,
...
...
@@ -54,9 +54,8 @@ class NewsaleController extends AbstractAction
$this
->
setTitle
(
'折扣专区'
);
$this
->
setNavHeader
(
'Sale'
);
$channel
=
$this
->
getCookie
(
'_Channel'
,
'boys'
);
$this
->
channelTrans
(
$channel
);
$channel
=
Helpers
::
getChannelByCookie
();
$data
=
array
();
$data
[
'discountPage'
]
=
true
;
$data
[
'headerBanner'
]
=
\Product\NewsaleModel
::
getNewFocus
(
$channel
);
...
...
@@ -68,7 +67,7 @@ class NewsaleController extends AbstractAction
$data
+=
array
(
'brand'
=>
0
,
'msort'
=>
0
,
'gender'
=>
$this
->
getCookie
(
'_Channel'
,
'boys'
),
'gender'
=>
Helpers
::
getGenderByCookie
(
),
'price'
=>
0
,
'size'
=>
0
,
'discount'
=>
'0.1,0.9'
...
...
@@ -92,7 +91,6 @@ class NewsaleController extends AbstractAction
$size
=
$this
->
get
(
'size'
,
null
);
$price
=
$this
->
get
(
'price'
,
null
);
$p_d
=
$this
->
get
(
'discount'
,
null
);
$channel
=
$this
->
getCookie
(
'_Channel'
,
'boys'
);
$dayLimit
=
$this
->
get
(
'dayLimit'
,
null
);
$limit
=
$this
->
get
(
'limit'
,
60
);
$page
=
$this
->
get
(
'page'
,
1
);
...
...
@@ -128,7 +126,7 @@ class NewsaleController extends AbstractAction
}
// 转换频道
$
this
->
channelTrans
(
$channel
);
$
channel
=
Helpers
::
getChannelByCookie
(
);
$data
=
NewsaleData
::
selectNewSaleProducts
(
$gender
,
$brand
,
$sort
,
$color
,
...
...
@@ -149,28 +147,4 @@ class NewsaleController extends AbstractAction
}
}
/**
* 转换频道
* @param string &$channel 待转换的频道
* @return integer 转换之后的频道
*/
private
function
channelTrans
(
&
$channel
)
{
switch
(
$channel
)
{
case
'girls'
:
$channel
=
2
;
break
;
case
'kids'
:
$channel
=
3
;
break
;
case
'lifestyle'
:
$channel
=
4
;
break
;
case
'boys'
:
default
:
$channel
=
1
;
break
;
}
}
}
...
...
yohobuy/m.yohobuy.com/configs/application.developer.ini
View file @
38b32b3
...
...
@@ -50,4 +50,4 @@ application.template.ext = ".phtml"
application.assets.path
=
ROOT_PATH "/assets"
; 应用的版本号
application.version
=
"0.0.1"
\ No newline at end of file
application.version
=
"0.0.2"
\ No newline at end of file
...
...
yohobuy/m.yohobuy.com/configs/application.production.ini
View file @
38b32b3
...
...
@@ -50,4 +50,4 @@ application.template.ext = ".phtml"
application.assets.path
=
ROOT_PATH "/assets"
; 应用的版本号
application.version
=
"0.0.1"
\ No newline at end of file
application.version
=
"0.0.2"
\ No newline at end of file
...
...
yohobuy/m.yohobuy.com/configs/application.testing.ini
View file @
38b32b3
...
...
@@ -50,4 +50,4 @@ application.template.ext = ".phtml"
application.assets.path
=
ROOT_PATH "/assets"
; 应用的版本号
application.version
=
"0.0.1"
\ No newline at end of file
application.version
=
"0.0.2"
\ No newline at end of file
...
...
yohobuy/m.yohobuy.com/configs/routes.index.ini
View file @
38b32b3
...
...
@@ -68,4 +68,18 @@ routes.brands.route.module = Category
routes.brands.route.controller
=
Brand
routes.brands.route.action
=
Index
; 新品到着(NEW)
routes.productnew.type
=
"rewrite"
routes.productnew.match
=
"/product/new"
routes.productnew.route.module
=
Product
routes.productnew.route.controller
=
Newsale
routes.productnew.route.action
=
Index
; 折扣专区(SALE)
routes.productsale.type
=
"rewrite"
routes.productsale.match
=
"/sale"
routes.productsale.route.module
=
Product
routes.productsale.route.controller
=
Newsale
routes.productsale.route.action
=
Discount
...
...
Please
register
or
login
to post a comment