Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
蒋秀川
/
miniProject
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 20a85a50
authored
Jun 14, 2023
by
李君
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
tabbar优化
1 parent
beb0c7ea
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
3 deletions
miniProject/custom-tab-bar/index.js
miniProject/custom-tab-bar/index.wxml
miniProject/index/index.js
miniProject/project.config.json
miniProject/custom-tab-bar/index.js
View file @
20a85a5
Component
({
Component
({
data
:
{
data
:
{
show
:
true
,
curClick
:
1
,
curClick
:
1
,
color
:
"#7A7E83"
,
color
:
"#7A7E83"
,
selectedColor
:
"#3cc51f"
,
selectedColor
:
"#3cc51f"
,
...
...
miniProject/custom-tab-bar/index.wxml
View file @
20a85a5
<!--miniprogram/custom-tab-bar/index.wxml-->
<!--miniprogram/custom-tab-bar/index.wxml-->
<view class="tab-bar">
<view class="tab-bar"
wx:if="{{show}}"
>
<view class="tab-bar-border"></view>
<view class="tab-bar-border"></view>
<view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
<view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
<image src="{{curClick === item.curr ? item.selectedIconPath : item.iconPath}}"></image>
<image src="{{curClick === item.curr ? item.selectedIconPath : item.iconPath}}"></image>
...
...
miniProject/index/index.js
View file @
20a85a5
...
@@ -61,6 +61,9 @@ Component({
...
@@ -61,6 +61,9 @@ Component({
methods
:
{
methods
:
{
// 关闭自定义日期选择
// 关闭自定义日期选择
onClose
()
{
onClose
()
{
this
.
getTabBar
().
setData
({
show
:
true
});
this
.
setData
({
this
.
setData
({
show
:
false
show
:
false
});
});
...
@@ -75,6 +78,9 @@ Component({
...
@@ -75,6 +78,9 @@ Component({
},
},
// 点击自定义日期选择器的确定
// 点击自定义日期选择器的确定
onConfirm
(
event
)
{
onConfirm
(
event
)
{
this
.
getTabBar
().
setData
({
show
:
true
});
const
[
start
,
end
]
=
event
.
detail
;
const
[
start
,
end
]
=
event
.
detail
;
let
startDate
=
moment
(
start
).
format
(
"YYYY-MM-DD"
)
let
startDate
=
moment
(
start
).
format
(
"YYYY-MM-DD"
)
let
endDate
=
moment
(
end
).
format
(
"YYYY-MM-DD"
)
let
endDate
=
moment
(
end
).
format
(
"YYYY-MM-DD"
)
...
@@ -108,6 +114,9 @@ Component({
...
@@ -108,6 +114,9 @@ Component({
show
:
true
,
show
:
true
,
types
:
e
.
target
.
dataset
.
type
,
types
:
e
.
target
.
dataset
.
type
,
})
})
this
.
getTabBar
().
setData
({
show
:
false
,
});
break
;
break
;
}
}
if
(
dateType
!=
5
)
{
if
(
dateType
!=
5
)
{
...
@@ -214,8 +223,15 @@ Component({
...
@@ -214,8 +223,15 @@ Component({
// 返回趋势图配置项
// 返回趋势图配置项
getLineConfig
(
res
)
{
getLineConfig
(
res
)
{
let
xasix
=
res
.
xaxis
.
data
||
[]
let
xasix
=
res
.
xaxis
.
data
||
[]
let
seriesList
=
res
.
series
||
[]
let
seriesList
=
res
.
series
||
[];
if
(
seriesList
.
length
<
1
)
{
let
data
=
seriesList
[
0
].
data
;
let
isData
=
false
;
for
(
let
index
=
0
;
index
<
data
.
length
;
index
++
)
{
if
(
data
[
index
]
!=
null
){
isData
=
true
;
}
}
if
(
!
isData
)
{
return
{
return
{
title
:
{
title
:
{
text
:
'暂无数据'
,
text
:
'暂无数据'
,
...
...
miniProject/project.config.json
View file @
20a85a5
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