提交 1e40b9e9 编写于 作者: DCloud-yyl's avatar DCloud-yyl

Merge branch 'dev' into alpha

# Conflicts:
#	pages/API/download-file/download-file.test.js
#	pages/API/upload-file/upload-file.test.js
...@@ -1172,6 +1172,14 @@ ...@@ -1172,6 +1172,14 @@
"navigationBarTitleText": "权限申请监听", "navigationBarTitleText": "权限申请监听",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
{
"path" : "pages/component/list-view/list-view-multiplex-input",
"style" :
{
"navigationBarTitleText" : "list-view复用input",
"enablePullDownRefresh" : false
}
} }
// #endif // #endif
], ],
......
...@@ -8,7 +8,7 @@ describe('ExtApi-DownloadFile', () => { ...@@ -8,7 +8,7 @@ describe('ExtApi-DownloadFile', () => {
page = await program.reLaunch(PAGE_PATH) page = await program.reLaunch(PAGE_PATH)
await page.waitFor(600); await page.waitFor(600);
await page.callMethod('jest_downloadFile'); await page.callMethod('jest_downloadFile');
await page.waitFor(1000); await page.waitFor(2000);
res = await page.data('jest_result'); res = await page.data('jest_result');
}); });
...@@ -37,7 +37,7 @@ describe('ExtApi-DownloadFile', () => { ...@@ -37,7 +37,7 @@ describe('ExtApi-DownloadFile', () => {
return return
} }
res = await page.callMethod('jest_set_cookie') res = await page.callMethod('jest_set_cookie')
await page.waitFor(1000); await page.waitFor(2000);
res = await page.data('jest_result'); res = await page.data('jest_result');
expect(res).toBe(true) expect(res).toBe(true)
}); });
...@@ -46,7 +46,7 @@ describe('ExtApi-DownloadFile', () => { ...@@ -46,7 +46,7 @@ describe('ExtApi-DownloadFile', () => {
return return
} }
res = await page.callMethod('jest_delete_cookie') res = await page.callMethod('jest_delete_cookie')
await page.waitFor(1000); await page.waitFor(2000);
res = await page.data('jest_result'); res = await page.data('jest_result');
expect(res).toBe(true) expect(res).toBe(true)
}); });
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<view class="uni-label" style="width:180px;">{{item.label}}</view> <view class="uni-label" style="width:180px;">{{item.label}}</view>
</view> </view>
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<textarea :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" /> <textarea style="width: 100%;" :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" />
</view> </view>
</view> </view>
</view> </view>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
}}</view> }}</view>
</view> </view>
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<textarea :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" /> <textarea style="width: 100%;" :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" />
</view> </view>
</view> </view>
</view> </view>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
}}</view> }}</view>
</view> </view>
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<textarea :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" /> <textarea style="width: 100%;" :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" />
</view> </view>
</view> </view>
</view> </view>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<view class="uni-label" style="width: 180px">{{ item.label }}</view> <view class="uni-label" style="width: 180px">{{ item.label }}</view>
</view> </view>
<view class="uni-list-cell-db"> <view class="uni-list-cell-db">
<textarea :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" /> <textarea style="width: 100%;" :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" />
</view> </view>
</view> </view>
</view> </view>
......
...@@ -22,7 +22,7 @@ async function request(page, method, header, data, url) { ...@@ -22,7 +22,7 @@ async function request(page, method, header, data, url) {
header: header header: header
}) })
res = await page.callMethod('jest_request') res = await page.callMethod('jest_request')
await page.waitFor(500); await page.waitFor(2000);
res = await page.data('jest_result'); res = await page.data('jest_result');
expect(res).toBe(true) expect(res).toBe(true)
} }
...@@ -87,7 +87,7 @@ describe('ExtApi-Request', () => { ...@@ -87,7 +87,7 @@ describe('ExtApi-Request', () => {
version = version.split(" ")[1] version = version.split(" ")[1]
if(version > 9){ if(version > 9){
res = await page.callMethod('jest_set_cookie') res = await page.callMethod('jest_set_cookie')
await page.waitFor(500); await page.waitFor(2000);
res = await page.data('jest_result'); res = await page.data('jest_result');
expect(res).toBe(true) expect(res).toBe(true)
} }
...@@ -99,7 +99,7 @@ describe('ExtApi-Request', () => { ...@@ -99,7 +99,7 @@ describe('ExtApi-Request', () => {
version = version.split(" ")[1] version = version.split(" ")[1]
if(version > 9){ if(version > 9){
res = await page.callMethod('jest_delete_cookie') res = await page.callMethod('jest_delete_cookie')
await page.waitFor(1000); await page.waitFor(2000);
res = await page.data('jest_result'); res = await page.data('jest_result');
expect(res).toBe(true) expect(res).toBe(true)
} }
......
...@@ -15,7 +15,7 @@ describe('ExtApi-UploadFile', () => { ...@@ -15,7 +15,7 @@ describe('ExtApi-UploadFile', () => {
page = await program.reLaunch(PAGE_PATH) page = await program.reLaunch(PAGE_PATH)
await page.waitFor(600); await page.waitFor(600);
await page.callMethod('jest_uploadFile'); await page.callMethod('jest_uploadFile');
await page.waitFor(1000); await page.waitFor(2000);
res = await page.data('jest_result'); res = await page.data('jest_result');
}); });
...@@ -35,7 +35,7 @@ describe('ExtApi-UploadFile', () => { ...@@ -35,7 +35,7 @@ describe('ExtApi-UploadFile', () => {
version = version.split(" ")[1] version = version.split(" ")[1]
if(version > 9){ if(version > 9){
res = await page.callMethod('jest_set_cookie') res = await page.callMethod('jest_set_cookie')
await page.waitFor(1000); await page.waitFor(2000);
res = await page.data('jest_result'); res = await page.data('jest_result');
expect(res).toBe(true) expect(res).toBe(true)
} }
...@@ -47,7 +47,7 @@ describe('ExtApi-UploadFile', () => { ...@@ -47,7 +47,7 @@ describe('ExtApi-UploadFile', () => {
version = version.split(" ")[1] version = version.split(" ")[1]
if(version > 9){ if(version > 9){
res = await page.callMethod('jest_delete_cookie') res = await page.callMethod('jest_delete_cookie')
await page.waitFor(1000); await page.waitFor(2000);
res = await page.data('jest_result'); res = await page.data('jest_result');
expect(res).toBe(true) expect(res).toBe(true)
} }
...@@ -55,7 +55,7 @@ describe('ExtApi-UploadFile', () => { ...@@ -55,7 +55,7 @@ describe('ExtApi-UploadFile', () => {
}); });
it('Check files upload', async () => { it('Check files upload', async () => {
res = await page.callMethod('jest_files_upload') res = await page.callMethod('jest_files_upload')
await page.waitFor(1000); await page.waitFor(2000);
res = await page.data('jest_result'); res = await page.data('jest_result');
expect(res).toBe(true) expect(res).toBe(true)
}); });
......
<template>
<scroll-view direction="horizontal" style="flex-direction: row;">
<button class="button_item" @click="delayShow">测试延时显示</button>
</scroll-view>
<list-view v-show="list_show" id="listview" style="flex: 1;" show-scrollbar=false @scrolltolower="onScrollTolower">
<list-item v-for="index in item_count" class="item" @click="itemClick(index)">
<text >item-------<text>{{index}}</text></text>
<input :placeholder="index" :value= "index ==1 ? `第一个` :index "/>
</list-item>
</list-view>
</template>
<script>
export default {
data() {
return {
item_count: 20,
list_show: true,
listViewElement: null as UniListViewElement|null
}
},
onReady() {
this.listViewElement = uni.getElementById<UniListViewElement>('listview')
},
methods: {
onScrollTolower(_: ScrollToLowerEvent) {
setTimeout(() => {
this.item_count += 20
}, 300)
},
itemClick(index: number) {
console.log("itemTextClick---"+index)
},
delayShow() {
this.list_show = !this.list_show
this.item_count += 20
//延时显示list-view 测试list-item延时显示bug
setTimeout(()=>{
this.list_show = !this.list_show
}, 400)
}
}
}
</script>
<style>
.item {
padding: 15px;
margin: 5px 0;
background-color: #fff;
border-radius: 5px;
}
.button_item {
width: 200px;
}
</style>
...@@ -188,6 +188,11 @@ ...@@ -188,6 +188,11 @@
list-view 对list-item复用测试 list-view 对list-item复用测试
</button> </button>
</navigator> </navigator>
<navigator url="/pages/component/list-view/list-view-multiplex-input" hover-class="none">
<button type="primary" class="button">
list-view 复用测试(item中嵌入input)
</button>
</navigator>
</view> </view>
</scroll-view> </scroll-view>
</template> </template>
......
...@@ -204,11 +204,11 @@ ...@@ -204,11 +204,11 @@
<style> <style>
.card { .card {
width: 350px; width:95%;
height: 375px; height: 375px;
position: absolute; position: absolute;
top: 0; top: 0px;
left: 0; /* left: 0px; */
margin: 0 12px; margin: 0 12px;
margin-top: 50px; margin-top: 50px;
border-radius: 10px; border-radius: 10px;
...@@ -219,7 +219,7 @@ ...@@ -219,7 +219,7 @@
} }
.card-img { .card-img {
width: 350px; width: 100%;
height: 375px; height: 375px;
border-radius: 10px; border-radius: 10px;
} }
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
.state { .state {
top: 10px; top: 10px;
left: 10px; left: 10px;
width: 325px; width: 86%;
padding: 4px; padding: 4px;
position: absolute; position: absolute;
flex-direction: row; flex-direction: row;
......
...@@ -26,5 +26,6 @@ ...@@ -26,5 +26,6 @@
.root { .root {
flex: 1; flex: 1;
position: relative; position: relative;
align-items: center;
} }
</style> </style>
<template> <template>
<scroll-view @scroll="onScroll" class="scroll-view" rebound="false"> <scroll-view @scroll="onScroll" class="page" show-scrollbar="false">
<!--#ifdef APP--> <view ref="seatbar" class="seatbar"></view>
<view class="height-seat" style="height: 125px;">
<!-- 垫高专用 -->
</view>
<!--#endif-->
<!--#ifdef WEB-->
<view class="height-seat" style="height: 90px;">
<!-- 垫高专用 -->
</view>
<!--#endif-->
<view class="content"> <view class="content">
<view class="content-item"> <view class="content-item">
...@@ -23,197 +14,161 @@ ...@@ -23,197 +14,161 @@
</view> </view>
</view> </view>
<view ref="top-box" class="top-box"> <view ref="navigatorbar" class="navigatorbar">
<view ref="scroll-fold-nav" class="scroll-fold-nav"> <view class="titlebar">
<view class="nav-title">DCloud 为开发者而生</view> <view class="backview" @tap="back">
</view> <image class="back" src="/static/template/scroll-fold-nav/back.png" mode="widthFix"></image>
<view @click="back" class="nav-back">
<image class="back-img" src="/static/template/scroll-fold-nav/back.png" mode="widthFix"></image>
</view> </view>
<view ref="search" class="search" @click="toSearchPage"> <text ref="title" class="title">DCloud 为开发者而生</text>
<view class="search-inner">
<image class="search-img" src="/static/template/scroll-fold-nav/search.png" mode="widthFix"></image>
<text class="search-tip-text">请输入你要搜索的内容</text>
</view> </view>
<text class="search-btn">搜索</text> <view ref="searchbar" class="searchbar" @tap="search">
<image class="searchimg" src="/static/template/scroll-fold-nav/search.png" mode="widthFix"></image>
<text class="searchinput">请输入你要搜索的内容</text>
<text class="searchbutton">搜索</text>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</template> </template>
<script> <script>
//导航栏高度
const NAVIBARHEIGHT = 88;
//搜索栏高度
const SEARCHBARHEIGHT = 40;
//返回键按钮宽度
const BACKWIDTH = 32;
export default { export default {
data() { data() {
return { return {
statusBarHeight: 35, statusBarHeight: 0,
scrollTop: 0, nviBarHeight: 0,
searchWidth: 700, naviElement: null as UniElement | null,
searchNode: null as UniElement | null, titleElement: null as UniElement | null,
boxNode: null as UniElement | null, searchElement: null as UniElement | null
navNode: null as UniElement | null
} }
}, },
onLoad() { }, onLoad() {
// #ifdef APP
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
// #endif
this.nviBarHeight = NAVIBARHEIGHT + this.statusBarHeight;
},
onReady() { onReady() {
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight ?? 35; this.naviElement = this.$refs['navigatorbar'] as UniElement;
this.searchNode = this.$refs['search'] as UniElement; this.searchElement = this.$refs['searchbar'] as UniElement;
this.boxNode = this.$refs['top-box'] as UniElement; this.titleElement = this.$refs['title'] as UniElement;
this.navNode = this.$refs['scroll-fold-nav'] as UniElement; //适配不同状态栏高度
this.naviElement?.style?.setProperty('padding-top', this.statusBarHeight+'px');
this.naviElement?.style?.setProperty('height', (NAVIBARHEIGHT+this.statusBarHeight)+'px');
let seatElement = this.$refs['seatbar'] as UniElement;
seatElement.style.setProperty('height', (NAVIBARHEIGHT+this.statusBarHeight)+'px');
}, },
methods: { methods: {
onScroll(e : ScrollEvent) { onScroll(e : ScrollEvent) {
let scrollTop = e.detail.scrollTop let offset = e.detail.scrollTop>SEARCHBARHEIGHT?SEARCHBARHEIGHT:e.detail.scrollTop;
// #ifdef APP this.naviElement?.style?.setProperty('height', (this.nviBarHeight -offset)+'px');
const originalBoxHeight = 125 this.searchElement?.style?.setProperty('left', BACKWIDTH*offset/SEARCHBARHEIGHT+'px');
// #else this.titleElement?.style?.setProperty('opacity', (1-offset/SEARCHBARHEIGHT));
const originalBoxHeight = 90
// #endif
this.boxNode?.style?.setProperty('height', (originalBoxHeight - (scrollTop > 35 ? 35 : scrollTop)) + 'px');
this.boxNode?.style?.setProperty('background-color', 'rgba(255, 255, 255, ' + (scrollTop * 3 > 100 ? 100 : scrollTop * 3) / 100.0 + ')');
this.navNode?.style?.setProperty('opacity', 1 - (scrollTop * 3 > 100 ? 100 : scrollTop * 3) / 100.0);
this.searchNode?.style?.setProperty('width', 700 - (scrollTop > 40 ? 40 : scrollTop) + 'rpx');
this.searchNode?.style?.setProperty('top', 0 - (scrollTop > 40 ? 40 : scrollTop) + 'px');
this.scrollTop = scrollTop;
}, },
back() { back() {
// uni.navigateBack() // 这么写用不了 uni.navigateBack();
// 这么写可以用
uni.navigateBack({
success(result) {
console.log('navigateBack success', result.errMsg)
},
fail(error) {
console.log('navigateBack fail', error.errMsg)
}, },
complete(result) { search() {
console.log('navigateBack complete', result.errMsg)
},
})
// uni.switchTab({
// url:'/pages/tabBar/template'
// })
},
toSearchPage() {
uni.showToast({ uni.showToast({
title: '暂不支持', title: '暂不支持',
icon: 'none' icon: 'none'
}); });
} }
}, }
} }
</script> </script>
<style> <style>
.page { .page {
flex: 1;
background-color: #fbdf0d;
}
.scroll-view {
flex: 1; flex: 1;
}
.height-seat {
height: 110px;
/* background-color: #fbdf0d; */
}
.content {
padding: 5px 15px;
background-color: #f5f5f5; background-color: #f5f5f5;
} }
.navigatorbar {
.content-item {
padding: 15px;
margin: 5px 0;
background-color: #fff;
border-radius: 5px;
}
.text {
font-size: 14px;
color: #666;
line-height: 20px;
}
.top-box {
position: fixed; position: fixed;
top: 0; /* #ifdef APP */
width: 100%;
align-items: flex-end;
border-bottom: 1px solid #efefef;
/* #ifdef APP */
height: 125px;
padding-top: 35px; padding-top: 35px;
/* #else */ height: 124px;
height: 90px; /* #endif */
/* #endif */ /* #ifdef WEB */
background-color: rgba(255, 255, 255, 0); height: 88px;
background-color: aliceblue; /* #endif */
} border-bottom: 1px solid #efefef;
width: 100%;
.scroll-fold-nav { background-color: #f5f5f5;
}
.titlebar {
flex-direction: row;
align-items: center;
height: 44px;
}
.backview {
width: 44px;
height: 44px; height: 44px;
width: 375px;
justify-content: center; justify-content: center;
} align-items: center;
}
.nav-title { .back {
margin-left: 30px; width: 20px;
} }
.title {
.nav-back { margin: 0px 2px;
}
.searchbar {
position: absolute; position: absolute;
/* #ifdef APP */ bottom: 2px;
top: 46px; left: 0px;
/* #else */ right: 0px;
top: 11px;
/* #endif */
left: 8px;
}
.nav-back .back-img {
width: 18px;
margin-top: 2px;
}
.search {
background-color: #FFFFFF; background-color: #FFFFFF;
border: 1px solid #fbdf0d; border: 1px solid #fbdf0d;
height: 35px; height: 32px;
border-radius: 100px; border-radius: 100px;
margin: 0 12px; margin: 6px 12px;
padding: 8px; padding: 8px;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: center;
width: 350px; }
top: 0px; .searchimg {
}
.search-inner {
margin-top: 2px;
flex-direction: row;
}
.search-inner .search-img {
width: 15px; width: 15px;
} }
.searchinput {
.search-tip-text { flex-grow: 1;
font-size: 12px; font-size: 12px;
color: #666; color: #666;
} }
.searchbutton {
.search-btn {
font-size: 12px; font-size: 12px;
background-color: #ff6900; background-color: #ff6900;
color: #FFF; color: #FFF;
padding: 5px 8px; padding: 5px 8px;
border-radius: 100px; border-radius: 100px;
} }
.seatbar {
/* #ifdef APP */
height: 124px;
/* #endif */
/* #ifdef WEB */
height: 88px;
/* #endif */
}
.content {
padding: 5px 15px;
}
.content-item {
padding: 15px;
margin: 5px 0;
background-color: #fff;
border-radius: 5px;
}
.text {
font-size: 14px;
color: #666;
line-height: 20px;
}
</style> </style>
<template> <template>
<view class="page"> <view class="page">
<view @click="back" class="nav-back"> <view ref="back" @click="back" class="nav-back">
<image class="back-img" src="/static/template/scroll-fold-nav/back.png" mode="widthFix"></image> <image class="back-img" src="/static/template/scroll-fold-nav/back.png" mode="widthFix"></image>
</view> </view>
<swiper class="swiper" :current="current" :circular="index != 0" :vertical="true" @change="onSwiperChange" <swiper class="swiper" :current="current" :circular="index != 0" :vertical="true" @change="onSwiperChange"
...@@ -86,7 +86,12 @@ ...@@ -86,7 +86,12 @@
}, },
onReady() { onReady() {
// 一启动完成,就播放第一个 // 一启动完成,就播放第一个
this.doPlay(0) this.doPlay(0);
// #ifdef APP
//App端适配不同状态栏高度
let backElement = this.$refs['back'] as UniElement;
backElement.style.setProperty('top', uni.getSystemInfoSync().statusBarHeight+'px');
// #endif
}, },
onShow() { onShow() {
currentPageIsShow = true currentPageIsShow = true
...@@ -257,12 +262,14 @@ ...@@ -257,12 +262,14 @@
.nav-back { .nav-back {
position: absolute; position: absolute;
top: 20px; /* #ifdef APP */
left: 8px; top: 35px;
/* #endif */
background-color: rgba(220, 220, 220, 0.8); background-color: rgba(220, 220, 220, 0.8);
border-radius: 100px; border-radius: 100px;
width: 28px; margin: 6px;
height: 28px; width: 32px;
height: 32px;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
z-index: 10; z-index: 10;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册