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 f35c2b89
authored
Aug 16, 2022
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
第一轮bug修复
1 parent
5bc982a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
42 deletions
src/views/home/index.vue
src/views/home/useHistory.vue
src/views/home/index.vue
View file @
f35c2b8
...
...
@@ -4,7 +4,7 @@
<div
class=
"wrapper-content"
>
<div
class=
"wrapper-integral"
>
<span>
可用积分
</span>
<span
class=
"integral"
>
{{
data
.
integral
}}
</span>
<span
class=
"integral"
>
{{
data
.
integral
}}
</span>
<img
class=
"coin-img"
src=
"@/assets/images/coin.png"
alt=
""
/>
</div>
<div
class=
"wrapper-userinfo"
>
...
...
@@ -119,7 +119,7 @@ type UserInfo = {
name
?:
string
;
mobile
?:
string
;
plateNo
?:
string
;
authStatus
?:
number
authStatus
?:
number
;
};
interface
page
{
pageNum
:
number
;
...
...
@@ -131,16 +131,16 @@ const router = useRouter();
const
data
:
{
innerHeight
:
number
;
userInfo
:
UserInfo
;
integral
:
number
integral
:
number
;
}
=
reactive
({
innerHeight
:
window
.
innerHeight
,
// 获取可视区高度
userInfo
:
{
name
:
""
,
mobile
:
""
,
plateNo
:
""
,
authStatus
:
0
authStatus
:
0
,
},
integral
:
0
integral
:
0
,
});
// 积分历史明细列表
const
list
=
reactive
<
listStyle
>
([]);
...
...
@@ -155,16 +155,14 @@ let total = ref<number>(1);
// 校验是否登录
const
hasSession
=
()
=>
{
console
.
log
(
"123"
);
const
sessionId
=
userStore
.
getSession
;
if
(
sessionId
)
{
onLoad
()
getUserInfo
()
getIntegral
()
onLoad
()
;
getUserInfo
()
;
getIntegral
()
;
}
else
{
Toast
(
"请先登录"
)
logout
()
Toast
(
"请先登录"
)
;
logout
()
;
}
// if (!sessionId) Toast("请先登录");
// // onLoad
...
...
@@ -177,11 +175,10 @@ const getUserInfo = async () => {
};
// 查询可用积分
const
getIntegral
=
async
()
=>
{
const
res
=
await
req
(
'scrm.api.renewal.h5.integral.get'
)
console
.
log
(
res
.
amount
,
'-------'
)
data
.
integral
=
res
.
amount
}
const
getIntegral
=
async
()
=>
{
const
res
=
await
req
(
"scrm.api.renewal.h5.integral.get"
);
data
.
integral
=
res
.
amount
;
};
// 路由跳转,value:跳转页面路径
const
routerTo
=
(
value
:
string
)
=>
{
...
...
@@ -196,7 +193,6 @@ const logout = () => {
// 下拉加载积分历史明细数据
const
onLoad
=
async
()
=>
{
console
.
log
(
"456"
);
loading
.
value
=
true
;
let
params
:
{
pageNum
?:
number
;
...
...
@@ -454,7 +450,7 @@ onBeforeMount(() => {
display
:
flex
;
justify-content
:
space-around
;
font-size
:
14px
;
&-content
{
width
:
50%
;
text-align
:
center
;
...
...
src/views/home/useHistory.vue
View file @
f35c2b8
<
template
>
<
div
class=
"info-content
"
>
<
van-list
finished-text=
"- 没有更多啦 -"
loading-text=
"加载中..."
v-model:loading=
"loading"
:finished=
"finished"
@
load=
"getHistoryList"
>
<
template
v-if=
"useList.length == 0"
>
<div
class=
"nodata"
:style=
"
{ height: innerHeight + 'px' }">
<img
class=
"nodata-img"
src=
"@/assets/images/nodata.png"
alt=
""
/>
<div
class=
"nodata-word"
>
暂无积分使用记录
</div>
</div>
</
template
>
<
template
v-else
>
<
template
v-if=
"useList.length == 0
"
>
<
div
class=
"nodata"
:style=
"
{ height: innerHeight + 'px' }">
<img
class=
"nodata-img"
src=
"@/assets/images/nodata.png"
alt=
""
/>
<div
class=
"nodata-word"
>
暂无积分使用记录
</div>
</div>
</
template
>
<
template
v-else
>
<div
class=
"info-content"
>
<
van-list
finished-text=
"- 没有更多啦 -"
loading-text=
"加载中..."
v-model:loading=
"loading"
:finished=
"finished"
@
load=
"getHistoryList"
>
<div
v-for=
"item in useList"
:key=
"item.id"
>
<div
class=
"info-content-list"
>
<div
class=
"info-content-list-left"
>
...
...
@@ -29,21 +29,20 @@
<div
class=
"info-content-right"
>
<div
class=
"info-content-right-top"
>
{{
item
.
name
}}
</div>
<div
class=
"info-content-right-middle"
>
{{
item
.
bankName
}}
(
{{
item
.
bankNo
}}
}
)
{{
item
.
bankName
}}
(
{{
item
.
bankNo
}}
)
</div>
<div
class=
"info-content-right-bottom"
>
处理时间:
{{
item
.
cardNam
e
}}
处理时间:
{{
item
.
approverDat
e
}}
</div>
</div>
</div>
<div
class=
"finish-img"
>
已完成
</div>
</div>
</div>
</
template
>
</
van-list
>
</
div
>
</
van-list
>
</
div
>
</
template
>
</template>
<
script
lang=
"ts"
setup
>
import
{
ref
,
reactive
,
onMounted
}
from
"vue"
;
import
{
Toast
}
from
"vant"
;
...
...
@@ -78,7 +77,6 @@ let total = ref<number>(1);
// 获取积分使用记录
const
getHistoryList
=
async
()
=>
{
console
.
log
(
222222222
);
loading
.
value
=
true
;
let
params
:
{
pageNum
?:
number
;
...
...
@@ -114,7 +112,9 @@ const getHistoryList = async () => {
};
// 组件挂载完成
onMounted
(()
=>
{});
onMounted
(()
=>
{
getHistoryList
();
});
</
script
>
<
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