Bladeren bron

修改搜索和发展历程

zjm
等你 2 maanden geleden
bovenliggende
commit
cff7dc5ee5

+ 20
- 34
src/pages/common/css/common.less Bestand weergeven

@@ -905,7 +905,7 @@ footer{
905 905
     .searchConIn{
906 906
         width: 70%;
907 907
         max-width: 1300px;
908
-        
908
+        // height: 100%;
909 909
         max-height: 80%;
910 910
         background: #fff;
911 911
         .searchUp{
@@ -945,10 +945,20 @@ footer{
945 945
         }
946 946
         .searchDw{
947 947
             width: 100%;
948
-            max-height: calc(100% - 60px);
948
+            height: calc(80vh - 60px);
949 949
             overflow-y: auto;
950 950
             box-sizing: border-box;
951
-            padding: 0px 30px 0;
951
+            padding: 20px 30px 20px;
952
+            display: none;
953
+            &::-webkit-scrollbar {
954
+                width: 3px;
955
+              }
956
+              &::-webkit-scrollbar-thumb {
957
+                background-color: #b5b5b5;
958
+              }
959
+        }
960
+        .searchShow{
961
+            display: block;
952 962
         }
953 963
     }
954 964
     
@@ -961,34 +971,14 @@ footer{
961 971
           justify-content: space-between;
962 972
           border-bottom: 1px solid #acacac5e;
963 973
           box-sizing: border-box;
964
-          padding: 27px 0px;
965
-          &:first-child {
966
-            margin-top: 30px;
967
-          }
974
+          padding: 30px 15px;
975
+          
968 976
           &:last-child{
969 977
             border-bottom: 0px solid #ACACAC;
970 978
           }
971
-          .timer{
972
-            width: 65px;
973
-            height: 66px;
974
-            border-radius: 8px;
975
-            border: 1px solid #A7A5A5;
976
-            text-align: center;
977
-            font-size: 12px;
978
-            padding: 0px 12px 0;
979
-            box-sizing: border-box;
980
-            .timerData{
981
-              font-size: 26px;
982
-              color: #b81c25;
983
-              border-bottom: 1px solid #b81c25;
984
-              padding-bottom: 3px;
985
-              margin-bottom: 3px;
986
-              line-height: 30px;
987
-              padding-top: 4px;
988
-            }
989
-          }
979
+          
990 980
           .newsLiCon{
991
-            width: calc(100% - 80px);
981
+            width: 100%;
992 982
             font-size: 18px;
993 983
             text-align: left;
994 984
             &>div{
@@ -1001,13 +991,9 @@ footer{
1001 991
             .liTitle{
1002 992
               color: #231F20;
1003 993
               font-weight: 500;
1004
-              margin-bottom: 8px;
1005
-              padding-top: 6px;
1006
-            }
1007
-            .licon{
1008
-              font-weight: 400;
1009
-              color: #999999;
1010
-              font-size: 16px;
994
+              span{
995
+                color: #B81C25;
996
+              }
1011 997
             }
1012 998
           }
1013 999
           transition: all 0.3s ease-in-out;

+ 18
- 12
src/pages/common/js/Common.js Bestand weergeven

@@ -219,22 +219,27 @@ export default class Common {
219 219
     let searchInput=document.querySelector(".searchInput");
220 220
     let searchClose=document.querySelector(".searchClose");
221 221
     let searchDw=document.querySelector(".searchDw");
222
+    let newsType=document.querySelector(".searchDw .newsType");
222 223
     searchDiv.addEventListener("click",(e)=>{
223
-      searchDw.innerHTML='';
224
+      // newsType.innerHTML='';
224 225
       searchCon.classList.add("searchConShow");
225 226
 
226 227
     });
227 228
     searchClose.addEventListener("click",(e)=>{
228 229
       searchCon.classList.remove("searchConShow");
230
+      newsType.innerHTML='';
231
+      searchInput.value='';
232
+      searchDw.classList.remove("searchShow");
229 233
     });
230 234
     //今天输入内容,3秒没有输入,则搜索
231 235
     let setTimeNum=null;
232 236
     searchInput.addEventListener("input",(e)=>{
233 237
       console.log('当前输入值:', e.target.value);
238
+      let title=e.target.value;
234 239
       if(setTimeNum){clearTimeout(setTimeNum)}
235 240
       setTimeNum=setTimeout(()=>{
236 241
         console.log("搜索内容:",e.target.value);
237
-        fetch('/system/news/search?keyword='+e.target.value)
242
+        fetch('http://60.205.233.182:90/api/system/news/select?title='+title)
238 243
         .then(response => {
239 244
           if (!response.ok) {
240 245
             throw new Error('网络响应不是 OK');
@@ -246,21 +251,22 @@ export default class Common {
246 251
          //获取搜索数据循环添加内容
247 252
          let str='';
248 253
          if(response.data.length>0){
254
+
249 255
             response.data.forEach((item)=>{
250 256
               //把时间和内容,链接加上
257
+              let tit=item.title;
258
+              let highlightedTit = tit.replace(new RegExp(title, 'g'), `<span>${title}</span>`);
251 259
               str+=`<a class="newsLi" href="" target="_blank">
252
-                    <div class="timer">
253
-                    <div class="timerData">10</div>
254
-                    <div>24-12</div>
255
-                    </div>
256
-                    <div class="newsLiCon">
257
-                        <div class="liTitle">${item.title}</div>
258
-                      <div class="licon">${item.dec}</div>
259
-                    </div></a>`;
260
+                        <div class="newsLiCon">
261
+                            <div class="liTitle">${highlightedTit}</div>
262
+                        </div>
263
+                    </a>`;
260 264
             });
261
-            searchDw.innerHTML=str;
265
+            searchDw.classList.add("searchShow")
266
+            newsType.innerHTML=str;
262 267
           }else{
263
-            searchDw.innerHTML=`<div class="noData">暂无数据</div>`
268
+            searchDw.classList.add("searchShow")
269
+            newsType.innerHTML=`暂无数据`
264 270
           }
265 271
         })
266 272
       },3000)

+ 8
- 11
src/pages/common/tpl/footer.tpl Bestand weergeven

@@ -95,17 +95,14 @@
95 95
             <input class="searchInput" type="text" placeholder="请输入搜索内容" />
96 96
             <div class="searchClose"><span class="iconfont icon-guanbi"></span></div>
97 97
         </div>
98
-        <div class="searchDw newsType">
99
-            <!--<a class="newsLi" href="" target="_blank">
100
-                <div class="timer">
101
-                <div class="timerData">10</div>
102
-                <div>24-12</div>
103
-                </div>
104
-                <div class="newsLiCon">
105
-                    <div class="liTitle">标题</div>
106
-                    <div class="licon">描述</div>
107
-                </div>
108
-            </a>-->
98
+        <div class="searchDw">
99
+            <div class="newsType">
100
+                <!--<a class="newsLi" href="" target="_blank">
101
+                    <div class="newsLiCon">
102
+                        <div class="liTitle">标题1<span>第三帝国</span></div>
103
+                    </div>
104
+                </a>-->
105
+            </div>
109 106
         </div>
110 107
     </div>
111 108
 </div>

+ 1
- 1
src/pages/common/tpl/header.tpl Bestand weergeven

@@ -56,7 +56,7 @@
56 56
                 </div>
57 57
             </div>
58 58
         </div>
59
-        <div class="language menuOne" style="display:none">
59
+        <div class="language menuOne">
60 60
             <div class="btn2 btnW searchDiv"><span class="iconfont icon-search"></span></div>
61 61
             <!--<span class="line" style="display:none"></span>
62 62
             <a href="./join.html#contactUs" class="aborder">联系我们</a>-->

+ 9
- 2
src/pages/index/App.js Bestand weergeven

@@ -241,8 +241,9 @@ export default class App {
241 241
                 spaceBetween: isMob?0:20,
242 242
                 allowTouchMove: false,
243 243
                 centeredSlides: true,
244
-                slidesOffsetBefore : isMob?0:pagebefore,
245
-                slidesOffsetAfter : isMob?0:pageAfter,
244
+                loop: true,
245
+                // slidesOffsetBefore : isMob?0:pagebefore,
246
+                // slidesOffsetAfter : isMob?0:pageAfter,
246 247
                 navigation: {
247 248
                     nextEl: '.btn-nextP1',
248 249
                     prevEl: '.btn-prevP1',
@@ -278,6 +279,12 @@ export default class App {
278 279
         let allNum = document.querySelector(".allNum");
279 280
         let nowNum = document.querySelector(".nowNum");
280 281
         let fillLine = document.querySelector(".fillLine");
282
+        let historySwiperText=document.querySelectorAll(".historySwiper .text");
283
+        historySwiperText.forEach(item=>{
284
+            let txt=item.innerText;
285
+            let textNew = txt.replace('@', '<br>');
286
+            item.innerHTML=textNew;
287
+        });
281 288
         allNum.textContent=historySlides.length;
282 289
         let historySwiper = null;
283 290
         let defaultYear=2020;

+ 6
- 6
src/pages/index/index.html Bestand weergeven

@@ -299,7 +299,7 @@
299 299
                   <img class="lazy" data-src="./static/images/index/his1997.jpg" data-srcM="./static/images/index/his1997.jpg" alt="" />
300 300
                 </div>
301 301
                 <div class="hisTime">1997</div>
302
-                <div class="text">并购辽阳针织二厂,成立中泽集团针织有限公司</div>
302
+                <div class="text">并购辽阳针织二厂,@成立中泽集团针织有限公司</div>
303 303
                 <div class="hisBottom">
304 304
                   <div class="hisLine"></div>
305 305
                   <div class="hisIcon">
@@ -315,7 +315,7 @@
315 315
                   <img class="lazy" data-src="./static/images/index/his2001.jpg" data-srcM="./static/images/index/his2001.jpg" alt="" />
316 316
                 </div>
317 317
                 <div class="hisTime">2001</div>
318
-                <div class="text">并购辽阳纺织厂,成立辽宁三耳兔服饰有限公司</div>
318
+                <div class="text">并购辽阳纺织厂,@成立辽宁三耳兔服饰有限公司</div>
319 319
                 <div class="hisBottom">
320 320
                   <div class="hisLine"></div>
321 321
                   <div class="hisIcon">
@@ -347,7 +347,7 @@
347 347
                   <img class="lazy" data-src="./static/images/index/his2003.jpg" data-srcM="./static/images/index/his2003.jpg" alt="" />
348 348
                 </div>
349 349
                 <div class="hisTime">2003</div>
350
-                <div class="text">并购朝阳纺织厂,成立辽宁中泽集团朝阳纺织有限责任公司</div>
350
+                <div class="text">并购朝阳纺织厂,@成立辽宁中泽集团朝阳纺织有限责任公司</div>
351 351
                 <div class="hisBottom">
352 352
                   <div class="hisLine"></div>
353 353
                   <div class="hisIcon">
@@ -379,7 +379,7 @@
379 379
                   <img class="lazy" data-src="./static/images/index/his2005.jpg" data-srcM="./static/images/index/his2005.jpg" alt="" />
380 380
                 </div>
381 381
                 <div class="hisTime">2005</div>
382
-                <div class="text">并购辽阳宾馆,成立辽阳宾馆有限责任公司</div>
382
+                <div class="text">并购辽阳宾馆,@成立辽阳宾馆有限责任公司</div>
383 383
                 <div class="hisBottom">
384 384
                   <div class="hisLine"></div>
385 385
                   <div class="hisIcon">
@@ -395,7 +395,7 @@
395 395
                   <img class="lazy" data-src="./static/images/index/his2006.jpg" data-srcM="./static/images/index/his2006.jpg" alt="" />
396 396
                 </div>
397 397
                 <div class="hisTime">2006</div>
398
-                <div class="text">并购朝阳重型机器厂,成立朝阳重型机器有限公司</div>
398
+                <div class="text">并购朝阳重型机器厂,@成立朝阳重型机器有限公司</div>
399 399
                 <div class="hisBottom">
400 400
                   <div class="hisLine"></div>
401 401
                   <div class="hisIcon">
@@ -427,7 +427,7 @@
427 427
                   <img class="lazy" data-src="./static/images/index/his2011.jpg" data-srcM="./static/images/index/his2011.jpg" alt="" />
428 428
                 </div>
429 429
                 <div class="hisTime">2011</div>
430
-                <div class="text">并购辽宁省机械研究院,成立辽宁省机械研究院有限公司</div>
430
+                <div class="text">并购辽宁省机械研究院,@成立辽宁省机械研究院有限公司</div>
431 431
                 <div class="hisBottom">
432 432
                   <div class="hisLine"></div>
433 433
                   <div class="hisIcon">

+ 3
- 3
src/pages/index/index.less Bestand weergeven

@@ -819,7 +819,7 @@
819 819
     z-index: 2;
820 820
     padding-bottom: 60px;
821 821
     .corTits{
822
-      width: 440px;
822
+      width: 670px;
823 823
       margin: 0px auto;
824 824
       height: 60px;
825 825
       display: flex;
@@ -829,7 +829,7 @@
829 829
       color: rgba(255, 255, 255, 0.8);
830 830
       box-sizing: border-box;
831 831
       div{
832
-        font-size: 20px;
832
+        font-size: 32px;
833 833
         padding: 0px 10px;
834 834
         position: relative;
835 835
         cursor: pointer;
@@ -857,7 +857,7 @@
857 857
       width: 100%;
858 858
       margin-top: 20px;
859 859
       color: #fff;
860
-      font-size: 20px;
860
+      font-size: 30px;
861 861
       div{
862 862
         display: none;
863 863
       }

Laden…
Annuleren
Opslaan