瀏覽代碼

数据服务模式竖版添加提示信息

zhangxc 5 年之前
父節點
當前提交
fc85f25848
共有 5 個文件被更改,包括 95 次插入14 次删除
  1. 21 1
      src/css/indexVert.less
  2. 26 3
      src/js/index.js
  3. 0 2
      src/js/indexHorizontal.js
  4. 7 5
      src/js/indexHorizontalDom.js
  5. 41 3
      src/js/indexVertDom.js

+ 21 - 1
src/css/indexVert.less

@@ -40,6 +40,12 @@
         background-color: #E3FEFE;
     }
 }
+.tipsInfo {
+    h4 {
+        background-color: #E3FEFE;
+    }
+}
+
 
 .conditTips {
     h4 {
@@ -54,6 +60,9 @@
 .treatRecommend h4 i {
     background: url(/images/zhiliao.png) center center no-repeat;
 }
+.tipsInfo h4 i {
+    background: url(/images/zhiliao.png) center center no-repeat;
+}
 
 .conditTips h4 i {
     background: url(/images/tips.png) center center no-repeat;
@@ -285,7 +294,7 @@
     padding-right: 15px;
 }
 
-.recommendNull {
+.recommendNull,.TipsInfoNull {
     color: #ADADAD;
 }
 .treatItemTitle {
@@ -294,4 +303,15 @@
 }
 .disclaimerInfo {
     cursor: pointer;
+}
+.moreInfo {
+    display: inline-block;
+    width:42px;
+    height:20px;
+    border-radius:4px;
+    border:1px solid #267FD7;
+    line-height:20px;
+    color: #267FD7;
+    text-align: center;
+    margin-left: 20px;
 }

+ 26 - 3
src/js/index.js

@@ -7,7 +7,7 @@ var Promise = require("bluebird");
 const $ = require("jquery");
 const { post,config,getUrlArgObject,openNewWin } = require('./promise.js');
 const { transConf } = require('./util.js');
-const { renderRecommendInfo, renderMultRecommendInfo, renderTreat, renderRecommendConditTips } = require('./indexVertDom.js');
+const { renderRecommendInfo, renderMultRecommendInfo, renderTreat, renderRecommendConditTips, renderTipsInfo } = require('./indexVertDom.js');
 
 let mrId = getUrlArgObject('mrId') 
 let msg;
@@ -160,12 +160,20 @@ function getTreatment() {
   
 }
 
+function getTipsInfo() {
+  post(config.information,{name:getUrlArgObject('tipsName'),type:getUrlArgObject('tipsType'), position: 1}).then((res)=>{
+    var data = res.data
+    window.tipsInfo = data
+  })
+}
+
+
 // getConf()
 // pushInfo()
 // getTreatment();
 function getPageInfo() {
 
-  Promise.all([getConf(),getPushInfo(),getTreatment()]).then(([res1, res2, res3]) =>{
+  Promise.all([getConf(),getPushInfo(),getTreatment(),getTipsInfo()]).then(([res1, res2, res3, res4]) =>{
     if(pushInfo.code == 0) {
       pushResult = pushInfo.data;
     } else {
@@ -176,6 +184,11 @@ function getPageInfo() {
     } else {
       treatResult = {}
     }
+    if(tipsInfo.code == 0) {
+      tipsResult = tipsInfo.data
+    } else {
+      tipsResult = {}
+    }
     const diagPossible =  pushResult.dis&&pushResult.dis['可能诊断'] || []//可能
     const diagDoubt = pushResult.dis&&pushResult.dis['疑似诊断'] || [] // 疑似
     const diagDeter = pushResult.dis&&pushResult.dis['确诊'] || []//确诊
@@ -223,6 +236,10 @@ function getPageInfo() {
         case "diagnose_show": //推荐诊断
           renderRecommendInfo('diagRecommend', '推荐诊断', diagRecommend, true,7,2)
           break;
+        case "tip_show": //提示信息
+          renderTipsInfo('tipsInfo','提示信息',tipsResult)
+          moreInfo()
+          break;
         default:
            return
       } 
@@ -241,7 +258,13 @@ function getPageInfo() {
 
 
 }
-
+function moreInfo() {
+  $('.moreInfo').click(function(){
+    const name = $(this).attr('data-name')
+    const type = getUrlArgObject('tipsType')
+    openNewWin(`information.html?type=${type}&position=0&name=${name}`)
+  })
+}
 
 
 $(".disclaimerInfo").on("click", function(){

+ 0 - 2
src/js/indexHorizontal.js

@@ -250,7 +250,6 @@ function getPageInfo() {
           renderMultRecommendInfo(labAndPacsImg, 'labAndPacsRecommend', '检验检查', labAndPacsRecommend, false)
           break;
         case "cure_show": //治疗方案
-        console.log(22222)
           tipsNum++;
           renderTreat(treatImg, 'treatRecommend','治疗方案',treatResult)
           break;
@@ -258,7 +257,6 @@ function getPageInfo() {
           renderRecommendInfo(diagImg, 'diagRecommend', '推荐诊断', diagRecommend, true,7,2)
           break;
         case "tip_show": //提示信息
-        console.log(11111111)
           tipsNum++;
           renderTipsInfo('', 'tipsInfo','提示信息',tipsResult)
           moreInfo()

+ 7 - 5
src/js/indexHorizontalDom.js

@@ -229,12 +229,14 @@ function renderTipsInfoText(className,title,data, parentNode) {
         childrenNodeBoxStr += `<p>暂无数据</p>
                                 
                             `
+    } else {
+        for(let i = 0; i < data.length; i++) {
+            childrenNodeBoxStr += `<p>${data[i].title}</p>
+                                    ${data[i].content.replace(/{imageUrlPrefix}/g, imageUrlPrefix)}
+                                `
+        }
     }
-    for(let i = 0; i < data.length; i++) {
-        childrenNodeBoxStr += `<p>${data[i].title}</p>
-                                ${data[i].content.replace(/{imageUrlPrefix}/g, imageUrlPrefix)}
-                            `
-    }
+   
     // const childrenNodeBoxStr = `
     //     <div class = "treatItemBox ${className + 'box'}">
     //         <p class="treatItemTitle">${title}:</p>

+ 41 - 3
src/js/indexVertDom.js

@@ -1,5 +1,5 @@
 const $ = require("jquery");
-const { openNewWin } = require('./promise.js');
+const { openNewWin,imageUrlPrefix } = require('./promise.js');
 const { bindTipsEvent } = require('./popupEdit.js');
 
 function renderRecommendInfo(className,title,data, hasInfo, type, position) {
@@ -43,7 +43,7 @@ function renderMultRecommendInfo(className,title,data, hasInfo, type, position)
                     <h4><i></i>${title}</h4>
                     <div class="recommendInfoBox ${className + 'box'}"></div>
                 </div>`
-    $('.recommendWrap').append(str)
+    $('.recommendInfoWrapper').append(str)
     for(let i = 0; i < data.length; i++) {
         let childrenNodeBoxStr  = `<div class="labAndPacsBox ${data[i].className} clearfix"> </div>`
         let childrenNodeStr =  `<span class="labAndPacsTitle">${data[i].title}<i></i></span>`
@@ -60,6 +60,43 @@ function renderMultRecommendInfo(className,title,data, hasInfo, type, position)
 
 }
 
+function renderTipsInfo(className,title, data) {
+    const str = `<div class="recommendInfoWrapper ${className}">
+                    <h4><i></i>${title}</h4>
+                    <div class="recommendInfoBox clearfix ${className + 'box'}"></div>
+                </div>`
+    $('.recommendWrap').append(str)
+    if(data.name) {
+        renderTipsInfoMsg('tipsInfo', data.name, data.details, className+'box')
+    } else {
+        // renderTipsInfoMsg('tipsInfo', data.name, data.details, className+'box')
+        $('.' + className+'box').append('<p class="TipsInfoNull">暂无数据</p>')
+    }
+}
+
+function renderTipsInfoMsg(className,title,data, parentNode) {
+    const childrenNodeBoxStr = `
+        <div class = "treatItemBox ${className + 'box'}">
+            <p class="treatItemTitle">${title} <span class="moreInfo" data-name="${title}">详情</span></p>
+            <p class="${className + 'Info'} clearfix"></p>
+        </div>
+    `
+    $('.' + parentNode).append(childrenNodeBoxStr)
+    let dataStr = ``
+    if(data.length === 0) {
+        dataStr += `<p class="TipsInfoNull">暂无数据</p>
+                            `
+    } else {
+        for(let i = 0; i < data.length; i++) {
+            dataStr += `<p>${data[i].title}</p>
+                                    ${data[i].content.replace(/{imageUrlPrefix}/g, imageUrlPrefix)}
+                        `
+        }
+    }
+    
+    $('.' + className+'Info').html(dataStr)
+}
+
 function renderTreat(className,title, data) {
     const str = `<div class="recommendInfoWrapper ${className}">
                     <h4><i></i>${title}${msg.diag?'('+msg.diag+')':''}</h4>
@@ -292,5 +329,6 @@ module.exports = {
     renderRecommendInfo,
     renderMultRecommendInfo,
     renderTreat,
-    renderRecommendConditTips
+    renderRecommendConditTips,
+    renderTipsInfo
 }