浏览代码

style:标讯搜索页面,跳转详情优化处理

zhangsiya 1 年之前
父节点
当前提交
515a95ffc2
共有 1 个文件被更改,包括 9 次插入40 次删除
  1. 9 40
      src/web/templates/pc/supsearch.html

+ 9 - 40
src/web/templates/pc/supsearch.html

@@ -2796,35 +2796,22 @@ function checkTagDisabled () {
       }
     })
   }
-
   function noIn(p){
     var thisId = $(p).attr("dataId");
     //var dataindustry = {{.T.industry}};
     var dataindustry = $(p).parents(".bid-list-title").next(".bid-list-tags").find(".tags-industry").text();
     dataId = thisId;
+    var aHref = ".html";
+    if (searchvalue != ""){
+      aHref+= '?kds=' + encodeURIComponent(searchvalue)
+    }
+    if (dataindustry != "" && dataindustry != undefined){
+      aHref += aHref.indexOf('?') > -1 ? '&' : '?'
+      aHref += 'industry='+dataindustry;
+    }
     if(loginflag){
-      var aHref = "";
-      if (searchvalue != ""){
-        if (dataindustry!=""&&dataindustry!=undefined){
-          aHref += '.html?kds='+encodeURIComponent(searchvalue)+'&industry='+dataindustry;
-        } else{
-          aHref += '.html?kds='+encodeURIComponent(searchvalue);
-        }
-      } else{
-        if (dataindustry!=""&&dataindustry!=undefined){
-          aHref += '.html?industry='+dataindustry;
-        } else{
-          aHref += '.html';
-        }
-      }
       if (getParam('resource') === 'BI') {
-        if (aHref.indexOf('.html?') !== -1) {
-          aHref += '&resource=BI'
-        } else {
-          aHref += '.html?resource=BI'
-        }
-      } else {
-        aHref = '.html'
+        aHref += aHref.indexOf('?') > -1 ? '&resource=BI' : '?resource=BI'
       }
       try {
         visitedPath.pathVisiting(
@@ -2836,24 +2823,8 @@ function checkTagDisabled () {
       } catch (error) {}
 
       checkVisited()
-
       window.open("/article/content/"+thisId+aHref);
     }else{//没有登录跳转新的详情
-      var aHref = "";
-      if (searchvalue != ""){
-        if (dataindustry!=""&&dataindustry!=undefined){
-          aHref += '.html?kds='+encodeURIComponent(searchvalue)+'&industry='+dataindustry;
-        } else{
-          aHref += '.html?kds='+encodeURIComponent(searchvalue);
-        }
-      } else{
-        if (dataindustry!=""&&dataindustry!=undefined){
-          aHref += '.html?industry='+dataindustry;
-        } else{
-          aHref += '.html';
-        }
-      }
-
       try {
         visitedPath.pathVisiting(
           new VisitedPathItem(
@@ -2869,8 +2840,6 @@ function checkTagDisabled () {
       } else {
         window.open("/nologin/content/"+thisId+aHref);
       }
-
-      // $('#bidLogin').modal("show");
     }
   }
   //