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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
74 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
{
{
"description"
:
"项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html"
,
"description"
:
"项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html"
,
"packOptions"
:
{
"packOptions"
:
{
"ignore"
:
[],
"ignore"
:
[],
"include"
:
[]
"include"
:
[]
},
},
"setting"
:
{
"setting"
:
{
"urlCheck"
:
true
,
"urlCheck"
:
true
,
"es6"
:
true
,
"es6"
:
true
,
"enhance"
:
true
,
"enhance"
:
true
,
"postcss"
:
true
,
"postcss"
:
true
,
"preloadBackgroundData"
:
false
,
"preloadBackgroundData"
:
false
,
"minified"
:
true
,
"minified"
:
true
,
"newFeature"
:
false
,
"newFeature"
:
false
,
"coverView"
:
true
,
"coverView"
:
true
,
"nodeModules"
:
true
,
"nodeModules"
:
true
,
"autoAudits"
:
true
,
"autoAudits"
:
true
,
"showShadowRootInWxmlPanel"
:
true
,
"showShadowRootInWxmlPanel"
:
true
,
"scopeDataCheck"
:
false
,
"scopeDataCheck"
:
false
,
"uglifyFileName"
:
false
,
"uglifyFileName"
:
false
,
"checkInvalidKey"
:
true
,
"checkInvalidKey"
:
true
,
"checkSiteMap"
:
true
,
"checkSiteMap"
:
true
,
"uploadWithSourceMap"
:
true
,
"uploadWithSourceMap"
:
true
,
"compileHotReLoad"
:
false
,
"compileHotReLoad"
:
false
,
"babelSetting"
:
{
"babelSetting"
:
{
"ignore"
:
[],
"ignore"
:
[],
"disablePlugins"
:
[],
"disablePlugins"
:
[],
"outputPath"
:
""
"outputPath"
:
""
},
},
"useIsolateContext"
:
false
,
"useIsolateContext"
:
false
,
"useCompilerModule"
:
false
,
"useCompilerModule"
:
false
,
"userConfirmedUseCompilerModuleSwitch"
:
false
,
"userConfirmedUseCompilerModuleSwitch"
:
false
,
"lazyloadPlaceholderEnable"
:
false
,
"lazyloadPlaceholderEnable"
:
false
,
"useMultiFrameRuntime"
:
true
,
"useMultiFrameRuntime"
:
true
,
"useApiHook"
:
true
,
"useApiHook"
:
true
,
"useApiHostProcess"
:
true
,
"useApiHostProcess"
:
true
,
"userConfirmedBundleSwitch"
:
false
,
"userConfirmedBundleSwitch"
:
false
,
"packNpmManually"
:
false
,
"packNpmManually"
:
false
,
"packNpmRelationList"
:
[],
"packNpmRelationList"
:
[],
"minifyWXSS"
:
true
,
"minifyWXSS"
:
true
,
"disableUseStrict"
:
false
,
"disableUseStrict"
:
false
,
"minifyWXML"
:
true
,
"minifyWXML"
:
true
,
"showES6CompileOption"
:
false
,
"showES6CompileOption"
:
false
,
"useCompilerPlugins"
:
false
,
"useCompilerPlugins"
:
false
,
"ignoreDevUnusedFiles"
:
false
,
"ignoreDevUnusedFiles"
:
false
,
"ignoreUploadUnusedFiles"
:
false
,
"ignoreUploadUnusedFiles"
:
false
,
"useStaticServer"
:
true
,
"useStaticServer"
:
true
,
"condition"
:
false
"condition"
:
false
},
},
"compileType"
:
"miniprogram"
,
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.14.4"
,
"libVersion"
:
"2.14.4"
,
"appid"
:
"wx220b5d2dbb82ce64"
,
"appid"
:
"wx220b5d2dbb82ce64"
,
"projectname"
:
"miniProject"
,
"projectname"
:
"miniProject"
,
"cloudfunctionTemplateRoot"
:
"cloudfunctionTemplate/"
,
"cloudfunctionTemplateRoot"
:
"cloudfunctionTemplate/"
,
"editorSetting"
:
{
"editorSetting"
:
{
"tabIndent"
:
"insertSpaces"
,
"tabIndent"
:
"insertSpaces"
,
"tabSize"
:
4
"tabSize"
:
4
},
},
"simulatorType"
:
"wechat"
,
"simulatorType"
:
"wechat"
,
"simulatorPluginLibVersion"
:
{},
"simulatorPluginLibVersion"
:
{},
"condition"
:
{
"condition"
:
{
"miniprogram"
:
{
"miniprogram"
:
{
"list"
:
[
"list"
:
[
{
{
"name"
:
"pages/accountHome/index"
,
"name"
:
"pages/accountHome/index"
,
"pathName"
:
"pages/accountHome/index"
,
"pathName"
:
"pages/accountHome/index"
,
"query"
:
""
,
"query"
:
""
,
"scene"
:
null
"scene"
:
null
}
}
]
]
}
}
}
}
}
}
\ No newline at end of file
\ No newline at end of file
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