Commit 500a387e authored by 王李辉's avatar 王李辉

点击显示遮罩层

parent 7d8a133e
...@@ -44,7 +44,6 @@ export default { ...@@ -44,7 +44,6 @@ export default {
}, },
created() { created() {
this.source = this.$route.params.source this.source = this.$route.params.source
console.log(this.source);
if(this.source){ if(this.source){
this.getList() this.getList()
} }
...@@ -72,7 +71,6 @@ export default { ...@@ -72,7 +71,6 @@ export default {
this.$refs.checkboxes[index].toggle(); this.$refs.checkboxes[index].toggle();
}, },
confirm() { confirm() {
console.log(this.result);
this.$bus.$emit("sourceAyy",this.result) this.$bus.$emit("sourceAyy",this.result)
this.$router.go(-1) this.$router.go(-1)
}, },
......
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
inset inset
v-for="(item, index) in messageList" v-for="(item, index) in messageList"
:key="index" :key="index"
@touchstart="touchstart(index, item)" @click="touchstart(index, item)"
@touchend.prevent="touchend(index)"
> >
<van-row gutter=""> <van-row gutter="">
<van-col span="5">所属项目:</van-col> <van-col span="5">所属项目:</van-col>
...@@ -44,13 +43,13 @@ ...@@ -44,13 +43,13 @@
<!-- 长按显示遮罩层 --> <!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop> <div class="wrapper" @click.stop>
<van-button round type="primary" @touchstart="goDetail(item)" <van-button round type="primary" @click="goDetail(item)"
>详情</van-button >详情</van-button
> >
<van-button round type="info" @touchstart="goConfirm(item)" <van-button round type="info" @click="goConfirm(item)"
>确认</van-button >确认</van-button
> >
<van-button round type="info" @touchstart="goDelay(item)" <van-button round type="info" @click="goDelay(item)"
>延期</van-button >延期</van-button
> >
</div> </div>
...@@ -111,18 +110,10 @@ export default { ...@@ -111,18 +110,10 @@ export default {
}, },
touchstart(index, item) { touchstart(index, item) {
clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
if (this.showIndex != null) { if (this.showIndex != null) {
this.showIndex = null; this.showIndex = null;
return;
} }
this.Loop = setTimeout(() => {
this.showIndex = index; this.showIndex = index;
}, 300); // 这里的1000是指需要长按的时间,单位为ms
},
touchend(index) {
// 这个方法主要是用来将每次手指移出之后将计时器清零
clearInterval(this.Loop);
}, },
// 详情 // 详情
......
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
inset inset
v-for="(item, index) in messageList" v-for="(item, index) in messageList"
:key="index" :key="index"
@touchstart="touchstart(index, item)" @click="touchstart(index, item)"
@touchend.prevent="touchend(index)"
> >
<van-row gutter=""> <van-row gutter="">
<van-col span="5">所属项目:</van-col> <van-col span="5">所属项目:</van-col>
...@@ -35,10 +34,10 @@ ...@@ -35,10 +34,10 @@
<!-- 长按显示遮罩层 --> <!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop> <div class="wrapper" @click.stop>
<van-button round type="primary" @touchstart="goDetail(item)" <van-button round type="primary" @click="goDetail(item)"
>详情</van-button >详情</van-button
> >
<van-button round type="info" @touchstart="goConfirm(item)" <van-button round type="info" @click="goConfirm(item)"
>确认</van-button >确认</van-button
> >
</div> </div>
...@@ -101,20 +100,13 @@ export default { ...@@ -101,20 +100,13 @@ export default {
}); });
}, },
touchstart(index, item) { touchstart(index, item) {
clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
if (this.showIndex != null) { if (this.showIndex != null) {
this.showIndex = null; this.showIndex = null;
return;
} }
this.Loop = setTimeout(() => {
this.showIndex = index; this.showIndex = index;
}, 300); // 这里的1000是指需要长按的时间,单位为ms
},
touchend(index) {
// 这个方法主要是用来将每次手指移出之后将计时器清零
clearInterval(this.Loop);
}, },
// 详情 // 详情
goDetail(data) { goDetail(data) {
this.$router.push({ this.$router.push({
......
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
inset inset
v-for="(item, index) in messageList" v-for="(item, index) in messageList"
:key="index" :key="index"
@touchstart="touchstart(index, item)" @click="touchstart(index, item)"
@touchend.prevent="touchend(index)"
> >
<van-row gutter=""> <van-row gutter="">
...@@ -35,10 +34,10 @@ ...@@ -35,10 +34,10 @@
<!-- 长按显示遮罩层 --> <!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop> <div class="wrapper" @click.stop>
<van-button round type="primary" @touchstart="goDetail(item)" <van-button round type="primary" @click="goDetail(item)"
>详情</van-button >详情</van-button
> >
<van-button round type="info" @touchstart="goConfirm(item)" <van-button round type="info" @click="goConfirm(item)"
>审批</van-button >审批</van-button
> >
</div> </div>
...@@ -109,20 +108,13 @@ export default { ...@@ -109,20 +108,13 @@ export default {
}, },
touchstart(index, item) { touchstart(index, item) {
clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
if (this.showIndex != null) { if (this.showIndex != null) {
this.showIndex = null; this.showIndex = null;
return;
} }
this.Loop = setTimeout(() => {
this.showIndex = index; this.showIndex = index;
}, 300); // 这里的1000是指需要长按的时间,单位为ms
},
touchend(index) {
// 这个方法主要是用来将每次手指移出之后将计时器清零
clearInterval(this.Loop);
}, },
// 详情 // 详情
goDetail(data) { goDetail(data) {
this.$router.push({ this.$router.push({
......
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
inset inset
v-for="(item, index) in messageList" v-for="(item, index) in messageList"
:key="index" :key="index"
@touchstart="touchstart(index, item)" @click="touchstart(index, item)"
@touchend.prevent="touchend(index)"
> >
<van-row gutter=""> <van-row gutter="">
...@@ -35,10 +34,10 @@ ...@@ -35,10 +34,10 @@
<!-- 长按显示遮罩层 --> <!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop> <div class="wrapper" @click.stop>
<van-button round type="primary" @touchstart="goDetail(item)" <van-button round type="primary" @click="goDetail(item)"
>详情</van-button >详情</van-button
> >
<van-button round type="info" @touchstart="goConfirm(item)" <van-button round type="info" @click="goConfirm(item)"
>审批</van-button >审批</van-button
> >
</div> </div>
...@@ -123,18 +122,10 @@ export default { ...@@ -123,18 +122,10 @@ export default {
}, },
touchstart(index, item) { touchstart(index, item) {
clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
if (this.showIndex != null) { if (this.showIndex != null) {
this.showIndex = null; this.showIndex = null;
return;
} }
this.Loop = setTimeout(() => {
this.showIndex = index; this.showIndex = index;
}, 300); // 这里的1000是指需要长按的时间,单位为ms
},
touchend(index) {
// 这个方法主要是用来将每次手指移出之后将计时器清零
clearInterval(this.Loop);
}, },
// 详情 // 详情
......
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
inset inset
v-for="(item, index) in messageList" v-for="(item, index) in messageList"
:key="index" :key="index"
@touchstart="touchstart(index, item)" @click="touchstart(index, item)"
@touchend.prevent="touchend(index)"
> >
<van-row gutter=""> <van-row gutter="">
...@@ -34,10 +33,10 @@ ...@@ -34,10 +33,10 @@
<!-- 长按显示遮罩层 --> <!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop> <div class="wrapper" @click.stop>
<van-button round type="primary" @touchstart="goDetail(item)" <van-button round type="primary" @click="goDetail(item)"
>详情</van-button >详情</van-button
> >
<van-button round type="info" @touchstart="goConfirm(item)" <van-button round type="info" @click="goConfirm(item)"
>批示</van-button >批示</van-button
> >
</div> </div>
...@@ -121,20 +120,13 @@ export default { ...@@ -121,20 +120,13 @@ export default {
}, },
touchstart(index, item) { touchstart(index, item) {
clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
if (this.showIndex != null) { if (this.showIndex != null) {
this.showIndex = null; this.showIndex = null;
return;
} }
this.Loop = setTimeout(() => {
this.showIndex = index; this.showIndex = index;
}, 300); // 这里的1000是指需要长按的时间,单位为ms
},
touchend(index) {
// 这个方法主要是用来将每次手指移出之后将计时器清零
clearInterval(this.Loop);
}, },
// 详情 // 详情
goDetail(data) { goDetail(data) {
this.$router.push({ this.$router.push({
......
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
inset inset
v-for="(item, index) in messageList" v-for="(item, index) in messageList"
:key="index" :key="index"
@touchstart="touchstart(index, item)" @click="touchstart(index, item)"
@touchend.prevent="touchend(index)"
> >
<van-row gutter=""> <van-row gutter="">
<van-col span="5">所属项目:</van-col> <van-col span="5">所属项目:</van-col>
...@@ -39,10 +38,10 @@ ...@@ -39,10 +38,10 @@
<!-- 长按显示遮罩层 --> <!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop> <div class="wrapper" @click.stop>
<van-button round type="primary" @touchstart="goSubmit(item)" <van-button round type="primary" @click="goSubmit(item)"
>上报</van-button >上报</van-button
> >
<van-button round type="warning" @touchstart="goDelete(item)" <van-button round type="warning" @click="goDelete(item)"
>删除</van-button >删除</van-button
> >
</div> </div>
...@@ -105,18 +104,10 @@ export default { ...@@ -105,18 +104,10 @@ export default {
onSearch(val) { onSearch(val) {
}, },
touchstart(index, item) { touchstart(index, item) {
clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
if (this.showIndex != null) { if (this.showIndex != null) {
this.showIndex = null; this.showIndex = null;
return;
} }
this.Loop = setTimeout(() => {
this.showIndex = index; this.showIndex = index;
}, 300); // 这里的1000是指需要长按的时间,单位为ms
},
touchend(index) {
// 这个方法主要是用来将每次手指移出之后将计时器清零
clearInterval(this.Loop);
}, },
// 提交 // 提交
......
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
inset inset
v-for="(item, index) in messageList" v-for="(item, index) in messageList"
:key="index" :key="index"
@touchstart="touchstart(index, item)" @click="touchstart(index, item)"
@touchend.prevent="touchend(index)"
> >
<van-row gutter=""> <van-row gutter="">
<van-col span="5">所属项目:</van-col> <van-col span="5">所属项目:</van-col>
...@@ -43,10 +42,10 @@ ...@@ -43,10 +42,10 @@
<!-- 长按显示遮罩层 --> <!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop> <div class="wrapper" @click.stop>
<van-button round type="primary" @touchstart="goDetail(item)" <van-button round type="primary" @click="goDetail(item)"
>详情</van-button >详情</van-button
> >
<van-button round type="info" @touchstart="goConfirm(item)" <van-button round type="info" @click="goConfirm(item)"
>确认</van-button >确认</van-button
> >
</div> </div>
...@@ -110,20 +109,13 @@ export default { ...@@ -110,20 +109,13 @@ export default {
}, },
touchstart(index, item) { touchstart(index, item) {
clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
if (this.showIndex != null) { if (this.showIndex != null) {
this.showIndex = null; this.showIndex = null;
return;
} }
this.Loop = setTimeout(() => {
this.showIndex = index; this.showIndex = index;
}, 300); // 这里的1000是指需要长按的时间,单位为ms
},
touchend(index) {
// 这个方法主要是用来将每次手指移出之后将计时器清零
clearInterval(this.Loop);
}, },
// 详情 // 详情
goDetail(data) { goDetail(data) {
this.$router.push({ this.$router.push({
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
inset inset
v-for="(item, index) in messageList" v-for="(item, index) in messageList"
:key="index" :key="index"
@touchstart="touchstart(index, item)" @click="touchstart(index, item)"
@touchend.prevent="touchend(index)"
> >
<van-row gutter=""> <van-row gutter="">
<van-col span="5">所属项目:</van-col> <van-col span="5">所属项目:</van-col>
<van-col span="19">{{ item.proId }}</van-col> <van-col span="19">{{ item.proId }}</van-col>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<!-- 长按显示遮罩层 --> <!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop> <div class="wrapper" @click.stop>
<van-button round type="primary" @touchstart="goDetail(item)" <van-button round type="primary" @click="goDetail(item)"
>详情</van-button >详情</van-button
> >
</div> </div>
...@@ -108,18 +108,10 @@ export default { ...@@ -108,18 +108,10 @@ export default {
}, },
touchstart(index, item) { touchstart(index, item) {
clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
if (this.showIndex != null) { if (this.showIndex != null) {
this.showIndex = null; this.showIndex = null;
return;
} }
this.Loop = setTimeout(() => {
this.showIndex = index; this.showIndex = index;
}, 300); // 这里的1000是指需要长按的时间,单位为ms
},
touchend(index) {
// 这个方法主要是用来将每次手指移出之后将计时器清零
clearInterval(this.Loop);
}, },
// 详情 // 详情
......
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
inset inset
v-for="(item, index) in messageList" v-for="(item, index) in messageList"
:key="index" :key="index"
@touchstart="touchstart(index, item)" @click="touchstart(index, item)"
@touchend.prevent="touchend(index)"
> >
<van-row gutter=""> <van-row gutter="">
<van-col span="7">隐患编号:</van-col> <van-col span="7">隐患编号:</van-col>
...@@ -33,10 +32,10 @@ ...@@ -33,10 +32,10 @@
<!-- 长按显示遮罩层 --> <!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop> <div class="wrapper" @click.stop>
<van-button round type="primary" @touchstart="goDetail(item)" <van-button round type="primary" @click="goDetail(item)"
>详情</van-button >详情</van-button
> >
<van-button round type="info" @touchstart="goConfirm(item)" <van-button round type="info" @click="goConfirm(item)"
>批示</van-button >批示</van-button
> >
</div> </div>
...@@ -117,18 +116,10 @@ export default { ...@@ -117,18 +116,10 @@ export default {
}, },
touchstart(index, item) { touchstart(index, item) {
clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
if (this.showIndex != null) { if (this.showIndex != null) {
this.showIndex = null; this.showIndex = null;
return;
} }
this.Loop = setTimeout(() => {
this.showIndex = index; this.showIndex = index;
}, 300); // 这里的1000是指需要长按的时间,单位为ms
},
touchend(index) {
// 这个方法主要是用来将每次手指移出之后将计时器清零
clearInterval(this.Loop);
}, },
// 详情 // 详情
......
...@@ -3,9 +3,6 @@ ...@@ -3,9 +3,6 @@
<div class="message-wrap"> <div class="message-wrap">
<!-- 标签 --> <!-- 标签 -->
<div class="category-wrap"> <div class="category-wrap">
<!-- <span class="my-tag-style active">全部</span>
<span class="my-tag-style">已读</span>
<span class="my-tag-style">未读</span> -->
<span <span
class="my-tag-style" class="my-tag-style"
:class="index == activeIndex ? 'active' : ''" :class="index == activeIndex ? 'active' : ''"
...@@ -34,10 +31,9 @@ ...@@ -34,10 +31,9 @@
inset inset
v-for="(item, index) in messageList" v-for="(item, index) in messageList"
:key="index" :key="index"
@click="read(item)" @click="touchstart(index, item)"
@touchstart="touchstart(index, item)"
@touchend="touchend(index)"
> >
<!--@touchend.prevent="touchend(index)" 长按备份-->
<div class="messgae-title">{{ item.noticeTitle }}</div> <div class="messgae-title">{{ item.noticeTitle }}</div>
<div class="message-content"> <div class="message-content">
{{ item.upcomingUserName }},您好!您有一条来自{{ {{ item.upcomingUserName }},您好!您有一条来自{{
...@@ -49,12 +45,16 @@ ...@@ -49,12 +45,16 @@
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop> <div class="wrapper" @click.stop>
<van-button round type="primary" @touchstart="goDetail(item)" <van-button round type="primary" @click="goDetail(item)"
>详情</van-button >详情</van-button
> >
<van-button round type="info" @touchstart="goConfirm(item)" <!-- @touchstart="goDetail(item)" 长按备份-->
<van-button round type="info" @click="goConfirm(item)"
>整改</van-button >整改</van-button
> >
<van-button round type="warning" @click="read(item)" v-if="item.status == '未读'"
>已读</van-button
>
</div> </div>
</van-overlay> </van-overlay>
</van-cell-group> </van-cell-group>
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
messageCategory: [ messageCategory: [
{ {
key: "0", key: "0",
category: "全部" category: "未读"
}, },
{ {
key: "1", key: "1",
...@@ -82,11 +82,11 @@ export default { ...@@ -82,11 +82,11 @@ export default {
}, },
{ {
key: "2", key: "2",
category: "未读" category: "全部"
} }
], ],
activeIndex: 0, activeIndex: 0,
activeVal: "全部", activeVal: "未读",
searchVal: "", searchVal: "",
messageList: [], // 消息列表 messageList: [], // 消息列表
// refreshing: false, // 下拉刷新开关 // refreshing: false, // 下拉刷新开关
...@@ -98,12 +98,13 @@ export default { ...@@ -98,12 +98,13 @@ export default {
}; };
}, },
created() { created() {
this.getMessageList();
this.unRead(); this.unRead();
}, },
methods: { methods: {
// 点击类别 // 点击类别
clickCategory(index, data) { clickCategory(index, data) {
// 关闭遮罩层
this.showIndex = null;
this.activeIndex = index; this.activeIndex = index;
this.activeVal = this.messageCategory[index].category; this.activeVal = this.messageCategory[index].category;
// 点击全部还是已读还是未读 // 点击全部还是已读还是未读
...@@ -112,6 +113,7 @@ export default { ...@@ -112,6 +113,7 @@ export default {
// 搜索事件 // 搜索事件
onSearch(val) { onSearch(val) {
console.log(val);
}, },
// 封装全部 已读 和 未读的方法 // 封装全部 已读 和 未读的方法
...@@ -127,6 +129,7 @@ export default { ...@@ -127,6 +129,7 @@ export default {
// 点击消息条目时的点击事件 变成已读 // 点击消息条目时的点击事件 变成已读
read(data) { read(data) {
console.log("触发了点击事件");
// 判断showIndex是否等于null 如果不等于则先将showIndex改为null // 判断showIndex是否等于null 如果不等于则先将showIndex改为null
this.showIndex = null; this.showIndex = null;
if (data.status == "未读") { if (data.status == "未读") {
...@@ -152,6 +155,8 @@ export default { ...@@ -152,6 +155,8 @@ export default {
if (res.code == 0) { if (res.code == 0) {
// 向父组件发送消息条数 // 向父组件发送消息条数
this.$emit("messageLength", res.total); this.$emit("messageLength", res.total);
// 给消息列表赋值
this.messageList = res.rows
} }
}); });
}, },
...@@ -194,29 +199,32 @@ export default { ...@@ -194,29 +199,32 @@ export default {
// } // }
touchstart(index, item) { touchstart(index, item) {
clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器 // clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
if (this.showIndex != null) { if (this.showIndex != null) {
this.showIndex = null; this.showIndex = null;
return; // return;
} }
this.Loop = setTimeout(
function() {
this.showIndex = index; this.showIndex = index;
}.bind(this), // this.Loop = setTimeout(
300 // function() {
); // 这里的1000是指需要长按的时间,单位为ms // this.showIndex = index;
}, // }.bind(this),
touchend(index) { // 0
// 这个方法主要是用来将每次手指移出之后将计时器清零 // ); // 这里的1000是指需要长按的时间,单位为ms
clearTimeout(this.Loop);
}, },
// touchend(index) {
// // 这个方法主要是用来将每次手指移出之后将计时器清零 长按备份
// clearTimeout(this.Loop);
// },
// 详情 // 详情
goDetail(data) { goDetail(data) {
console.log(data);
this.showIndex = null; this.showIndex = null;
}, },
// 删除 // 整改
goDelete(data) { goConfirm(data) {
console.log(123);
this.showIndex = null; this.showIndex = null;
} }
} }
......
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
inset inset
v-for="(item, index) in messageList" v-for="(item, index) in messageList"
:key="index" :key="index"
@touchstart="touchstart(index, item)" @click="touchstart(index, item)"
@touchend.prevent="touchend(index)"
> >
<van-row gutter=""> <van-row gutter="">
...@@ -38,7 +37,7 @@ ...@@ -38,7 +37,7 @@
<!-- 长按显示遮罩层 --> <!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop> <div class="wrapper" @click.stop>
<van-button round type="primary" @touchstart="goDetail(item)" <van-button round type="primary" @click="goDetail(item)"
>详情</van-button >详情</van-button
> >
</div> </div>
...@@ -122,18 +121,10 @@ export default { ...@@ -122,18 +121,10 @@ export default {
}, },
touchstart(index, item) { touchstart(index, item) {
clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
if (this.showIndex != null) { if (this.showIndex != null) {
this.showIndex = null; this.showIndex = null;
return;
} }
this.Loop = setTimeout(() => {
this.showIndex = index; this.showIndex = index;
}, 300); // 这里的1000是指需要长按的时间,单位为ms
},
touchend(index) {
// 这个方法主要是用来将每次手指移出之后将计时器清零
clearInterval(this.Loop);
}, },
// 详情 // 详情
......
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
inset inset
v-for="(item, index) in messageList" v-for="(item, index) in messageList"
:key="index" :key="index"
@touchstart="touchstart(index, item)" @click="touchstart(index, item)"
@touchend.prevent="touchend(index)"
> >
<van-row gutter=""> <van-row gutter="">
<van-col span="5">所属项目:</van-col> <van-col span="5">所属项目:</van-col>
...@@ -47,10 +46,10 @@ ...@@ -47,10 +46,10 @@
<!-- 长按显示遮罩层 --> <!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop> <div class="wrapper" @click.stop>
<van-button round type="primary" @touchstart="goDetail(item)" <van-button round type="primary" @click="goDetail(item)"
>详情</van-button >详情</van-button
> >
<van-button round type="info" @touchstart="goConfirm(item)" <van-button round type="info" @click="goConfirm(item)"
>确认</van-button >确认</van-button
> >
</div> </div>
...@@ -116,18 +115,10 @@ export default { ...@@ -116,18 +115,10 @@ export default {
onSearch(val) { onSearch(val) {
}, },
touchstart(index, item) { touchstart(index, item) {
clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
if (this.showIndex != null) { if (this.showIndex != null) {
this.showIndex = null; this.showIndex = null;
return;
} }
this.Loop = setTimeout(() => {
this.showIndex = index; this.showIndex = index;
}, 300); // 这里的1000是指需要长按的时间,单位为ms
},
touchend(index) {
// 这个方法主要是用来将每次手指移出之后将计时器清零
clearInterval(this.Loop);
}, },
// 详情 // 详情
......
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
inset inset
v-for="(item, index) in messageList" v-for="(item, index) in messageList"
:key="index" :key="index"
@touchstart="touchstart(index, item)" @change="touchstart(index, item)"
@touchend.prevent="touchend(index)"
> >
<van-row gutter=""> <van-row gutter="">
<van-col span="5">所属项目:</van-col> <van-col span="5">所属项目:</van-col>
...@@ -48,10 +47,10 @@ ...@@ -48,10 +47,10 @@
<!-- 长按显示遮罩层 --> <!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop> <div class="wrapper" @click.stop>
<van-button round type="primary" @touchstart="goDetail(item)" <van-button round type="primary" @click="goDetail(item)"
>上报</van-button >上报</van-button
> >
<van-button round type="warning" @touchstart="goDelete(item)" <van-button round type="warning" @click="goDelete(item)"
>删除</van-button >删除</van-button
> >
</div> </div>
...@@ -116,18 +115,10 @@ export default { ...@@ -116,18 +115,10 @@ export default {
onSearch(val) { onSearch(val) {
}, },
touchstart(index, item) { touchstart(index, item) {
clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
if (this.showIndex != null) { if (this.showIndex != null) {
this.showIndex = null; this.showIndex = null;
return;
} }
this.Loop = setTimeout(() => {
this.showIndex = index; this.showIndex = index;
}, 300); // 这里的1000是指需要长按的时间,单位为ms
},
touchend(index) {
// 这个方法主要是用来将每次手指移出之后将计时器清零
clearInterval(this.Loop);
}, },
// 重新上报 // 重新上报
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment