提交 4121ced3 编写于 作者: W wanganxp

补充软键盘上推页面的测试

上级 33093bf9
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
<input type="file" /> <input type="file" />
<p style="font-size: 14px;">&lt;input type="file" accept="image/*" multiple /&gt;</p> <p style="font-size: 14px;">&lt;input type="file" accept="image/*" multiple /&gt;</p>
<input type="file" accept="image/*" multiple /> <input type="file" accept="image/*" multiple />
<p style="font-size: 14px;">普通input</p>
<input placeholder="底部输入框"/>
</div> </div>
<!-- uni 的 SDK --> <!-- uni 的 SDK -->
<script type="text/javascript" src="uni.webview.1.5.5.js"></script> <script type="text/javascript" src="uni.webview.1.5.5.js"></script>
......
<template> <template>
<view class="content"> <view class="content">
<uni-navbar-lite :title="title" :is-left="isLeft" :text-color="navigationBarTextColor"></uni-navbar-lite> <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"> <view class="content-item" @click="onClick">
<text>设置自定义导航栏前景色白色</text> <text>点击此处,将标题切换为{{isLeft?'居中':'左侧'}}显示</text>
</view> </view>
<view class="content-item" @tap="setNavigationBarColor1">
<view class="content-item" @tap="setNavigationBarColor2"> <text>设置自定义导航栏前景色白色</text>
<text>设置自定义导航栏前景色黑色</text> </view>
</view> <view class="content-item" @tap="setNavigationBarColor2">
<text>设置自定义导航栏前景色黑色</text>
<view class="content-item" v-for="item in 20"> </view>
<view class="cell-item"> <view style="align-items: center;height: 60px;">
<text class="text">内容:{{item}}</text> <text>测试输入框上推页面</text>
<input class="text" style="margin-top: 8px;" placeholder="备注:"/> <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>
</view> </view>
<!-- <input/> -->
</scroll-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> </view>
</template> </template>
<script> <script>
import { state, setLifeCycleNum } from '@/store/index.uts' import { state, setLifeCycleNum } from '@/store/index.uts'
export default { export default {
data() { data() {
return { return {
title: 'Hello uni-app', title: 'Hello uni-app',
isLeft: false, isLeft: false,
navigationBarTextColor: '#000' navigationBarTextColor: '#000',
indexView: 0
} }
}, },
methods: { methods: {
onClick(){ onClick() {
this.isLeft = !this.isLeft this.isLeft = !this.isLeft
}, },
setNavigationBarColor1() { setNavigationBarColor1() {
uni.setNavigationBarColor({ uni.setNavigationBarColor({
frontColor: '#ffffff', frontColor: '#ffffff',
backgroundColor: '#0000', backgroundColor: '#0000',
success: () => { success: () => {
this.navigationBarTextColor = '#fff' this.navigationBarTextColor = '#fff'
console.log('setNavigationBarColor success') console.log('setNavigationBarColor success')
this.setLifeCycleNum(state.lifeCycleNum + 1) this.setLifeCycleNum(state.lifeCycleNum + 1)
}, },
fail: () => { fail: () => {
console.log('setNavigationBarColor fail') console.log('setNavigationBarColor fail')
this.setLifeCycleNum(state.lifeCycleNum - 1) this.setLifeCycleNum(state.lifeCycleNum - 1)
}, },
complete: () => { complete: () => {
console.log('setNavigationBarColor complete') console.log('setNavigationBarColor complete')
this.setLifeCycleNum(state.lifeCycleNum + 1) this.setLifeCycleNum(state.lifeCycleNum + 1)
} }
}) })
}, },
setNavigationBarColor2() { setNavigationBarColor2() {
uni.setNavigationBarColor({ uni.setNavigationBarColor({
frontColor: '#000000', frontColor: '#000000',
backgroundColor: '#0000', backgroundColor: '#0000',
success: () => { success: () => {
this.navigationBarTextColor = '#000' this.navigationBarTextColor = '#000'
console.log('setNavigationBarColor success') console.log('setNavigationBarColor success')
this.setLifeCycleNum(state.lifeCycleNum + 1) this.setLifeCycleNum(state.lifeCycleNum + 1)
}, },
fail: () => { fail: () => {
console.log('setNavigationBarColor fail') console.log('setNavigationBarColor fail')
this.setLifeCycleNum(state.lifeCycleNum - 1) this.setLifeCycleNum(state.lifeCycleNum - 1)
}, },
complete: () => { complete: () => {
console.log('setNavigationBarColor complete') console.log('setNavigationBarColor complete')
this.setLifeCycleNum(state.lifeCycleNum + 1) this.setLifeCycleNum(state.lifeCycleNum + 1)
} }
}) })
},
// 自动化测试
getLifeCycleNum(): number {
return state.lifeCycleNum
},
// 自动化测试
setLifeCycleNum(num: number) {
setLifeCycleNum(num)
}, },
ChangeView(e:UniRadioGroupChangeEvent){
this.indexView = parseInt(e.detail.value)
},
// 自动化测试
getLifeCycleNum() : number {
return state.lifeCycleNum
},
// 自动化测试
setLifeCycleNum(num : number) {
setLifeCycleNum(num)
},
} }
} }
</script> </script>
...@@ -108,11 +129,11 @@ ...@@ -108,11 +129,11 @@
margin: 5px 10px; margin: 5px 10px;
background-color: #fff; background-color: #fff;
border-radius: 5px; border-radius: 5px;
} }
.cell-item { .cell-item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.text { .text {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册