Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
account-book
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘文虎
account-book
Commits
9a9e326e
Commit
9a9e326e
authored
Jul 14, 2022
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 首页明细列表封装
parent
73944e45
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
242 additions
and
41 deletions
+242
-41
index.vue
components/bill-list/index.vue
+114
-0
index.vue
components/cell-bill-list/index.vue
+11
-1
index.vue
components/no-data/index.vue
+70
-0
index.vue
pages/index/index.vue
+47
-40
No files found.
components/bill-list/index.vue
0 → 100644
View file @
9a9e326e
<
template
>
<view
class=
"bill-list"
>
<view
class=
"list-view"
v-if=
"list && list.length > 0"
>
<view
class=
"list-day-view"
v-for=
"(items, index) in list"
:key=
"index"
>
<view
class=
"cell-head"
>
<view
class=
"left-view"
>
<view
class=
"week-view"
>
{{}}
</view>
<view
class=
"day-view"
>
{{}}
</view>
</view>
<view
class=
"right-view"
>
<view
><text>
收:
</text><text
class=
"count-view"
>
{{}}
</text></view
>
<view
><text>
支:
</text><text
class=
"count-view"
>
{{}}
</text></view
>
</view>
</view>
<view
class=
"item-view"
v-for=
"(item, ind) in items.list"
:key=
"ind"
>
<CellBill
@
select=
"handleSelect"
:info=
"item"
:isLast=
"ind + 1 >= items.list.length"
></CellBill>
</view>
</view>
</view>
<NoData
v-else-if=
"!loading"
imageWidth=
"374"
text=
"当前暂无收支明细"
/>
</view>
</
template
>
<
script
>
import
CellBill
from
'@/components/cell-bill-list/index.vue'
import
NoData
from
'@/components/no-data'
export
default
{
components
:
{
CellBill
,
NoData
},
props
:
{
list
:
{
type
:
Array
,
default
()
{
return
[]
},
}
},
data
()
{
return
{
loading
:
true
}
},
watch
:
{
list
()
{
console
.
log
(
'----------'
)
this
.
loading
=
false
}
},
computed
:
{
},
methods
:
{
handleSelect
(
id
)
{
this
.
$emit
(
'select'
,
id
)
},
},
}
</
script
>
<
style
scoped
lang=
"scss"
>
.bill-list
{
.list-view
{
.list-day-view
{
background-color
:
#ffffff
;
border-radius
:
16rpx
;
margin-top
:
24rpx
;
.cell-head
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
padding
:
24rpx
24rpx
8rpx
24rpx
;
.left-view
{
display
:
flex
;
align-items
:
center
;
.week-view
{
font-size
:
28rpx
;
font-weight
:
bold
;
color
:
#333333
;
}
.day-view
{
color
:
#8d8d8d
;
font-size
:
24rpx
;
}
}
.right-view
{
display
:
flex
;
align-items
:
center
;
color
:
#8d8d8d
;
font-size
:
24rpx
;
.count-view
{
font-weight
:
bold
;
color
:
#333333
;
}
}
}
}
}
}
</
style
>
components/cell-bill-list/index.vue
View file @
9a9e326e
...
...
@@ -19,6 +19,7 @@
<view
class=
"time-view"
>
{{
info
.
time
}}
</view>
</view>
</view>
<view
v-if=
"!isLast"
class=
"line-view"
></view>
</view>
</
template
>
...
...
@@ -31,6 +32,10 @@ export default {
return
{}
},
},
isLast
:
{
type
:
Boolean
,
default
:
false
}
},
data
()
{
return
{}
...
...
@@ -46,11 +51,11 @@ export default {
</
script
>
<
style
scoped
lang=
"scss"
>
.cell-bill-list
{
padding
:
32rpx
24rpx
;
.content-view
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
flex-start
;
padding
:
32rpx
24rpx
;
.left-view
{
flex
:
1
;
display
:
flex
;
...
...
@@ -88,5 +93,10 @@ export default {
}
}
}
.line-view
{
height
:
2rpx
;
background-color
:
#F6F7FA
;
margin
:
0
24rpx
;
}
}
</
style
>
components/no-data/index.vue
0 → 100644
View file @
9a9e326e
<
template
>
<view
class=
"no-data-view"
:style=
"customStyle"
>
<image
v-if=
"imageName"
class=
"no-data-image"
mode=
"widthFix"
:style=
"'width:' + imageWidth + 'rpx'"
:src=
"wudingdanImage"
></image>
<text
v-if=
"text"
class=
"text-view"
:style=
"'color:' + textColor"
>
{{
text
}}
</text>
<slot></slot>
</view>
</
template
>
<
script
>
export
default
{
props
:
{
customStyle
:
{
type
:
String
,
default
:
'background-color: transparent'
,
},
imageName
:
{
// 图片
type
:
[
String
,
Boolean
],
default
:
'wushouzhiquesheng@3x.png'
,
},
imageWidth
:
{
type
:
[
Number
,
String
],
default
:
''
,
},
text
:
{
// 提示文字
type
:
[
String
,
Boolean
],
default
:
'当前暂无数据'
,
},
textColor
:
{
type
:
String
,
default
:
'#8D8D8D'
}
},
computed
:
{
wudingdanImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
this
.
imageName
},
},
}
</
script
>
<
style
lang=
"scss"
scoped
>
.no-data-view
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
color
:
#999999
;
font-size
:
26rpx
;
padding
:
30rpx
;
border-radius
:
12rpx
;
min-height
:
460rpx
;
margin-top
:
50rpx
;
.no-data-image
{
width
:
240rpx
;
height
:
240rpx
;
margin
:
50rpx
auto
48rpx
;
}
.text-view
{
}
}
</
style
>
pages/index/index.vue
View file @
9a9e326e
...
...
@@ -87,7 +87,8 @@
<view
class=
"title-view"
>
收支明细
</view>
<view
class=
"tip-view"
>
展示近3天数据
</view>
</view>
<view
class=
"list-view"
>
<BillList
:list=
"list"
@
select=
"handleSelectCell"
/>
<!--
<view
class=
"list-view"
v-if=
"list.length > 0"
>
<view
class=
"list-day-view"
v-for=
"(items, index) in list"
...
...
@@ -112,10 +113,11 @@
v-for=
"(item, ind) in items.list"
:key=
"ind"
>
<CellBill
:info=
"item"
></CellBill>
<CellBill
:info=
"item"
:isLast=
"ind + 1 >= items.list.length"
></CellBill>
</view>
</view>
</view>
<NoData
v-else
imageWidth=
"374"
text=
"当前暂无收支明细"
/>
-->
</view>
</view>
<mid-popup
ref=
"midPopup"
></mid-popup>
...
...
@@ -130,13 +132,17 @@
<
script
>
import
MidPopup
from
'@/components/mid-popup/mid-popup.vue'
import
CellBill
from
'@/components/cell-bill-list/index.vue'
// import CellBill from '@/components/cell-bill-list/index.vue'
// import NoData from '@/components/no-data'
import
BillList
from
'@/components/bill-list'
import
{
tabbar
}
from
'@/utils/settings.js'
import
{
addBind
}
from
'@/api/login/index.js'
export
default
{
components
:
{
MidPopup
,
CellBill
BillList
,
// CellBill,
// NoData
},
data
()
{
return
{
...
...
@@ -248,6 +254,7 @@ export default {
handleSelectDate
()
{},
handleClickTool
(
path
)
{},
handleClickOperate
(
path
)
{},
handleSelectCell
(
id
)
{},
formatCount
(
count
)
{
return
(
Math
.
trunc
(
count
*
100
)
/
100
).
toFixed
(
2
)
},
...
...
@@ -451,42 +458,42 @@ export default {
margin-top
:
6rpx
;
}
}
.list-view
{
.list-day-view
{
background-color
:
#ffffff
;
border-radius
:
16rpx
;
margin-top
:
24rpx
;
.cell-head
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
padding
:
24rpx
24rpx
8rpx
24rpx
;
.left-view
{
display
:
flex
;
align-items
:
center
;
.week-view
{
font-size
:
28rpx
;
font-weight
:
bold
;
color
:
#333333
;
}
.day-view
{
color
:
#8d8d8d
;
font-size
:
24rpx
;
}
}
.right-view
{
display
:
flex
;
align-items
:
center
;
color
:
#8d8d8d
;
font-size
:
24rpx
;
.count-view
{
font-weight
:
bold
;
color
:
#333333
;
}
}
}
}
}
//
.list-view {
//
.list-day-view {
//
background-color: #ffffff;
//
border-radius: 16rpx;
//
margin-top: 24rpx;
//
.cell-head {
//
display: flex;
//
justify-content: space-between;
//
align-items: center;
//
padding: 24rpx 24rpx 8rpx 24rpx;
//
.left-view {
//
display: flex;
//
align-items: center;
//
.week-view {
//
font-size: 28rpx;
//
font-weight: bold;
//
color: #333333;
//
}
//
.day-view {
//
color: #8d8d8d;
//
font-size: 24rpx;
//
}
//
}
//
.right-view {
//
display: flex;
//
align-items: center;
//
color: #8d8d8d;
//
font-size: 24rpx;
//
.count-view {
//
font-weight: bold;
//
color: #333333;
//
}
//
}
//
}
//
}
//
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment