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
db8ec649
Commit
db8ec649
authored
Mar 10, 2022
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品列表添加滚动动画
parent
3a787cd4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
5 deletions
+25
-5
static/nativeComponents/GoodsList/index.js
+8
-4
static/nativeComponents/GoodsList/index.json
+2
-1
static/nativeComponents/GoodsList/index.wxml
+4
-0
static/nativeComponents/GoodsList/index.wxss
+11
-0
No files found.
static/nativeComponents/GoodsList/index.js
View file @
db8ec649
...
...
@@ -25,6 +25,7 @@ const componentOptions = {
classificationLoadNum
:
10
,
queryProductInfoLoading
:
false
,
loading
:
false
,
scrollLoading
:
false
,
// 滚动加载优化后添加加载动画
finished
:
false
,
goodsList
:[],
storageGoodsList
:[],
...
...
@@ -311,7 +312,8 @@ const componentOptions = {
this
.
setData
({
"datas.componentData.goodsList"
:
goodsList
,
// goodsList
loadingFlag
loadingFlag
,
scrollLoading
:
false
,
},
function
()
{
// that.lazyloading();
...
...
@@ -377,7 +379,9 @@ const componentOptions = {
return
}
this
.
setData
({
scrollLoading
:
true
})
wx
.
createSelectorQuery
().
selectAll
(
`.goodsListItemIndex
${
that
.
data
.
datasIndex
}
>>>.
${
type
}
`
).
boundingClientRect
(
function
(
rects
){
for
(
let
index
=
0
;
index
<
rects
.
length
;
index
++
)
{
if
(
rects
[
index
].
top
==
0
&&
rects
[
index
].
bottom
==
0
&&
rects
[
index
].
left
==
0
&&
rects
[
index
].
right
==
0
)
{
...
...
@@ -401,10 +405,10 @@ const componentOptions = {
if
(
that
.
data
.
pageGoodsList
[
that
.
data
.
datasIndex
][
that
.
data
.
pageGoodsList
[
that
.
data
.
datasIndex
].
length
-
1
].
loadState
==
true
)
{
loadingFlag
[
that
.
data
.
datasIndex
]
=
true
that
.
setData
({
loadingFlag
loadingFlag
,
})
wx
.
setStorageSync
(
'loadingFlag'
,
loadingFlag
)
that
.
moreProduct
(
false
)
console
.
log
(
'load--ok'
);
...
...
static/nativeComponents/GoodsList/index.json
View file @
db8ec649
...
...
@@ -3,6 +3,7 @@
"usingComponents"
:
{
"goods-item"
:
"./GoodsItem/index"
,
"waterfall-flow"
:
"../module/WaterfallFlow/index"
,
"heap-item"
:
"./heapItem/index"
"heap-item"
:
"./heapItem/index"
,
"van-loading"
:
"/static/vant/loading/index"
}
}
static/nativeComponents/GoodsList/index.wxml
View file @
db8ec649
...
...
@@ -41,6 +41,10 @@
indexs="{{index}}"
></goods-item>
</view>
<!-- 网格布局滚动加载 -->
<view class="scrollLoading" wx:if="{{scrollLoading}}">
<van-loading size="16px" color="#fff"><text class="scrollLoadingText">加载中...</text></van-loading>
</view>
</view>
<!-- 横向滚动 -->
<view class="goods-across" wx:elif="{{datas.componentData.style==='across'}}">
...
...
static/nativeComponents/GoodsList/index.wxss
View file @
db8ec649
...
...
@@ -90,4 +90,14 @@ image{
flex-shrink: 0;
display: inline-block;
box-sizing: border-box;
}
.scrollLoading{
width: 100%;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
}
.scrollLoading .scrollLoadingText{
color: #fff;
}
\ No newline at end of file
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