提交 f205a365 编写于 作者: KK's avatar KK

长按事件

上级 7b66f456
......@@ -8,13 +8,18 @@
${ctrl.render.code}
</#if>
<#if ctrl.getPSSysPFPlugin().getPFPluginType?? && ctrl.getPSSysPFPlugin().getPFPluginType()?? && ctrl.getPSSysPFPlugin().getPFPluginType()=='LIST_ITEMRENDER'>
<ion-list class="items" ref="ionlist">
<ion-list class="items" ref="ionlist" @touchstart="gotouchstart" @touchend="gotouchend">
<div class="selectall">
<ion-checkbox :checked="selectAllIschecked" v-show="showCheack" @ionChange="checkboxAll"></ion-checkbox>
<ion-label class="selectal-label" v-show="showCheack">全选</ion-label>
</div>
<template v-if="(viewType == 'DEMOBMDVIEW9') && controlStyle != 'SWIPERVIEW' ">
<ion-checkbox slot="start" :checked="item.checked" v-show="showCheack" @click.stop="checkboxSelect(item)"></ion-checkbox>
${ctrl.render.code}
<ion-button v-if="!isTempMode && !allLoaded && needLoadMore" class="loadmore_btn" @click="loadBottom">{{$t('app.button.loadmore')}}</ion-button>
</template>
</ion-list>
<ion-list class="items" ref="ionlist">
<ion-list class="items" ref="ionlist" @touchmove="gotouchmove" @touchstart="gotouchstart" @touchend="gotouchend">
<ion-item-sliding :ref="item.srfkey" v-for="item in items" @click="item_click(item)" :key="item.srfkey" class="app-mob-mdctrl-item" :disabled="item.sliding_disabled" @ionDrag="ionDrag">
<#-- BENGIN:输出界面行为组 -->
<@outPutActionGroup ctrl />
......@@ -83,7 +88,7 @@
<#-- <ion-button v-if="!isTempMode && !allLoaded && needLoadMore" class="loadmore_btn" @click="loadBottom">{{$t('app.button.loadmore')}}</ion-button> -->
</template>
</ion-list>
<ion-list class="items" ref="ionlist">
<ion-list class="items" ref="ionlist" @touchmove="gotouchmove" @touchstart="gotouchstart" @touchend="gotouchend">
<#--多数据视图||多数据视图(部件视图)-->
<template v-if="(viewType == 'DEMOBMDVIEW') && controlStyle != 'SWIPERVIEW' ">
<div class="selectall">
......
......@@ -534,10 +534,10 @@
*/
public onPress(){
let _this = this;
window.addEventListener('contextmenu',(e:any)=>{
_this.onCheackChange();
e.preventDefault();
});
// window.addEventListener('contextmenu',(e:any)=>{
// _this.onCheackChange();
// e.preventDefault();
// });
}
/**
......@@ -1146,6 +1146,53 @@
}
}
}
/**
* 长按定时器
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public timeOutEvent :number = 0;
/**
* 开始长按
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public gotouchstart(){
let _this = this;
clearTimeout(this.timeOutEvent); //清除定时器
this.timeOutEvent = 0;
this.timeOutEvent = setTimeout(() => {
if(_this.timeOutEvent > 0){
_this.showCheack = !_this.showCheack;
}
console.log(this.timeOutEvent);
this.timeOutEvent = 0
}, 2000); //这里设置定时
}
/**
* touchmove
* 如果手指有移动,则取消所有事件,此时说明用户只是要移动而不是长按
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public gotouchmove() {
clearTimeout(this.timeOutEvent); //清除定时器
this.timeOutEvent = 0;
}
/**
* touchend
* 结束长按
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public gotouchend() {
this.timeOutEvent = 0;
}
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册