Ver código fonte

Merge remote-tracking branch 'origin/scale0414' into testNew

zhouna 4 anos atrás
pai
commit
463ed45e6c

+ 4 - 3
src/css/homeStatic.less

@@ -79,9 +79,10 @@
     width: 100%;
     text-align: center;
     margin:180px 0 50px 0;
-    color: #333;
-    font-size: 2.7vw;
-    font-weight: bold;
+    img{
+      width: 47%;
+      max-width: 647px;
+    }
   }
   .staticBg {
     width: 62.4%;

+ 5 - 5
src/css/staticInfoOut.less

@@ -229,27 +229,27 @@ div,li,span,i,p,h1,h2,h3,h4,h5,pre{
     padding: 0 40px 0;
   }
   .showWhich {
-    width: 94px;
+    width: 187px;
     text-align: center;
     padding: 30px 0 20px;
     position: relative;
     .showWhichSelect {
       display: inline-block;
       color: @staticMainColor;
-      background: url("../images/d1.png") 100px 9px #EAFCFF no-repeat;
+      background: url("../images/d1.png") 200px 9px #EAFCFF no-repeat;
       font-size: 16px;
-      padding:0 24px 0 9px;
+      padding:1px 24px 2px 9px;
       width: 100%;
       cursor: pointer;
     }
     ul {
       display: none;
       position: absolute;
-      left: -9px;
+      left: 0;
       top: 52px;
       z-index: 10;
       background-color: #fff;
-      width: 110px;
+      width: 220px;
       box-shadow: 0px 6px 16px 0px rgba(0, 0, 0, 0.18);
       border-radius: 4px;
       border: 1px solid #E6E6E6;

+ 1 - 1
src/html/homeStatic.html

@@ -32,7 +32,7 @@
           </div>
       </div>
     </div>
-    <p class="foryou">——— 为你提供丰富的医学知识查询 ———</p>
+    <p class="foryou"><img src="../images/word.png" alt=""></p>
     <div class="staticBg">
       <img src="../images/staticBg.png" alt="">
     </div>

BIN
src/images/word.png


+ 1 - 0
src/js/homeStatic.js

@@ -6,6 +6,7 @@ let searchType = 0;
 require('./../images/staticBgS.png').replace(/^undefined/g, '')
 require('./../images/staticLogo.png').replace(/^undefined/g, '')
 require('./../images/staticBg.png').replace(/^undefined/g, '')
+require('./../images/word.png').replace(/^undefined/g, '')
 
 $(function(){
   getAllTypes()

+ 7 - 2
src/js/searchStaticList.js

@@ -112,7 +112,11 @@ function renderList(tabList){
     $('.resultItem').click(function(){
         let name = $(this).attr('data-name')
         let type = $(this).attr('data-type')
-        window.open(`./staticInfo.html?name=${name}&type=${type}`);
+        if(window.opener){
+            openNewWin(`./staticInfo.html?name=${name}&type=${type}`);
+        }else{
+            window.open(`./staticInfo.html?name=${name}&type=${type}`);
+        }
     })
 }
 function initData(){
@@ -192,7 +196,8 @@ function renderPagination(totalPage,activePage,totalNum){
         }
     })
     $('.select').change(function(){
-        size = $(this).val()
+        size = $(this).val();
+        curPage=1;
         getTabData()
     })
     $('.goNum input').change(function(){

+ 31 - 20
src/js/staticInfoOut.js

@@ -16,8 +16,14 @@ const {
   openNewWin
 } = require('./promise.js');
 const $ = require("jquery");
-let showName,noticeName,clinicalPathwayName,showLis=[]
+let showName,noticeName,clinicalPathwayName,showLis=[],selectedDrop=0,selectedTab=0
 
+//如果是子窗口,隐藏网页查看按钮
+if(window.opener){
+    selectedDrop=getUrlArgObject("d")||0;
+    selectedTab=getUrlArgObject("t")||0;
+    $("#openWin").hide();
+}
 let icond = require('./../images/d.png').replace(/^undefined/g, '')
 function getInfomation() {
   // var param = {
@@ -33,7 +39,7 @@ function getInfomation() {
     "hisDetailName": getUrlArgObject('hisDetailName'),
     "contentTypes":[1,2,3]
   };
-  showName = param.hisName;
+  //showName = param.hisName;
   // if (param.type == 5 || param.type == 51) {
   //   param.type = 12;
   //   param.name = uname;
@@ -44,22 +50,23 @@ function getInfomation() {
       const data = res.data.data
       var str = '';
       var anchors = '';
+      let sName ='';
       if (!data||data.length===0) {
         showEmpty();
         return;
       }
-      $(".titleCont .title").html(showName);
       showLis=data
       for(let i = 0;i < showLis.length;i++){
         let tmp = showLis[i]
-        str+=`<li data-idx="${i}" title="${tmp.name}">${tmp.name}</li>`
+        str+=`<li data-idx="${i}" title="${tmp.name}">${tmp.name}(${tmp.hisName})</li>`
       }
-      $(".showWhich ul").html(str)
-      $(".showWhichSelect").html(showLis[0].name).attr("title",showLis[0].name)
-      showName = data[0].name
-      document.title = showName
+      $(".showWhich ul").html(str);
+        sName=showLis[selectedDrop].name+"("+showLis[selectedDrop].hisName+")";
+      $(".showWhichSelect").html(sName).attr("title",sName)
+      showName = data[selectedDrop].name
       showInfoSelect()
-      showInfo(data[0])
+      showInfo(data[selectedDrop])
+        renderTitleShow();
       $('.content img').bind('contextmenu', function(){
         return false
       })
@@ -95,9 +102,11 @@ function showInfoSelect(){
   $('.showWhich li').click(function(){
     let idx = $(this).attr('data-idx')
     let name = $(this).html(),str=''
-    showName = showLis[idx].name
-    document.title = showName
+    selectedDrop=idx;
+    selectedTab=0;
+    showName = showLis[idx].name;
     showInfo(showLis[idx])
+    renderTitleShow();
     $('.content .infos').scrollTop(0)
     $(".showWhich ul").css("display","none")
     $(".showWhichSelect").html(name).attr("title",name)
@@ -110,6 +119,10 @@ function showInfoSelect(){
     $(".showWhich ul").css("display","none")
   })
 }
+function renderTitleShow(){
+    document.title = showName;
+    $(".titleCont .title").html($(".tabList .tab:eq("+selectedTab+")").attr("data-title"));
+}
 function renderContent(list, contentWrapClassName){
   $(`.${contentWrapClassName} .infos`).html('');
   $(`.${contentWrapClassName} .anchors ul`).html('');
@@ -180,15 +193,17 @@ function renderTab(detailList){
     $(".tabList").append(`<span class="tab" data-module="notice" data-title="`+noticeName+`">注意事项</span>`)
     //$(".titleCont .title").html(noticeName);
   }
-  $(".tabList .tab").eq(0).addClass("activeTab")
-  let defaultModuleName = $(".tabList .tab").eq(0).attr("data-module")
+
+  $(".tabList .tab").eq(selectedTab).addClass("activeTab")
+  let defaultModuleName = $(".tabList .tab").eq(selectedTab).attr("data-module")
   $(`.${defaultModuleName}`).css("display","block")
   bindTabClick()
 }
 function bindTabClick(){
   $(".tabList .tab").on("click", function(){
     const moduleName = $(this).attr("data-module")
-    const display = $(`.${moduleName}`).css("display")
+    //const display = $(`.${moduleName}`).css("display")
+      selectedTab=$('.tabList .tab').index(this);
       $(".titleCont .title").html($(this).attr('data-title'));
     //if(display == "none"){
       $(".activeTab").removeClass("activeTab")
@@ -202,8 +217,8 @@ function bindTabClick(){
     const type= getUrlArgObject('type');
     const hospitalId= getUrlArgObject('hospitalId');
     const hisName= getUrlArgObject('hisName');
-    const hisDetailName= getUrlArgObject('hisDetailName');
-    openNewWin("staticInfoOut.html?hospitalId="+encodeURIComponent(hospitalId)+"&hisName="+encodeURIComponent(hisName)+"&hisDetailName="+encodeURIComponent(hisDetailName||'')+"&type="+encodeURIComponent(type));
+    const hisDetailName= getUrlArgObject('hisDetailName');console.log(selectedDrop)
+    openNewWin("staticInfoOut.html?hospitalId="+encodeURIComponent(hospitalId)+"&hisName="+encodeURIComponent(hisName)+"&hisDetailName="+encodeURIComponent(hisDetailName||'')+"&type="+encodeURIComponent(type)+"&d="+selectedDrop+"&t="+selectedTab);
   })
 }
 function adjustHeight() {
@@ -220,8 +235,4 @@ $(window).on('resize', function(){
   adjustHeight()
   adjustWidth()
 })
-//如果是子窗口,隐藏网页查看按钮
-if(window.opener){
-  $("#openWin").hide();
-}