Explorar o código

Merge branch 'dev/v4.9.27_yf' of qmx/jy into feature/v4.9.27

yangfeng hai 1 ano
pai
achega
c2f4c1cc3a

+ 10 - 0
src/web/staticres/js/index/index_2023.12.js

@@ -167,6 +167,8 @@ var _page = {
     this.initImportantGovTab()
     this.initHotIndustrySearch()
     this.initDocsDescTab()
+    this.docImgClick()
+
   },
   // 计算九宫格高度
   initUserInfoCard: function () {
@@ -374,6 +376,14 @@ var _page = {
       $(this).text(text)
     })
   },
+  // 处理文库图片点击也可跳转(不能用a标签包裹,搜索引擎会识别a标签内不是文字,也不能用行内onclick事件,不能绑定自定义属性)
+  docImgClick: function() {
+    var $img = $('.doc-card-list-item .doc-main-img')
+    $img.click(function() {
+      var href = $(this).parents().siblings('a').attr('href')
+      window.open(href)
+    })
+  }
 }
 
 $(function () {

+ 1 - 0
src/web/staticres/pccss/index_pc.css

@@ -264,6 +264,7 @@
 }
 .doc-card-list-item .doc-main-img:hover{
   transform: scale(1.3);
+  cursor: pointer;
 }
 .doc-card-list-item .doc-type-img{
   position: absolute;

+ 0 - 6
src/web/templates/pc/newIndex.html

@@ -234,12 +234,6 @@
   <script type="text/javascript" src='{{Msg "seo" "cdn"}}/js/index/index_2023.12.js?v={{Msg "seo" "version"}}'></script>
   <script defer src=//cdn-common.jianyu360.com/cdn/lib/echarts/4.8.0/echarts.min.js></script>
   <script defer type="text/javascript" src='{{Msg "seo" "cdn"}}/js/index/index_charts.js?v={{Msg "seo" "version"}}'></script>
-  <script>
-    var docsData = {{.T.docsData}}
-    var docClass = {{.T.docsClass}}
-    var strategyList = {{.T.strategyList}}
-    console.log(docsData, strategyList, docClass);
-  </script>
 </body>
 
 </html>

+ 6 - 6
src/web/templates/pc/template/index/doc-card-module.html

@@ -17,17 +17,17 @@
             {{range $kk,$vv := $v}}
             <li class="doc-card-list-item">
               <div class='doc-card-list-item-img {{if not $vv.productType}}{{else if Eq $vv.productType 1}}free{{end}}'>
-                <img class="doc-main-img" src="{{$vv.previewImg}}" alt="doc-name">
+                <img class="doc-main-img" src="{{$vv.previewImg}}" alt="{{$vv.docName}}">
                 {{if or (eq $vv.docFileSuffix "doc") (eq $vv.docFileSuffix "docx")}}
-                <img class="doc-type-img" src='/images/pc/word.png' alt="doc-type">
+                <img class="doc-type-img" src='/images/pc/word.png' alt="{{$vv.docFileSuffix}}">
                 {{else if  eq $vv.docFileSuffix "pdf"}}
-                <img class="doc-type-img" src='/images/pc/pdf.png' alt="doc-type">
+                <img class="doc-type-img" src='/images/pc/pdf.png' alt="{{$vv.docFileSuffix}}">
                 {{else if  eq $vv.docFileSuffix "ppt"}}
-                <img class="doc-type-img" src='/images/pc/ppt.png' alt="doc-type">
+                <img class="doc-type-img" src='/images/pc/ppt.png' alt="{{$vv.docFileSuffix}}">
                 {{else if  eq $vv.docFileSuffix "xls"}}
-                <img class="doc-type-img" src='/images/pc/excel.png' alt="doc-type">
+                <img class="doc-type-img" src='/images/pc/excel.png' alt="{{$vv.docFileSuffix}}">
                 {{else if  eq $vv.docFileSuffix "txt"}}
-                <img class="doc-type-img" src='/images/pc/txt.png' alt="doc-type">
+                <img class="doc-type-img" src='/images/pc/txt.png' alt="{{$vv.docFileSuffix}}">
                 {{end}}
               </div>
               <a class="doc-card-list-item-title cms-link ellipsis-2" target="_blank" href="/swordfish/docs/content/{{$vv.id}}" title="{{$vv.docName}}">{{$vv.docName}}</a>