Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mp-enterprise-people-recruitment-h5
Project
Project
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
彭佳妮(贵阳日报)
mp-enterprise-people-recruitment-h5
Commits
2b0c233e
Commit
2b0c233e
authored
Oct 10, 2024
by
石建新(贵阳日报)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息下啦刷新
parent
ebb2a346
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
8 deletions
+44
-8
pages.json
src/pages.json
+3
-1
index.vue
src/pages/messageList/index.vue
+41
-7
No files found.
src/pages.json
View file @
2b0c233e
...
...
@@ -59,7 +59,9 @@
"path"
:
"pages/messageList/index"
,
"style"
:
{
"navigationBarTitleText"
:
"消息"
,
"navigationStyle"
:
"custom"
"navigationStyle"
:
"custom"
,
"enablePullDownRefresh"
:
true
,
"onReachBottomDistance"
:
50
}
},
{
...
...
src/pages/messageList/index.vue
View file @
2b0c233e
...
...
@@ -30,25 +30,59 @@ import { ref } from "vue";
import
{
getEnumText
}
from
"@/utils/utils"
;
import
_
from
"lodash"
;
const
list
=
ref
([]);
let
pageNo
=
1
;
const
params
=
ref
({
pageNo
:
1
,
pageSize
:
10
,
isEnd
:
false
});
const
goToDetail
=
item
=>
{
xma
.
navigateTo
({
url
:
`/pages/user/feedbackDetails/index?id=
${
item
.
id
}
`
});
};
const
refresh
=
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
list
.
value
=
[];
params
.
value
.
pageNo
=
1
;
params
.
value
.
isEnd
=
false
;
resolve
();
});
};
const
getList
=
()
=>
{
getMessagePageList
({
pageNo
:
pageNo
++
,
pageSize
:
10
}).
then
(
res
=>
{
if
(
params
.
value
.
isEnd
===
true
)
return
new
Promise
(
resolve
=>
{
resolve
();
});
xma
.
showLoading
({
title
:
"加载中..."
,
mask
:
true
});
return
getMessagePageList
(
params
.
value
).
then
(
res
=>
{
if
(
res
.
data
.
length
<
params
.
value
.
pageSize
)
{
params
.
value
.
isEnd
=
true
;
}
res
.
data
.
forEach
(
async
v
=>
{
v
.
typeText
=
await
getEnumText
(
"EnumMessageType"
,
v
.
type
);
});
console
.
log
(
res
.
data
);
list
.
value
=
_
.
concat
(
list
.
value
,
res
.
data
);
params
.
value
.
pageNo
+=
1
;
list
.
value
=
list
.
value
.
concat
(
res
.
data
);
xma
.
hideLoading
();
});
};
onPullDownRefresh
(()
=>
{
refresh
().
then
(()
=>
{
getList
().
then
(()
=>
{
xma
.
stopPullDownRefresh
();
});
});
});
// 触底加载
onReachBottom
(()
=>
{
getList
();
});
getList
();
</
script
>
...
...
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