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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
31 deletions
src/views/home/index.vue
src/views/home/useHistory.vue
src/views/home/index.vue
View file @
f35c2b8
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<div
class=
"wrapper-content"
>
<div
class=
"wrapper-content"
>
<div
class=
"wrapper-integral"
>
<div
class=
"wrapper-integral"
>
<span>
可用积分
</span>
<span>
可用积分
</span>
<span
class=
"integral"
>
{{
data
.
integral
}}
</span>
<span
class=
"integral"
>
{{
data
.
integral
}}
</span>
<img
class=
"coin-img"
src=
"@/assets/images/coin.png"
alt=
""
/>
<img
class=
"coin-img"
src=
"@/assets/images/coin.png"
alt=
""
/>
</div>
</div>
<div
class=
"wrapper-userinfo"
>
<div
class=
"wrapper-userinfo"
>
...
@@ -119,7 +119,7 @@ type UserInfo = {
...
@@ -119,7 +119,7 @@ type UserInfo = {
name
?:
string
;
name
?:
string
;
mobile
?:
string
;
mobile
?:
string
;
plateNo
?:
string
;
plateNo
?:
string
;
authStatus
?:
number
authStatus
?:
number
;
};
};
interface
page
{
interface
page
{
pageNum
:
number
;
pageNum
:
number
;
...
@@ -131,16 +131,16 @@ const router = useRouter();
...
@@ -131,16 +131,16 @@ const router = useRouter();
const
data
:
{
const
data
:
{
innerHeight
:
number
;
innerHeight
:
number
;
userInfo
:
UserInfo
;
userInfo
:
UserInfo
;
integral
:
number
integral
:
number
;
}
=
reactive
({
}
=
reactive
({
innerHeight
:
window
.
innerHeight
,
// 获取可视区高度
innerHeight
:
window
.
innerHeight
,
// 获取可视区高度
userInfo
:
{
userInfo
:
{
name
:
""
,
name
:
""
,
mobile
:
""
,
mobile
:
""
,
plateNo
:
""
,
plateNo
:
""
,
authStatus
:
0
authStatus
:
0
,
},
},
integral
:
0
integral
:
0
,
});
});
// 积分历史明细列表
// 积分历史明细列表
const
list
=
reactive
<
listStyle
>
([]);
const
list
=
reactive
<
listStyle
>
([]);
...
@@ -155,16 +155,14 @@ let total = ref<number>(1);
...
@@ -155,16 +155,14 @@ let total = ref<number>(1);
// 校验是否登录
// 校验是否登录
const
hasSession
=
()
=>
{
const
hasSession
=
()
=>
{
console
.
log
(
"123"
);
const
sessionId
=
userStore
.
getSession
;
const
sessionId
=
userStore
.
getSession
;
if
(
sessionId
)
{
if
(
sessionId
)
{
onLoad
()
onLoad
()
;
getUserInfo
()
getUserInfo
()
;
getIntegral
()
getIntegral
()
;
}
else
{
}
else
{
Toast
(
"请先登录"
)
Toast
(
"请先登录"
)
;
logout
()
logout
()
;
}
}
// if (!sessionId) Toast("请先登录");
// if (!sessionId) Toast("请先登录");
// // onLoad
// // onLoad
...
@@ -177,11 +175,10 @@ const getUserInfo = async () => {
...
@@ -177,11 +175,10 @@ const getUserInfo = async () => {
};
};
// 查询可用积分
// 查询可用积分
const
getIntegral
=
async
()
=>
{
const
getIntegral
=
async
()
=>
{
const
res
=
await
req
(
'scrm.api.renewal.h5.integral.get'
)
const
res
=
await
req
(
"scrm.api.renewal.h5.integral.get"
);
console
.
log
(
res
.
amount
,
'-------'
)
data
.
integral
=
res
.
amount
;
data
.
integral
=
res
.
amount
};
}
// 路由跳转,value:跳转页面路径
// 路由跳转,value:跳转页面路径
const
routerTo
=
(
value
:
string
)
=>
{
const
routerTo
=
(
value
:
string
)
=>
{
...
@@ -196,7 +193,6 @@ const logout = () => {
...
@@ -196,7 +193,6 @@ 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
;
...
...
src/views/home/useHistory.vue
View file @
f35c2b8
<
template
>
<
template
>
<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"
>
<div
class=
"info-content"
>
<van-list
<van-list
finished-text=
"- 没有更多啦 -"
finished-text=
"- 没有更多啦 -"
...
@@ -7,13 +14,6 @@
...
@@ -7,13 +14,6 @@
:finished=
"finished"
:finished=
"finished"
@
load=
"getHistoryList"
@
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
>
<div
v-for=
"item in useList"
:key=
"item.id"
>
<div
v-for=
"item in useList"
:key=
"item.id"
>
<div
class=
"info-content-list"
>
<div
class=
"info-content-list"
>
<div
class=
"info-content-list-left"
>
<div
class=
"info-content-list-left"
>
...
@@ -29,21 +29,20 @@
...
@@ -29,21 +29,20 @@
<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"
>
<div
class=
"info-content-right-middle"
>
{{
item
.
bankName
}}
(
{{
item
.
bankNo
}}
}
)
{{
item
.
bankName
}}
(
{{
item
.
bankNo
}}
)
</div>
</div>
<div
class=
"info-content-right-bottom"
>
<div
class=
"info-content-right-bottom"
>
处理时间:
{{
item
.
cardNam
e
}}
处理时间:
{{
item
.
approverDat
e
}}
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"finish-img"
>
已完成
</div>
<div
class=
"finish-img"
>
已完成
</div>
</div>
</div>
</div>
</div>
</
template
>
</van-list>
</van-list>
</div>
</div>
</
template
>
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
reactive
,
onMounted
}
from
"vue"
;
import
{
ref
,
reactive
,
onMounted
}
from
"vue"
;
import
{
Toast
}
from
"vant"
;
import
{
Toast
}
from
"vant"
;
...
@@ -78,7 +77,6 @@ let total = ref<number>(1);
...
@@ -78,7 +77,6 @@ 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
;
...
@@ -114,7 +112,9 @@ const getHistoryList = async () => {
...
@@ -114,7 +112,9 @@ const getHistoryList = async () => {
};
};
// 组件挂载完成
// 组件挂载完成
onMounted
(()
=>
{});
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