Browse Source

Merge branch 'feature/v4.8.83_wky' of qmx/jy into feature/v4.8.83

wangkaiyue 1 year ago
parent
commit
4a996972bc

+ 8 - 0
src/jfw/front/index.go

@@ -2,6 +2,7 @@ package front
 
 import (
 	"app.yhyue.com/moapp/jybase/common"
+	util "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/encrypt"
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 	"app.yhyue.com/moapp/jybase/redis"
@@ -54,6 +55,13 @@ func init() {
 
 // NewIndex 新版首页改版
 func (nIndex *NewIndex) NewIndex() error {
+	sessVal := nIndex.Session().GetMultiple()
+	userId := util.ObjToString(sessVal["userId"])
+
+	nIndex.T["hasLogin"] = userId != ""
+	nIndex.T["hotkey"] = hotKeyArrLoginEd
+	nIndex.T["hotKeyArrUnLogin"] = hotKeyArrUnLogin
+
 	//顶部菜单
 	nIndex.T["topMenu"] = g.Cfg("index").MustGet(context.Background(), "topMenu").Maps()
 	//招标公告

+ 10 - 2
src/web/staticres/js/index/index_swiper.js

@@ -1,7 +1,15 @@
 var pageSwiper = {
   idList: [
-    '#swiper-container-1',
-    '#swiper-container-2',
+    // '#swiper-container-1',
+    // '#swiper-container-2',
+
+    // 'new-pc-index-top-ad',
+    // 'new-pc-index-carousel',
+    // 'new-pc-index-middle-carousel',
+    // 'new-pc-index-ent-service',
+    // 'new-pc-index-twenty-three-right',
+    // 'new-pc-index-twenty-three-left',
+    // 'new-pc-index-twenty-seven',
   ],
   swiperList: [],
   init: function () {

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

@@ -170,6 +170,7 @@
     display: flex;
     align-items: center;
     justify-content: space-between;
+    white-space: nowrap;
 }
 .index-search-module .header-top-left {
     display: flex;

+ 65 - 5
src/web/templates/pc/newIndex.html

@@ -39,7 +39,19 @@
         </section>
         <!-- banner swiper -->
         <section class="main-module swiper-module-12">
-          {{include "/pc/template/index/banner-swiper.html"}}
+          {{$ad_1:=(Ad "new-pc-index-top-ad" -1 .Host)}}
+          {{if $ad_1}}
+          <div class="banner-swiper swiper-container" id="new-pc-index-top-ad">
+            <div class="swiper-wrapper">
+              {{range $ad := $ad_1}}
+              <a class="swiper-slide" target="_blank" href="{{$ad.S_link}}">
+                <img class="img-banner" src='{{$ad.S_pic}}' alt="{{$ad.S_picalt}}">
+              </a>
+              {{end}}
+            </div>
+            <div class="w1200 swiper-pagination custom-dot"></div>
+          </div>
+          {{end}}
         </section>
         <!-- 13消息中心 -->
         <section class="main-module">
@@ -52,7 +64,19 @@
               {{include "/pc/template/index/zb-aside-card.html"}}
               <div class="swiper-module-15">
                 <!-- 首页上部分中心轮播图 -->
-                {{include "/pc/template/index/banner-swiper.html"}}
+                {{$ad_2:=(Ad "new-pc-index-carousel" -1 .Host)}}
+                {{if $ad_2}}
+                <div class="banner-swiper swiper-container" id="new-pc-index-carousel">
+                  <div class="swiper-wrapper">
+                    {{range $ad := $ad_2}}
+                    <a class="swiper-slide" target="_blank" href="{{$ad.S_link}}">
+                      <img class="img-banner" src='{{$ad.S_pic}}' alt="{{$ad.S_picalt}}">
+                    </a>
+                    {{end}}
+                  </div>
+                  <div class="w1200 swiper-pagination custom-dot"></div>
+                </div>
+                {{end}}
               </div>
             </section>
             <!-- 招标动态 -->
@@ -65,7 +89,19 @@
             </section>
             <!-- 项目专区下广告位 -->
             <section class="aside-main-module mb20 swiper-module-21">
-              {{include "/pc/template/index/banner-swiper.html"}}
+              {{$ad_3:=(Ad "new-pc-index-middle-carousel" -1 .Host)}}
+              {{if $ad_3}}
+              <div class="banner-swiper swiper-container" id="new-pc-index-middle-carousel">
+                <div class="swiper-wrapper">
+                  {{range $ad := $ad_3}}
+                  <a class="swiper-slide" target="_blank" href="{{$ad.S_link}}">
+                    <img class="img-banner" src='{{$ad.S_pic}}' alt="{{$ad.S_picalt}}">
+                  </a>
+                  {{end}}
+                </div>
+                <div class="w1200 swiper-pagination custom-dot"></div>
+              </div>
+              {{end}}
             </section>
             <!-- 机构专区 -->
             <section class="aside-main-module mb20">
@@ -74,10 +110,34 @@
             <!-- 机构专区下广告位 -->
             <section class="aside-main-module mb20 swiper-module-23">
               <div class="swiper-module-23-children">
-                {{include "/pc/template/index/banner-swiper.html"}}
+                {{$ad_4:=(Ad "new-pc-index-twenty-three-left" -1 .Host)}}
+                {{if $ad_4}}
+                <div class="banner-swiper swiper-container" id="new-pc-index-twenty-three-left">
+                  <div class="swiper-wrapper">
+                    {{range $ad := $ad_4}}
+                    <a class="swiper-slide" target="_blank" href="{{$ad.S_link}}">
+                      <img class="img-banner" src='{{$ad.S_pic}}' alt="{{$ad.S_picalt}}">
+                    </a>
+                    {{end}}
+                  </div>
+                  <div class="w1200 swiper-pagination custom-dot"></div>
+                </div>
+                {{end}}
               </div>
               <div class="swiper-module-23-children">
-                {{include "/pc/template/index/banner-swiper.html"}}
+                {{$ad_5:=(Ad "new-pc-index-twenty-three-right" -1 .Host)}}
+                {{if $ad_5}}
+                <div class="banner-swiper swiper-container" id="new-pc-index-twenty-three-right">
+                  <div class="swiper-wrapper">
+                    {{range $ad := $ad_5}}
+                    <a class="swiper-slide" target="_blank" href="{{$ad.S_link}}">
+                      <img class="img-banner" src='{{$ad.S_pic}}' alt="{{$ad.S_picalt}}">
+                    </a>
+                    {{end}}
+                  </div>
+                  <div class="w1200 swiper-pagination custom-dot"></div>
+                </div>
+                {{end}}
               </div>
             </section>
             <!-- 企业服务专区 -->

+ 7 - 7
src/web/templates/pc/template/index/partners-project-list.html

@@ -1,15 +1,15 @@
 <!-- 客户合作案例 -->
 <section class="partners-project-container">
+  {{$ad_5:=(Ad "new-pc-index-bottom-ad" -1 .Host)}}
+  {{if $ad_5}}
   <ul class="partners-project-list">
+    {{range $ad := $ad_5}}
     <li class="partners-project-item">
-      <a href="">
-        <img src="" alt="">
-      </a>
-    </li>
-    <li class="partners-project-item">
-      <a href="">
-        <img src="" alt="">
+      <a href="{{$ad.S_link}}">
+        <img src="{{$ad.S_pic}}" alt="{{$ad.S_picalt}}">
       </a>
     </li>
+    {{end}}
   </ul>
+  {{end}}
 </section>

+ 18 - 15
src/web/templates/pc/template/index/search-module.html

@@ -33,21 +33,24 @@
       </div>
       <i class="hot-divider"></i>
       <ul class="hot-key-list">
-        <li class="hot-key-item">
-          <a class="cms-link" href="">医院</a>
-        </li>
-        <li class="hot-key-item">
-          <a class="cms-link" href="">一卡通</a>
-        </li>
-        <li class="hot-key-item">
-          <a class="cms-link" href="">台式机</a>
-        </li>
-        <li class="hot-key-item">
-          <a class="cms-link" href="">多媒体</a>
-        </li>
-        <li class="hot-key-item">
-          <a class="cms-link" href="">综合布线综合布线</a>
-        </li>
+        {{$hasLogin := .T.hasLogin}}
+        {{if and (not $hasLogin) .T.hotKeyArrUnLogin }}
+          {{range $i,$v := .T.hotKeyArrUnLogin}}
+            {{if lt $i 10}}
+            <li class="hot-key-item">
+              <a class="cms-link" href="{{$v.Url}}">{{$v.Name}}</a>
+            </li>
+            {{end}}
+          {{end}}
+        {{else}}
+          {{range $i,$v := .T.hotkey}}
+            {{if lt $i 10}}
+            <li class="hot-key-item">
+              <a class="cms-link" href="{{if  $hasLogin}}/page_workDesktop/work-bench/page?link={{end}}/jylab/supsearch/index.html?keywords={{$v}}&searchvalue=&selectType=title">{{$v}}</a>
+            </li>
+            {{end}}
+          {{end}}
+        {{end}}
       </ul>
     </div>
   </div>