提交 fc3f623e 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

refactor(swiper): 屏蔽小程序不支持方法

上级 54ac0743
......@@ -122,26 +122,28 @@
animationfinishDetailTest: null as UniSwiperAnimationFinishEventDetail | null,
isChangeTest: '',
isTransitionTest: '',
isAnimationfinishTest: '',
swipeX: 0,
isAnimationfinishTest: '',
swipeX: 0,
swipeY: 0
}
},
onReady() {
// 获取模拟滑动手势的起始点
let ele = uni.getElementById("swiper-view")
},
onReady() {
// #ifndef MP
// 获取模拟滑动手势的起始点
let ele = uni.getElementById("swiper-view")
let eleRect = ele?.getBoundingClientRect()
if(eleRect != null) {
this.swipeX = eleRect.width - 10
this.swipeY += eleRect.y + uni.getSystemInfoSync().safeArea.top + 44 + 35
}
}
// #endif
},
methods: {
swipertouchStart(e: UniTouchEvent) {
console.log("swiper touchstart")
},
viewtouchStart(e: UniTouchEvent) {
console.log("view touchstart:")
methods: {
swipertouchStart(e: UniTouchEvent) {
console.log("swiper touchstart")
},
viewtouchStart(e: UniTouchEvent) {
console.log("view touchstart:")
},
swiperChange: function (e : UniSwiperChangeEvent) {
this.changeDetailTest = e.detail
......@@ -182,12 +184,12 @@
}
},
// 自动化测试专用(由于事件event参数对象中存在循环引用,在ios端JSON.stringify报错,自动化测试无法page.data获取)
checkEventTest(e : SwiperEventTest, eventName : String) {
checkEventTest(e : SwiperEventTest, eventName : String) {
// #ifndef MP
const isPass = e.type === eventName && e.target instanceof UniElement && e.currentTarget instanceof UniElement;
// #endif
const isPass = e.type === eventName && e.target instanceof UniElement && e.currentTarget instanceof UniElement;
// #endif
// #ifdef MP
const isPass = true;
const isPass = true;
// #endif
const result = isPass ? `${eventName}:Success` : `${eventName}:Fail`;
switch (eventName) {
......@@ -284,4 +286,4 @@
text-align: center;
line-height: 150px;
}
</style>
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册