Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
vite-integral
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3f02c969
authored
Aug 12, 2022
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
历史记录页面
1 parent
b9203ea2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
src/views/home/useHistory.vue
src/views/home/useHistory.vue
View file @
3f02c96
...
@@ -5,7 +5,8 @@
...
@@ -5,7 +5,8 @@
loading-text=
"加载中..."
loading-text=
"加载中..."
v-model:loading=
"loading"
v-model:loading=
"loading"
:finished=
"finished"
:finished=
"finished"
@
load=
"getHistoryList"
:immediate-check=
"false"
:offset=
"20"
>
>
<template
v-if=
"useList.length == 0"
>
<template
v-if=
"useList.length == 0"
>
<div
class=
"nodata"
:style=
"
{ height: innerHeight + 'px' }">
<div
class=
"nodata"
:style=
"
{ height: innerHeight + 'px' }">
...
@@ -18,7 +19,9 @@
...
@@ -18,7 +19,9 @@
<div
class=
"info-content-list"
>
<div
class=
"info-content-list"
>
<div
class=
"info-content-list-left"
>
<div
class=
"info-content-list-left"
>
<div
class=
"info-content-left"
>
<div
class=
"info-content-left"
>
<div
class=
"info-content-left-top"
>
{{
item
.
amount
}}
</div>
<div
class=
"info-content-left-top"
>
{{
item
.
amount
}}
</div>
<div
class=
"info-content-left-bottom"
>
兑换积分
</div>
<div
class=
"info-content-left-bottom"
>
兑换积分
</div>
</div>
</div>
</div>
</div>
...
@@ -26,7 +29,9 @@
...
@@ -26,7 +29,9 @@
<div
class=
"info-content-list-right"
>
<div
class=
"info-content-list-right"
>
<div
class=
"info-content-right"
>
<div
class=
"info-content-right"
>
<div
class=
"info-content-right-top"
>
{{
item
.
name
}}
</div>
<div
class=
"info-content-right-top"
>
{{
item
.
name
}}
</div>
<div
class=
"info-content-right-middle"
>
{{
item
.
bankName
}}
</div>
<div
class=
"info-content-right-middle"
>
{{
item
.
bankName
}}
(
{{
item
.
bankNo
}}
})
</div>
<div
class=
"info-content-right-bottom"
>
<div
class=
"info-content-right-bottom"
>
处理时间:
{{
item
.
cardName
}}
处理时间:
{{
item
.
cardName
}}
</div>
</div>
...
@@ -41,7 +46,7 @@
...
@@ -41,7 +46,7 @@
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
reactive
,
on
BeforeMount
}
from
"vue"
;
import
{
ref
,
reactive
,
on
Mounted
}
from
"vue"
;
import
{
Toast
}
from
"vant"
;
import
{
Toast
}
from
"vant"
;
import
req
from
"../../utils/request"
;
import
req
from
"../../utils/request"
;
type
historyList
=
{
type
historyList
=
{
...
@@ -63,7 +68,7 @@ type historyList = {
...
@@ -63,7 +68,7 @@ type historyList = {
const
innerHeight
=
ref
<
number
>
(
window
.
innerHeight
);
const
innerHeight
=
ref
<
number
>
(
window
.
innerHeight
);
// 积分使用记录
// 积分使用记录
const
useList
=
reactive
<
historyList
>
([]);
const
useList
=
reactive
<
historyList
>
([]);
const
loading
=
ref
<
boolean
>
(
tru
e
);
const
loading
=
ref
<
boolean
>
(
fals
e
);
const
finished
=
ref
<
boolean
>
(
false
);
const
finished
=
ref
<
boolean
>
(
false
);
// 分页加载数据
// 分页加载数据
let
pageData
:
object
=
{
let
pageData
:
object
=
{
...
@@ -74,6 +79,7 @@ let total = ref<number>(1);
...
@@ -74,6 +79,7 @@ let total = ref<number>(1);
// 获取积分使用记录
// 获取积分使用记录
const
getHistoryList
=
async
()
=>
{
const
getHistoryList
=
async
()
=>
{
console
.
log
(
222222222
);
loading
.
value
=
true
;
loading
.
value
=
true
;
let
params
:
{
let
params
:
{
pageNum
?:
number
;
pageNum
?:
number
;
...
@@ -81,7 +87,6 @@ const getHistoryList = async () => {
...
@@ -81,7 +87,6 @@ const getHistoryList = async () => {
}
=
{};
}
=
{};
params
.
pageNum
=
pageData
.
pageNum
+
1
;
params
.
pageNum
=
pageData
.
pageNum
+
1
;
params
.
pageSize
=
pageData
.
pageSize
;
params
.
pageSize
=
pageData
.
pageSize
;
console
.
log
(
useList
.
length
,
total
.
value
);
// 如果列表长度小于总长度下拉刷新
// 如果列表长度小于总长度下拉刷新
if
(
pageData
.
pageNum
<
total
.
value
)
{
if
(
pageData
.
pageNum
<
total
.
value
)
{
const
res
=
await
req
(
const
res
=
await
req
(
...
@@ -90,8 +95,15 @@ const getHistoryList = async () => {
...
@@ -90,8 +95,15 @@ const getHistoryList = async () => {
true
true
);
);
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
if
(
res
.
data
.
list
)
{
res
.
data
.
list
.
map
((
item
)
=>
{
item
.
bankNo
=
item
.
bankNo
.
substring
(
item
.
bankNo
.
length
-
4
);
return
item
;
});
}
useList
.
push
(...
res
.
data
.
list
);
useList
.
push
(...
res
.
data
.
list
);
total
.
value
=
res
.
data
.
pages
;
total
.
value
=
res
.
data
.
pages
;
loading
.
value
=
false
;
}
else
{
}
else
{
Toast
(
"获取积分使用记录失败"
);
Toast
(
"获取积分使用记录失败"
);
}
}
...
@@ -100,12 +112,12 @@ const getHistoryList = async () => {
...
@@ -100,12 +112,12 @@ const getHistoryList = async () => {
finished
.
value
=
true
;
finished
.
value
=
true
;
}
}
}
}
loading
.
value
=
false
;
};
};
// 组件挂载完成
// 组件挂载完成
onBeforeMount
(()
=>
{});
onMounted
(()
=>
{
getHistoryList
();
});
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment