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

卡片视图长按功能

上级 25fbb6ba
......@@ -3,6 +3,7 @@
<#if view.getViewType?? && view.getViewType()?? && view.getViewType() == 'DEMOBDATAVIEW'>
<ion-row >
<ion-col :size="size" v-for="(item,index) in items" :key="index">
<ion-checkbox v-show="showcheack" class="ionic-checkbox" @click.stop="checkboxSelect(item)"></ion-checkbox>
<ion-card :class="[size == '12'? 'ios hydrated ibz-card-12':' ios hydrated ibz-card-6']">
<div :class="{'line':size == '12'}">
<img class="cardimg" :style="{width :size == '6' ?'':'30%'}" src="assets/images/card.jpg" />
......
......@@ -642,6 +642,57 @@
}
/**
* 是否展示多选
*
* @memberof ${srfclassname('${ctrl.name}')}
*/
public showcheack = false;
/**
* 选中或取消事件
*
* @memberof ${srfclassname('${ctrl.name}')}
*/
public checkboxSelect(item:any){
let count = this.selectedArray.findIndex((i) => {
return i.mobile_entity1id == item.mobile_entity1id;
});
if(count == -1){
this.selectedArray.push(item);
}else{
this.selectedArray.splice(count,1);
}
}
/**
* 长按定时器
*
* @memberof ${srfclassname('${ctrl.name}')}
*/
public loop :any;
/**
* 开始长按
*
* @memberof ${srfclassname('${ctrl.name}')}
*/
public start () {
      clearTimeout(this.loop); //再次清空定时器,防止重复注册定时器
      this.loop = setTimeout(() => {
this.showcheack = ! this.showcheack;
      }, 1000);
    }
/**
* 结束长按
*
* @memberof ${srfclassname('${ctrl.name}')}
*/
public end () {
clearTimeout(this.loop); //清空定时器,防止重复注册定时器
}
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
......
......@@ -21,12 +21,10 @@
font-size: 15px;
}
.ibz-card-12 {
margin: 12px;
margin-bottom: 0;
margin: 12px 12px 0 35px;
}
.ibz-card-6{
margin-bottom: 0;
margin: 5px 10px;
margin: 5px 10px 5px 30px;
}
.ibz-content {
padding: 10px;
......@@ -40,4 +38,8 @@
.cardimg{
height: auto;
}
.ionic-checkbox {
position: absolute;
top: calc(50% - 13px);
}
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册