Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
a4ff3991
Commit
a4ff3991
authored
Jul 28, 2022
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
f48d727b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
45 deletions
+70
-45
static/nativeComponents/GoodsList/index.js
+23
-22
static/nativeComponents/GoodsList/index.wxml
+27
-20
static/nativeComponents/GoodsList/index.wxss
+20
-3
No files found.
static/nativeComponents/GoodsList/index.js
View file @
a4ff3991
...
...
@@ -39,7 +39,7 @@ const componentOptions = {
isPageHidden
:
false
,
// 页面是否处于隐藏状态
titleIcon
:
""
,
classificationLoadPage
:
1
,
classificationLoadNum
:
10
,
classificationLoadNum
:
4
,
queryProductInfoLoading
:
false
,
loading
:
false
,
scrollLoading
:
false
,
// 滚动加载优化后添加加载动画
...
...
@@ -64,6 +64,7 @@ const componentOptions = {
goodsSpecificationIds
:
[],
},
randomNumber
:
""
,
selectScreen
:
false
,
// 筛选选中状态
},
// 数据监听器
observers
:
{},
...
...
@@ -75,10 +76,18 @@ const componentOptions = {
app
.
getFilterGoodsData
=
(
val
)
=>
{
if
(
val
.
randomNumber
!=
_this
.
data
.
randomNumber
)
return
;
console
.
log
(
val
,
'-------------------------77'
)
let
selectScreen
=
val
.
submitFliterVal
.
minPrice
!=
""
||
val
.
submitFliterVal
.
maxPrice
!=
""
||
val
.
submitFliterVal
.
attribute
.
length
>
0
||
val
.
submitFliterVal
.
brandIdList
.
length
>
0
||
val
.
submitFliterVal
.
brandActiveNameList
.
length
>
0
||
val
.
submitFliterVal
.
goodsSpecificationIds
.
length
>
0
_this
.
setData
({
submitFliterVal
:
val
.
submitFliterVal
,
selectScreen
,
loading
:
true
})
console
.
log
(
_this
.
data
.
submitFliterVal
,
'----------submitFliterVal'
)
console
.
log
(
_this
.
data
.
submitFliterVal
,
'----------submitFliterVal'
)
_this
.
init
();
}
this
.
setData
({
...
...
@@ -130,20 +139,8 @@ const componentOptions = {
filterGoods
(
e
)
{
let
{
item
}
=
e
.
currentTarget
.
dataset
;
let
{
filterPriceType
,
filterType
}
=
this
.
data
;
if
(
item
==
2
)
{
// 价格筛选
filterPriceType
=
filterPriceType
==
0
?
1
:
0
}
else
{
// 还原默认值
filterPriceType
=
1
}
this
.
setData
({
filterType
:
item
,
filterPriceType
})
if
(
item
==
99
)
{
// 展示筛选弹窗
// wx.showToast({title:"暂未开发", icon:"error"})
let
_this
=
this
;
app
.
openFilterGoods
({
submitFliterVal
:
_this
.
data
.
submitFliterVal
,
...
...
@@ -152,12 +149,18 @@ const componentOptions = {
randomNumber
:
_this
.
data
.
randomNumber
,
hideBrandSelectFlag
:
_this
.
data
.
datas
.
componentData
.
filterBrand
.
length
>
0
?
true
:
false
,
});
// this.opt.bus.$emit("openGoodsFilters",{
// submitFliterVal: this.submitFliterVal,
// randomNumber: this.randomNumber,
// hideBrandSelectFlag: this.filterBrand.length>0?true:false,
// });
}
else
{
if
(
item
==
2
)
{
// 价格筛选
filterPriceType
=
filterPriceType
==
0
?
1
:
0
}
else
{
// 还原默认值
filterPriceType
=
1
}
this
.
setData
({
filterType
:
item
,
filterPriceType
})
this
.
init
();
}
},
...
...
@@ -233,9 +236,7 @@ const componentOptions = {
let
query
=
{
categoryId
:
this
.
data
.
datas
.
componentData
.
categoryId
,
page
:
this
.
showRowNum
()
?
classificationLoadPage
:
1
,
rows
:
this
.
showRowNum
()
?
this
.
data
.
classificationLoadNum
:
this
.
getItemNum
(),
rows
:
this
.
data
.
datas
.
componentData
.
classificationLoadNum
,
sortColumn
:
goodsSort
,
sortType
:
goodsSort
!=
2
?
1
:
0
,
whetherShowSoldOutGoods
:
this
.
data
.
datas
.
componentData
...
...
static/nativeComponents/GoodsList/index.wxml
View file @
a4ff3991
...
...
@@ -26,30 +26,33 @@
<view class="btn" bindtap="init">搜索</view>
</view>
<view class="filterCondition flex">
<view class="filterItem {{filterType == -1?'activeStatus':''}}" bindtap="filterGoods" data-item="{{-1}}">
综合
</view>
<view class="filterItem {{filterType == 3?'activeStatus':''}}" bindtap="filterGoods" data-item="{{3}}">
销量
</view>
<view class="filterItem flex filterPrice {{filterType == 2?'activeStatus':''}}" bindtap="filterGoods" data-item="{{2}}">
<text>价格</text>
<view class="svgItem flex">
<view class="arrowTop">
<m-svg src="/static/svg/arrowTop.svg" colors="{{[filterType == 2 && filterPriceType == 0?mainColor:'']}}"></m-svg>
</view>
<view class="arrowBottom">
<m-svg src="/static/svg/arrowBottom.svg" colors="{{[filterType == 2 && filterPriceType == 1?mainColor:'']}}"></m-svg>
<view class="left flex">
<view class="filterItem {{filterType == -1?'activeStatus':''}}" bindtap="filterGoods" data-item="{{-1}}">
综合
</view>
<view class="filterItem {{filterType == 3?'activeStatus':''}}" bindtap="filterGoods" data-item="{{3}}">
销量
</view>
<view class="filterItem flex filterPrice {{filterType == 2?'activeStatus':''}}" bindtap="filterGoods" data-item="{{2}}">
<text>价格</text>
<view class="svgItem flex">
<view class="arrowTop">
<m-svg src="/static/svg/arrowTop.svg" colors="{{[filterType == 2 && filterPriceType == 0?mainColor:'']}}"></m-svg>
</view>
<view class="arrowBottom">
<m-svg src="/static/svg/arrowBottom.svg" colors="{{[filterType == 2 && filterPriceType == 1?mainColor:'']}}"></m-svg>
</view>
</view>
</view>
<view class="filterItem {{filterType == 8?'activeStatus':''}}" bindtap="filterGoods" data-item="{{8}}">
上新
</view>
</view>
<view class="filterItem {{filterType == 8?'activeStatus':''}}" bindtap="filterGoods" data-item="{{8}}">
上新
</view>
<view class="filterItem flex {{filterType == 99?'activeStatus':''}}" bindtap="filterGoods" data-item="{{99}}">
<text> | 筛选</text>
<view class="filterItem flex verticalLine">|</view>
<view class="filterItem flex {{selectScreen == true?'activeStatus':''}}" bindtap="filterGoods" data-item="{{99}}">
<text>筛选</text>
<view class="shaixuan">
<m-svg src="/static/svg/shaixuan1.svg" colors="{{[
filterType == 99
?mainColor:'']}}"></m-svg>
<m-svg src="/static/svg/shaixuan1.svg" colors="{{[
selectScreen == true
?mainColor:'']}}"></m-svg>
</view>
</view>
</view>
...
...
@@ -140,6 +143,10 @@
<view class="goods-heap-Item" wx:if="{{datas.componentData.style==='heap'}}">
<heap-item datas="{{datas}}"></heap-item>
</view>
<view class="noGoods" wx:if="{{datas.componentData.goodsList.length == 0 && datas.componentData.filterComponentsFlag && !loading}}">
<image mode="widthFix" src="https://cdn.mayi888.com/static/img/empty-goods.png"></image>
没有找到商品
</view>
<view
class="moreBottom"
bindtap="viewMore"
...
...
static/nativeComponents/GoodsList/index.wxss
View file @
a4ff3991
...
...
@@ -50,6 +50,19 @@ image{
transform: rotate(405deg);
margin-left: 0px;
}
.noGoods{
font-size: 14px;
text-align: center;
padding: 10px 0 30px 0;
color: #666;
display: flex;
flex-direction: column;
align-items: center;
}
.noGoods image{
width: 40%;
margin: 20px 0;
}
.moreBottom {
font-size: 13px;
text-align: center;
...
...
@@ -106,14 +119,18 @@ image{
align-items: center;
justify-content: space-between;
}
.filterComponents .filterCondition .left{
flex: 1;
justify-content: space-between;
}
.filterComponents .filterCondition .verticalLine {
margin: 0 10px;
}
.filterComponents .filterCondition .filterItem{
font-size: 14px;
color: #999;
align-items: center;
}
.filterComponents .filterCondition .filterItem:last-child{
margin-left: 30px;
}
.filterComponents .filterCondition .filterItem:last-child .shaixuan{
width: 14px;
height: 14px;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment