Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
4121ced3
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5995
Star
90
Fork
162
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
4121ced3
编写于
5月 02, 2024
作者:
W
wanganxp
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
补充软键盘上推页面的测试
上级
33093bf9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
99 addition
and
76 deletion
+99
-76
hybrid/html/local.html
hybrid/html/local.html
+2
-0
pages/template/navbar-lite/navbar-lite.uvue
pages/template/navbar-lite/navbar-lite.uvue
+97
-76
未找到文件。
hybrid/html/local.html
浏览文件 @
4121ced3
...
...
@@ -46,6 +46,8 @@
<input
type=
"file"
/>
<p
style=
"font-size: 14px;"
>
<
input type="file" accept="image/*" multiple /
>
</p>
<input
type=
"file"
accept=
"image/*"
multiple
/>
<p
style=
"font-size: 14px;"
>
普通input
</p>
<input
placeholder=
"底部输入框"
/>
</div>
<!-- uni 的 SDK -->
<script
type=
"text/javascript"
src=
"uni.webview.1.5.5.js"
></script>
...
...
pages/template/navbar-lite/navbar-lite.uvue
浏览文件 @
4121ced3
<template>
<view class="content">
<uni-navbar-lite :title="title" :is-left="isLeft" :text-color="navigationBarTextColor"></uni-navbar-lite>
<scroll-view class="scroll-view" scroll-y="true">
<view class="content-item" @click="onClick">
<text>点击此处,将标题切换为{{isLeft?'居中':'左侧'}}显示</text>
</view>
<view class="content-item" @tap="setNavigationBarColor1">
<text>设置自定义导航栏前景色白色</text>
</view>
<view class="content-item" @tap="setNavigationBarColor2">
<text>设置自定义导航栏前景色黑色</text>
</view>
<view class="content-item" v-for="item in 20">
<view class="cell-item">
<text class="text">内容:{{item}}</text>
<input class="text" style="margin-top: 8px;" placeholder="备注:"/>
<view class="content-item" @click="onClick">
<text>点击此处,将标题切换为{{isLeft?'居中':'左侧'}}显示</text>
</view>
<view class="content-item" @tap="setNavigationBarColor1">
<text>设置自定义导航栏前景色白色</text>
</view>
<view class="content-item" @tap="setNavigationBarColor2">
<text>设置自定义导航栏前景色黑色</text>
</view>
<view style="align-items: center;height: 60px;">
<text>测试输入框上推页面</text>
<radio-group @change="ChangeView" style="flex-direction: row;">
<radio value="0" :checked="true"><text>scroll-view</text></radio>
<radio value="1"><text>list-view</text></radio>
<radio value="2"><text>web-view</text></radio>
</radio-group>
</view>
<scroll-view v-if="indexView==0" class="scroll-view">
<view class="content-item" v-for="item in 10">
<view class="cell-item">
<text class="text">内容:{{item}}</text>
<input class="text" style="margin-top: 8px;" placeholder="备注输入框:" />
</view>
</view>
<!-- <input/> -->
</view>
</scroll-view>
<list-view v-if="indexView==1" class="scroll-view">
<list-item class="content-item" v-for="item in 10">
<view class="cell-item">
<text class="text">列表项内容:{{item}}</text>
<input class="text" style="margin-top: 8px;" placeholder="备注输入框:" />
</view>
</list-item>
</list-view>
<web-view v-if="indexView==2" src="/hybrid/html/local.html" id="webv" style="height:380px"></web-view>
<view style="position: relative;bottom: 0;">
<input placeholder="滚动视图外的居底输入框" adjust-position="true" />
</view>
</view>
</template>
<script>
<script>
import { state, setLifeCycleNum } from '@/store/index.uts'
export default {
data() {
return {
title: 'Hello uni-app',
isLeft: false,
navigationBarTextColor: '#000'
isLeft: false,
navigationBarTextColor: '#000'
,
indexView: 0
}
},
methods: {
onClick(){
this.isLeft = !this.isLeft
},
setNavigationBarColor1() {
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: '#0000',
success: () => {
this.navigationBarTextColor = '#fff'
console.log('setNavigationBarColor success')
this.setLifeCycleNum(state.lifeCycleNum + 1)
},
fail: () => {
console.log('setNavigationBarColor fail')
this.setLifeCycleNum(state.lifeCycleNum - 1)
},
complete: () => {
console.log('setNavigationBarColor complete')
this.setLifeCycleNum(state.lifeCycleNum + 1)
}
})
},
setNavigationBarColor2() {
uni.setNavigationBarColor({
frontColor: '#000000',
backgroundColor: '#0000',
success: () => {
this.navigationBarTextColor = '#000'
console.log('setNavigationBarColor success')
this.setLifeCycleNum(state.lifeCycleNum + 1)
},
fail: () => {
console.log('setNavigationBarColor fail')
this.setLifeCycleNum(state.lifeCycleNum - 1)
},
complete: () => {
console.log('setNavigationBarColor complete')
this.setLifeCycleNum(state.lifeCycleNum + 1)
}
})
},
// 自动化测试
getLifeCycleNum(): number {
return state.lifeCycleNum
},
// 自动化测试
setLifeCycleNum(num: number) {
setLifeCycleNum(num)
methods: {
onClick() {
this.isLeft = !this.isLeft
},
setNavigationBarColor1() {
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: '#0000',
success: () => {
this.navigationBarTextColor = '#fff'
console.log('setNavigationBarColor success')
this.setLifeCycleNum(state.lifeCycleNum + 1)
},
fail: () => {
console.log('setNavigationBarColor fail')
this.setLifeCycleNum(state.lifeCycleNum - 1)
},
complete: () => {
console.log('setNavigationBarColor complete')
this.setLifeCycleNum(state.lifeCycleNum + 1)
}
})
},
setNavigationBarColor2() {
uni.setNavigationBarColor({
frontColor: '#000000',
backgroundColor: '#0000',
success: () => {
this.navigationBarTextColor = '#000'
console.log('setNavigationBarColor success')
this.setLifeCycleNum(state.lifeCycleNum + 1)
},
fail: () => {
console.log('setNavigationBarColor fail')
this.setLifeCycleNum(state.lifeCycleNum - 1)
},
complete: () => {
console.log('setNavigationBarColor complete')
this.setLifeCycleNum(state.lifeCycleNum + 1)
}
})
},
ChangeView(e:UniRadioGroupChangeEvent){
this.indexView = parseInt(e.detail.value)
},
// 自动化测试
getLifeCycleNum() : number {
return state.lifeCycleNum
},
// 自动化测试
setLifeCycleNum(num : number) {
setLifeCycleNum(num)
},
}
}
</script>
...
...
@@ -108,11 +129,11 @@
margin: 5px 10px;
background-color: #fff;
border-radius: 5px;
}
.cell-item {
display: flex;
flex-direction: column;
}
.cell-item {
display: flex;
flex-direction: column;
}
.text {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录