Browse Source

清除时清除慢病推送信息,新增小弹窗

liucf 6 năm trước cách đây
mục cha
commit
997f320225

+ 47 - 0
src/common/components/MiniToast/index.jsx

@@ -0,0 +1,47 @@
+import React from 'react';
+import style from './index.less';
+import close from "../../images/close-icon.png";
+/**
+*小弹窗,没有蒙层,例如计算公式结果
+*title:弹窗标题
+*icon:标题旁边的icon,不传不显示
+*children:弹窗内容
+*show:弹窗显示
+*footer:是否显示底部“确定”按钮,默认不显示
+*close:关闭弹窗事件
+*confirm:确定事件
+*使用时,父元素需要加相对定位position: relative;
+*/
+class MiniToast extends React.Component{
+  constructor(props){
+    super(props);
+  }
+
+  close(){
+    const {close} = this.props;
+    close&&close();
+  }
+
+  confirm(){
+    const {confirm} = this.props;
+    confirm&&confirm();
+  }
+
+
+  render(){
+    const {show,title,icon,children,footer} = this.props;
+    return <div className={style["infoBox"]} style={{display:show?'block':'none'}}>
+              <p className={style["infoTitle"]}>
+                {icon?<img src={icon} />:''}
+                {title}
+                <img src={close} onClick={this.close.bind(this)} className={style["closeIcon"]}/>
+              </p>
+              <div className={style["infoCon"]}>{children}</div>
+              <div className={style["infoFoot"]} style={{display:footer?'block':'none'}}>
+                <span onClick={this.confirm.bind(this)}>确定</span>
+              </div>
+            </div>
+  }
+}
+
+export default MiniToast;

+ 41 - 0
src/common/components/MiniToast/index.less

@@ -0,0 +1,41 @@
+.infoBox{
+  position: absolute;
+  top:27px;
+  width: 388px;
+  background: #fff;
+  z-index: 66;
+  border: 1px solid #EAEDF1;
+  box-shadow: 0 5px 10px 0 rgba(0,0,0,0.10);
+  .infoTitle{
+    height: 40px;
+    line-height: 40px;
+    padding-left: 18px;
+    // border-bottom: 1px solid #EAEDF1;
+    background: #DFEAFE;
+    img{
+      vertical-align: text-top;
+    }
+    .closeIcon{
+      // vertical-align: middle;
+      float: right;
+    }
+  }
+  .infoCon{
+    padding: 15px 26px 25px;
+  }
+  .infoFoot{
+    text-align: right;
+    // border-top: 1px solid #EAEDF1;
+    padding: 10px 20px 10px 0;
+    span{
+      color:#3B9ED0;
+      display: inline-block;
+      width: 66px;
+      height: 32px;
+      line-height: 32px;
+      text-align: center;
+      border: 1px solid #3B9ED0;
+      border-radius: 4px;
+    }
+  }
+}

+ 3 - 1
src/common/components/index.js

@@ -22,6 +22,7 @@ import Textarea from "./Textarea";
 import NumberUnitPan from "./NumberUnitPan";
 import Add from "./Add";
 import ComplexModal from "./ComplexModal";
+import MiniToast from "./MiniToast";
 
 module.exports = {
     Banner,
@@ -47,5 +48,6 @@ module.exports = {
     Textarea,
     NumberUnitPan,
     Add,
-    ComplexModal
+    ComplexModal,
+    MiniToast
 };

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 46 - 59
src/components/ChronicInfo/index.jsx


+ 1 - 1
src/store/actions/pushMessage.js

@@ -222,7 +222,7 @@ export const clearAllPushMessage = (state, action) => {
 	res.determine = [];
 	res.assay = [];
 	res.check = [];
-  res.medicalIndications = [];//量表
+  res.chronicPushItems = [];//量表
 	return res;
 }