需求:

1.点击一个事件时弹出一个蒙版;

2.蒙版上有取消,删除事件;(点击取消时候蒙版消失,点击删除时,删除蒙版并消失);

3.点击空白地方,蒙版也消失;

 
<template>
    <div class="waitPay">
        <div class="logo">
            <span></span>
            <span>保单号{{accidentData.orderId}}</span>
            <span @click="isdele">删除</span>
        </div>
        <div class="carInfo">
            <div class="text">
                <p>{{accidentData.orderMemberName}}</p>
                <p>投保人:{{accidentData.policyHolder}} </p>
                <p>被保人: {{accidentData.protectHolder}} </p>
                <p>
                    结算日期:{{accidentData.orderMemberName}}
                </p>
            </div>
            <div class="item-img">
                <img :src="orderStatus" alt="">
            </div>
        </div>
        <div class="item">
            <p>
                <span>保费 :{{accidentData.amount}}</span>
                <span>推广费 : 271.1</span>
            </p>
            <p v-show="isState">
                <span>
                    重新投保
                </span>
                <span>
                    付款
                </span>
            </p>
        </div>
        <IsDeleMask v-show="show" @isShow="isShow" />
    </div>
</template>
<script>
import IsDeleMask from "@/components/IsDeleMask.vue"; // 是否删除
export default {
props: ["accidentData"],
components: {
IsDeleMask
},
data(){
     return{
         show:false,
     }
},
computed: {
orderStatus() {
let obj = {
"10000531": require("@/assets/img/yi_chu_dan.png"), // 已出单
"10000532": require("@/assets/img/daizhifu.png"), // 待支付
"10000533": require("@/assets/img/tui-dan.jpg") // 退单
};
return obj[this.accidentData.orderStatus];
},
isState() {
let obj = {
"10000531": false, // 已出单
"10000532": true, // 未出单
"10000533": false // 退单
};
return obj[this.accidentData.orderStatus];
}
},
methods: {
isdele() {
this.show = true;
},
isShow() {
this.show = false;
}
}
};
</script>
<style lang="scss" scoped>
.waitPay {
width: 94.67%;
max-height: 4.6rem;
background-color: #fff;
margin: auto;
margin-bottom: 0.2rem;
border: 0.18rem;
> .logo {
width: 100%;
height: 0.7rem;
// background: green;
display: flex;
align-items: center;
border-bottom: 0.012rem solid #f2f2f2;
> span:nth-child(1) {
color: #f76c41;
font-weight: bold;
font-size: 0.28rem;
margin-left: 8%;
}
> span:nth-child(2) {
color: #6a6a6a;
font-size: 0.22rem;
margin-left: 8%;
margin-right: 10%;
}
> span:nth-child(3) {
text-align: right;
color: #333333;
font-size: 0.22rem;
font-weight: bold;
}
}
> .carInfo {
width: 100%;
height: 2.32rem;
// background: red;
display: flex;
border-bottom: 0.012rem solid #f2f2f2;
.text {
padding-left: 0.3rem;
width: 73.33%;
// background: yellow;
height: 2.32rem;
box-sizing: border-box;
> p {
font-size: 0.26rem;
color: #6a6a6a;
// font-weight: bold;
line-height: 0.46rem;
}
> p:nth-child(1) {
padding-top: 0.25rem;
color: #333333;
font-size: 0.3rem;
font-weight: bold;
}
}
> .item-img {
width: 26.67%;
display: flex;
margin-bottom: 0.61rem;
margin-top: 0.4rem;
justify-content: center;
> img {
width: 1.3rem;
height: 1.3rem;
align-items: center;
}
}
}
> .item {
width: 100%;
max-height: 1.58rem;
// background: green;
> p:nth-child(1) {
width: 100%;
height: 0.69rem;
display: flex;
justify-content: space-between;
align-items: center;
> span {
font-size: 0.24rem;
color: #f76c41;
font-weight: bold;
}
> span:nth-child(1) {
padding-left: 0.3rem;
}
> span:nth-child(2) {
padding-right: 0.3rem;
}
}
> p:nth-child(2) {
width: 100%;
height: 0.89rem;
> span {
width: 2rem;
height: 0.7rem;
display: inline-block;
text-align: center;
line-height: 0.7rem;
font-size: 0.26rem;
}
> span:nth-child(1) {
border: 0.012rem solid #6a6a6a;
color: #6a6a6a;
margin-left: 30.9%;
margin-right: 6.5%;
}
> span:nth-child(2) {
background-color: #f76c41;
color: white;
}
}
}
}
</style>
<template>
    <div class="isDele" @click="kbxs">
        <div class="item">
            <p>是否删除</p>
            <p>
                <span>
                    取消
                </span>
                <span>
                    删除
                </span>
            </p>
        </div>
    </div>
</template>
<script>
export default {
data() {
return {
deleData: ""
};
},
methods: {
     kbxs(e) {
         if (e.target.tagName === 'DIV') {
             this.$emit('isShow')
         }else if (e.target.tagName === 'SPAN') {
            if (e.target.innerHTML.indexOf('取消') !== -1 ) {
                this.handleClick('取消')
            }else {
                this.handleClick('删除')
            }
         }
     },
handleClick(type) {
        if (type == '取消') {
            this.$emit('isShow')
            return
        }
let datas = {
// orderId:'OPRO20180823160539323',
};
this.$http.get("delect", datas).then(({ data }) => {
if (data.code == 1) {
this.$dialog.toast({
mes: data.msg,
timeout: 1500,
icon: "success",
callback: () => {
this.$emit('isShow')
}
});
}
});
}
}
};
</script>
<style lang="scss" scoped>
.isDele {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
display: flex;
justify-content: center;
align-items: center;
z-index: 100;
> .item {
width: 6.3rem;
height: 3rem;
background: #fff;
border-radius: 0.1rem;
> p:nth-child(1) {
height: 2.05rem;
color: #333333;
font-size: 0.38rem;
font-weight: bold;
text-align: center;
line-height: 2.05rem;
z-index: 200;
}
> p:nth-child(2) {
width: 100%;
height: 0.95rem;
// background: green;
> span {
color: #6a6a6a;
display: inline-block;
width: 50%;
font-size: 0.28rem;
text-align: center;
line-height: 0.95rem;
}
> span:nth-child(2) {
color: #fff;
background-color: #f76c41;
line-height: 0.97rem;
border-radius: 0 0 0.1rem 0;
}
}
}
font-size: 0.3rem;
color: green;
}
</style>
 
 

vue点击出现蒙版的更多相关文章

  1. vue 点击当前元素添加class 去掉兄弟的class 获取当前点击元素的文字

    点击当前标签给其添加class,兄弟标签class删除 然后获取当前点击元素的文字 演示地址: https://xibushijie.github.io/static/addClass.html &l ...

  2. vue点击返回顶部插件vue-totop

    vue-totop vue 点击返回顶部插件,可以根据参数设定按钮大小,颜色,类型,返回顶部的时间等.github地址:https://github.com/1006008051/vue-totop, ...

  3. vue点击切换颜色限制个数(用了mui框架)

    vue点击切换颜色 只能点击一个 <!doctype html> <head> <meta charset="UTF-8"> <title ...

  4. vue 点击当前元素添加class 去掉兄弟的class

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http ...

  5. vue点击时动态改变样式 ------- 最简单的方法

    vue点击时动态改变样式 template中 <li :class="{ active:index==isActive }" @click="changeValue ...

  6. vue点击切换样式,点击切换地址栏,点击显示或者隐藏

    1. vue点击显示切换 :class='{"span":index==0}' class原本是 类选择器 加上 :class就是绑定属性的意思 '{"span" ...

  7. vue 点击展开显示更多 点击收起部分隐藏

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  8. (1)vue点击图片预览(可旋转、翻转、缩放、上下切换、键盘操作)

    今天做项目的时候,遇到了新需求,需要把点击图片放大的功能.学习了一下GitHub上的viewerjs插件 GitHub地址:https://github.com/fengyuanchen/viewer ...

  9. vue点击元素变色兄弟元素不变色

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

随机推荐

  1. eclipse中取消自动生成的TODO Auto-generated method stub

    我们在实现接口定义的方法.Eclipse往往会自动加上一句:TODO Auto-generated method stub 每次手动删除很麻烦,我们可以设置一下,让强大的Eclipse在完成自动代码时 ...

  2. weblogic报:java.lang.LinkageError: loader constraint violation in interface itable initialization

    原因分析: gdaml服务中依赖org.apache.xerces_2.9.0.v201101211617.jar会产生jar包冲突 解决方法: 项目中的这个jar包删除,并将这个jar包放在服务器中 ...

  3. java 对象引用为null时,出现的bug问题

    在Java中,对象往往包含属性.方法及一个存储空间,若一个对象的属性和方法是空的则可认为这是一个空对象. 一个空对象也是对象,同样通过对象名引用方法或属性,但和一般对象有点不同. 1.空对象调用非静态 ...

  4. 如何解决Struts2和Servlet共存问题

    我之前用Servlet写过二维码扫描登录,结果把它整合到ssh框架中,发现Servlet和Struts存在共存问题,这是因为当我们在页面在请求应用时,struts2将会截获所有请求,对于servlet ...

  5. sql总结-----基本查询

    创建一个测试表,插入一些测试数据: Create Table Cstable (Id Int,Age Int,Name Varchar2(8),Address Varchar2(20)); Inser ...

  6. 【C++】C++类的static 关键字理解

    转载自:ZJE_ANDY static修饰类中成员,表示类的共享数据 1.static类成员 C++primer里面说过,static类成员不像普通的类数据成员,static类数据成员独立于一切类对象 ...

  7. android 给控件使用自定义字体Typeface

    第一步:将字体资源放在assets 资源文件夹下: 第二步:获取字体资源 Typeface mTf = Typeface.createFromAsset(c.getAssets(), "Op ...

  8. warning: accessed via instance reference

    提示如图: 先简单翻译一下: 静态成员***通过实例对象访问 显示通过类实例而不是类本身调用方法和属性. 现有一个类Test,有静态方法methods和静态属性fields. 对于静态变量或方法,推荐 ...

  9. Python_基础知识储备

    目录 目录 前言 初识Python 解析型与编译型 OOP与POP 相关概念1 Python的解释器 Python程序设计的思想 Python的编程风格 最后 前言 前面的博文从记录了如何Setup ...

  10. 人事中的BP是什么意思?

    BP= business partner,指业务伙伴 HR=human resources,指人力资源 HRBP就是人力资源服务经理.主要工作内容是负责公司的人力资源管理政策体系.制度规范在各业务单元 ...