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