Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
6fb6f52b
提交
6fb6f52b
authored
4月 25, 2019
作者:
YunaiV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改商品分类下的商品列表,使用搜搜接口
上级
f529985c
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
56 行增加
和
22 行删除
+56
-22
productcard.vue
mobile-web/src/components/common/productcard.vue
+0
-6
list.vue
mobile-web/src/page/product/list.vue
+55
-15
application.yaml
...h-service-impl/src/main/resources/config/application.yaml
+1
-1
没有找到文件。
mobile-web/src/components/common/productcard.vue
浏览文件 @
6fb6f52b
...
@@ -9,16 +9,10 @@
...
@@ -9,16 +9,10 @@
>
>
<template
slot=
"thumb"
>
<template
slot=
"thumb"
>
<img
:src=
"product.picUrls && product.picUrls ? product.picUrls[0] : ''"
/>
<img
:src=
"product.picUrls && product.picUrls ? product.picUrls[0] : ''"
/>
<!-- TODO 芋艿 暂时去掉 -->
<!--
<p
v-if=
"product.imageTag!=null&&product.imageTag!=''"
class=
"image_tag"
>
{{
product
.
imageTag
}}
</p>
-->
</
template
>
</
template
>
<
template
slot=
"tags"
>
<
template
slot=
"tags"
>
<p
class=
"price"
v-if=
"product.buyPrice || product.price"
>
<p
class=
"price"
v-if=
"product.buyPrice || product.price"
>
¥
<span>
{{
product
.
buyPrice
?
product
.
buyPrice
/
100.00
:
product
.
price
/
100.00
}}
</span>
¥
<span>
{{
product
.
buyPrice
?
product
.
buyPrice
/
100.00
:
product
.
price
/
100.00
}}
</span>
<!-- TODO 芋艿 暂时去掉 -->
<!--
<van-tag
v-if=
"product.tags!=null"
v-for=
"tag in product.tags"
:key=
"tag"
plain
type=
"danger"
>
-->
<!--
{{
tag
}}
-->
<!--
</van-tag>
-->
<van-tag
v-if=
"product.promotionActivityTitle"
plain
type=
"danger"
>
<van-tag
v-if=
"product.promotionActivityTitle"
plain
type=
"danger"
>
{{
product
.
promotionActivityTitle
}}
{{
product
.
promotionActivityTitle
}}
</van-tag>
</van-tag>
...
...
mobile-web/src/page/product/list.vue
浏览文件 @
6fb6f52b
...
@@ -8,14 +8,26 @@
...
@@ -8,14 +8,26 @@
<van-tab
v-for=
"category in childCategories"
:title=
"category.name"
/>
<van-tab
v-for=
"category in childCategories"
:title=
"category.name"
/>
</van-tabs>
</van-tabs>
<div
v-for=
"(product,i) in products"
:key=
"i"
>
<!--
<div
v-for=
"(product,i) in products"
:key=
"i"
>
-->
<product-card
:product=
'product'
@
click=
"showProduct(product)"
/>
<!--
<product-card
:product=
'product'
@
click=
"showProduct(product)"
/>
-->
</div>
<!--
</div>
-->
<van-list
v-model=
"loading"
:finished=
"finished"
finished-text=
"没有更多了"
@
load=
"onLoad"
>
<div
v-for=
"(product,i) in products"
:key=
"i"
>
<product-card
:product=
'product'
@
click=
"showProduct(product)"
/>
</div>
</van-list>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
getProductCategoryList
,
getProductSpuPage
}
from
'../../api/product'
;
import
{
getProductCategoryList
,
getProductSpuPage
}
from
'../../api/product'
;
import
{
getProductPage
}
from
"../../api/search"
;
export
default
{
export
default
{
data
()
{
data
()
{
...
@@ -28,8 +40,14 @@ export default {
...
@@ -28,8 +40,14 @@ export default {
id
:
parseInt
(
this
.
$route
.
query
.
cidSecond
),
id
:
parseInt
(
this
.
$route
.
query
.
cidSecond
),
},
},
childCategories
:
[],
childCategories
:
[],
active
:
2
,
active
:
-
1
,
products
:
[],
products
:
[],
page
:
0
,
pageSize
:
10
,
loading
:
false
,
finished
:
false
,
};
};
},
},
methods
:
{
methods
:
{
...
@@ -41,18 +59,40 @@ export default {
...
@@ -41,18 +59,40 @@ export default {
this
.
active
=
key
;
this
.
active
=
key
;
// 加载商品
// 加载商品
this
.
products
=
[];
this
.
products
=
[];
this
.
loadProductList
(
this
.
childCategories
[
key
].
id
);
// 加载商品
this
.
loadProductList
(
this
.
childCategories
[
key
].
id
,
1
);
},
},
loadProductList
(
categoryId
)
{
loadProductList
(
categoryId
,
page
)
{
// 设置当前选中的分类
this
.
childCategory
.
id
=
categoryId
;
this
.
childCategory
.
id
=
categoryId
;
// 读取商品
getProductPage
({
// alert('商品分类:' + categoryId);
pageNo
:
page
,
let
response
=
getProductSpuPage
(
categoryId
);
pageSize
:
this
.
pageSize
,
response
.
then
(
data
=>
{
cid
:
this
.
childCategory
.
id
,
this
.
products
.
push
(...
data
.
spus
);
}).
then
(
data
=>
{
})
this
.
handleData
(
page
,
data
);
}
});
},
onLoad
()
{
// debugger;
// 进入下一页
let
page
=
this
.
page
+
1
;
// 加载商品
this
.
loadProductList
(
this
.
childCategory
.
id
,
page
);
},
handleData
(
page
,
data
)
{
this
.
loading
=
true
;
// 设置下页面
this
.
page
=
page
;
// 数据保存到 list 中
this
.
products
.
push
(...
data
.
list
);
// 判断页数
if
(
this
.
products
.
length
>=
data
.
total
)
{
this
.
finished
=
true
;
}
// 标记不在加载中
this
.
loading
=
false
;
},
},
},
mounted
()
{
mounted
()
{
let
response
=
getProductCategoryList
(
this
.
rootCategory
.
id
);
let
response
=
getProductCategoryList
(
this
.
rootCategory
.
id
);
...
@@ -70,7 +110,7 @@ export default {
...
@@ -70,7 +110,7 @@ export default {
}
}
}
}
// 加载商品列表
// 加载商品列表
this
.
loadProductList
(
this
.
childCategory
.
id
);
//
this.loadProductList(this.childCategory.id);
});
});
}
}
};
};
...
...
search/search-service-impl/src/main/resources/config/application.yaml
浏览文件 @
6fb6f52b
...
@@ -3,7 +3,7 @@ spring:
...
@@ -3,7 +3,7 @@ spring:
data
:
data
:
elasticsearch
:
elasticsearch
:
cluster-name
:
elasticsearch
cluster-name
:
elasticsearch
cluster-nodes
:
1
92.168.88.10
:9300
cluster-nodes
:
1
80.167.213.26
:9300
repositories
:
repositories
:
enable
:
true
enable
:
true
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论