Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
eee22915
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5998
Star
91
Fork
163
代码
文件
提交
分支
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看板
提交
eee22915
编写于
6月 12, 2024
作者:
Anne_LXM
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test(scroll-view): 支持 iOS 端测试
上级
9739c6b3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
14 deletion
+6
-14
pages/component/scroll-view/scroll-view-refresher.uvue
pages/component/scroll-view/scroll-view-refresher.uvue
+4
-4
pages/component/scroll-view/scroll-view.test.js
pages/component/scroll-view/scroll-view.test.js
+1
-9
pages/component/scroll-view/scroll-view.uvue
pages/component/scroll-view/scroll-view.uvue
+1
-1
未找到文件。
pages/component/scroll-view/scroll-view-refresher.uvue
浏览文件 @
eee22915
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
},
},
methods: {
methods: {
onRefresherrefresh(e : UniRefresherEvent)
)
{
onRefresherrefresh(e : UniRefresherEvent) {
this.refresherrefresh = true
this.refresherrefresh = true
console.log("onRefresherrefresh------下拉刷新触发")
console.log("onRefresherrefresh------下拉刷新触发")
this.checkEventTest({
this.checkEventTest({
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
this.refresherTriggered = false
this.refresherTriggered = false
}, 1500)
}, 1500)
},
},
onRefresherabort(e : UniRefresherEvent)
)
{
onRefresherabort(e : UniRefresherEvent) {
console.log("onRefresherabort------下拉刷新被中止")
console.log("onRefresherabort------下拉刷新被中止")
this.checkEventTest({
this.checkEventTest({
type:e.type,
type:e.type,
...
@@ -67,7 +67,7 @@
...
@@ -67,7 +67,7 @@
dy:e.detail.dy,
dy:e.detail.dy,
} as RefresherEventTest,'refresherabort')
} as RefresherEventTest,'refresherabort')
},
},
onRefresherrestore(e : UniRefresherEvent)
)
{
onRefresherrestore(e : UniRefresherEvent) {
this.refresherrefresh = false
this.refresherrefresh = false
console.log("onRefresherrestore------下拉刷新被复位")
console.log("onRefresherrestore------下拉刷新被复位")
this.checkEventTest({
this.checkEventTest({
...
@@ -77,7 +77,7 @@
...
@@ -77,7 +77,7 @@
dy:e.detail.dy,
dy:e.detail.dy,
} as RefresherEventTest,'refresherrestore')
} as RefresherEventTest,'refresherrestore')
},
},
onRefresherpulling(e : UniRefresherEvent)
)
{
onRefresherpulling(e : UniRefresherEvent) {
console.log("onRefresherpulling------拉刷新控件被下拉-dy=" + e.detail.dy)
console.log("onRefresherpulling------拉刷新控件被下拉-dy=" + e.detail.dy)
this.checkEventTest({
this.checkEventTest({
type:e.type,
type:e.type,
...
...
pages/component/scroll-view/scroll-view.test.js
浏览文件 @
eee22915
jest
.
setTimeout
(
30000
);
jest
.
setTimeout
(
30000
);
describe
(
'
component-native-scroll-view
'
,
()
=>
{
describe
(
'
component-native-scroll-view
'
,
()
=>
{
const
platformInfo
=
process
.
env
.
uniTestPlatformInfo
.
toLocaleLowerCase
()
const
isIos
=
platformInfo
.
startsWith
(
'
ios
'
)
if
(
isIos
)
{
it
(
'
dummyTest
'
,
()
=>
{
expect
(
1
).
toBe
(
1
)
})
return
}
let
page
;
let
page
;
beforeAll
(
async
()
=>
{
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
'
/pages/component/scroll-view/scroll-view
'
);
page
=
await
program
.
reLaunch
(
'
/pages/component/scroll-view/scroll-view
'
);
...
@@ -40,7 +32,7 @@ describe('component-native-scroll-view', () => {
...
@@ -40,7 +32,7 @@ describe('component-native-scroll-view', () => {
expect
(
topScrollDetail
.
scrollHeight
).
toBeGreaterThan
(
0
)
expect
(
topScrollDetail
.
scrollHeight
).
toBeGreaterThan
(
0
)
expect
(
topScrollDetail
.
scrollWidth
).
toBeGreaterThan
(
0
)
expect
(
topScrollDetail
.
scrollWidth
).
toBeGreaterThan
(
0
)
expect
(
topScrollDetail
.
deltaX
).
toBe
(
0
)
expect
(
topScrollDetail
.
deltaX
).
toBe
(
0
)
expect
(
topScrollDetail
.
deltaY
).
toBe
(
-
10
0
)
expect
(
topScrollDetail
.
deltaY
).
not
.
toBe
(
0
)
}
}
expect
(
await
page
.
data
(
'
isScrollTest
'
)).
toBe
(
'
scroll:Success
'
)
expect
(
await
page
.
data
(
'
isScrollTest
'
)).
toBe
(
'
scroll:Success
'
)
})
})
...
...
pages/component/scroll-view/scroll-view.uvue
浏览文件 @
eee22915
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
</view>
</view>
<view>
<view>
<scroll-view :scroll-top="scrollTop" direction="vertical" class="scroll-Y" scroll-with-animation="true"
<scroll-view :scroll-top="scrollTop" direction="vertical" class="scroll-Y" scroll-with-animation="true"
@scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll" :show-scrollbar="showScrollbar">
@scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll"
@scrollend="end"
:show-scrollbar="showScrollbar">
<view class="scroll-view-item uni-bg-red"><text class="text">A</text></view>
<view class="scroll-view-item uni-bg-red"><text class="text">A</text></view>
<view class="scroll-view-item uni-bg-green"><text class="text">B</text></view>
<view class="scroll-view-item uni-bg-green"><text class="text">B</text></view>
<view class="scroll-view-item uni-bg-blue"><text class="text">C</text></view>
<view class="scroll-view-item uni-bg-blue"><text class="text">C</text></view>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录