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 17ef088a
authored
Aug 17, 2022
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改
1 parent
0a44d422
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
104 additions
and
53 deletions
package-lock.json
src/utils/http.ts
src/views/home/index.vue
src/views/home/useHistory.vue
package-lock.json
View file @
17ef088
This diff is collapsed.
Click to expand it.
src/utils/http.ts
View file @
17ef088
...
...
@@ -15,7 +15,7 @@ const response = {
message_key
:
'message'
,
code_key
:
'code'
,
code_success_value
:
'0'
,
errId_logout_value
:
'
21
'
,
errId_logout_value
:
'
10039
'
,
logout_function
:
'reLogin'
,
code_message_map
:
{}
}
...
...
src/views/home/index.vue
View file @
17ef088
...
...
@@ -14,14 +14,32 @@
<div
class=
"user-top"
>
<span
class=
"username"
>
{{
data
.
userInfo
.
name
}}
</span>
<!--
<img
v-if=
"data.userInfo.authStatus == 1"
class=
"auth"
src=
"@/assets/images/auth.png"
alt=
""
/>
-->
<div
class=
"auth-status"
:class=
"data.userInfo.authStatus == 1 ? 'certified':'no-certified'"
>
<img
v-if=
"data.userInfo.authStatus == 1"
src=
"@/assets/images/certified.png"
alt=
""
>
<img
v-else
src=
"@/assets/images/no-certified.png"
alt=
""
>
<span
:class=
"data.userInfo.authStatus == 1 ? 'certified-color':''"
>
{{
data
.
userInfo
.
authStatus
==
1
?
'已'
:
'未'
}}
认证
</span>
<div
class=
"auth-status"
:class=
"
data.userInfo.authStatus == 1 ? 'certified' : 'no-certified'
"
>
<img
v-if=
"data.userInfo.authStatus == 1"
src=
"@/assets/images/certified.png"
alt=
""
/>
<img
v-else
src=
"@/assets/images/no-certified.png"
alt=
""
/>
<span
:class=
"
data.userInfo.authStatus == 1 ? 'certified-color' : ''
"
>
{{
data
.
userInfo
.
authStatus
==
1
?
"已"
:
"未"
}}
认证
</span
>
</div>
</div>
<div>
<span
class=
"user-mobile"
>
{{
data
.
userInfo
.
mobile
}}
<span
v-if=
"data.userInfo.plateNo"
>
丨
</span>
{{
data
.
userInfo
.
plateNo
}}
</span>
<span
class=
"user-mobile"
>
{{
data
.
userInfo
.
mobile
}}
<span
v-if=
"data.userInfo.plateNo"
>
丨
</span
>
{{
data
.
userInfo
.
plateNo
}}
</span
>
</div>
</div>
<div
class=
"logout"
@
click=
"logout"
>
退出登录
</div>
...
...
@@ -42,9 +60,18 @@
<div
class=
"history-list-top"
>
<img
class=
"top-img"
src=
"@/assets/images/list-info.png"
alt=
""
/>
</div>
<div
class=
"van-list-box"
:style=
"
{ height: data.innerHeight - (280 + 10 + 28 + 68) + 'px' }">
<van-list
finished-text=
"- 没有更多啦 -"
loading-text=
"加载中..."
v-model:loading=
"loading"
:finished=
"finished"
@
load=
"onLoad"
:immediate-check=
"false"
>
<div
class=
"van-list-box"
:style=
"
{ height: data.innerHeight - (280 + 10 + 28 + 68) + 'px' }"
>
<van-list
finished-text=
"- 没有更多啦 -"
loading-text=
"加载中..."
v-model:loading=
"loading"
:finished=
"finished"
@
load=
"onLoad"
:immediate-check=
"false"
>
<!-- 没有历史数据 -->
<template
v-if=
"!list.length"
>
<div
class=
"nodata"
>
...
...
@@ -56,16 +83,24 @@
<template
v-for=
"item in list"
:key=
"item.id"
>
<div
class=
"list-content"
>
<div
class=
"list-content-left"
>
<div
class=
"list-content-left-top"
>
{{
data
.
recordStatus
[
item
.
recordType
]
}}
</div>
<div
class=
"list-content-left-top"
>
{{
data
.
recordStatus
[
item
.
recordType
]
}}
</div>
<div
class=
"list-content-left-bottom"
>
{{
item
.
createdDate
}}
</div>
</div>
<div
class=
"list-content-right"
>
<div
v-if=
"item.recordType == 1"
class=
"list-content-right-increment"
>
<div
v-if=
"item.recordType == 1"
class=
"list-content-right-increment"
>
+
{{
item
.
amount
}}
</div>
<div
v-if=
"item.recordType == 2"
class=
"list-content-right-decrement"
>
<div
v-if=
"item.recordType == 2"
class=
"list-content-right-decrement"
>
-
{{
item
.
amount
}}
</div>
</div>
...
...
@@ -102,7 +137,7 @@ type UserInfo = {
name
?:
string
;
mobile
?:
string
;
plateNo
?:
string
;
authStatus
?:
number
authStatus
?:
number
;
};
interface
page
{
pageNum
:
number
;
...
...
@@ -114,21 +149,21 @@ const router = useRouter();
const
data
:
{
innerHeight
:
number
;
userInfo
:
UserInfo
;
integral
:
number
,
recordStatus
:
any
integral
:
number
;
recordStatus
:
any
;
}
=
reactive
({
innerHeight
:
window
.
innerHeight
,
// 获取可视区高度
userInfo
:
{
name
:
""
,
mobile
:
""
,
plateNo
:
""
,
authStatus
:
0
authStatus
:
0
,
},
integral
:
0
,
recordStatus
:
{
1
:
'系统赠送'
,
2
:
'积分兑换'
}
1
:
"系统赠送"
,
2
:
"积分兑换"
,
}
,
});
// 积分历史明细列表
const
list
=
reactive
<
listStyle
>
([]);
...
...
@@ -146,13 +181,15 @@ const hasSession = () => {
console
.
log
(
"123"
);
const
sessionId
=
userStore
.
getSession
;
console
.
log
(
sessionId
,
"12333"
);
if
(
sessionId
)
{
onLoad
()
getUserInfo
()
getIntegral
()
onLoad
()
;
getUserInfo
()
;
getIntegral
()
;
}
else
{
Toast
(
"请先登录"
)
logout
()
Toast
(
"请先登录"
)
;
logout
()
;
}
// if (!sessionId) Toast("请先登录");
// // onLoad
...
...
@@ -161,15 +198,14 @@ const hasSession = () => {
// 获取用户信息
const
getUserInfo
=
async
()
=>
{
const
res
=
await
req
(
"scrm.api.renewal.h5.customer.get"
);
data
.
userInfo
=
res
;
if
(
res
)
data
.
userInfo
=
res
;
};
// 查询可用积分
const
getIntegral
=
async
()
=>
{
const
res
=
await
req
(
'scrm.api.renewal.h5.integral.get'
)
console
.
log
(
res
.
amount
,
'-------'
)
data
.
integral
=
res
.
amount
}
const
res
=
await
req
(
"scrm.api.renewal.h5.integral.get"
);
if
(
res
)
data
.
integral
=
res
.
amount
;
};
// 路由跳转,value:跳转页面路径
const
routerTo
=
(
value
:
string
)
=>
{
...
...
@@ -181,12 +217,12 @@ const logout = () => {
userStore
.
logout
();
// router.replace("/login")
router
.
replace
({
path
:
'/login'
,
path
:
"/login"
,
query
:
{
plateNo
:
data
.
userInfo
.
plateNo
,
mobile
:
data
.
userInfo
.
mobile
}
})
mobile
:
data
.
userInfo
.
mobile
,
}
,
})
;
};
// 下拉加载积分历史明细数据
...
...
@@ -206,11 +242,12 @@ const onLoad = async () => {
params
,
true
);
if
(
res
.
code
==
0
)
{
list
.
push
(...
res
.
data
.
list
);
total
.
value
=
res
.
data
.
pages
;
const
{
code
,
data
,
message
}
=
res
;
if
(
code
==
0
)
{
list
.
push
(...
data
.
list
);
total
.
value
=
data
.
pages
;
}
else
{
Toast
(
"获取积分历史明细失败"
);
Toast
(
message
);
}
pageData
.
pageNum
++
;
if
(
pageData
.
pageNum
==
total
.
value
)
{
...
...
@@ -275,7 +312,8 @@ onBeforeMount(() => {
z-index
:
-1
;
}
&
-content
{}
&
-content
{
}
&
-history-list
{
background-color
:
#fff
;
...
...
@@ -453,14 +491,14 @@ onBeforeMount(() => {
line-height
:
12px
;
}
.certified-color
{
color
:
#
F7712B
;
color
:
#
f7712b
;
}
}
.no-certified
{
background-color
:
#
F2F2F
2
;
background-color
:
#
f2f2f
2
;
}
.certified
{
background-color
:
#
FFEBE
0
;
background-color
:
#
ffebe
0
;
}
.user-mobile
{
...
...
src/views/home/useHistory.vue
View file @
17ef088
...
...
@@ -29,7 +29,8 @@
<div
class=
"info-content-right"
>
<div
class=
"info-content-right-top"
>
{{
item
.
name
}}
</div>
<div
class=
"info-content-right-middle"
>
{{
item
.
bankName
}}
(
{{
item
.
bankNo
}}
)
<div
class=
"card-name"
>
{{
item
.
bankName
}}
</div>
<div>
(
{{
item
.
bankNo
}}
)
</div>
</div>
<div
class=
"info-content-right-bottom"
>
处理时间:
{{
item
.
approverDate
}}
...
...
@@ -138,13 +139,14 @@ onMounted(() => {
margin-top
:
20px
;
&-list
{
width
:
calc
(
100%
-
32px
);
height
:
96px
;
//
height
:
96px
;
margin
:
0
16px
10px
;
display
:
flex
;
background
:
#fff
;
position
:
relative
;
&-left
{
width
:
30%
;
position
:
relative
;
}
.finish-img
{
width
:
48px
;
...
...
@@ -156,19 +158,23 @@ onMounted(() => {
font-weight
:
500
;
background
:
linear-gradient
(
180deg
,
#fc6f35
0%
,
#f6b78c
100%
);
border-radius
:
9px
0
0
9px
;
border-image
:
linear-gradient
(
180deg
,
rgba
(
247
,
171
,
125
,
1
),
rgba
(
251
,
133
,
79
,
1
)
)
1
1
;
//
border-image
:
linear-gradient
(
//
180deg
,
//
rgba
(
247
,
171
,
125
,
1
),
//
rgba
(
251
,
133
,
79
,
1
)
//
)
//
1
1
;
position
:
absolute
;
top
:
12px
;
right
:
0
;
}
}
&
-left
{
padding
:
24px
16px
0
16px
;
//
padding
:
24px
16px
0
16px
;
position
:
absolute
;
top
:
50%
;
left
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
text-align
:
center
;
&-top
{
font-size
:
24px
;
...
...
@@ -187,12 +193,15 @@ onMounted(() => {
}
.right-line
{
width
:
1px
;
height
:
48px
;
margin-top
:
24px
;
height
:
50px
;
position
:
absolute
;
top
:
50%
;
left
:
30%
;
transform
:
translateY
(
-50%
);
background
:
#ececec
;
}
&
-right
{
padding
:
16px
0
0
16px
;
padding
:
16px
0
16px
16px
;
&-top
{
font-size
:
14px
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
...
...
@@ -208,6 +217,10 @@ onMounted(() => {
color
:
#333333
;
line-height
:
20px
;
margin-bottom
:
4px
;
display
:
flex
;
.card-name
{
max-width
:
170px
;
}
}
&
-bottom
{
font-size
:
12px
;
...
...
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