Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Accustomed_
hello uni-app x
提交
9171cea3
H
hello uni-app x
项目概览
Accustomed_
/
hello uni-app x
与 Fork 源项目一致
Fork自
DCloud / hello uni-app x
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
9171cea3
编写于
7月 28, 2023
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(api): setNavigationBarColor
上级
1ca3f346
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
130 addition
and
21 deletion
+130
-21
pages.json
pages.json
+19
-15
pages/API/navigator/new-page/new-page-2.uvue
pages/API/navigator/new-page/new-page-2.uvue
+1
-4
pages/API/set-navigation-bar-color/set-navigation-bar-color.test.js
...set-navigation-bar-color/set-navigation-bar-color.test.js
+30
-0
pages/API/set-navigation-bar-color/set-navigation-bar-color.uvue
...PI/set-navigation-bar-color/set-navigation-bar-color.uvue
+74
-0
pages/tabBar/API.uvue
pages/tabBar/API.uvue
+6
-2
未找到文件。
pages.json
浏览文件 @
9171cea3
...
...
@@ -171,6 +171,13 @@
"navigationBarTitleText"
:
"页面跳转"
}
},
{
"path"
:
"pages/API/set-navigation-bar-color/set-navigation-bar-color"
,
"style"
:
{
"navigationBarTitleText"
:
"设置导航条颜色"
}
},
{
"path"
:
"pages/API/navigator/new-page/new-page-1"
,
"style"
:
{
...
...
@@ -671,23 +678,20 @@
"navigationBarTitleText"
:
"电量"
}
},
{
"path"
:
"pages/CSS/border/complex-border/complex-border"
,
"style"
:
{
"navigationBarTitleText"
:
"border属性组合示例"
,
"enablePullDownRefresh"
:
false
}
{
"path"
:
"pages/CSS/border/complex-border/complex-border"
,
"style"
:
{
"navigationBarTitleText"
:
"border属性组合示例"
,
"enablePullDownRefresh"
:
false
}
,{
"path"
:
"pages/template/scroll-fold-nav2/scroll-fold-nav2"
,
"style"
:
{
},
{
"path"
:
"pages/template/scroll-fold-nav2/scroll-fold-nav2"
,
"style"
:
{
"navigationStyle"
:
"custom"
}
}
],
}
}
],
"globalStyle"
:
{
"pageOrientation"
:
"portrait"
,
"navigationBarTitleText"
:
"Hello uniapp x"
,
...
...
pages/API/navigator/new-page/new-page-2.uvue
浏览文件 @
9171cea3
...
...
@@ -72,10 +72,7 @@ export default {
},
pageScrollTo(){
uni.pageScrollTo({
scrollTop: 1200,
complete(res){
console.warn('pageScrollTo', res)
}
scrollTop: 1200
})
}
},
...
...
pages/API/set-navigation-bar-color/set-navigation-bar-color.test.js
0 → 100644
浏览文件 @
9171cea3
const
CURRENT_PAGE_PATH
=
'
/pages/API/set-navigation-bar-color/set-navigation-bar-color
'
describe
(
'
setNavigationBarColor
'
,
()
=>
{
let
page
let
originLifeCycleNum
let
lifeCycleNum
beforeAll
(
async
()
=>
{
page
=
await
program
.
navigateTo
(
CURRENT_PAGE_PATH
)
await
page
.
waitFor
(
1000
)
originLifeCycleNum
=
await
page
.
callMethod
(
'
getLifeCycleNum
'
)
})
afterAll
(
async
()
=>
{
await
page
.
callMethod
(
'
setLifeCycleNum
'
,
originLifeCycleNum
)
lifeCycleNum
=
await
page
.
callMethod
(
'
getLifeCycleNum
'
)
expect
(
lifeCycleNum
).
toBe
(
originLifeCycleNum
)
})
it
(
'
setNavigationBarColor1
'
,
async
()
=>
{
await
page
.
callMethod
(
'
setNavigationBarColor1
'
)
const
image
=
await
program
.
screenshot
()
expect
(
image
).
toMatchImageSnapshot
()
})
it
(
'
setNavigationBarColor2
'
,
async
()
=>
{
await
page
.
callMethod
(
'
setNavigationBarColor2
'
)
const
image
=
await
program
.
screenshot
()
expect
(
image
).
toMatchImageSnapshot
()
})
})
pages/API/set-navigation-bar-color/set-navigation-bar-color.uvue
0 → 100644
浏览文件 @
9171cea3
<template>
<view>
<page-head title="setNavigationBarColor"></page-head>
<view class="uni-padding-wrap uni-common-mt">
<button @tap="setNavigationBarColor1" class="uni-btn">
设置导航条背景绿色,标题白色
</button>
<button @tap="setNavigationBarColor2" class="uni-btn">
设置导航条背景红色,标题黑色
</button>
</view>
</view>
</template>
<script lang="ts">
import { state, setLifeCycleNum } from '@/store/index.uts'
export default {
methods: {
setNavigationBarColor1() {
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: '#00ff00',
success() {
console.log('setNavigationBarColor success')
setLifeCycleNum(state.lifeCycleNum + 1)
},
fail() {
console.log('setNavigationBarColor success')
setLifeCycleNum(state.lifeCycleNum - 1)
},
complete() {
console.log('setNavigationBarColor success')
setLifeCycleNum(state.lifeCycleNum + 1)
}
})
},
setNavigationBarColor2() {
uni.setNavigationBarColor({
frontColor: '#000000',
backgroundColor: '#ff0000',
success() {
console.log('setNavigationBarColor success')
setLifeCycleNum(state.lifeCycleNum + 1)
},
fail() {
console.log('setNavigationBarColor success')
setLifeCycleNum(state.lifeCycleNum - 1)
},
complete() {
console.log('setNavigationBarColor success')
setLifeCycleNum(state.lifeCycleNum + 1)
}
})
},
// 自动化测试
getLifeCycleNum(): number {
return state.lifeCycleNum
},
// 自动化测试
setLifeCycleNum(num: number) {
setLifeCycleNum(num)
},
},
}
</script>
<style>
.direction-row {
flex-direction: row;
}
.label {
width: 190px;
}
</style>
pages/tabBar/API.uvue
浏览文件 @
9171cea3
...
...
@@ -81,10 +81,14 @@
enable: false
},
{
name: "设置导航条",
name: "设置导航条
标题
",
url: "set-navigation-bar-title",
enable: false
},
},
{
name: "设置导航条颜色",
url: "set-navigation-bar-color",
},
{
name: "设置TabBar",
url: "set-tabbar",
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录