Explorar o código

Merge branch 'tipsMode' into test

zhangxc %!s(int64=5) %!d(string=hai) anos
pai
achega
f6b4f15280
Modificáronse 2 ficheiros con 42 adicións e 12 borrados
  1. 21 6
      src/js/index.js
  2. 21 6
      src/js/indexHorizontal.js

+ 21 - 6
src/js/index.js

@@ -4,6 +4,9 @@ require('./../css/popup.css');
 // require('./popupEdit.js');
 var Promise = require("bluebird");
 
+
+//tipsMode: 提示信息模式  1 为多个提示信息, 2 为单个
+
 const $ = require("jquery");
 const { post,config,getUrlArgObject,openNewWin } = require('./promise.js');
 const { transConf } = require('./util.js');
@@ -11,6 +14,8 @@ const { renderRecommendInfo, renderMultRecommendInfo, renderTreat, renderRecomme
 
 
 let mrId = getUrlArgObject('mrId') 
+const tipsMode = getUrlArgObject('tipsMode') || 1
+
 let msg;
 if(mrId) {
  post(config.getMr,{mrId:mrId}).then((res) => {
@@ -73,8 +78,11 @@ function getTreatment() {
 
 function getTipsInfo() {
   let tipsInfoList =  getUrlArgObject('tipsInfoList')&&JSON.parse(getUrlArgObject('tipsInfoList')) || []
-  return post(config.informationMore, {conceptIntorduces:tipsInfoList})
-  // return post(config.information,{name:getUrlArgObject('tipsName'),type:getUrlArgObject('tipsType'), position: 1})
+  if(+tipsMode === 1) {
+    return post(config.informationMore, {conceptIntorduces:tipsInfoList})
+  } else {
+    return post(config.information,{name:getUrlArgObject('tipsName'),type:getUrlArgObject('tipsType'), position: 1})
+  }
 }
 
 
@@ -85,11 +93,18 @@ function getPageInfo() {
     const configArr = res1&&res1.data&&res1.data.data || []
     const pushInfo = res2&&res2.data || {}
     const treatInfo = res3&&res3.data || {}
-    const tipsInfo = res4&&res4.data || []
+    const tipsInfo = res4&&res4.data || {}
     const {confArr, showLabsNum, showPacsNum, labsAndPacMode} = transConf(configArr)
-    pushResult = pushInfo.data || {};
-    treatResult = treatInfo.data || {}
-    tipsResult = tipsInfo.data || []
+    const pushResult = pushInfo.data || {};
+    const treatResult = treatInfo.data || {}
+    let tipsResult = []
+    if(tipsInfo.data) {
+      if(+tipsMode === 1) {
+          tipsResult = tipsInfo.data
+      } else {
+          tipsResult.push(tipsInfo.data)
+      }
+    }
 
     const diagPossible =  pushResult.dis&&pushResult.dis['可能诊断'] || []//可能
     const diagDoubt = pushResult.dis&&pushResult.dis['拟诊'] || [] // 疑似

+ 21 - 6
src/js/indexHorizontal.js

@@ -29,6 +29,8 @@ if(is8Ie) {
 
 let mrId = getUrlArgObject('mrId') 
 let showTab = getUrlArgObject('showTab') || '0';
+const tipsMode = getUrlArgObject('tipsMode') || 1
+
 let msg;
 if(mrId) {
  post(config.getMr,{mrId:mrId}).then((res) => {
@@ -72,8 +74,12 @@ function getTreatment() {
 
 function getTipsInfo() {
   let tipsInfoList =  getUrlArgObject('tipsInfoList')&&JSON.parse(getUrlArgObject('tipsInfoList')) || []
-  return post(config.informationMore, {conceptIntorduces:tipsInfoList})
-  // return post(config.information,{name:getUrlArgObject('tipsName'),type:getUrlArgObject('tipsType'), position: 1})
+  
+  if(+tipsMode === 1) {
+    return post(config.informationMore, {conceptIntorduces:tipsInfoList})
+  } else {
+    return post(config.information,{name:getUrlArgObject('tipsName'),type:getUrlArgObject('tipsType'), position: 1})
+  }
 }
 
 function getPageInfo() {
@@ -81,11 +87,20 @@ function getPageInfo() {
     const configArr = res1&&res1.data&&res1.data.data || []
     const pushInfo = res2.data || {}
     const treatInfo = res3.data || {}
-    const tipsInfo = res4.data || []
     const {confArr, showLabsNum, showPacsNum, labsAndPacMode} = transConf(configArr)
-    pushResult = pushInfo.data || {};
-    treatResult = treatInfo.data || {}
-    tipsResult = tipsInfo.data || []
+    const tipsInfo = res4.data || {}
+    const pushResult = pushInfo.data || {};
+    const treatResult = treatInfo.data || {}
+    let tipsResult = []
+    if(tipsInfo.data) {
+      if(+tipsMode === 1) {
+          tipsResult = tipsInfo.data
+      } else {
+          tipsResult.push(tipsInfo.data)
+      }
+    }
+    
+    
     const diagPossible =  pushResult.dis&&pushResult.dis['可能诊断'] || []//可能
     const diagDoubt = pushResult.dis&&pushResult.dis['拟诊'] || [] // 疑似
     const diagDeter = pushResult.dis&&pushResult.dis['确诊'] || []//确诊