Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wx-boss
Project
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
姜雷
wx-boss
Commits
7fbc07bf
Commit
7fbc07bf
authored
Nov 05, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加反馈数据切片
parent
5138e9e0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
9 deletions
+38
-9
feedback.js
miniprogram/pages/feedback/feedback.js
+0
-0
feedback.ts
miniprogram/pages/feedback/feedback.ts
+31
-3
feedback.wxml
miniprogram/pages/feedback/feedback.wxml
+7
-6
No files found.
miniprogram/pages/feedback/feedback.js
View file @
7fbc07bf
This diff is collapsed.
Click to expand it.
miniprogram/pages/feedback/feedback.ts
View file @
7fbc07bf
...
...
@@ -15,6 +15,8 @@ Page({
list1
:
[],
list2
:
[],
areaList
:
[],
list
:
[],
pageNum
:
[
null
,
0
,
0
],
},
initData
()
{
this
.
fetchList
(
1
);
...
...
@@ -23,10 +25,9 @@ Page({
toggleList
(
e
)
{
const
{
tabindex
}
=
e
.
currentTarget
.
dataset
;
if
(
tabindex
!==
this
.
data
.
tabIndex
)
{
this
.
setData
!
({
t
abIndex
:
tabindex
,
this
.
setData
!
({
tabIndex
:
tabindex
},
()
=>
{
t
his
.
fetchList
(
tabindex
);
});
this
.
fetchList
(
tabindex
);
}
},
fetchList
(
state
?:
number
)
{
...
...
@@ -44,8 +45,15 @@ Page({
.
then
(
res
=>
{
wx
.
hideLoading
();
const
list
=
res
.
data
;
let
viewList
=
list
.
slice
(
0
,
10
);
if
(
state
===
this
.
data
.
tabIndex
)
{
this
.
setData
!
({
list
:
viewList
,
});
}
this
.
setData
!
({
[
'list'
+
state
]:
list
,
[
`pageNum[
${
state
}
]`
]:
0
,
});
})
.
catch
(
err
=>
{
...
...
@@ -90,4 +98,24 @@ Page({
console
.
log
(
err
);
});
},
getMoreListItem
()
{
let
state
=
this
.
data
.
tabIndex
;
let
index
=
this
.
data
.
pageNum
[
state
]
+
1
;
let
max
=
Math
.
ceil
(
this
.
data
[
'list'
+
state
].
length
/
10
);
console
.
log
(
'in getMoreListItem'
,
index
,
max
);
if
(
index
>=
max
)
{
wx
.
showToast
({
title
:
'没有更多数据'
,
icon
:
'none'
,
});
}
else
{
this
.
setData
({
[
`pageNum[
${
state
}
]`
]:
index
,
list
:
[
...
this
.
data
.
list
,
...
this
.
data
[
'list'
+
state
].
slice
(
index
*
10
,
(
index
+
1
)
*
10
),
],
});
}
},
});
miniprogram/pages/feedback/feedback.wxml
View file @
7fbc07bf
...
...
@@ -13,10 +13,10 @@
<text class="feedback-tabCount">{{list2.length}}</text>
</view>
</view>
<
view wx:if="{{tabIndex===1}}" class="feedback-list
">
<feedback-item wx:for="{{list
1
}}" wx:key="{{item.id}}" feedback-data="{{item}}" bind:refresh="refreshHandle" />
</view>
<
view wx:elif="{{tabIndex===2}}" class="feedback-list
">
<feedback-item wx:for="{{list
2
}}" wx:key="{{item.id}}" feedback-data="{{item}}" bind:refresh="refreshHandle" />
</view>
<
scroll-view wx:if="{{tabIndex===1}}" class="feedback-list" scroll-y bindscrolltolower="getMoreListItem
">
<feedback-item wx:for="{{list}}" wx:key="{{item.id}}" feedback-data="{{item}}" bind:refresh="refreshHandle" />
</
scroll-
view>
<
scroll-view wx:elif="{{tabIndex===2}}" class="feedback-list" scroll-y bindscrolltolower="getMoreListItem
">
<feedback-item wx:for="{{list}}" wx:key="{{item.id}}" feedback-data="{{item}}" bind:refresh="refreshHandle" />
</
scroll-
view>
</view>
\ 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