Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
schedule
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fengzhaoyu
schedule
Commits
b3c644a7
Commit
b3c644a7
authored
Nov 19, 2020
by
zhouweifeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat 动态列表 接口
parent
5627f248
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
9 deletions
+105
-9
index.acss
pages/index/index.acss
+13
-0
index.axml
pages/index/index.axml
+14
-6
index.js
pages/index/index.js
+78
-3
No files found.
pages/index/index.acss
View file @
b3c644a7
...
...
@@ -427,3 +427,15 @@
.tabBarView .iconicon_days {
color: #FFFFFF !important;
}
.dynamicMore {
text-align: center;
margin-top: 32rpx;
color: rgba(27, 38, 61, .3);
font-size: 28rpx;
}
.dynamicMore image {
width: 50rpx;
height: 50rpx;
}
\ No newline at end of file
pages/index/index.axml
View file @
b3c644a7
...
...
@@ -39,6 +39,14 @@
</block>
</view>
</view>
<block a:if="{{more}}">
<view a:if="{{!moreLoading}}" onTap="getPagesMore" class="dynamicMore">
加载更多
</view>
<view a:else class="dynamicMore">
<image mode="scaleToFill" src="/assests/loading.gif"/>
</view>
</template>
</view>
</scroll-view>
<view class="noDate" a:else>
...
...
@@ -122,8 +130,8 @@
<template is="loading" a:else>
</template>
</view>
</block>
<view class="tabBarContent">
</block>
<view class="tabBarContent">
<view class="tabBar">
<view onTap="changeTabBar" data-tabbar='0' data-title='动态'>
<view class="tabBarView tabBarView1 {{$data.tabBarIndex === '0' ? 'ischooseTabBar' : ''}}">
...
...
@@ -149,7 +157,7 @@
</view>
</view>
<template is="fullScreen" data="{{isIPX:isIPX}}" />
</view>
<popup className="square" position="left" show="{{popupShow}}" mask="true" onClose="closePopup">
</view>
<popup className="square" position="left" show="{{popupShow}}" mask="true" onClose="closePopup">
<setting onClose="closePopup"/>
</popup>
\ No newline at end of file
</popup>
\ No newline at end of file
pages/index/index.js
View file @
b3c644a7
...
...
@@ -67,6 +67,8 @@ create.Page({
pages
:
1
,
listLoading
:
true
,
isIPX
:
checkFullScren
(),
more
:
false
,
moreLoading
:
false
},
scrollTop
:
0
,
pageSize
:
10
,
...
...
@@ -84,6 +86,7 @@ create.Page({
todayIndex
:
0
,
onShow
()
{
//刷新动态列表
console
.
log
(
this
.
$store
.
data
.
isIndexAffairListNeedUpdate
)
if
(
this
.
$store
.
data
.
isIndexAffairListNeedUpdate
)
{
this
.
getPages
(
1
);
this
.
$store
.
data
.
isIndexAffairListNeedUpdate
=
false
;
...
...
@@ -320,13 +323,40 @@ create.Page({
this
.
onLoad
();
},
getPages
(
current
,
callBack
)
{
getDynamicList
()
getDynamicList
(
{
before
:
'yes'
}
)
.
then
(
res
=>
{
if
(
!
res
.
data
.
data
)
{
if
((
!
res
.
data
.
data
||
res
.
data
.
data
.
length
===
0
)
&&
res
.
data
.
msg
===
'yes'
)
{
getDynamicList
({
before
:
'no'
}).
then
(
res
=>
{
if
(
!
res
.
data
.
data
||
res
.
data
.
data
.
length
===
0
)
{
this
.
setData
({
listLoading
:
false
,
more
:
false
,
dynamicList
:
[]
});
}
else
{
const
dynamicList
=
res
.
data
.
data
.
map
((
item
,
index
)
=>
{
for
(
let
i
=
0
;
i
<
item
.
commentListDataModelList
.
length
;
i
++
)
{
let
itemData
=
item
.
commentListDataModelList
[
i
];
if
(
itemData
.
updateTime
)
{
itemData
.
updateTime
=
getCreateShowTime
(
itemData
.
updateTime
);
}
if
(
itemData
.
notes
)
{
itemData
.
notes
=
removeHtml
(
itemData
.
notes
)
}
}
return
item
;
});
this
.
setData
({
dynamicList
,
listLoading
:
false
,
more
:
false
,
});
if
(
callBack
)
{
callBack
();
}
}
})
return
;
}
const
dynamicList
=
res
.
data
.
data
.
map
((
item
,
index
)
=>
{
...
...
@@ -338,13 +368,58 @@ create.Page({
if
(
itemData
.
notes
)
{
itemData
.
notes
=
removeHtml
(
itemData
.
notes
)
}
}
return
item
;
});
const
more
=
res
.
data
.
msg
===
'yes'
this
.
setData
({
dynamicList
,
listLoading
:
false
,
more
,
});
if
(
callBack
)
{
callBack
();
}
})
.
catch
(
err
=>
{
if
(
err
&&
err
.
refresh
)
{
this
.
setData
({
refresh
:
true
});
}
});
},
getPagesMore
(
current
,
callBack
)
{
this
.
setData
({
moreLoading
:
true
,
});
getDynamicList
({
before
:
'no'
})
.
then
(
res
=>
{
if
(
!
res
.
data
.
data
||
res
.
data
.
data
.
length
===
0
)
{
return
}
let
dynamicList
=
this
.
data
.
dynamicList
.
concat
(
res
.
data
.
data
.
map
((
item
,
index
)
=>
{
for
(
let
i
=
0
;
i
<
item
.
commentListDataModelList
.
length
;
i
++
)
{
let
itemData
=
item
.
commentListDataModelList
[
i
];
if
(
itemData
.
updateTime
)
{
itemData
.
updateTime
=
getCreateShowTime
(
itemData
.
updateTime
);
}
if
(
itemData
.
notes
)
{
itemData
.
notes
=
removeHtml
(
itemData
.
notes
)
}
}
return
item
;
}))
dynamicList
=
dynamicList
.
filter
((
el
,
index
)
=>
{
if
(
dynamicList
.
findIndex
(
ele
=>
ele
.
meetingId
===
el
.
meetingId
)
===
index
)
{
return
true
;
}
});
this
.
setData
({
dynamicList
,
listLoading
:
false
moreLoading
:
false
,
more
:
false
});
if
(
callBack
)
{
callBack
();
...
...
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