Browse Source

提示信息模式

zhangxc 5 years ago
parent
commit
bcf004920a
2 changed files with 21 additions and 5 deletions
  1. 7 2
      src/js/index.js
  2. 14 3
      src/js/indexHorizontal.js

+ 7 - 2
src/js/index.js

@@ -11,6 +11,7 @@ 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 +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})
+  const tipsMode = getUrlArgObject('tipsMode') || 1
+  if(tipsMode === 1) {
+    return post(config.informationMore, {conceptIntorduces:tipsInfoList})
+  } else {
+    return post(config.information,{name:getUrlArgObject('tipsName'),type:getUrlArgObject('tipsType'), position: 1})
+  }
 }
 
 

+ 14 - 3
src/js/indexHorizontal.js

@@ -29,6 +29,7 @@ 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) => {
@@ -89,8 +90,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() {
@@ -98,7 +103,13 @@ function getPageInfo() {
     const configArr = res1&&res1.data&&res1.data.data || []
     const pushInfo = res2.data || {}
     const treatInfo = res3.data || {}
-    const tipsInfo = res4.data || []
+    let tipsInfo
+    if(tipsMode === 1) {
+      tipsInfo = res4.data || []
+    } else {
+      console.log('tipsInfo',res4.data)
+      tipsInfo = res4.data&&[].push(res4.data) || []
+    }
     const confArr = transConf(configArr)
     pushResult = pushInfo.data || {};
     treatResult = treatInfo.data || {}