Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
2d978d51
提交
2d978d51
authored
3月 25, 2019
作者:
YunaiV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
前端 mobile :商品列表
上级
40e4236a
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
153 行增加
和
97 行删除
+153
-97
product.js
mobile-web/src/api/product.js
+13
-0
productcard.vue
mobile-web/src/components/common/productcard.vue
+109
-92
router.js
mobile-web/src/config/router.js
+8
-1
index.vue
mobile-web/src/page/category/index.vue
+6
-3
list.vue
mobile-web/src/page/product/list.vue
+0
-0
search.vue
mobile-web/src/page/product/search.vue
+0
-0
UsersProductSpuVO.java
.../mall/product/application/vo/users/UsersProductSpuVO.java
+16
-0
ProductSpuServiceImpl.java
...n/iocoder/mall/product/service/ProductSpuServiceImpl.java
+1
-1
没有找到文件。
mobile-web/src/api/product.js
浏览文件 @
2d978d51
...
@@ -8,4 +8,16 @@ export function getProductCategoryList(pid) {
...
@@ -8,4 +8,16 @@ export function getProductCategoryList(pid) {
pid
pid
}
}
});
});
}
export
function
getProductSpuPage
(
cid
,
pageNo
,
pageSize
)
{
return
request
({
url
:
'product-api/users/spu/page'
,
method
:
'get'
,
params
:
{
cid
,
pageNo
:
pageNo
||
1
,
pageSize
:
pageSize
||
10
,
}
});
}
}
\ No newline at end of file
mobile-web/src/components/common/productcard.vue
浏览文件 @
2d978d51
<
template
>
<
template
>
<van-cell-group
class=
"additional"
>
<router-link
:to=
"'/product/' + product.id"
>
<van-card
<van-cell-group
class=
"additional"
>
:title=
"product.title"
<van-card
:desc=
"product.desc"
:title=
"product.name"
:num=
"(iscard?null:product.quantity)"
:desc=
"product.sellPoint"
style=
"background:#fff"
:num=
"(iscard?null:product.quantity)"
>
style=
"background:#fff"
<template
slot=
"thumb"
>
>
<img
:src=
"product.imageURL"
/>
<template
slot=
"thumb"
>
<p
v-if=
"product.imageTag!=null&&product.imageTag!=''"
class=
"image_tag"
>
{{
product
.
imageTag
}}
</p>
<img
:src=
"product.picUrls[0]"
/>
</
template
>
<p
v-if=
"product.imageTag!=null&&product.imageTag!=''"
class=
"image_tag"
>
{{
product
.
imageTag
}}
</p>
<
template
slot=
"tags"
>
</
template
>
<p
class=
"price"
v-if=
"product.price!=null&&product.price!=''"
>
<
template
slot=
"tags"
>
¥
<span>
{{
product
.
price
}}
</span>
<p
class=
"price"
v-if=
"product.price!=null&&product.price!=''"
>
<van-tag
v-if=
"product.tags!=null"
v-for=
"tag in product.tags"
:key=
"tag"
plain
type=
"danger"
>
{{
tag
}}
</van-tag>
¥
<span>
{{
product
.
price
}}
</span>
</p>
<van-tag
v-if=
"product.tags!=null"
v-for=
"tag in product.tags"
:key=
"tag"
plain
type=
"danger"
>
<van-stepper
v-if=
"iscard"
v-model=
"product.quantity"
:max=
"product.max"
:min=
"product.min"
/>
{{
tag
}}
</
template
>
</van-tag>
</van-card>
</p>
<van-cell
v-for=
"(gift,j) in product.gift"
:key=
"j"
:value=
"'x'+gift.quantity"
>
<van-stepper
v-if=
"iscard"
v-model=
"product.quantity"
:max=
"product.max"
:min=
"product.min"
/>
<
template
slot=
"title"
>
</
template
>
<van-tag
type=
"danger"
v-if=
"j==0"
>
赠品
</van-tag>
</van-card>
<span
class=
"van-cell-text"
:style=
"(j>0?'margin-left: 35px;':'')"
>
{{
gift
.
title
}}
</span>
<!-- TODO 芋艿,暂时去掉赠品 -->
</
template
>
<!--<van-cell v-for="(gift,j) in product.gift" :key="j" :value="'x'+gift.quantity" >-->
</van-cell>
<!--<template slot="title">-->
<slot
/>
<!--<van-tag type="danger" v-if="j==0" >赠品</van-tag>-->
</van-cell-group>
<!--<span class="van-cell-text" :style="(j>0?'margin-left: 35px;':'')" >{{gift.title}}</span>-->
<!--</template>-->
<!--</van-cell>-->
<slot/>
</van-cell-group>
</router-link>
</template>
</template>
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'product-card'
,
name
:
'product-card'
,
props
:{
props
:
{
product
:
Object
,
product
:
Object
,
iscard
:
{
iscard
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
},
},
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
.additional {
.additional {
.van-cell {
.van-cell {
padding: 0 15px;
padding: 0 15px;
font-size: 12px;
font-size: 12px;
}
}
.van-cell:not(:last-child)::after{
border:0;
.van-cell:not(:last-child)::after {
}
border: 0;
.van-card__title{
}
font-size: 14px;
}
.van-card__title {
.van-cell__title {
font-size: 14px;
flex: 10;
}
overflow: hidden;
text-overflow: ellipsis;
.van-cell__title {
white-space: nowrap;
flex: 10;
}
overflow: hidden;
.van-tag {
text-overflow: ellipsis;
line-height: 12px;
white-space: nowrap;
margin-right: 5px;
}
}
.price {
.van-tag {
color: #e93b3d;
line-height: 12px;
font-size: 10px;
overflow: hidden;
height: 18px;
span {
font-size: 16px;
margin-right: 5px;
margin-right: 5px;
}
.van-tag{
font-size: 12px;
}
}
.van-stepper{
position: absolute;
bottom: 5px;
right: 5px;
&__plus{
width: 30px;
}
}
&__minus{
width: 30px;
.price {
color: #e93b3d;
font-size: 10px;
overflow: hidden;
height: 18px;
span {
font-size: 16px;
margin-right: 5px;
}
.van-tag {
font-size: 12px;
}
}
.van-stepper {
position: absolute;
bottom: 5px;
right: 5px;
&__plus {
width: 30px;
}
&__minus {
width: 30px;
}
}
.image_tag {
position: absolute;
bottom: 0;
width: 90px;
height: 20px;
line-height: 20px;
font-size: 10px;
color: #fff;
text-align: center;
background-color: rgba(0, 0, 0, .7);
}
}
}
}
.image_tag{
position: absolute;
bottom: 0;
width: 90px;
height: 20px;
line-height: 20px;
font-size: 10px;
color: #fff;
text-align: center;
background-color: rgba(0,0,0,.7);
}
}
.additional::after{
border-color: #f7f7f7;
}
.additional::after {
border-color: #f7f7f7;
}
</
style
>
</
style
>
mobile-web/src/config/router.js
浏览文件 @
2d978d51
...
@@ -151,7 +151,14 @@ const routes = [
...
@@ -151,7 +151,14 @@ const routes = [
}
}
},
},
{
{
path
:
'/search'
,
path
:
'/product/search'
,
component
:
()
=>
import
(
'../page/product/search'
),
meta
:
{
title
:
'商品搜索'
}
},
{
path
:
'/products/list'
,
component
:
()
=>
import
(
'../page/product/list'
),
component
:
()
=>
import
(
'../page/product/list'
),
meta
:
{
meta
:
{
title
:
'商品列表'
title
:
'商品列表'
...
...
mobile-web/src/page/category/index.vue
浏览文件 @
2d978d51
...
@@ -66,10 +66,10 @@
...
@@ -66,10 +66,10 @@
<!--
<li><a
><img
src=
"//img12.360buyimg.com/focus/s140x140_jfs/t1/345/33/944/5582/5b9236d2E62d8da2e/99f72d51b8f195ed.jpg"
><span>
电话手表
</span></a></li>
-->
<!--
<li><a
><img
src=
"//img12.360buyimg.com/focus/s140x140_jfs/t1/345/33/944/5582/5b9236d2E62d8da2e/99f72d51b8f195ed.jpg"
><span>
电话手表
</span></a></li>
-->
<!--
<li><a
><img
src=
"//img30.360buyimg.com/focus/s140x140_jfs/t1/1446/14/631/8500/5b9237e5E0d1f9e16/b1a627b92323b5ed.png"
><span>
华为
</span></a></li>
-->
<!--
<li><a
><img
src=
"//img30.360buyimg.com/focus/s140x140_jfs/t1/1446/14/631/8500/5b9237e5E0d1f9e16/b1a627b92323b5ed.png"
><span>
华为
</span></a></li>
-->
<li
v-for=
"category in childCategories"
>
<li
v-for=
"category in childCategories"
>
<
a
>
<
router-link
:to=
"'/products/list?title=' + activeCategory.name + '&cidFirst=' + activeCategory.id + '&cidSecond=' + category.id"
>
<img
:src=
"category.picUrl"
/>
<img
:src=
"category.picUrl"
/>
<span>
{{
category
.
name
}}
</span>
<span>
{{
category
.
name
}}
</span>
</
a
>
</
router-link
>
</li>
</li>
<div
style=
"clear:both"
>
<div
style=
"clear:both"
>
</div>
</div>
...
@@ -96,6 +96,7 @@ export default {
...
@@ -96,6 +96,7 @@ export default {
rootCategories
:
[],
rootCategories
:
[],
childCategories
:
[],
childCategories
:
[],
activeKey
:
0
,
activeKey
:
0
,
activeCategory
:
{},
// 选中的分类
fullHeight
:
document
.
documentElement
.
clientHeight
-
93
,
fullHeight
:
document
.
documentElement
.
clientHeight
-
93
,
fullWidth
:
document
.
documentElement
.
clientWidth
-
99
fullWidth
:
document
.
documentElement
.
clientWidth
-
99
};
};
...
@@ -113,7 +114,8 @@ export default {
...
@@ -113,7 +114,8 @@ export default {
this
.
activeKey
=
key
;
this
.
activeKey
=
key
;
// 读取子节点的分类
// 读取子节点的分类
if
(
this
.
rootCategories
.
length
>
key
)
{
if
(
this
.
rootCategories
.
length
>
key
)
{
let
response
=
getProductCategoryList
(
this
.
rootCategories
[
key
].
id
);
this
.
activeCategory
=
this
.
rootCategories
[
key
];
let
response
=
getProductCategoryList
(
this
.
activeCategory
.
id
);
response
.
then
(
data
=>
{
response
.
then
(
data
=>
{
this
.
childCategories
=
data
;
this
.
childCategories
=
data
;
});
});
...
@@ -129,6 +131,7 @@ export default {
...
@@ -129,6 +131,7 @@ export default {
this
.
rootCategories
=
data
;
this
.
rootCategories
=
data
;
// 获得首个根节点的分类
// 获得首个根节点的分类
if
(
data
&&
data
.
length
>
0
)
{
if
(
data
&&
data
.
length
>
0
)
{
this
.
activeCategory
=
data
[
0
];
let
response
=
getProductCategoryList
(
data
[
0
].
id
);
let
response
=
getProductCategoryList
(
data
[
0
].
id
);
response
.
then
(
data
=>
{
response
.
then
(
data
=>
{
this
.
childCategories
=
data
;
this
.
childCategories
=
data
;
...
...
mobile-web/src/page/product/list.vue
浏览文件 @
2d978d51
差异被折叠。
点击展开。
mobile-web/src/page/product/search.vue
0 → 100644
浏览文件 @
2d978d51
差异被折叠。
点击展开。
product/product-application/src/main/java/cn/iocoder/mall/product/application/vo/users/UsersProductSpuVO.java
浏览文件 @
2d978d51
...
@@ -28,6 +28,12 @@ public class UsersProductSpuVO {
...
@@ -28,6 +28,12 @@ public class UsersProductSpuVO {
* 目前的计算方式是,以 Sku 最小价格为准
* 目前的计算方式是,以 Sku 最小价格为准
*/
*/
private
Integer
price
;
private
Integer
price
;
/**
* 库存数量
*
* 目前的计算方式是,以 Sku 库存累加为准
*/
private
Integer
quantity
;
public
Integer
getId
()
{
public
Integer
getId
()
{
return
id
;
return
id
;
...
@@ -82,4 +88,13 @@ public class UsersProductSpuVO {
...
@@ -82,4 +88,13 @@ public class UsersProductSpuVO {
this
.
price
=
price
;
this
.
price
=
price
;
return
this
;
return
this
;
}
}
public
Integer
getQuantity
()
{
return
quantity
;
}
public
UsersProductSpuVO
setQuantity
(
Integer
quantity
)
{
this
.
quantity
=
quantity
;
return
this
;
}
}
}
\ No newline at end of file
product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/ProductSpuServiceImpl.java
浏览文件 @
2d978d51
...
@@ -202,7 +202,7 @@ public class ProductSpuServiceImpl implements ProductSpuService {
...
@@ -202,7 +202,7 @@ public class ProductSpuServiceImpl implements ProductSpuService {
public
CommonResult
<
ProductSpuPageBO
>
getProductSpuPage
(
ProductSpuPageDTO
productSpuPageDTO
)
{
public
CommonResult
<
ProductSpuPageBO
>
getProductSpuPage
(
ProductSpuPageDTO
productSpuPageDTO
)
{
ProductSpuPageBO
productSpuPage
=
new
ProductSpuPageBO
();
ProductSpuPageBO
productSpuPage
=
new
ProductSpuPageBO
();
// 查询分页数据
// 查询分页数据
int
offset
=
productSpuPageDTO
.
getPageNo
(
)
*
productSpuPageDTO
.
getPageSize
();
int
offset
=
(
productSpuPageDTO
.
getPageNo
()
-
1
)
*
productSpuPageDTO
.
getPageSize
();
productSpuPage
.
setSpus
(
ProductSpuConvert
.
INSTANCE
.
convert
(
productSpuMapper
.
selectListByNameLikeOrderBySortAsc
(
productSpuPage
.
setSpus
(
ProductSpuConvert
.
INSTANCE
.
convert
(
productSpuMapper
.
selectListByNameLikeOrderBySortAsc
(
productSpuPageDTO
.
getName
(),
productSpuPageDTO
.
getCid
(),
productSpuPageDTO
.
getVisible
(),
productSpuPageDTO
.
getName
(),
productSpuPageDTO
.
getCid
(),
productSpuPageDTO
.
getVisible
(),
offset
,
productSpuPageDTO
.
getPageSize
())));
offset
,
productSpuPageDTO
.
getPageSize
())));
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论