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
Plain Diff
Browse Files
Authored by
Rock Zhang
9 years ago
Commit
f4f71f3ef4f5e1263202abf529ed1ef75555ace4
2 parents
7760fc66
a1528ab2
Merge branch 'feature/wap325' into develop
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
458 additions
and
153 deletions
library/Configs/CacheConfig.php
library/LibModels/Wap/Home/SideData.php
library/LibModels/Wap/Product/DetailData.php
static/js/guang/home.js
static/js/guang/info.js
static/sass/home/_side-nav.scss
static/sass/me/_browse-record.scss
template/m.yohobuy.com/actions/guang/index/index.phtml
template/m.yohobuy.com/actions/guang/index/page.phtml
template/m.yohobuy.com/actions/index/home/browse-record-content.phtml
template/m.yohobuy.com/actions/index/home/order-detail.phtml
template/m.yohobuy.com/partials/cart/good.phtml
template/m.yohobuy.com/partials/home/side_nav.phtml
yohobuy/m.yohobuy.com/application/models/Guang/Index.php
yohobuy/m.yohobuy.com/application/models/Home/Order.php
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
yohobuy/m.yohobuy.com/application/models/Index/Side.php
yohobuy/m.yohobuy.com/application/models/Index/User.php
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
yohobuy/m.yohobuy.com/application/modules/Guang/controllers/Index.php
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Detail.php
library/Configs/CacheConfig.php
View file @
f4f71f3
...
...
@@ -59,7 +59,9 @@ class CacheConfig
const
KEY_INDEX_BRANDS_LIST_DATA
=
'key_index_brands_list_data'
;
//频道brands数据
const
KEY_CODE_YOHOCOIN_BANNER
=
'key_code_yohocoin_banner'
;
// 有货币banner数据
const
KEY_CODE_LOGISTIC_BANNER
=
'key_code_logistic_banner'
;
// 物流详情banner数据
const
KEY_WEB_HOME_NAVBAR_DATA
=
'key_web_home_navbar_data'
;
//web的导航数据
const
KEY_WEB_HOME_CHANNEL_DATA
=
'key_web_home_channel_data'
;
//web首页频道数据[boys, girls, kids, lifestyle]
const
KEY_WEB_HOME_CHANNEL_NEWARRIVAL_DATA
=
'key_web_home_newarrival_data'
;
//web频道最新上架数据[boys, girls, kids, lifestyle]
...
...
library/LibModels/Wap/Home/SideData.php
View file @
f4f71f3
...
...
@@ -18,7 +18,7 @@ class SideData
{
const
URI_LEFTNAV_ENTRANCE
=
'operations/api/v5/entrance/getEntrance'
;
const
URI_LEFTNAV_CATEGORY
=
'operations/api/v
5
/category/getCategory'
;
const
URI_LEFTNAV_CATEGORY
=
'operations/api/v
6
/category/getCategory'
;
/**
* 左侧边栏的分类和图标数据
...
...
@@ -40,6 +40,7 @@ class SideData
$param
=
Yohobuy
::
param
();
$param
[
'client_type'
]
=
'h5'
;
// 调用H5手机网站的
$param
[
'private_key'
]
=
'fd4ad5fcfa0de589ef238c0e7331b585'
;
// 调用Android的private_key不然会有参数验证错误的bug
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_LEFTNAV_CATEGORY
,
$param
);
...
...
library/LibModels/Wap/Product/DetailData.php
View file @
f4f71f3
...
...
@@ -52,13 +52,20 @@ class DetailData
* 商品尺码信息
*
* @param int $productSkn 商品SKN号
* @param int $uid 用户ID
* @param int $udid 客户端唯一标识
* @return array
*/
public
static
function
sizeInfo
(
$productSkn
)
public
static
function
sizeInfo
(
$productSkn
,
$uid
,
$udid
)
{
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'h5.product.intro'
;
$param
[
'productskn'
]
=
$productSkn
;
if
(
!
empty
(
$uid
))
{
$param
[
'uid'
]
=
$uid
;
}
$param
[
'udid'
]
=
$udid
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
...
...
static/js/guang/home.js
View file @
f4f71f3
...
...
@@ -4,8 +4,7 @@
* @date: 2015/10/10
*/
var
$
=
require
(
'jquery'
),
Swiper
=
require
(
'yoho.iswiper'
);
var
$
=
require
(
'jquery'
);
var
info
=
require
(
'./info'
),
loadMore
=
info
.
loadMore
;
...
...
@@ -24,18 +23,12 @@ var $infoList = $('#info-list'),
var
state
=
{};
var
mySwiper
;
if
(
$loadMoreInfo
.
length
>
0
)
{
$loading
=
$loadMoreInfo
.
children
(
'.loading'
);
$noMore
=
$loadMoreInfo
.
children
(
'.no-more'
);
}
mySwiper
=
new
Swiper
(
'.swiper-container'
,
{
lazyLoading
:
true
,
pagination
:
'.swiper-pagination'
,
autoplay
:
3000
});
info
.
initSwiper
(
curType
);
info
.
initInfosEvt
(
$infoList
);
...
...
@@ -86,6 +79,7 @@ $nav.on('touchend touchcancel', function(e) {
$loading
.
addClass
(
'hide'
);
$noMore
.
addClass
(
'hide'
);
state
[
curType
].
isTab
=
true
;
loadMore
(
$content
,
state
[
curType
]);
}
else
{
...
...
static/js/guang/info.js
View file @
f4f71f3
...
...
@@ -7,16 +7,19 @@
var
$
=
require
(
'jquery'
),
Hammer
=
require
(
'yoho.hammer'
),
ellipsis
=
require
(
'mlellipsis'
),
lazyLoad
=
require
(
'yoho.lazyload'
);
lazyLoad
=
require
(
'yoho.lazyload'
),
Swiper
=
require
(
'yoho.iswiper'
);
var
tip
=
require
(
'../plugin/tip'
);
var
loading
=
require
(
'../plugin/loading'
);
var
$loadMoreInfo
=
$
(
'#load-more-info'
);
var
$loading
=
$
(
''
),
$noMore
=
$
(
''
);
$noMore
=
$
(
''
),
$swiper
=
$
(
''
);
var
searching
=
false
;
var
mySwiper
=
{};
ellipsis
.
init
();
...
...
@@ -25,6 +28,19 @@ if ($loadMoreInfo.length > 0) {
$noMore
=
$loadMoreInfo
.
children
(
'.no-more'
);
}
//初始化swiper
function
initSwiper
(
typeId
)
{
if
(
typeof
typeId
===
undefined
)
{
return
;
}
mySwiper
[
typeId
]
=
new
Swiper
(
'.swiper-cont-'
+
typeId
,
{
lazyLoading
:
true
,
wrapperClass
:
'swiper-wrap-'
+
typeId
,
pagination
:
'.swiper-pagi-'
+
typeId
,
autoplay
:
3000
});
}
/**
* 设置指定资讯项的Lazyload和文字截取
* @params $infos 资讯项
...
...
@@ -175,6 +191,14 @@ function loadMore($container, opt, url) {
$container
.
append
(
data
);
$swiper
=
$container
.
find
(
'.swiper-container'
);
if
(
$swiper
.
length
)
{
$swiper
.
addClass
(
'swiper-cont-'
+
opt
.
type
);
$swiper
.
children
(
'.swiper-wrapper'
).
addClass
(
'swiper-wrap-'
+
opt
.
type
);
$swiper
.
children
(
'.swiper-pagination'
).
addClass
(
'swiper-pagi-'
+
opt
.
type
);
initSwiper
(
opt
.
type
);
}
if
(
num
>
0
)
{
$newItems
=
$container
.
find
(
'.guang-info:gt('
+
(
num
-
1
)
+
')'
);
}
else
{
...
...
@@ -194,14 +218,19 @@ function loadMore($container, opt, url) {
opt
.
page
++
;
searching
=
false
;
delete
opt
.
isTab
;
},
error
:
function
()
{
tip
.
show
(
'网络断开连接了~'
);
searching
=
false
;
delete
opt
.
isTab
;
}
});
}
exports
.
mySwiper
=
mySwiper
;
exports
.
initSwiper
=
initSwiper
;
exports
.
initInfosEvt
=
initInfosEvt
;
exports
.
setLazyLoadAndMellipsis
=
setLazyLoadAndMellipsis
;
exports
.
loadMore
=
loadMore
;
\ No newline at end of file
...
...
static/sass/home/_side-nav.scss
View file @
f4f71f3
...
...
@@ -7,20 +7,40 @@
left
:
0
;
right
:
100rem
/
$pxConvertRem
;
width
:
540rem
/
$pxConvertRem
;
background
:
#f0f0f0
;
overflow
:
hidden
;
overflow-y
:
auto
;
@include
transition
(
all
.3s
);
ul
{
background
:
#f0f0f0
;
>
ul
{
margin-bottom
:
20rem
/
$pxConvertRem
;
background
:
#fff
;
border-top
:
1px
solid
#e0e0e0
;
border-bottom
:
1px
solid
#e0e0e0
;
}
li
{
position
:
relative
;
height
:
128rem
/
$pxConvertRem
;
line-height
:
128rem
/
$pxConvertRem
;
border-bottom
:
1px
solid
#e0e0e0
;
height
:
80rem
/
$pxConvertRem
;
line-height
:
80rem
/
$pxConvertRem
;
background
:
#fff
;
&
:after
{
content
:
''
;
position
:
absolute
;
right
:
0
;
bottom
:
0
;
width
:
430rem
/
$pxConvertRem
;
height
:
0
;
border-top
:
1px
solid
#e0e0e0
;
}
&
:last-child
{
&
:after
{
content
:
none
;
}
}
a
{
display
:
block
;
height
:
100%
;
...
...
@@ -29,6 +49,15 @@
font-size
:
24rem
/
$pxConvertRem
;
}
.title
{
display
:
inline-block
;
padding-left
:
10rem
/
$pxConvertRem
;
font-size
:
30rem
/
$pxConvertRem
;
vertical-align
:
baseline
;
// 此处字体小于 12px, 先扩大,再scale缩小
@include
transform
(
scale
(
0
.75
));
}
.nav-icon
,
.nav-img
{
position
:
absolute
;
width
:
60rem
/
$pxConvertRem
;
...
...
@@ -51,9 +80,38 @@
}
em
{
margin-right
:
10rem
/
$pxConvertRem
;
font-weight
:
bold
;
font-size
:
34rem
/
$pxConvertRem
;
font-size
:
30rem
/
$pxConvertRem
;
}
}
.first
{
li
{
height
:
100rem
/
$pxConvertRem
;
line-height
:
100rem
/
$pxConvertRem
;
border-bottom
:
1px
solid
#e0e0e0
;
&
:last-child
{
border-bottom
:
none
;
}
&
:after
{
content
:
none
;
}
a
{
font-size
:
40rem
/
$pxConvertRem
;
}
em
{
font-size
:
40rem
/
$pxConvertRem
;
}
.title
{
font-size
:
24rem
/
$pxConvertRem
;
@include
transform
(
scale
(
1
));
}
}
}
...
...
@@ -85,17 +143,17 @@
}
}
li
.new
{
margin
:
(
19rem
/
$pxConvertRem
)
0
0
;
border-top
:
1px
solid
#e0e0e0
;
a
{}
i
{
background
:
image-url
(
"side-nav/new.png"
)
no-repeat
left
center
;
background-size
:
100%
100%
;
}
}
// li.new {
// margin: (19rem / $pxConvertRem) 0 0;
// border-top: 1px solid #e0e0e0;
//
// a {}
//
// i {
// background: image-url("side-nav/new.png") no-repeat left center;
// background-size: 100% 100%;
// }
// }
li
.guang
,
li
.trendfinder
{
.nav-icon
{
...
...
@@ -123,16 +181,20 @@
@include
transition
(
transform
0
.3s
);
li
{
height
:
109rem
/
$pxConvertRem
;
line-height
:
109rem
/
$pxConvertRem
;
height
:
80rem
/
$pxConvertRem
;
line-height
:
80rem
/
$pxConvertRem
;
border
:
none
;
border-bottom
:
1px
solid
#e0e0e0
;
&
:after
{
content
:
none
;
}
a
{
position
:
relative
;
display
:
block
;
margin
:
0
0
0
(
30rem
/
$pxConvertRem
);
padding-left
:
50rem
/
$pxConvertRem
;
border-bottom
:
1px
solid
#e0e0e0
;
font-size
:
36rem
/
$pxConvertRem
;
z-index
:
2
;
}
...
...
@@ -173,7 +235,7 @@
a
{
color
:
#fff
;
border-bottom
:
none
;
padding-left
:
11
0rem
/
$pxConvertRem
;
padding-left
:
7
0rem
/
$pxConvertRem
;
}
.nav-back
{
...
...
@@ -185,6 +247,7 @@
.sub-nav.show
{
display
:
block
;
z-index
:
1
;
@include
transform
(
translateX
(
0
));
@include
transition
(
transform
0
.3s
);
}
...
...
static/sass/me/_browse-record.scss
View file @
f4f71f3
.browse-record-good
{
position
:
relative
;
padding
:
0
.5rem
0
0
.5rem
0
.75rem
;
display
:
block
;
.thumb
{
float
:
left
;
...
...
template/m.yohobuy.com/actions/guang/index/index.phtml
View file @
f4f71f3
{
{>
layout/header
}
}
<div
class=
"guang-list-page guang-page yoho-page"
>
{
{#
guang
}
}
{
{#if
swiper
}
}
<div
class=
"swiper-container"
>
<div
class=
"swiper-wrapper"
>
{
{#
swiper
}
}
<div
class=
"swiper-slide"
>
<a
href=
"{{url}}"
>
<img
class=
"swiper-lazy"
data-src=
"{{img}}"
>
</a>
<div
class=
"swiper-lazy-preloader"
></div>
</div>
{
{/
swiper
}
}
</div>
<div
class=
"swiper-pagination"
></div>
</div>
{
{/if
}
}
<ul
id=
"guang-nav"
class=
"guang-nav clearfix"
>
{
{#
navs
}
}
...
...
@@ -28,6 +13,23 @@
<div
id=
"info-list"
class=
"info-list-container"
>
{
{#
infos
}
}
<div
class=
"info-list{{^show}} hide{{/show}}"
>
{
{#if
show
}
}
{
{#if
../swiper
}
}
<div
class=
"swiper-container swiper-cont-{{@index}}"
>
<div
class=
"swiper-wrapper swiper-wrap-{{@index}}"
>
{
{#
swiper
}
}
<div
class=
"swiper-slide"
>
<a
href=
"{{url}}"
>
<img
class=
"swiper-lazy"
data-src=
"{{img}}"
>
</a>
<div
class=
"swiper-lazy-preloader"
></div>
</div>
{
{/
swiper
}
}
</div>
<div
class=
"swiper-pagination swiper-pagi-{{@index}}"
></div>
</div>
{
{/if
}
}
{
{/if
}
}
{
{#
info
}
}
{
{>
guang/info
}
}
{
{/
info
}
}
...
...
template/m.yohobuy.com/actions/guang/index/page.phtml
View file @
f4f71f3
{
{#if
swiper
}
}
<div
class=
"swiper-container"
>
<div
class=
"swiper-wrapper"
>
{
{#
swiper
}
}
<div
class=
"swiper-slide"
>
<a
href=
"{{url}}"
>
<img
class=
"swiper-lazy"
data-src=
"{{img}}"
>
</a>
<div
class=
"swiper-lazy-preloader"
></div>
</div>
{
{/
swiper
}
}
</div>
<div
class=
"swiper-pagination"
></div>
</div>
{
{/if
}
}
{
{#
infos
}
}
{
{>
guang/info
}
}
{
{/
infos
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/index/home/browse-record-content.phtml
View file @
f4f71f3
{
{#
browseRecord
}
}
<
div
class=
"browse-record-good clearfix"
data-skn=
"{{product_skn
}}"
>
<
a
class=
"browse-record-good clearfix"
data-skn=
"{{product_skn}}"
href=
"{{link
}}"
>
<img
class=
"thumb lazy"
data-original=
"{{image}}"
>
<div
class=
"deps clearfix"
>
<p
class=
"name row"
>
{
{product_name
}
}</p>
...
...
@@ -17,7 +17,7 @@
</p>
<span
class=
"iconfont del-icon"
>
621
;</span>
</div>
</
div
>
</
a
>
{
{/
browseRecord
}
}
{
{#if
noRecord
}
}
...
...
template/m.yohobuy.com/actions/index/home/order-detail.phtml
View file @
f4f71f3
...
...
@@ -60,6 +60,12 @@
运费
<span>
{
{freight
}
}</span>
</li>
{
{#if
promo_code_amount
}
}
<li>
优惠码
<span>
{
{promo_code_amount
}
}</span>
</li>
{
{/if
}
}
{
{#if
coupon
}
}
<li>
优惠券
...
...
template/m.yohobuy.com/partials/cart/good.phtml
View file @
f4f71f3
<div class="shopping-cart-good clearfix" data-id="{{id}}">
<div class="shopping-cart-good clearfix" data-id="{{id}}"
data-skn="{{skn}}"
>
{{#if inValid}}
<span class="few-tag-expire">失效</span>
{{/if}}
...
...
template/m.yohobuy.com/partials/home/side_nav.phtml
View file @
f4f71f3
<div class="side-nav">
<ul>
{{# sideNav}}
{{# sideNav}}
<ul {{#if @first}}class="first"{{/if}}>
{{# this}}
<li class="{{styleClass}}">
{{# url}}
<a href="{{.}}">
{{/ url}}
{{^ url}}
<a href="javascript:;">
{{/ url}}
{{#if url}}
<a href="{{url}}" style="{{#if color}}color:{{color}};{{/if}}">
{{else}}
<a href="javascript:;" style="{{#if color}}color:{{color}};{{/if}}">
{{/if}}
{{# img}}
<span class="nav-img" style="background-image: url({{.}})"></span>
{{/ img}}
{{^ img}}
<i class="nav-icon"></i>
{{/ img}}
<em>{{textCn}}</em>{{textEn}}
<em>{{textCn}}</em>
<span class="title">{{textEn}}</span>
{{# subNav}}
<span class="enter-subnav iconfont"></span>
{{/ subNav}}
...
...
@@ -22,13 +23,12 @@
{{# subNav}}
<ul class="sub-nav">
{{# list}}
<li class="{{# isSelect}}current{{/ isSelect}}" style="background-color:{{bgColor}}">
{{# url}}
<a href="{{.}}">
{{/ url}}
{{^ url}}
<a href="javascript:;">
{{/ url}}
<li class="{{# isSelect}}current{{/ isSelect}}" style="background-color:{{bgColor}};">
{{#if url}}
<a href="{{url}}" style="{{#if color}}color:{{color}};{{/if}}">
{{else}}
<a href="javascript:;" style="{{#if color}}color:{{color}};{{/if}}">
{{/if}}
{{^ back}}
<span class="nav-point iconfont"></span>
{{/ back}}
...
...
@@ -36,13 +36,14 @@
<i class="nav-back iconfont"></i>
{{/ back}}
<em>{{textCn}}</em>
{{textEn}}
<span class="title">{{textEn}}</span>
</a>
</li>
{{/ list}}
</ul>
{{/ subNav}}
</li>
{{/
sideNav
}}
{{/
this
}}
</ul>
</div>
\ No newline at end of file
{{/sideNav}}
</div>
...
...
yohobuy/m.yohobuy.com/application/models/Guang/Index.php
View file @
f4f71f3
...
...
@@ -315,6 +315,52 @@ class IndexModel
}
/**
* 获取切换逛类别或者分页时的文章数据
*
* @param string $gender "1,3"表示男, "2,3"表示女
* @param int $sortId 分类ID
* @param int $uid 用户ID
* @param string $udid 客户端唯一标识
* @param int $page 分页第几页, 默认第1页
* @param string $tag 标签
* @param string $authorId 作者ID
* @param boolean $isApp 是否是APP
* @param boolean $showAuthor 是否显示作者
* @param boolean $isTab 是否为tab切换操作
* @return array
*/
public
static
function
getPageData
(
$gender
,
$sortId
,
$uid
,
$udid
,
$page
,
$tag
,
$authorId
,
$isApp
,
$showAuthor
,
$isTab
)
{
$result
=
array
();
do
{
$article
=
ListData
::
article
(
$gender
,
$sortId
,
$uid
,
$udid
,
$page
,
$tag
,
$authorId
);
if
(
empty
(
$article
[
'data'
][
'list'
][
'artList'
]))
{
break
;
}
// 广告列表
if
(
$isTab
&&
!
empty
(
$article
[
'data'
][
'list'
][
'adlist'
]))
{
foreach
(
$article
[
'data'
][
'list'
][
'adlist'
]
as
$value
)
{
$build
=
array
();
$build
[
'url'
]
=
Helpers
::
getFilterUrl
(
$value
[
'url'
]);
$build
[
'img'
]
=
Helpers
::
getImageUrl
(
$value
[
'src'
],
830
,
327
);
$result
[
'swiper'
][]
=
$build
;
}
}
/* 构建资讯文章内容 */
$build
=
array
();
foreach
(
$article
[
'data'
][
'list'
][
'artList'
]
as
$article
)
{
$build
[]
=
Helpers
::
formatArticle
(
$article
,
true
,
$isApp
,
$showAuthor
,
$uid
);
}
$result
[
'infos'
]
=
$build
;
}
while
(
false
);
return
$result
;
}
/**
* 构建信息内容
*
* @param array $data
...
...
yohobuy/m.yohobuy.com/application/models/Home/Order.php
View file @
f4f71f3
...
...
@@ -2,6 +2,8 @@
namespace
Home
;
use
Configs\CacheConfig
;
use
LibModels\Wap\Home\IndexData
;
use
LibModels\Wap\Home\OrderData
;
use
Plugin\Helpers
;
...
...
@@ -14,6 +16,7 @@ class OrderModel
const
CODE_PAYMENT
=
'04cf5abaa7c20178325a07c4a833782c'
;
//支付订单资源码
const
CODE_STROLL
=
'a7989369aa86681c678bc40f171b8f1d'
;
//随便逛逛url地址资源码
const
CODE_LOGISTIC_BANNER
=
'1fc9b2484fcd559049f2f7e0db313f20'
;
// 物流详情banner资源码
/**
* 订单相关数据处理
...
...
@@ -99,23 +102,80 @@ class OrderModel
{
$result
=
array
();
if
(
isset
(
$orderCode
)
&&
is_numeric
(
$uid
))
{
do
{
if
(
!
isset
(
$orderCode
)
||
!
is_numeric
(
$uid
))
{
break
;
}
$logistics
=
OrderData
::
LogisticsData
(
$orderCode
,
$uid
);
if
(
!
empty
(
$logistics
[
'data'
]))
{
$result
[
'logisticUrl'
]
=
$logistics
[
'data'
][
'url'
];
$result
[
'logisticImg'
]
=
$logistics
[
'data'
][
'logo'
];
$result
[
'logisticCompany'
]
=
$logistics
[
'data'
][
'caption'
];
$result
[
'logisticNumber'
]
=
$logistics
[
'data'
][
'express_number'
];
$build
=
array
();
foreach
(
$logistics
[
'data'
][
'express_detail'
]
as
$value
)
{
$build
[
'status'
]
=
$value
[
'accept_address'
];
$build
[
'date'
]
=
$value
[
'acceptTime'
];
$result
[
'logisticDetail'
][]
=
$build
;
if
(
empty
(
$logistics
[
'data'
]))
{
break
;
}
$result
[
'logisticUrl'
]
=
$logistics
[
'data'
][
'url'
];
$result
[
'logisticImg'
]
=
$logistics
[
'data'
][
'logo'
];
$result
[
'logisticCompany'
]
=
$logistics
[
'data'
][
'caption'
];
$result
[
'logisticNumber'
]
=
$logistics
[
'data'
][
'express_number'
];
$build
=
array
();
foreach
(
$logistics
[
'data'
][
'express_detail'
]
as
$value
)
{
$build
[
'status'
]
=
$value
[
'accept_address'
];
$build
[
'date'
]
=
$value
[
'acceptTime'
];
$result
[
'logisticDetail'
][]
=
$build
;
}
// 获取物流详情页banner
$banner
=
self
::
getLogisterBanner
();
if
(
$banner
)
{
$result
[
'banner'
]
=
$banner
;
}
}
while
(
false
);
return
$result
;
}
/**
* 获取物流详情页banner
*
* @return array|bool
*/
private
static
function
getLogisterBanner
()
{
$result
=
false
;
if
(
USE_CACHE
)
{
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result
=
Cache
::
get
(
CacheConfig
::
KEY_CODE_LOGISTIC_BANNER
,
'master'
);
if
(
!
empty
(
$result
))
{
return
$result
;
}
}
// 调用接口获取数据
$banner
=
IndexData
::
getBannerStart
(
self
::
CODE_LOGISTIC_BANNER
);
if
(
isset
(
$banner
[
'code'
])
&&
$banner
[
'code'
]
==
200
&&
!
empty
(
$banner
[
'data'
]))
{
$result
=
array
();
// 处理数据
foreach
(
$banner
[
'data'
]
as
$val
)
{
foreach
(
$val
[
'data'
]
as
$single
)
{
$result
[
'url'
]
=
Helpers
::
getFilterUrl
(
$single
[
'url'
]);
$result
[
'img'
]
=
Helpers
::
getImageUrl
(
$single
[
'src'
],
640
,
200
);
}
}
}
if
(
USE_CACHE
)
{
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if
(
empty
(
$result
))
{
$result
=
Cache
::
get
(
CacheConfig
::
KEY_CODE_LOGISTIC_BANNER
,
'slave'
);
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else
{
Cache
::
set
(
CacheConfig
::
KEY_CODE_LOGISTIC_BANNER
,
$result
);
}
}
return
$result
;
}
...
...
@@ -148,6 +208,10 @@ class OrderModel
$result
[
'salePrice'
]
=
self
::
filterOrderPrice
(
$orderDetail
[
'data'
][
'promotion_amount'
]);
// 活动金额
$result
[
'freight'
]
=
$orderDetail
[
'data'
][
'shipping_cost'
];
// 运费
$result
[
'coupon'
]
=
self
::
filterOrderPrice
(
$orderDetail
[
'data'
][
'coupons_amount'
]);
// 优惠券
if
(
isset
(
$orderDetail
[
'data'
][
'promo_code_amount'
]))
{
$result
[
'promo_code_amount'
]
=
self
::
filterOrderPrice
(
$orderDetail
[
'data'
][
'promo_code_amount'
]);
// 优惠码
}
$result
[
'yohoCoin'
]
=
self
::
filterOrderPrice
(
$orderDetail
[
'data'
][
'yoho_coin_num'
]);
// YOHO币
$result
[
'price'
]
=
$orderDetail
[
'data'
][
'amount'
];
// 实付金额
$result
[
'goodsAmount'
]
=
$orderDetail
[
'data'
][
'payment_amount'
];
// 商品总金额没有人民币符号
...
...
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
f4f71f3
...
...
@@ -224,8 +224,7 @@ class CartModel
$product
=
CartData
::
cartProductData
(
$uid
,
$skn
);
if
(
isset
(
$product
[
'code'
])
&&
$product
[
'code'
]
===
200
)
{
$result
[
'code'
]
=
200
;
$result
[
'data'
]
=
self
::
procGoodsDetail
(
$product
[
'data'
],
$num
);
$result
=
self
::
procGoodsDetail
(
$product
[
'data'
],
$num
);
}
return
$result
;
...
...
@@ -244,7 +243,7 @@ class CartModel
$product
=
CartData
::
giftProductData
(
$skn
,
$promotionId
);
if
(
isset
(
$product
[
'code'
])
&&
$product
[
'code'
]
===
200
)
{
$result
[
'data'
]
=
self
::
procGoodsDetail
(
$product
[
'data'
]);
$result
=
self
::
procGoodsDetail
(
$product
[
'data'
]);
}
return
$result
;
...
...
yohobuy/m.yohobuy.com/application/models/Index/Side.php
View file @
f4f71f3
...
...
@@ -8,7 +8,7 @@ use Plugin\Helpers;
use
Plugin\Cache
;
/**
*
*
* @name SideModel
* @package models/Index
* @copyright yoho.inc
...
...
@@ -20,7 +20,7 @@ class SideModel
/**
* 获取左侧边栏数据
*
*
* @param string $guangChoosed 逛默认选中项 "all"表示全部,"boys":只看男生,"girls":只看女生
*/
public
static
function
getLeftNav
(
$guangChoosed
=
'all'
)
...
...
@@ -39,16 +39,47 @@ class SideModel
// 调用接口获取后台配置的侧边栏数据
$side
=
SideData
::
leftNav
();
if
(
!
empty
(
$side
[
'data'
]))
{
$group
=
array
();
$num
=
0
;
$groupKey
=
0
;
$count
=
count
((
$side
[
'data'
]));
foreach
(
$side
[
'data'
]
as
$key
=>
$value
)
{
if
(
$value
[
'separative_sign'
]
===
'Y'
)
{
$result
[
$num
]
=
$group
;
$num
++
;
$groupKey
=
0
;
$group
=
array
();
}
// 逛的按照原来的做法,使用配置
if
(
$value
[
'sort_name_en'
]
===
'TRENDFINDER'
)
{
continue
;
}
$result
[
$key
][
'textCn'
]
=
$value
[
'sort_name'
];
$result
[
$key
][
'textEn'
]
=
$value
[
'sort_name_en'
];
$result
[
$key
][
'styleClass'
]
=
strtolower
(
$value
[
'sort_name_en'
]);
$result
[
$key
][
'url'
]
=
Helpers
::
getFilterUrl
(
$value
[
'sort_url'
]);
$result
[
$key
][
'img'
]
=
Helpers
::
getImageUrl
(
$value
[
'sort_ico'
],
60
,
60
,
1
);
$group
[
$groupKey
]
=
self
::
formatSideItem
(
$value
);
// 如果存在子菜单,就输出子菜单
if
(
isset
(
$value
[
'sub'
])
&&
!
empty
(
$value
[
'sub'
]))
{
$subs
=
array
(
array
(
'textCn'
=>
$group
[
$groupKey
][
'textCn'
],
'textEn'
=>
$group
[
$groupKey
][
'textEn'
],
'back'
=>
true
,
'isSelect'
=>
false
,
'bgColor'
=>
self
::
getSideTopColor
(
$guangChoosed
)
)
);
foreach
(
$value
[
'sub'
]
as
$oneSub
)
{
$subs
[]
=
self
::
formatSideItem
(
$oneSub
);
}
$group
[
$groupKey
][
'styleClass'
]
=
'guang'
;
$group
[
$groupKey
][
'subNav'
][
'list'
]
=
$subs
;
}
$groupKey
++
;
if
(
$count
===
$key
+
1
)
{
$result
[
$num
]
=
$group
;
}
}
}
...
...
@@ -71,13 +102,65 @@ class SideModel
/**
* 获取并生成左侧边栏中逛的数据
*
*
* @param string $guangChoosed 逛默认选中项 "all"表示全部,"boys":只看男生,"girls":只看女生
* @return array
*/
private
static
function
genLeftNavGuang
(
$guangChoosed
=
'all'
)
{
// 判断逛的背景色
$color
=
self
::
getSideTopColor
(
$guangChoosed
);
return
array
(
array
(
'textCn'
=>
'逛'
,
'textEn'
=>
'TRENDFINDER'
,
'styleClass'
=>
'guang'
,
'subNav'
=>
array
(
'list'
=>
array
(
0
=>
array
(
'textCn'
=>
'逛'
,
'textEn'
=>
'TrendFinder'
,
'back'
=>
true
,
'isSelect'
=>
false
,
'bgColor'
=>
$color
,
),
1
=>
array
(
'textCn'
=>
'查看全部'
,
'textEn'
=>
''
,
'back'
=>
false
,
'isSelect'
=>
(
$guangChoosed
===
'lifestyle'
||
$guangChoosed
===
'kids'
)
?
true
:
false
,
'url'
=>
Helpers
::
url
(
''
,
array
(
'gender'
=>
'1,2,3'
),
'guang'
)
),
2
=>
array
(
'textCn'
=>
'只看男生'
,
'textEn'
=>
'Boys'
,
'back'
=>
false
,
'isSelect'
=>
(
$guangChoosed
===
'boys'
)
?
true
:
false
,
'url'
=>
Helpers
::
url
(
''
,
array
(
'gender'
=>
'1,3'
),
'guang'
)
),
3
=>
array
(
'textCn'
=>
'只看女生'
,
'textEn'
=>
'Girls'
,
'back'
=>
false
,
'isSelect'
=>
(
$guangChoosed
===
'girls'
)
?
true
:
false
,
'url'
=>
Helpers
::
url
(
''
,
array
(
'gender'
=>
'2,3'
),
'guang'
)
),
)
)
)
);
}
/**
* 根据选择的频道获取逛的背景色
* @param string $guangChoosed 逛默认选中项 "all"表示全部,"boys":只看男生,"girls":只看女生
* @return string color值
*/
private
static
function
getSideTopColor
(
$guangChoosed
)
{
// 判断逛的背景色
$color
=
false
;
if
(
$guangChoosed
===
'girls'
)
{
$color
=
'#FF88AE'
;
...
...
@@ -87,43 +170,30 @@ class SideModel
$color
=
'#4f4138'
;
}
return
array
(
'textCn'
=>
'逛'
,
'textEn'
=>
'TRENDFINDER'
,
'styleClass'
=>
'guang'
,
'subNav'
=>
array
(
'list'
=>
array
(
0
=>
array
(
'textCn'
=>
'逛'
,
'textEn'
=>
'TrendFinder'
,
'back'
=>
true
,
'isSelect'
=>
false
,
'bgColor'
=>
$color
,
),
1
=>
array
(
'textCn'
=>
'查看全部'
,
'textEn'
=>
''
,
'back'
=>
false
,
'isSelect'
=>
(
$guangChoosed
===
'lifestyle'
||
$guangChoosed
===
'kids'
)
?
true
:
false
,
'url'
=>
Helpers
::
url
(
''
,
array
(
'gender'
=>
'1,2,3'
),
'guang'
)
),
2
=>
array
(
'textCn'
=>
'只看男生'
,
'textEn'
=>
'Boys'
,
'back'
=>
false
,
'isSelect'
=>
(
$guangChoosed
===
'boys'
)
?
true
:
false
,
'url'
=>
Helpers
::
url
(
''
,
array
(
'gender'
=>
'1,3'
),
'guang'
)
),
3
=>
array
(
'textCn'
=>
'只看女生'
,
'textEn'
=>
'Girls'
,
'back'
=>
false
,
'isSelect'
=>
(
$guangChoosed
===
'girls'
)
?
true
:
false
,
'url'
=>
Helpers
::
url
(
''
,
array
(
'gender'
=>
'2,3'
),
'guang'
)
),
)
)
);
return
$color
;
}
/**
* 格式化侧边栏数据
*
* @param array $data 要格式化的侧边栏数据
* @return array
*/
private
static
function
formatSideItem
(
$data
)
{
$result
=
array
();
$result
[
'textCn'
]
=
$data
[
'sort_name'
];
$result
[
'textEn'
]
=
$data
[
'sort_name_en'
];
$result
[
'styleClass'
]
=
strtolower
(
$data
[
'sort_name_en'
]);
$result
[
'url'
]
=
Helpers
::
getFilterUrl
(
$data
[
'sort_url'
]);
$result
[
'img'
]
=
Helpers
::
getImageUrl
(
$data
[
'sort_ico'
],
60
,
60
,
1
);
if
(
isset
(
$data
[
'sort_name_color'
]))
{
$result
[
'color'
]
=
$data
[
'sort_name_color'
];
}
return
$result
;
}
}
...
...
yohobuy/m.yohobuy.com/application/models/Index/User.php
View file @
f4f71f3
...
...
@@ -378,6 +378,11 @@ class UserModel
return
$result
;
}
/**
* 获取有货币页面的banner数据
*
* @return array|bool|mixed
*/
public
static
function
getYohoCoinBanner
()
{
$result
=
false
;
...
...
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
View file @
f4f71f3
...
...
@@ -335,15 +335,17 @@ class DetailModel
* 商品尺码信息
*
* @param int $productSkn
* @param int $uid 用户ID
* @param int $udid 客户端唯一标识
* @return array
*/
public
static
function
getSizeInfo
(
$productSkn
)
public
static
function
getSizeInfo
(
$productSkn
,
$uid
,
$udid
)
{
$result
=
array
();
if
(
is_numeric
(
$productSkn
))
{
// 调用服务
$sizeInfo
=
DetailData
::
sizeInfo
(
$productSkn
);
$sizeInfo
=
DetailData
::
sizeInfo
(
$productSkn
,
$uid
,
$udid
);
// 商品信息
if
(
isset
(
$sizeInfo
[
'productDescBo'
][
'erpProductId'
]))
{
...
...
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
View file @
f4f71f3
...
...
@@ -195,7 +195,9 @@ class IndexController extends AbstractAction
$result
[
'num'
]
=
$num
;
}
$this
->
echoJson
(
$result
);
$this
->
_view
->
display
(
'gift-info'
,
array
(
'cartInfo'
=>
$result
));
}
// /*
...
...
@@ -223,7 +225,7 @@ class IndexController extends AbstractAction
$this
->
_view
->
display
(
'gift-info'
,
array
(
'promotionId'
=>
$promotionId
,
'cartInfo'
=>
$result
[
'data'
]
'cartInfo'
=>
$result
));
}
...
...
yohobuy/m.yohobuy.com/application/modules/Guang/controllers/Index.php
View file @
f4f71f3
<?php
use
Action\AbstractAction
;
use
Guang\IndexModel
;
use
LibModels\Wap\Guang\ListData
;
use
Plugin\Helpers
;
use
Plugin\Cache
;
...
...
@@ -42,7 +43,7 @@ class IndexController extends AbstractAction
// $this->setNavSide();
// }
$this
->
_view
->
display
(
'index'
,
Guang\
IndexModel
::
getArticle
(
$gender
,
$type
,
$uid
,
$udid
));
$this
->
_view
->
display
(
'index'
,
IndexModel
::
getArticle
(
$gender
,
$type
,
$uid
,
$udid
));
}
/**
...
...
@@ -91,7 +92,7 @@ class IndexController extends AbstractAction
// 标签聚合内容列表
//$article = ListData::article($gender, 0, $uid, $udid, 1, $tag);
$article
=
Guang\
IndexModel
::
getArticleByTagOrEditor
(
$gender
,
0
,
$uid
,
$udid
,
1
,
$tag
);
$article
=
IndexModel
::
getArticleByTagOrEditor
(
$gender
,
0
,
$uid
,
$udid
,
1
,
$tag
);
// 标签聚合内容不存在, 跳到错误页面
if
(
empty
(
$article
[
'data'
][
'list'
][
'artList'
]))
{
$this
->
error
();
...
...
@@ -184,7 +185,7 @@ class IndexController extends AbstractAction
// 标签聚合内容列表
//$article = ListData::article($gender, 0, $uid, $udid, 1, null, $id);
$article
=
Guang\
IndexModel
::
getArticleByTagOrEditor
(
$gender
,
0
,
$uid
,
$udid
,
1
,
null
,
$id
);
$article
=
IndexModel
::
getArticleByTagOrEditor
(
$gender
,
0
,
$uid
,
$udid
,
1
,
null
,
$id
);
// 构建资讯文章内容
if
(
!
empty
(
$article
[
'data'
][
'list'
][
'artList'
]))
{
$build
=
array
();
...
...
@@ -227,6 +228,7 @@ class IndexController extends AbstractAction
$gender
=
$this
->
get
(
'gender'
);
$authorId
=
$this
->
get
(
'authorId'
);
$isApp
=
$this
->
get
(
'isApp'
,
false
);
$isTab
=
$this
->
get
(
'isTab'
,
false
);
// 是否为tab切换操作
$showAuthor
=
true
;
if
(
!
empty
(
$sortId
)
&&
!
is_numeric
(
$sortId
))
{
break
;
...
...
@@ -247,18 +249,7 @@ class IndexController extends AbstractAction
$udid
=
$this
->
getUdid
();
}
//$page = intval($page) + 1;
$article
=
ListData
::
article
(
$gender
,
$sortId
,
$uid
,
$udid
,
$page
,
$tag
,
$authorId
);
if
(
empty
(
$article
[
'data'
][
'list'
][
'artList'
]))
{
break
;
}
/* 构建资讯文章内容 */
$data
=
array
();
$build
=
array
();
foreach
(
$article
[
'data'
][
'list'
][
'artList'
]
as
$article
)
{
$build
[]
=
Helpers
::
formatArticle
(
$article
,
true
,
$isApp
,
$showAuthor
,
$uid
);
}
$data
[
'infos'
]
=
$build
;
$data
=
IndexModel
::
getPageData
(
$gender
,
$sortId
,
$uid
,
$udid
,
$page
,
$tag
,
$authorId
,
$isApp
,
$showAuthor
,
$isTab
);
}
while
(
false
);
if
(
isset
(
$data
))
{
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Detail.php
View file @
f4f71f3
...
...
@@ -90,7 +90,11 @@ class DetailController extends AbstractAction
if
(
!
is_numeric
(
$productSkn
))
{
echo
' '
;
}
$data
=
\Product\DetailModel
::
getSizeInfo
(
$productSkn
);
// 加入uid和udid参数,为了实现记录浏览记录的功能
$uid
=
$this
->
getUid
();
$udid
=
$this
->
getUdid
();
$data
=
\Product\DetailModel
::
getSizeInfo
(
$productSkn
,
$uid
,
$udid
);
if
(
array
()
===
$data
)
{
echo
' '
;
exit
();
...
...
Please
register
or
login
to post a comment