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 b8ac797a
authored
Aug 09, 2022
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
样式调整
1 parent
86f69cf7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
100 additions
and
63 deletions
package-lock.json
src/assets/images/coin.png
src/views/home/index.vue
src/views/home/useHistory.vue
package-lock.json
View file @
b8ac797
...
...
@@ -111,6 +111,15 @@
"integrity"
:
"sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw=="
,
"dev"
:
true
},
"@types/sha1"
:
{
"version"
:
"1.1.3"
,
"resolved"
:
"https://registry.npmmirror.com/@types/sha1/-/sha1-1.1.3.tgz"
,
"integrity"
:
"sha512-bXfx/6xrPu1l6pLItGRMPX00lhnJavpj2qiQeLHflXvL2Ix97aC8FTF2/pQoqukRzcCwKyN3csZvOLzamIoaSA=="
,
"dev"
:
true
,
"requires"
:
{
"@types/node"
:
"*"
}
},
"@types/web-bluetooth"
:
{
"version"
:
"0.0.14"
,
"resolved"
:
"https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.14.tgz"
,
...
...
@@ -1311,6 +1320,15 @@
"upper-case-first"
:
"^2.0.2"
}
},
"sha1"
:
{
"version"
:
"1.1.1"
,
"resolved"
:
"https://registry.npmmirror.com/sha1/-/sha1-1.1.1.tgz"
,
"integrity"
:
"sha512-dZBS6OrMjtgVkopB1Gmo4RQCDKiZsqcpAQpkV/aaj+FCrCg8r4I4qMkDPQjBgLIxlmu9k4nUbWq6ohXahOneYA=="
,
"requires"
:
{
"charenc"
:
">= 0.0.1"
,
"crypt"
:
">= 0.0.1"
}
},
"side-channel"
:
{
"version"
:
"1.0.4"
,
"resolved"
:
"https://registry.npmmirror.com/side-channel/-/side-channel-1.0.4.tgz"
,
...
...
src/assets/images/coin.png
0 → 100644
View file @
b8ac797
52 KB
src/views/home/index.vue
View file @
b8ac797
...
...
@@ -16,6 +16,7 @@
<div
class=
"wrapper-integral"
>
<span>
可用积分
</span>
<span
class=
"integral"
>
1800
</span>
<img
class=
"coin-img"
src=
"@/assets/images/coin.png"
alt=
""
/>
</div>
<div
class=
"wrapper-userinfo"
>
<div
class=
"user-content"
>
...
...
@@ -50,14 +51,10 @@
<div
class=
"history-list-top"
>
<img
class=
"top-img"
src=
"@/assets/images/list-info.png"
alt=
""
/>
</div>
<!-- 没有历史数据 -->
<template
v-if=
"!list.length"
>
<div
class=
"nodata"
>
<img
class=
"nodata-img"
src=
"@/assets/images/nodata.png"
alt=
""
/>
<div
class=
"nodata-word"
>
暂无积分历史明细
</div>
</div>
</
template
>
<
template
v-else
>
<div
class=
"van-list-box"
:style=
"
{ height: innerHeight - (280 + 10 + 28 + 68) + 'px' }"
>
<van-list
finished-text=
"- 没有更多啦 -"
loading-text=
"加载中..."
...
...
@@ -65,24 +62,37 @@
v-model:loading=
"loading"
:finished=
"finished"
>
<template
v-for=
"item in list"
:key=
"item.id"
>
<div
class=
"list-content"
>
<div
class=
"list-content-left"
>
<div
class=
"list-content-left-top"
>
{{
item
.
name
}}
</div>
<div
class=
"list-content-left-bottom"
>
{{
item
.
time
}}
</div>
</div>
<div
class=
"list-content-right"
>
{{
item
.
jifen
}}
</div>
<!-- 没有历史数据 -->
<template
v-if=
"!list.length"
>
<div
class=
"nodata"
>
<img
class=
"nodata-img"
src=
"@/assets/images/nodata.png"
alt=
""
/>
<div
class=
"nodata-word"
>
暂无积分历史明细
</div>
</div>
</
template
>
<
template
v-else
>
<template
v-for=
"item in list"
:key=
"item.id"
>
<div
class=
"list-content"
>
<div
class=
"list-content-left"
>
<div
class=
"list-content-left-top"
>
{{
item
.
name
}}
</div>
<div
class=
"list-content-left-bottom"
>
{{
item
.
time
}}
</div>
</div>
<div
class=
"list-content-right"
>
{{
item
.
jifen
}}
</div>
</div>
</
template
>
</template>
</van-list>
</
template
>
</
div
>
</div>
</template>
</div>
</template>
<
script
lang=
"ts"
setup
>
import
{
ref
,
reactive
,
on
Mounted
}
from
"vue"
;
import
{
ref
,
reactive
,
on
BeforeMount
}
from
"vue"
;
import
{
useRouter
}
from
"vue-router"
;
type
listStyle
=
{
...
...
@@ -98,7 +108,7 @@ const router = useRouter();
const
innerHeight
=
ref
<
number
>
(
window
.
innerHeight
);
const
list
=
reactive
<
listStyle
>
([]);
let
id
=
ref
<
number
>
(
0
);
const
loading
=
ref
<
boolean
>
(
fals
e
);
const
loading
=
ref
<
boolean
>
(
tru
e
);
const
finished
=
ref
<
boolean
>
(
false
);
// 跳到登录页面
...
...
@@ -117,8 +127,8 @@ const toUseList = () => {
};
// 跳转我的信息
const
toInformation
=
()
=>
{
router
.
push
(
'/information'
)
}
router
.
push
(
"/information"
);
}
;
// 下拉加载数据
const
onLoad
=
():
void
=>
{
...
...
@@ -141,11 +151,11 @@ const onLoad = (): void => {
if
(
list
.
length
>=
40
)
{
finished
.
value
=
true
;
}
}
,
1000
);
});
};
// 组件挂载完成
on
Mounted
(()
=>
{
on
BeforeMount
(()
=>
{
onLoad
();
});
</
script
>
...
...
@@ -202,7 +212,7 @@ onMounted(() => {
border-radius
:
4px
;
margin
:
0
16px
28px
;
width
:
calc
(
100%
-
32px
);
overflow
:
auto
;
//
overflow
:
auto
;
.history-list-top
{
text-align
:
center
;
padding
:
16px
0
;
...
...
@@ -211,6 +221,9 @@ onMounted(() => {
height
:
33px
;
}
}
.van-list-box
{
overflow
:
auto
;
}
.nodata
{
margin-top
:
40px
;
text-align
:
center
;
...
...
@@ -259,12 +272,13 @@ onMounted(() => {
&
-integral
{
display
:
inline-flex
;
height
:
37px
;
width
:
calc
(
100%
-
32px
);
margin-top
:
55px
;
margin-left
:
30px
;
color
:
#ffffff
;
font-size
:
14px
;
font-weight
:
400
;
position
:
relative
;
span
:
first-child
{
padding
:
11px
0
6px
;
}
...
...
@@ -275,6 +289,13 @@ onMounted(() => {
line-height
:
37px
;
margin-left
:
4px
;
}
.coin-img
{
width
:
123px
;
height
:
109px
;
position
:
absolute
;
top
:
-25px
;
right
:
20px
;
}
}
&
-userinfo
{
...
...
src/views/home/useHistory.vue
View file @
b8ac797
<
template
>
<div>
<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"
:style=
"
{ height: innerHeight + 'px' }">
<van-list
finished-text=
"- 没有更多啦 -"
loading-text=
"加载中..."
@
load=
"getHistoryList"
v-model:loading=
"loading"
:finished=
"finished"
>
<div
v-for=
"item in useList"
:key=
"item.id"
>
<div
class=
"info-content-list"
>
<div
class=
"info-content-list-left"
>
<div
class=
"info-content-left"
>
<div
class=
"info-content-left-top"
>
{{
item
.
jifen
}}
</div>
<div
class=
"info-content-left-bottom"
>
兑换积分
</div>
</div>
<div
class=
"info-content"
:style=
"
{ height: innerHeight + 'px' }">
<van-list
finished-text=
"- 没有更多啦 -"
loading-text=
"加载中..."
@
load=
"getHistoryList"
v-model:loading=
"loading"
:finished=
"finished"
>
<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
class=
"info-content-list"
>
<div
class=
"info-content-list-left"
>
<div
class=
"info-content-left"
>
<div
class=
"info-content-left-top"
>
{{
item
.
jifen
}}
</div>
<div
class=
"info-content-left-bottom"
>
兑换积分
</div>
</div>
<div
class=
"right-line"
>
</div>
<div
class=
"info-content-list-right"
>
<div
class=
"info-conten
t-right"
>
<div
class=
"info-content-right-top"
>
{{
item
.
name
}}
</div
>
<div
class=
"info-content-right-middle"
>
{{
item
.
bank
}}
</div>
<div
class=
"info-content-right-bottom"
>
处理时间:
{{
item
.
time
}}
</div>
</div>
<div
class=
"right-line"
></div
>
<div
class=
"info-content-lis
t-right"
>
<div
class=
"info-content-right"
>
<div
class=
"info-content-right-top"
>
{{
item
.
name
}}
</div>
<div
class=
"info-content-right-middle"
>
{{
item
.
bank
}}
</div
>
<div
class=
"info-content-right-bottom"
>
处理时间:
{{
item
.
time
}}
</div>
</div>
<div
class=
"finish-img"
>
已完成
</div>
</div>
<div
class=
"finish-img"
>
已完成
</div>
</div>
</
van-list
>
</
div
>
</
template
>
</
div
>
</
template
>
</
van-list
>
</div>
</template>
<
script
lang=
"ts"
setup
>
import
{
ref
,
reactive
,
on
Mounted
}
from
"vue"
;
import
{
ref
,
reactive
,
on
BeforeMount
}
from
"vue"
;
type
historyList
=
{
id
?:
number
;
...
...
@@ -55,7 +53,7 @@ type historyList = {
// 获取可视区高度
const
innerHeight
=
ref
<
number
>
(
window
.
innerHeight
);
const
useList
=
reactive
<
historyList
>
([]);
const
loading
=
ref
<
boolean
>
(
fals
e
);
const
loading
=
ref
<
boolean
>
(
tru
e
);
const
finished
=
ref
<
boolean
>
(
false
);
// 获取积分使用记录
...
...
@@ -78,11 +76,11 @@ const getHistoryList = (): void => {
if
(
useList
.
length
>=
40
)
{
finished
.
value
=
true
;
}
}
,
1000
);
});
};
// 组件挂载完成
on
Mounted
(()
=>
{
on
BeforeMount
(()
=>
{
getHistoryList
();
});
</
script
>
...
...
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