فهرست منبع

页面推送模式治疗方案修改

zhangxc 5 سال پیش
والد
کامیت
0bcc63d725

+ 7 - 0
src/css/indexHorizontal.less

@@ -430,4 +430,11 @@ color: @grayColor;
     color: #333;
     font-weight: 600;
     margin: 5px 0 10px;
+}
+.treatItemTitle {
+    .more {
+        background: #fff;
+        top: 0;
+        z-index: 2;
+    }
 }

+ 7 - 0
src/css/indexVert.less

@@ -394,4 +394,11 @@
     color: #333;
     font-weight: 600;
     margin: 5px 0 10px;
+}
+.treatItemTitle {
+    position: relative;
+    .slideDown {
+        font-weight: normal;
+        bottom: 5px;
+    }
 }

+ 25 - 0
src/css/treatPlan.less

@@ -1,3 +1,19 @@
+.conditionHintZhiliao {
+    padding: 10px 20px 0;
+    overflow-y: auto;
+    h4 {
+        font-size: 18px;
+        margin: 15px 0;
+    }
+    .diseaseName {
+        font-size: 18px;
+    }
+}
+.diagBox{
+    border: 1px solid #d2d2d2;
+    margin: 10px 0;
+    padding: 10px 10px 0;
+}
 .treatPlan,.treatDrug{
     position: relative;
     line-height: 36px;
@@ -24,6 +40,7 @@
     width: 100%;
     height: 100%;
     z-index: 2;
+    font-weight: 600;
 }
 .drugCategoryBox {
     position: relative;
@@ -78,4 +95,12 @@
     color: #333;
     font-weight: 600;
     margin: 5px 0 10px;
+}
+.icon {
+    width: 16px;
+    float: left;
+    margin: 10px;
+}
+.commonTreat {
+    line-height: 36px;
 }

+ 1 - 1
src/html/treatplan.html

@@ -31,7 +31,7 @@
                     <div class="treatMedicineWarp">
                         <div class="treatDrug">
                                 <p class="treatDrugBg"></p>
-                                <p class="treatDrugTitle">药物治疗</p>
+                                <p class="treatDrugTitle"><img src='./../images/drug.png' title="推荐药物" class="icon">推荐药物</p>
                         </div>
                         <p class="treatMedicineNullText">暂无推荐</p>
                         <div class="drugWarp"></div>

BIN
src/images/drug.png


BIN
src/images/general.png


+ 2 - 2
src/js/indexHorizontalDom.js

@@ -146,7 +146,7 @@ function renderTreat(icon, className,title, data) {
     const commonTreatmentInfo = data.commonTreatment&&data.commonTreatment.content || ""
     const treatmentList = data.treatmentPlan || []
     renderTreatText('commonTreatment', '一般治疗', commonTreatmentInfo, className+'box')
-    renderTreatDrug('drugTreatment', '药物治疗', treatmentList, className+'box')
+    renderTreatDrug('drugTreatment', '推荐药物', treatmentList, className+'box')
 }
 function renderKnowledgeInfo(icon, className,title, data) {
     $('.infoTabBox').append(`<span class="infoTab tipsTab boldFont"  data-box="${className}">${title}</span>`)
@@ -195,7 +195,7 @@ function renderTreatText(className,title,data, parentNode) {
 function renderTreatDrug(className,title,data, parentNode) {
     const childrenNodeBoxStr = `
         <div class = "treatItemBox ${className + 'box'}">
-            <p class="treatItemTitle">${title}:</p>
+            <p class="treatItemTitle">${title}: <span class="more">更多</span></p>
             <div class="treatDrugBox">
                 <p class="${className + 'Info'}"></p>
             </div>

+ 6 - 8
src/js/indexVertDom.js

@@ -176,7 +176,7 @@ function renderTreat(className,title, data) {
     const commonTreatmentInfo = data.commonTreatment&&data.commonTreatment.content || ""
     const treatmentList = data.treatmentPlan || []
     renderTreatText('commonTreatment', '一般治疗', commonTreatmentInfo, className+'box')
-    renderTreatDrug('drugTreatment', '常用药物治疗', treatmentList, className+'box')
+    renderTreatDrug('drugTreatment', '推荐药物', treatmentList, className+'box')
 }
 
 function renderTreatText(className,title,data, parentNode) {
@@ -196,18 +196,13 @@ function renderTreatText(className,title,data, parentNode) {
         $(".commonTreatmentInfo").addClass('commonTreatmentInfoLimit').append('<span class="slideDown">更多 <i></i></span>')
     }
     $(".treatItemBox").on('click',".slideDown",function(){
-        $(this).parents(".commonTreatmentInfo").removeClass("commonTreatmentInfoLimit").append('<span class="slideup">收起 <i></i></span>')
-        $(this).remove()
-    })
-    $(".treatItemBox").on('click',".slideup",function(){
-        $(this).parents(".commonTreatmentInfo").addClass("commonTreatmentInfoLimit").append('<span class="slideDown">更多 <i></i></span>')
-        $(this).remove()
+        openNewWin(`treatplan.html?msg=${encodeURIComponent(JSON.stringify(msg))}`)
     })
 }
 function renderTreatDrug(className,title,data, parentNode) {
     const childrenNodeBoxStr = `
         <div class = "treatItemBox ${className + 'box'}">
-            <p class="treatItemTitle">${title}</p>
+            <p class="treatItemTitle">${title} ${data.length ==0 ?'':'<span class="slideDown">更多 <i></i></span>'}</p>
             <p class="${className + 'Info'}"></p>
         </div>
     `
@@ -226,6 +221,9 @@ function renderTreatDrug(className,title,data, parentNode) {
             childrenNodeStr +=`</div>`
         $('.' + className+'Info').append(childrenNodeStr)
     }
+    $(".treatItemTitle").on('click',".slideDown",function(){
+        openNewWin(`treatplan.html?msg=${encodeURIComponent(JSON.stringify(msg))}`)
+    })
     // for(let i = 0; i < data.length; i++) {
     //     let childrenNodeStr = `<p class="drugTreatmentInfoItemBox">
     //         ${i+1}.${data[i].bigdrugsName}${data[i].subdrugsName&&"("+data[i].subdrugsName+")"}:`

+ 14 - 5
src/js/treatplan.js

@@ -1,10 +1,20 @@
 // require('../css/index.less');
-// require('../css/reset.css');
+require('../css/reset.css');
 // require('../css/popup.css');
 // require('../js/popup');
 require('../css/treatPlan.less')
 const $ = require("jquery");
-const { post,config,getUrlArgObject,openNewWin } = require('../js/promise.js');
+const { post,config,getUrlArgObject,openNewWin, isIe8 } = require('../js/promise.js');
+let generalImg = require('./../images/general.png')
+let drugImg = require('./../images/drug.png')
+
+
+const is8Ie = isIe8() //判断是否为IE8
+if(is8Ie) {
+  let reg = /undefined/g
+  generalImg = generalImg.replace(reg, '')
+  drugImg = drugImg.replace(reg, '')
+}
 
 // var msg = {
 //   age: getUrlArgObject('age'),
@@ -44,14 +54,13 @@ post(config.pushTreatment,Object.assign({featureType: '8'},msg)).then((res)=>{
 })
 
 function ybzlFun(data){//一般治疗
-  $(".conditionHintZhiliaoAp").prepend('<div class="treatPlanWrap clearfix"><div class="treatPlan"><p class="treatPlanBg"></p><p class="treatPlanTitle">一般治疗</p></div><p class="commonTreat clearfix">'+data+'</p></div>')
+  $(".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>`)
   $(".diseaseName").html(' ( '+msg.diseaseName+' )')
 }
 function cyywFun(data){//常用药物
-  console.log('data',data)
   for(let i = 0; i < data.length; i++) {
 
-    let str = `<div>
+    let str = `<div class = "diagBox">
       <p class="diagTitle"><i></i>${data[i].title}</p>`
       for(let j = 0; j < data[i].meditionDetails.length; j++) {
         const meditionDetailsItem = data[i].meditionDetails[j]