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

点击显示遮罩层

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