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 6fe05da7
authored
Aug 11, 2022
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改
1 parent
1b6f773b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
26 deletions
src/views/home/index.vue
src/views/home/useHistory.vue
src/views/home/index.vue
View file @
6fe05da
...
@@ -48,7 +48,6 @@
...
@@ -48,7 +48,6 @@
class=
"van-list-box"
class=
"van-list-box"
:style=
"
{ height: data.innerHeight - (280 + 10 + 28 + 68) + 'px' }"
:style=
"
{ height: data.innerHeight - (280 + 10 + 28 + 68) + 'px' }"
>
>
<!-- -->
<van-list
<van-list
finished-text=
"- 没有更多啦 -"
finished-text=
"- 没有更多啦 -"
loading-text=
"加载中..."
loading-text=
"加载中..."
...
@@ -150,7 +149,8 @@ let total = ref<number>(1);
...
@@ -150,7 +149,8 @@ let total = ref<number>(1);
// 校验是否登录
// 校验是否登录
const
hasSession
=
()
=>
{
const
hasSession
=
()
=>
{
console
.
log
(
userStore
.
getSession
);
console
.
log
(
"123"
);
const
sessionId
=
userStore
.
getSession
;
const
sessionId
=
userStore
.
getSession
;
if
(
!
sessionId
)
Toast
(
"请先登录"
);
if
(
!
sessionId
)
Toast
(
"请先登录"
);
sessionId
?
getUserInfo
()
:
logout
();
sessionId
?
getUserInfo
()
:
logout
();
...
@@ -174,6 +174,7 @@ const logout = () => {
...
@@ -174,6 +174,7 @@ const logout = () => {
// 下拉加载积分历史明细数据
// 下拉加载积分历史明细数据
const
onLoad
=
async
()
=>
{
const
onLoad
=
async
()
=>
{
console
.
log
(
"456"
);
loading
.
value
=
true
;
loading
.
value
=
true
;
let
params
:
{
let
params
:
{
pageNum
?:
number
;
pageNum
?:
number
;
...
@@ -181,9 +182,8 @@ const onLoad = async () => {
...
@@ -181,9 +182,8 @@ const onLoad = async () => {
}
=
{};
}
=
{};
params
.
pageNum
=
pageData
.
pageNum
+
1
;
params
.
pageNum
=
pageData
.
pageNum
+
1
;
params
.
pageSize
=
pageData
.
pageSize
;
params
.
pageSize
=
pageData
.
pageSize
;
console
.
log
(
pageData
.
pageNum
,
total
.
value
);
// 如果列表长度小于总长度下拉刷新
// 如果列表长度小于总长度下拉刷新
if
(
pageData
.
pageNum
<
total
.
value
)
{
if
(
pageData
.
pageNum
<
=
total
.
value
)
{
const
res
=
await
req
(
const
res
=
await
req
(
"scrm.api.renewal.h5.integral.record.list"
,
"scrm.api.renewal.h5.integral.record.list"
,
params
,
params
,
...
@@ -193,13 +193,13 @@ const onLoad = async () => {
...
@@ -193,13 +193,13 @@ const onLoad = async () => {
list
.
push
(...
res
.
data
.
list
);
list
.
push
(...
res
.
data
.
list
);
total
.
value
=
res
.
data
.
pages
;
total
.
value
=
res
.
data
.
pages
;
}
else
{
}
else
{
Toast
.
fail
(
"获取积分历史明细失败"
);
Toast
(
"获取积分历史明细失败"
);
}
pageData
.
pageNum
++
;
if
(
pageData
.
pageNum
==
total
.
value
)
{
finished
.
value
=
true
;
}
}
}
}
if
((
pageData
.
pageNum
=
total
.
value
))
{
finished
.
value
=
true
;
}
pageData
.
pageNum
++
;
loading
.
value
=
false
;
loading
.
value
=
false
;
};
};
// 组件挂载完成
// 组件挂载完成
...
...
src/views/home/useHistory.vue
View file @
6fe05da
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
<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
.
jifen
}}
</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,9 +26,9 @@
...
@@ -26,9 +26,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
.
bank
}}
</div>
<div
class=
"info-content-right-middle"
>
{{
item
.
bank
Name
}}
</div>
<div
class=
"info-content-right-bottom"
>
<div
class=
"info-content-right-bottom"
>
处理时间:
{{
item
.
ti
me
}}
处理时间:
{{
item
.
cardNa
me
}}
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -45,11 +45,19 @@ import { ref, reactive, onBeforeMount } from "vue";
...
@@ -45,11 +45,19 @@ import { ref, reactive, onBeforeMount } from "vue";
import
{
Toast
}
from
"vant"
;
import
{
Toast
}
from
"vant"
;
import
req
from
"../../utils/request"
;
import
req
from
"../../utils/request"
;
type
historyList
=
{
type
historyList
=
{
id
?:
number
;
amount
?:
number
;
jifen
?:
number
;
approverDate
?:
string
;
approverUserName
?:
string
;
bankName
?:
string
;
bankNo
?:
string
;
cardName
?:
string
;
id
?:
any
;
mobile
?:
string
;
name
?:
string
;
name
?:
string
;
bank
?:
string
;
orderCode
?:
string
;
time
?:
string
;
plateN
?:
string
;
status
?:
number
;
userId
?:
null
;
};
};
// 获取可视区高度
// 获取可视区高度
const
innerHeight
=
ref
<
number
>
(
window
.
innerHeight
);
const
innerHeight
=
ref
<
number
>
(
window
.
innerHeight
);
...
@@ -81,26 +89,23 @@ const getHistoryList = async () => {
...
@@ -81,26 +89,23 @@ const getHistoryList = async () => {
params
,
params
,
true
true
);
);
console
.
log
(
res
);
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
useList
.
push
(...
res
.
data
.
list
);
useList
.
push
(...
res
.
data
.
list
);
total
.
value
=
res
.
data
.
pages
;
total
.
value
=
res
.
data
.
pages
;
}
else
{
}
else
{
Toast
.
fail
(
"获取积分使用记录失败"
);
Toast
(
"获取积分使用记录失败"
);
}
pageData
.
pageNum
++
;
if
(
pageData
.
pageNum
==
total
.
value
)
{
finished
.
value
=
true
;
}
}
}
}
if
((
pageData
.
pageNum
=
total
.
value
))
{
finished
.
value
=
true
;
}
pageData
.
pageNum
++
;
loading
.
value
=
false
;
loading
.
value
=
false
;
};
};
// 组件挂载完成
// 组件挂载完成
onBeforeMount
(()
=>
{
onBeforeMount
(()
=>
{});
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