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
497b0559f874ac9b23cddd6c19d574875b0a0823
2 parents
68314275
40e854be
Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
254 additions
and
186 deletions
docs/data-structure.md
static/js/me/index.js
static/sass/me/_home.scss
static/sass/product/_comments-consults.scss
static/sass/product/_detail.scss
static/sass/product/_product-description.scss
template/m.yohobuy.com/actions/index/home/index.phtml
template/m.yohobuy.com/actions/product/detail/consults.phtml
template/m.yohobuy.com/actions/product/detail/index.phtml
template/m.yohobuy.com/partials/layout/use.phtml
template/m.yohobuy.com/partials/product/feedback-tab.phtml
template/m.yohobuy.com/partials/product/product-description.phtml
yohobuy/m.yohobuy.com/application/controllers/Home.php
yohobuy/m.yohobuy.com/application/models/home/Online.php → yohobuy/m.yohobuy.com/application/models/Home/Online.php
docs/data-structure.md
View file @
497b055
...
...
@@ -1243,6 +1243,6 @@
'cartInfo' : {
'numInCart' : 3,
'goodsInstore' : 0,
'isCollect':true
'isCollect':true
//
}
}
...
...
static/js/me/index.js
View file @
497b055
...
...
@@ -9,6 +9,8 @@ var $userAvatar = $('.user-avatar'),
var
myImage
=
new
Image
();
require
(
'../product/recommend-for-you.js'
);
require
(
'../product/suspend-cart.js'
);
myImage
.
src
=
$userAvatar
.
attr
(
'src'
);
myImage
.
onerror
=
function
()
{
$userAvatar
.
attr
(
'src'
,
'http://static.dev.yohobuy.com/img/me/index/user-avatar.png'
);
...
...
static/sass/me/_home.scss
View file @
497b055
...
...
@@ -28,7 +28,12 @@
}
.username
{
float
:
left
;
padding
:
0
pxToRem
(
16px
);
text-overflow
:
ellipsis
;
overflow
:
hidden
;
white-space
:
nowrap
;
max-width
:
pxToRem
(
290px
);
}
.vip-icon
{
...
...
static/sass/product/_comments-consults.scss
View file @
497b055
.goods-comments-page
{
.goods-comments
{
.comment-item
{
border
:
1px
solid
$borderC
;
border
-bottom
:
1px
solid
$borderC
;
padding
:
0
pxToRem
(
28px
);
.user-name
{
font-size
:
pxToRem
(
24px
);
...
...
@@ -44,7 +44,8 @@
height
:
pxToRem
(
120px
);
background-color
:
#ffffff
;
i
,
span
{
span
,
a
{
line-height
:
pxToRem
(
120px
);
font-size
:
pxToRem
(
28px
);
color
:
$mainFontC
;
...
...
static/sass/product/_detail.scss
View file @
497b055
...
...
@@ -30,50 +30,52 @@ $basicBtnC:#eb0313;
left
:
pxToRem
(
30px
);
right
:
auto
;
}
.tag-container
{
.tag-container
{
position
:
absolute
;
left
:
pxToRem
(
108px
);
top
:
pxToRem
(
40px
);
height
:
pxToRem
(
35px
);
// width: pxToRem(70px);
color
:
#fff
;
font-size
:
pxToRem
(
20px
);
line-height
:
pxToRem
(
35px
);
z-index
:
2
;
.good-tag
{
display
:
inline-block
;
box-sizing
:
border-box
;
margin-left
:
.5px
;
font-size
:
pxToRem
(
23px
);
text-align
:
center
;
line-height
:
pxToRem
(
35px
);
padding
:
0
8px
;
}
.new-tag
{
background-color
:
#78dc7e
;
color
:
#fff
;
}
.renew-tag
{
background-color
:
#78dc7e
;
color
:
#fff
;
}
.sale-tag
{
background-color
:
#ff575c
;
color
:
#fff
;
}
.new-festival-tag
{
background-color
:
#000
;
color
:
#fff
;
}
.limit-tag
{
border
:
1px
solid
#000
;
color
:
#000
;
}
.soonSoldOut-tag
{
background-color
:
#ffac5b
;
color
:
#fff
;
}
// width: pxToRem(70px);
color
:
#fff
;
font-size
:
pxToRem
(
20px
);
line-height
:
pxToRem
(
35px
);
z-index
:
2
;
.good-tag
{
display
:
inline-block
;
box-sizing
:
border-box
;
margin-left
:
.5px
;
font-size
:
pxToRem
(
23px
);
text-align
:
center
;
line-height
:
pxToRem
(
35px
);
padding
:
0
8px
;
}
.new-tag
{
background-color
:
#78dc7e
;
color
:
#fff
;
}
.renew-tag
{
background-color
:
#78dc7e
;
color
:
#fff
;
}
.sale-tag
{
background-color
:
#ff575c
;
color
:
#fff
;
}
.new-festival-tag
{
background-color
:
#000
;
color
:
#fff
;
}
.limit-tag
{
border
:
1px
solid
#000
;
color
:
#000
;
}
.soonSoldOut-tag
{
background-color
:
#ffac5b
;
color
:
#fff
;
}
}
.good-detail-page
{
overflow
:
hidden
;
background-color
:
#f0f0f0
;
...
...
@@ -104,16 +106,16 @@ $basicBtnC:#eb0313;
width
:
100%
;
// .row {
// display: table-row;
.column
{
box-sizing
:border-box
;
display
:
table-cell
;
padding
:
pxToRem
(
16px
)
pxToRem
(
12px
);
width
:
50%
;
border
:
1px
solid
#fff
;
font-size
:
pxToRem
(
24px
);
background-color
:
$tableCellC
;
float
:left
;
}
.column
{
box-sizing
:
border-box
;
display
:
table-cell
;
padding
:
pxToRem
(
16px
)
pxToRem
(
12px
);
width
:
50%
;
border
:
1px
solid
#fff
;
font-size
:
pxToRem
(
24px
);
background-color
:
$tableCellC
;
float
:
left
;
}
// }
}
}
...
...
@@ -136,15 +138,15 @@ $basicBtnC:#eb0313;
position
:
absolute
;
z-index
:
2
;
bottom
:
pxToRem
(
40px
);
.pagination-inner
{
span
{
.pagination-inner
{
span
{
background-color
:
#b0b0b0
;
}
.swiper-pagination-bullet
{
margin-right
:
2px
;
}
.swiper-pagination-bullet-active
{
background-color
:
#000
;
background-color
:
#000
;
}
}
}
...
...
@@ -227,8 +229,45 @@ $basicBtnC:#eb0313;
vertical-align
:
middle
;
}
}
.vip-level
{
box-sizing
:
box-border
;
padding-left
:
pxToRem
(
28px
);
padding-right
:
pxToRem
(
28px
);
min-height
:
pxToRem
(
88px
);
background-color
:
#fff
;
.icons-item
{
float
:
left
;
width
:
33
.3%
;
height
:
pxToRem
(
88px
);
span
{
display
:
inline-block
;
line-height
:
pxToRem
(
88px
);
}
.vip-img
{
padding-right
:
pxToRem
(
22px
);
.img
{
width
:
pxToRem
(
53px
);
height
:
pxToRem
(
32px
);
}
&
:nth-child
(
3n-3
)
.img
{
background
:
image-url
(
'product/silver.png'
)
no-repeat
;
}
&
:nth-child
(
3n-2
)
.img
{
background
:
image-url
(
'product/golden.png'
)
no-repeat
;
}
&
:nth-child
(
3n-1
)
.img
{
background
:
image-url
(
'product/platinum.png'
)
no-repeat
;
}
}
&
:first-child
{
float
:
left
;
}
&
:last-child
{
float
:
right
;
}
}
}
.vipLevel
{
width
:
100%
;
box-sizing
:
border-box
;
background-color
:
#fff
;
display
:
table
;
...
...
@@ -242,25 +281,24 @@ $basicBtnC:#eb0313;
display
:
table-cell
;
vertical-align
:
middle
;
}
.vip-img
{
.vip-img
{
padding-right
:
pxToRem
(
22px
);
.img
{
width
:
pxToRem
(
52px
);
height
:
pxToRem
(
32px
);
.img
{
width
:
pxToRem
(
53px
);
height
:
pxToRem
(
33px
);
}
&
:nth-child
(
3n-3
)
.img
{
&
:nth-child
(
3n-3
)
.img
{
background
:
image-url
(
'product/silver.png'
)
no-repeat
;
}
&
:nth-child
(
3n-2
)
.img
{
&
:nth-child
(
3n-2
)
.img
{
background
:
image-url
(
'product/golden.png'
)
no-repeat
;
}
&
:nth-child
(
3n-1
)
.img
{
&
:nth-child
(
3n-1
)
.img
{
background
:
image-url
(
'product/platinum.png'
)
no-repeat
;
}
}
.vip-price
{
padding-right
:
pxToRem
(
5
5
px
);
padding-right
:
pxToRem
(
5
2
px
);
}
.vip-price
:last-child
{
padding-right
:
0
;
...
...
@@ -295,7 +333,6 @@ $basicBtnC:#eb0313;
.goodsDiscount
{
text-indent
:
pxToRem
(
-14px
);
}
.enter-store
{
min-height
:
pxToRem
(
100px
);
display
:
table
;
...
...
@@ -327,7 +364,6 @@ $basicBtnC:#eb0313;
}
}
}
//底部固定栏
.cart-bar
{
position
:
relative
;
...
...
@@ -350,10 +386,10 @@ $basicBtnC:#eb0313;
font-size
:
pxToRem
(
34px
);
color
:
#ccc
}
&
.favorite.liked
{
color
:
$basicBtnC
;;
&
.favorite.liked
{
color
:
$basicBtnC
;
;
}
&
.addto-cart
,
&
.sold-out
{
height
:
pxToRem
(
80px
);
...
...
@@ -382,10 +418,10 @@ $basicBtnC:#eb0313;
font-size
:
pxToRem
(
24px
);
}
}
.recommend-for-you
{
.recommend-for-you
{
margin-bottom
:
pxToRem
(
120px
);
}
}
@import
"comments-consults"
;
@import
"product-description"
;
\ No newline at end of file
@import
"product-description"
;
...
...
static/sass/product/_product-description.scss
View file @
497b055
.good-detail-page
{
.goods-desc
{
.service
{
width
:
pxToRem
(
4
89
px
);
width
:
pxToRem
(
4
94
px
);
height
:
pxToRem
(
28px
);
margin-top
:
pxToRem
(
22px
);
margin-left
:
pxToRem
(
40px
);
background
:
image-url
(
'product/service.png'
)
no-repeat
;
background-size
:
cover
;
}
.detail
{
background-color
:
$tableCellC
;
...
...
template/m.yohobuy.com/actions/index/home/index.phtml
View file @
497b055
...
...
@@ -102,5 +102,8 @@
</div>
{
{>
product/recommend-for-you
}
}
{
{>
product/suspend-cart
}
}
</div>
{
{>
layout/download_app
}
}
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/product/detail/consults.phtml
View file @
497b055
...
...
@@ -3,7 +3,7 @@
<div
class=
"goto-consult"
>
<i
class=
"iconfont consult-logo"
>
639
;</i>
<span>我要咨询</span>
<
i
class=
"iconfont enter-consult-page"
>
604
;</i
>
<
a
href=
"/product/detail/consultform"
class=
"iconfont enter-consult-page"
>
604
;</a
>
</div>
{
{#
consults
}
}
<div
class=
"goods-consults"
>
...
...
template/m.yohobuy.com/actions/product/detail/index.phtml
View file @
497b055
...
...
@@ -52,6 +52,19 @@
{
{/
periodOfMarket
}
}
</div>
<!--
{
{#
vipLevel
}
}
<ul
class=
"vip-level clearfix"
>
{
{#
list
}
}
<li
class=
"icons-item"
>
<span
class=
"vip-img"
>
<div
class=
"img"
alt=
""
style=
"background-size:cover;"
></div>
</span>
<span
class=
"vip-price"
>
{
{text
}
}</span>
</li>
{
{/
list
}
}
</ul>
{
{/vipLevel
}
}
-->
{
{#
vipLevel
}
}
<div
class=
"vipLevel"
>
{
{#
list
}
}
...
...
@@ -112,17 +125,14 @@
{
{#if
numInCart
}
}
<span
class=
"num-tag"
>
{
{numInCart
}
}</span>
{
{/if
}
}
<a
href=
""
class=
"num-incart iconfont"
>
62
c;</a>
<a
href=
"
/shoppingCart
"
class=
"num-incart iconfont"
>
62
c;</a>
{
{#if
goodsInstore
}
}
<a
href=
""
class=
"addto-cart "
>加入购物车</a>
<a
href=
"
/shoppingCart
"
class=
"addto-cart "
>加入购物车</a>
{
{else
}
}
<a
href=
""
class=
"sold-out"
>已售罄</a>
{
{/if
}
}
{
{#if
isCollect
}
}
<a
href=
"#"
id=
"likeBtn"
class=
"favorite iconfont liked"
>
605
;</a>
{
{else
}
}
<a
href=
""
id=
"likeBtn"
class=
"favorite iconfont"
>
605
;</a>
<a
href=
"javascript:;"
class=
"sold-out"
>已售罄</a>
{
{/if
}
}
<a
href=
"#"
id=
"likeBtn"
class=
"favorite iconfont {{#isCollect}}liked{{/isCollect}}"
>
605
;</a>
</div>
{
{/cartInfo
}
}
...
...
template/m.yohobuy.com/partials/layout/use.phtml
View file @
497b055
...
...
@@ -166,7 +166,13 @@
{{!-- 商品详情评论 --}}
{{#if goodsCommentsPage}}
<script>
seajs.use('js/product/detail/comments-consults');
seajs.use('js/product/detail/loadmore');
</script>
{{/if}}
{{!-- 商品详情咨询 --}}
{{#if goodsConsultsPage}}
<script>
seajs.use('js/product/detail/loadmore');
</script>
{{/if}}
{{!-- 品类 --}}
...
...
@@ -210,6 +216,7 @@
{{#if myIndexPage}}
<script>
seajs.use('js/me/index');
seajs.use('js/index/footer');
</script>
{{/if}}
{{#if orderPage}}
...
...
template/m.yohobuy.com/partials/product/feedback-tab.phtml
View file @
497b055
...
...
@@ -59,7 +59,7 @@
<span class="iconfont"></span>暂无咨询
</div>
<div class="consult-content-footer">
<a href="
{{link}}
">
<a href="
/consultform
">
我要咨询
<span class="iconfont"></span></a>
</div>
...
...
template/m.yohobuy.com/partials/product/product-description.phtml
View file @
497b055
{
{#goodsDescription
}
}
<div
class=
"goods-desc page-block"
>
<
img
class=
"service lazy"
data-original=
"http://static.dev.yohobuy.com/img/product/service.png"
alt=
""
>
<
div
class=
"service"
></div
>
<h
1
class=
"title"
>
{
{title
}
}
<span
class=
"en-title"
>
{
{enTitle
}
}</span>
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
497b055
...
...
@@ -51,6 +51,7 @@ class HomeController extends AbstractAction
$data
=
array
(
'myIndexPage'
=>
true
,
'showDownloadApp'
=>
true
,
'pageFooter'
=>
true
);
$uid
=
$this
->
getUid
();
...
...
@@ -323,7 +324,7 @@ class HomeController extends AbstractAction
$this
->
_view
->
display
(
'online-service'
,
array
(
'onlineServicePage'
=>
true
,
//
'pageFooter' => true,
'pageFooter'
=>
true
,
'service'
=>
$service
));
}
...
...
yohobuy/m.yohobuy.com/application/models/
h
ome/Online.php → yohobuy/m.yohobuy.com/application/models/
H
ome/Online.php
View file @
497b055
<?php
namespace
Home
;
use
LibModels\Wap\Home\OnlineData
;
use
Plugin\Helpers
;
/**
* 在线客服相关数据处理
*/
class
OnlineModel
{
/*
* 获取在线帮助分类
* $clientType客户端类型
*/
public
static
function
getOnlineServiceInfo
(
$clientType
=
'iphone'
)
{
//调用接口获取数据
$res
=
OnlineData
::
getOnlineServiceInfo
(
$clientType
);
$cateInfo
=
$res
[
'data'
];
$question
=
array
();
$tab
=
array
();
if
(
$cateInfo
)
{
foreach
(
$cateInfo
as
$key
=>
$value
)
{
//强制截成3个tab
if
(
$key
>
2
)
{
break
;
}
$tab
[
$key
][
'tabid'
]
=
'tab'
.
$value
[
'id'
];
$tab
[
$key
][
'tabname'
]
=
$value
[
'category_name'
];
$tab
[
$key
][
'iscut'
]
=
true
;
$tab
[
$key
][
'current'
]
=
(
!
$key
)
?
TRUE
:
FALSE
;
$question
[
$key
][
'name'
]
=
'tab'
.
$value
[
'id'
];
$question
[
$key
][
'current'
]
=
(
!
$key
)
?
TRUE
:
FALSE
;
$sub
=
$value
[
'sub'
];
$qTmp
=
array
();
if
(
$sub
)
{
foreach
(
$sub
as
$sk
=>
$sv
)
{
$qTmp
[
$sk
][
'title'
]
=
$sv
[
'category_name'
];
$qTmp
[
$sk
][
'link'
]
=
Helpers
::
url
(
'/home/onlineservicedetail'
,
array
(
'cateId'
=>
$sv
[
'id'
],
'cateName'
=>
$sv
[
'category_name'
]));
}
}
$question
[
$key
][
'list'
]
=
$qTmp
;
}
$question
[
0
][
'current'
]
=
true
;
$tab
[
count
(
$tab
)
-
1
][
'iscut'
]
=
false
;
}
//处理返回信息
$result
=
array
(
'header'
=>
array
(
'title'
=>
'在线客服'
),
'tab'
=>
$tab
,
'question'
=>
$question
);
return
$result
;
}
/*
* 加载分类下的问题和解决方法
* cateId问题分类ID
* clientType客户端
*/
public
static
function
getOnlineServiceDetail
(
$cateId
,
$clinetType
=
'iphone'
)
{
$result
=
array
();
if
(
!
$cateId
)
{
return
$result
;
}
$res
=
OnlineData
::
getOnlineServiceDetail
(
$cateId
,
$clinetType
);
$questionInfo
=
$res
[
'data'
];
if
(
$questionInfo
)
{
$list
=
array
();
if
(
$questionInfo
)
{
foreach
(
$questionInfo
as
$qk
=>
$qv
)
{
$list
[
$qk
][
'q'
]
=
$qv
[
'title'
];
$list
[
$qk
][
'a'
]
=
$qv
[
'content'
];
}
}
//处理返回信息
$result
=
array
(
'header'
=>
array
(
'title'
=>
'在线客服'
),
'list'
=>
$list
);
}
return
$result
;
}
}
<?php
namespace
Home
;
use
LibModels\Wap\Home\OnlineData
;
use
Plugin\Helpers
;
/**
* 在线客服相关数据处理
*/
class
OnlineModel
{
/*
* 获取在线帮助分类
* $clientType客户端类型
*/
public
static
function
getOnlineServiceInfo
(
$clientType
=
'iphone'
)
{
//调用接口获取数据
$res
=
OnlineData
::
getOnlineServiceInfo
(
$clientType
);
$cateInfo
=
$res
[
'data'
];
$question
=
array
();
$tab
=
array
();
if
(
$cateInfo
)
{
foreach
(
$cateInfo
as
$key
=>
$value
)
{
//强制截成3个tab
if
(
$key
>
2
)
{
break
;
}
$tab
[
$key
][
'tabid'
]
=
'tab'
.
$value
[
'id'
];
$tab
[
$key
][
'tabname'
]
=
$value
[
'category_name'
];
$tab
[
$key
][
'iscut'
]
=
true
;
$tab
[
$key
][
'current'
]
=
(
!
$key
)
?
TRUE
:
FALSE
;
$question
[
$key
][
'name'
]
=
'tab'
.
$value
[
'id'
];
$question
[
$key
][
'current'
]
=
(
!
$key
)
?
TRUE
:
FALSE
;
$sub
=
$value
[
'sub'
];
$qTmp
=
array
();
if
(
$sub
)
{
foreach
(
$sub
as
$sk
=>
$sv
)
{
$qTmp
[
$sk
][
'title'
]
=
$sv
[
'category_name'
];
$qTmp
[
$sk
][
'link'
]
=
Helpers
::
url
(
'/home/onlineservicedetail'
,
array
(
'cateId'
=>
$sv
[
'id'
],
'cateName'
=>
$sv
[
'category_name'
]));
}
}
$question
[
$key
][
'list'
]
=
$qTmp
;
}
$question
[
0
][
'current'
]
=
true
;
$tab
[
count
(
$tab
)
-
1
][
'iscut'
]
=
false
;
}
//处理返回信息
$result
=
array
(
'header'
=>
array
(
'title'
=>
'在线客服'
),
'tab'
=>
$tab
,
'question'
=>
$question
);
return
$result
;
}
/*
* 加载分类下的问题和解决方法
* cateId问题分类ID
* clientType客户端
*/
public
static
function
getOnlineServiceDetail
(
$cateId
,
$clinetType
=
'iphone'
)
{
$result
=
array
();
if
(
!
$cateId
)
{
return
$result
;
}
$res
=
OnlineData
::
getOnlineServiceDetail
(
$cateId
,
$clinetType
);
$questionInfo
=
$res
[
'data'
];
if
(
$questionInfo
)
{
$list
=
array
();
if
(
$questionInfo
)
{
foreach
(
$questionInfo
as
$qk
=>
$qv
)
{
$list
[
$qk
][
'q'
]
=
$qv
[
'title'
];
$list
[
$qk
][
'a'
]
=
$qv
[
'content'
];
}
}
//处理返回信息
$result
=
array
(
'header'
=>
array
(
'title'
=>
'在线客服'
),
'list'
=>
$list
);
}
return
$result
;
}
}
...
...
Please
register
or
login
to post a comment