Bladeren bron

Merge remote-tracking branch 'origin/testMerged'

zhouna 5 jaren geleden
bovenliggende
commit
7088861aa7

+ 190 - 0
src/css/information.less

@@ -0,0 +1,190 @@
+* {
+    margin: 0;
+    padding: 0;
+  }
+
+  ul,
+  li {
+    list-style: none;
+  }
+
+  table {
+    border-collapse: collapse;
+    border-spacing: 0;
+  }
+
+  body {
+    font-size: 14px;
+    overflow-y: scroll;
+    font-family: '微软雅黑', '宋体';
+    background: #dde2ea;
+    height: 100%;
+    color: #1E1E1E;
+    line-height: 21px;
+  }
+
+  h1 {
+    margin: 0 0px 30px 0px !important;
+    font-size: 28px !important;
+    line-height: 37px;
+    padding: 0 0 0 20px;
+  }
+
+  .titleH2 {
+    font-size: 22px;
+    position: relative;
+    background: #fff;
+    padding-right: 6px;
+    font-weight: bold;
+    line-height: 30px;
+  }
+
+  .content {
+    position: relative;
+    height: 550px;
+  }
+  .infoBox {
+    border-left: 1px solid #969C9F;
+    padding: 0 0 0 33px;
+    margin: 0 0 20px 0;
+  }
+  .infoWrapper {
+    padding: 0 0 0 20px;
+  }
+  .circleBox {
+    position: absolute;
+    z-index: 10;
+    background: #fff;
+    left: -40px;
+    height: 32px;
+    top: -1px;
+  }
+  .circle {
+    display: inline-block;
+    width: 12px;
+    height: 12px;
+    border-radius: 50%;
+    background: #3B9ED0;
+    position: relative;
+    top: 2px;
+  }
+  .infos {
+    height: 100%;
+    overflow-y: auto;
+    padding: 0 60px 0 0;
+  }
+
+  .infos>div {
+    margin-right: 160px;
+  }
+
+  .title {
+    position: relative;
+    line-height: 24px;
+    
+    margin: 0 0 13px;
+  }
+
+  .line {
+    border-bottom: 1px dashed #ccc;
+  }
+
+  .container {
+    width: 80%;
+    overflow: hidden;
+    background: #fff;
+    margin: 0 auto;
+    padding: 43px 0 30px 20px;
+ 
+  }
+  pre {
+    white-space: pre-wrap;
+    word-wrap: break-word;
+    color: #1E1E1E;
+  }
+  .anchors {
+    width: 200px;
+    position: absolute;
+    right:15px;
+    top: 0;
+    margin-right: 14px;
+    overflow: auto;
+    height: 100%;
+  }
+
+  .anchors ul {
+    padding: 15px 0px 15px 20px;
+    border-radius: 4px;
+    border: 1px solid #F5F6F7;
+    background-color: #F5F6F7;
+    line-height: 19px;
+  }
+
+  .anchors li {
+    position: relative;
+    border-left: 2px solid #E0E2E3;
+  }
+
+  .anchors .anchor-line {
+    height: 20px;
+    width: 0;
+    border-left: 2px solid #E0E2E3;
+  }
+
+  .anchors .anchor-line:last-child {
+    display: none;
+  }
+
+  .anchors i {
+    position: absolute;
+    display: inline-block;
+    width: 8px;
+    height: 8px;
+    border-radius: 5px;
+    border: 1px solid #E0E2E3;
+    background-color: #E0E2E3;
+    left: -6px;
+    top: 5px;
+  }
+
+  .anchors a {
+    display: inline-block;
+    position: relative;
+    top: 0;
+    left: 0;
+    width: 132px;
+    padding: 0 0px 0 20px;
+    text-decoration: none;
+    font-size: 14px;
+    font-weight: 400;
+    color: #777;
+    word-wrap: break-word;
+  }
+
+  .anchors .active a {
+    color: #3B9ED0 !important;
+    font-weight: 700 !important;
+  }
+
+  .anchors .active i {
+    width: 16px;
+    height: 16px;
+    top: 1px;
+    left: -8px;
+    border-radius: 0;
+    border: none;
+    background-color: #F5F6F7;
+    background: url('../images/icon_current.png') center center no-repeat;
+  }
+
+  a:visited {
+    color: #777;
+  }
+  .disCopy {
+    -webkit-touch-callout: none;
+    -webkit-user-select: none;
+    -khtml-user-select: none;
+    -moz-user-select: none;
+    -ms-user-select: none;
+    user-select: none;
+  }

+ 8 - 0
src/css/treatPlan.less

@@ -103,6 +103,11 @@
     float: left;
     margin: 10px;
 }
+.slideImg {
+    width: 16px;
+    float: right;
+    margin: 10px;
+}
 .commonTreat {
     line-height: 36px;
 }
@@ -127,3 +132,6 @@
     filter:alpha(opacity=30);
     -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=30);";
 }
+.treatPlanWrap {
+    margin: 0 0 10px 0;
+}

File diff suppressed because it is too large
+ 7 - 158
src/html/information.html


BIN
src/images/icon_current.png


BIN
src/images/slide-down.png


BIN
src/images/slide-up.png


+ 9 - 10
src/js/information.js

@@ -1,3 +1,4 @@
+require('../css/information.less')
 const {
   post,
   throttle,
@@ -33,17 +34,17 @@ function getInfomation() {
     }
     var list = data.details;
     $("h1").html(showName);
-    $("h1").css({
-      "color": "#267FD7",
-      "borderBottom": "4px solid  #E9E9E9",
-      "padding": "0px 60px 50px 0px"
-    });
+    // $("h1").css({
+    //   "color": "#267FD7",
+    //   "borderBottom": "4px solid  #E9E9E9",
+    //   "padding": "0px 60px 50px 0px"
+    // });
     for (var i = 0; i < list.length; i++) {
       item = list[i];
       item.content = item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
       anchors = '<li><i></i><a href="#' + item.title +
         '">' + item.title + '</a></li><li class="anchor-line"></li>';
-      str = '<div class="title"><h2 id="' + item.title +
+      str = '<div class="infoBox"><div class="title"> <div class= "circleBox"><span class="circle"> <span></div> <h2 class="titleH2" id="' + item.title +
         '">'
       if (getUrlArgObject('type') == 8) {
         str += '【' + item.title + '】'
@@ -51,10 +52,8 @@ function getInfomation() {
         str += item.title
       }
       str += '</h2></div>' +
-        '<div><pre>' + item.content + '</pre><div>';
-      if (i != list.length - 1 && getUrlArgObject('type') != 8) {
-        str += '<div class="line"></div>'
-      }
+        '<div><pre>' + item.content + '</pre><div></div>';
+        str = `<div class="infoWrapper">${str}</div>`
       $(".infos").append(str);
       $(".anchors ul").append(anchors);
     }

+ 16 - 4
src/js/treatplan.js

@@ -3,11 +3,13 @@ require('../css/reset.css');
 require('../css/common.less');
 // require('../css/popup.css');
 // require('../js/popup');
-require('../css/treatPlan.less')
+require('../css/treatPlan.less');
 const $ = require("jquery");
 const { post,config,getUrlArgObject,openNewWin, isIe8 } = require('../js/promise.js');
-let generalImg = require('./../images/general.png')
-let drugImg = require('./../images/drug.png')
+let generalImg = require('./../images/general.png');
+let drugImg = require('./../images/drug.png');
+let slideUpImg = require('./../images/slide-up.png');
+let slideDownImg = require('./../images/slide-down.png');
 
 
 const is8Ie = isIe8() //判断是否为IE8
@@ -15,6 +17,8 @@ if(is8Ie) {
   let reg = /undefined/g
   generalImg = generalImg.replace(reg, '')
   drugImg = drugImg.replace(reg, '')
+  slideUpImg = slideUpImg.replace(reg, '')
+  slideDownImg = slideDownImg.replace(reg, '')
 }
 
 // var msg = {
@@ -55,8 +59,16 @@ post(config.pushInner,Object.assign({featureType: '8',ruleType:config.ruleTypeMa
 })
 
 function ybzlFun(data){//一般治疗
-  $(".conditionHintZhiliaoAp").prepend(`<div class="treatPlanWrap clearfix"><div class="treatPlan"><p class="treatPlanBg"></p><p class="treatPlanTitle"><img src=${generalImg} title="一般治疗" class="icon">一般治疗</p></div><div class="commonTreat clearfix">${data}</div></div>`)
+  $(".conditionHintZhiliaoAp").prepend(`<div class="treatPlanWrap clearfix"><div class="treatPlan"><p class="treatPlanBg"></p><p class="treatPlanTitle clearfix"><img src=${generalImg} title="一般治疗" class="icon"/><img src=${slideUpImg} title="收起" class="slideImg"/>一般治疗</p></div><div class="commonTreat clearfix">${data}</div></div>`)
   $(".diseaseName").html(' ( '+msg.diseaseName.uniqueName+' )')
+  $(document).on('click','.treatPlanTitle', function(){
+    if($('.slideImg').attr('src') === slideDownImg) {
+      $('.slideImg').attr('src', slideUpImg)
+    } else {
+      $('.slideImg').attr('src', slideDownImg)
+    }
+    $(".commonTreat").slideToggle(500);
+  })
 }
 function cyywFun(data){//常用药物
   for(let i = 0; i < data.length; i++) {