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
ccbikai
9 years ago
Commit
64eca9a339cc11022c01156ddf52293d7de7b4a1
2 parents
11a43b5a
0ceed4bd
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
299 additions
and
166 deletions
docs/data-structure.md
library/LibModels/Wap/Home/CartData.php
static/js/product/detail/desc.js
static/js/product/detail/detail.js
static/js/product/detail/like.js
static/sass/layout/_header.scss
static/sass/product/_comments-consults.scss
static/sass/product/_detail.scss
template/m.yohobuy.com/actions/index/index/systemUpdate.phtml
template/m.yohobuy.com/actions/product/detail/comments.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/header.phtml
template/m.yohobuy.com/partials/layout/systemUpdate.phtml
template/m.yohobuy.com/partials/layout/use.phtml
template/m.yohobuy.com/partials/product/feedback-tab.phtml
yohobuy/m.yohobuy.com/application/controllers/Index.php
yohobuy/m.yohobuy.com/application/controllers/ShoppingCart.php
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
docs/data-structure.md
View file @
64eca9a
...
...
@@ -1243,6 +1243,6 @@
'cartInfo' : {
'numInCart' : 3,
'goodsInstore' : 0,
'isCollect':true
'isCollect':true
//
}
}
...
...
library/LibModels/Wap/Home/CartData.php
View file @
64eca9a
...
...
@@ -51,17 +51,17 @@ class CartData
}
/**
*
修改购物车商品数据
*
移入收藏夹
*
* @param int $uid 用户ID
* @param string $s
wapData 商品数据
* @param string $s
ku 商品sku列表
* @return array 接口返回的数据
*/
public
static
function
modifyCartProduct
(
$uid
,
$swapData
)
public
static
function
addToFav
(
$uid
,
$sku
)
{
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'app.Shopping.swap'
;
$param
[
'swap_data'
]
=
$swapData
;
$param
[
'method'
]
=
'app.Shopping.addfavorite'
;
$param
[
'product_sku_list'
]
=
$sku
;
$param
[
'uid'
]
=
$uid
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
...
...
@@ -69,17 +69,35 @@ class CartData
}
/**
*
移入收藏夹
*
获取购物车商品数据
*
* @param int $uid 用户ID
* @param
string $sku 商品sku列表
* @param
int $skn 商品skn
* @return array 接口返回的数据
*/
public
static
function
addToFav
(
$uid
,
$sku
)
public
static
function
cartProductData
(
$uid
,
$skn
)
{
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'app.Shopping.addfavorite'
;
$param
[
'product_sku_list'
]
=
$sku
;
$param
[
'method'
]
=
'app.product.data'
;
$param
[
'product_skn'
]
=
$skn
;
$param
[
'uid'
]
=
$uid
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
/**
* 修改购物车商品数据
*
* @param int $uid 用户ID
* @param string $swapData 商品数据
* @return array 接口返回的数据
*/
public
static
function
modifyCartProduct
(
$uid
,
$swapData
)
{
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'app.Shopping.swap'
;
$param
[
'swap_data'
]
=
$swapData
;
$param
[
'uid'
]
=
$uid
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
...
...
static/js/product/detail/desc.js
View file @
64eca9a
...
...
@@ -47,15 +47,6 @@ function search() {
slidesPerView
:
'auto'
});
//优选
// recommendSwiper = new Swiper('#swiper-recommend', {
// slidesPerView: 'auto',
// grabCursor: true,
// slideElement: 'li',
// lazyLoading: true,
// watchSlidesVisibility: true
// });
searching
=
false
;
end
=
true
;
loading
.
hideLoadingMask
();
...
...
static/js/product/detail/detail.js
View file @
64eca9a
...
...
@@ -12,7 +12,6 @@ var goodsSwiper;
require
(
'./desc'
);
require
(
'./comments-consults'
);
require
(
'./like'
);
require
(
'../recommend-for-you.js'
);
lazyLoad
(
$
(
'img.lazy'
));
...
...
static/js/product/detail/like.js
View file @
64eca9a
...
...
@@ -44,6 +44,6 @@ likeHammer.on('tap', function(e) {
});
$
(
'#likeBtn'
).
on
(
'click'
,
function
(
e
)
{
return
false
;
});
\ No newline at end of file
// $('#likeBtn').on('click', function(e) {
// return false;
// });
\ No newline at end of file
...
...
static/sass/layout/_header.scss
View file @
64eca9a
...
...
@@ -105,4 +105,22 @@
font-weight
:
bold
;
color
:
#fff
;
}
}
.systemMain
{
width
:
92%
;
height
:
100%
;
overflow
:
hidden
;
background-color
:
#444
;
color
:
#fff
;
padding
:
0
4%
;
position
:
absolute
;
top
:
0
;
left
:
0
;
p
{
font-size
:
52em
/
$pxConvertRem
;
line-height
:
60rem
/
$pxConvertRem
;
&
:first-of-type
{
padding-top
:
90rem
/
$pxConvertRem
;
}
}
}
\ No newline at end of file
...
...
static/sass/product/_comments-consults.scss
View file @
64eca9a
.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
);
...
...
@@ -39,12 +39,14 @@
}
.goods-consults-page
{
background-color
:
#f0f0f0
;
.goto-consult
{
padding
:
0
pxToRem
(
28px
);
height
:
pxToRem
(
120px
);
background-color
:
#ffffff
;
i
,
span
{
span
,
a
{
line-height
:
pxToRem
(
120px
);
font-size
:
pxToRem
(
28px
);
color
:
$mainFontC
;
...
...
@@ -59,6 +61,7 @@
}
.goods-consults
{
.consult-item
{
margin-top
:
pxToRem
(
30px
);
padding
:
pxToRem
(
20px
)
pxToRem
(
28px
);
background-color
:
#fff
;
.question
{
...
...
@@ -98,10 +101,10 @@
}
}
}
.gap-block
{
min-height
:
30rem
/
$pxConvertRem
;
background-color
:
#f0f0f0
;
}
// .gap-block {
// min-height: 30rem/$pxConvertRem;
// background-color: #f0f0f0;
// }
}
.consult-form-page
{
...
...
static/sass/product/_detail.scss
View file @
64eca9a
...
...
@@ -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,47 @@ $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
;
font-size
:
pxToRem
(
22px
);
color
:
#999999
;
border-bottom
:
1px
solid
$borderC
;
.icons-item
{
float
:
left
;
width
:
33
.3%
;
height
:
pxToRem
(
88px
);
margin
:
0
;
span
{
vertical-align
:
middle
;
display
:
inline-block
;
line-height
:
pxToRem
(
88px
);
}
.vip-img
{
width
:
pxToRem
(
53px
);
height
:
pxToRem
(
32px
);
}
&
:nth-child
(
3
)
.vip-img
{
background
:
image-url
(
'product/silver.png'
)
no-repeat
;
}
&
:nth-child
(
2
)
.vip-img
{
background
:
image-url
(
'product/golden.png'
)
no-repeat
;
}
&
:nth-child
(
1
)
.vip-img
{
background
:
image-url
(
'product/platinum.png'
)
no-repeat
;
}
&
:first-child
{
text-align
:
left
;
}
&
:last-child
{
text-align
:
right
;
}
}
}
.vipLevel
{
width
:
100%
;
box-sizing
:
border-box
;
background-color
:
#fff
;
display
:
table
;
...
...
@@ -242,25 +283,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 +335,6 @@ $basicBtnC:#eb0313;
.goodsDiscount
{
text-indent
:
pxToRem
(
-14px
);
}
.enter-store
{
min-height
:
pxToRem
(
100px
);
display
:
table
;
...
...
@@ -327,7 +366,6 @@ $basicBtnC:#eb0313;
}
}
}
//底部固定栏
.cart-bar
{
position
:
relative
;
...
...
@@ -350,10 +388,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,11 +420,10 @@ $basicBtnC:#eb0313;
font-size
:
pxToRem
(
24px
);
}
}
.recommend-for-you
{
.recommend-for-you
{
margin-bottom
:
pxToRem
(
120px
);
}
}
@import
"comments-consults"
;
@import
"product-description"
;
...
...
template/m.yohobuy.com/actions/index/index/systemUpdate.phtml
0 → 100644
View file @
64eca9a
{
{>
layout/header
}
}
<div
class=
"systemMain"
>
<P>尊敬的顾客:</P>
<P>您好!</P>
<P>为了向您提供更优质的服务,目前系统正在升级,请您耐心等待。</P>
<P>系统升级期间,部分地区用户体验会有暂
时中断,如遇紧急事宜,欢迎垂询客服热线:
400-889-9646
09
:
00-22
:
30
(周一至周日)。</P>
<P>稍后系统将恢复正常使用,欢迎您继续光顾
YOHO!BUY
有货!</P>
<P>带来不便之处深表
歉意,请您谅解!</P>
<P>特此公告</P>
<P>YOHO!BUY
有货
客户服务中心。</P>
</div>
{
{>
layout/footer
}
}
...
...
template/m.yohobuy.com/actions/product/detail/comments.phtml
View file @
64eca9a
{
{>
layout/header
}
}
<div
class=
"goods-comments-page yoho-page"
>
{
{#comments
}
}
<div
class=
"goods-comments"
>
<div
class=
"goods-comments"
id=
"goods-comments"
>
{
{#list
}
}
<div
class=
"comment-item"
>
<span
class=
"user-name"
>
...
...
@@ -20,7 +20,10 @@
{
{/list
}
}
</div>
{
{/comments
}
}
{
{#if
loadmore
}
}
<input
id=
"loadMoreUrl"
type=
"hidden"
value=
{
{loadMoreUrl
}
}>
{
{/if
}
}
</div>
{
{>
layout/footer
}
}
...
...
template/m.yohobuy.com/actions/product/detail/consults.phtml
View file @
64eca9a
...
...
@@ -3,12 +3,11 @@
<div
class=
"goto-consult"
>
<i
class=
"iconfont consult-logo"
>
639
;</i>
<span>我要咨询</span>
<
i
class=
"iconfont enter-consult-page"
>
604
;</i
>
<
a
href=
"/consultform"
class=
"iconfont enter-consult-page"
>
604
;</a
>
</div>
{
{#
consults
}
}
<div
class=
"goods-consults"
>
<div
class=
"goods-consults"
id=
"goods-consults"
>
{
{#list
}
}
<div
class=
"gap-block"
></div>
<div
class=
"consult-item"
>
<div
class=
"question"
>
<span
class=
"iconfont"
>
639
;</span>
...
...
@@ -27,5 +26,9 @@
{
{/list
}
}
</div>
{
{/
consults
}
}
{
{#if
loadmore
}
}
<input
id=
"loadMoreUrl"
type=
"hidden"
value=
{
{loadMoreUrl
}
}>
{
{/if
}
}
</div>
{
{>
layout/footer
}
}
...
...
template/m.yohobuy.com/actions/product/detail/index.phtml
View file @
64eca9a
...
...
@@ -53,6 +53,19 @@
</div>
{
{#
vipLevel
}
}
<ul
class=
"vip-level clearfix"
>
{
{#
list
}
}
<li
class=
"icons-item"
>
<span
class=
"vip-img"
style=
"background-size:cover;"
>
<!--
<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
}
}
<span
class=
"vip-img"
>
...
...
@@ -61,7 +74,7 @@
<span
class=
"vip-price"
>
{
{text
}
}</span>
{
{/
list
}
}
</div>
{
{/
vipLevel
}
}
{
{/
vipLevel
}
}
-->
{
{#
goodsDiscount
}
}
<div
class=
"goodsDiscount"
>
...
...
@@ -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=
"javascript:;"
id=
"likeBtn"
class=
"favorite iconfont {{#isCollect}}liked{{/isCollect}}"
>
605
;</a>
</div>
{
{/cartInfo
}
}
...
...
template/m.yohobuy.com/partials/layout/header.phtml
View file @
64eca9a
...
...
@@ -45,7 +45,7 @@
<body
{{#
if
isPassportPage
}}
class=
passport-body{{/if}}
>
{{#if systemUpdate}}
<div
class=
"systemUpdate"
>
<a
href=
"systemUpdate"
class=
"systemHeader"
>
YOHO!BUY关于系统升级的公告
</a>
<a
href=
"
index/
systemUpdate"
class=
"systemHeader"
>
YOHO!BUY关于系统升级的公告
</a>
<span>
X
</span>
</div>
{{/if}}
...
...
template/m.yohobuy.com/partials/layout/systemUpdate.phtml
deleted
100644 → 0
View file @
11a43b5
template/m.yohobuy.com/partials/layout/use.phtml
View file @
64eca9a
...
...
@@ -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}}
{{!-- 品类 --}}
...
...
template/m.yohobuy.com/partials/product/feedback-tab.phtml
View file @
64eca9a
...
...
@@ -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>
...
...
yohobuy/m.yohobuy.com/application/controllers/Index.php
View file @
64eca9a
...
...
@@ -38,9 +38,11 @@ class IndexController extends AbstractAction
*
*/
public
function
systemUpdate
()
public
function
systemUpdate
Action
()
{
$this
->
_view
->
display
(
'systemUpdate'
,
''
);
$this
->
setTitle
(
'关于系统升级的公告'
);
$this
->
_view
->
display
(
'systemUpdate'
);
}
}
...
...
yohobuy/m.yohobuy.com/application/controllers/ShoppingCart.php
View file @
64eca9a
...
...
@@ -231,54 +231,19 @@ class ShoppingCartController extends AbstractAction
public
function
goodinfoAction
()
{
$result
=
array
();
if
(
$this
->
isAjax
())
{
$data
=
array
(
'thumb'
=>
'http://img11.static.yhbimg.com/goodsimg/2015/09/17/03/014cacfa5c458b9732c68adf1af15d7a45.jpg?imageMogr2/thumbnail/120x120/extent/120x120/background/d2hpdGU=/position/center/quality/90'
,
'name'
=>
'黄伟文Wyman X y yohood 联名商品YYYOHOOD圆领卫衣'
,
'price'
=>
289
,
'salePrice'
=>
241
,
'colors'
=>
array
(
array
(
'id'
=>
1
,
'name'
=>
'黄色'
),
array
(
'id'
=>
2
,
'chosed'
=>
true
,
'name'
=>
'白色'
)
),
'sizes'
=>
array
(
array
(
'id'
=>
1
,
'name'
=>
'XS'
),
array
(
'id'
=>
2
,
'name'
=>
'S'
),
array
(
'id'
=>
3
,
'chosed'
=>
true
,
'name'
=>
'M'
),
array
(
'id'
=>
4
,
'name'
=>
'L'
),
array
(
'id'
=>
5
,
'name'
=>
'XL'
),
array
(
'id'
=>
6
,
'name'
=>
'XXL'
)
),
'num'
=>
1
);
$this
->
echoJson
(
array
(
'code'
=>
200
,
'data'
=>
$data
));
$num
=
$this
->
get
(
'buy_num'
,
1
);
$skn
=
$this
->
get
(
'id'
,
1
);
$result
=
CartModel
::
cartProductData
(
$this
->
_uid
,
$skn
,
$num
);
// 测试skn的ID为51172055
$result
[
'num'
]
=
$num
;
}
if
(
empty
(
$result
))
{
echo
' '
;
}
else
{
$this
->
echoJson
(
$result
);
}
}
}
...
...
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
64eca9a
...
...
@@ -3,6 +3,7 @@
namespace
Index
;
use
LibModels\Wap\Home\CartData
;
use
Plugin\Helpers
;
use
Plugin\Images
;
/**
...
...
@@ -98,6 +99,70 @@ class CartModel
}
/**
* 处理购物车商品数据
*
* @param int $uid 用户ID
* @param int $skn 商品skn
* @param int $num 购买数目
* @return array 接口返回的数据
*/
public
static
function
cartProductData
(
$uid
,
$skn
,
$num
)
{
$result
=
array
(
'code'
=>
400
,
'message'
=>
'出错啦~'
);
$product
=
CartData
::
cartProductData
(
$uid
,
$skn
);
if
(
isset
(
$product
[
'code'
])
&&
$product
[
'code'
]
===
200
)
{
$result
[
'code'
]
=
200
;
$data
=
array
();
$productData
=
$product
[
'data'
];
// 品牌信息
if
(
isset
(
$productData
[
'brand_info'
])
&&
!
empty
(
$productData
[
'brand_info'
]))
{
$data
[
'thumb'
]
=
Helpers
::
getImageUrl
(
$productData
[
'brand_info'
][
'brand_ico'
],
120
,
120
);
}
$data
[
'name'
]
=
$productData
[
'product_name'
];
$data
[
'price'
]
=
$productData
[
'market_price'
];
$data
[
'salePrice'
]
=
$productData
[
'sales_price'
];
$data
[
'storage'
]
=
$productData
[
'storage_sum'
];
$data
[
'num'
]
=
$num
;
// 商品选择
if
(
isset
(
$productData
[
'goods_list'
]))
{
$goodsList
=
$productData
[
'goods_list'
];
$colors
=
array
();
$oneColor
=
array
();
$sizes
=
array
();
$oneSize
=
array
();
foreach
(
$goodsList
as
$val
)
{
// 颜色
$oneColor
=
array
();
$oneColor
[
'id'
]
=
$val
[
'color_id'
];
$oneColor
[
'name'
]
=
$val
[
'color_name'
];
// 尺码
foreach
(
$val
[
'size_list'
]
as
$one
)
{
$oneSize
=
array
();
$oneSize
[
'id'
]
=
$one
[
'size_id'
];
$oneSize
[
'name'
]
=
$one
[
'size_name'
];
}
$sizes
[]
=
$oneSize
;
$oneColor
[
'sizes'
]
=
$sizes
;
$colors
[]
=
$oneColor
;
}
$data
[
'colors'
]
=
$colors
;
}
$result
[
'data'
]
=
$data
;
}
return
$result
;
}
/**
* 修改购物车商品数据
*
* @param int $uid 用户ID
...
...
@@ -135,6 +200,7 @@ class CartModel
// 购买的商品列表
foreach
(
$data
[
'goods_list'
]
as
$value
)
{
$oneGoods
[
'id'
]
=
$value
[
'product_sku'
];
$oneGoods
[
'skn'
]
=
$value
[
'product_skn'
];
$oneGoods
[
'name'
]
=
$value
[
'product_name'
];
$oneGoods
[
'thumb'
]
=
Images
::
getImageUrl
(
$value
[
'goods_images'
],
120
,
120
);
$oneGoods
[
'color'
]
=
$value
[
'color_name'
];
...
...
Please
register
or
login
to post a comment