panhui 5 лет назад
Родитель
Сommit
73ffbdfd9c

+ 1 - 1
.env.development

@@ -1,4 +1,4 @@
-VUE_APP_BASE_URL=https://www.imttech.cn
+VUE_APP_BASE_URL=http://192.168.50.104:8080
 VUE_APP_PHONE=862160797117
 VUE_APP_EMAIL=imttech@itoc.com.cn
 VUE_APP_PRODUCTSTATUS=PENDING_REVIEW,NOW_ON_SHELF

+ 1 - 0
src/App.vue

@@ -120,6 +120,7 @@ page {
     --button-plain-background-color: transparent;
     --sidebar-selected-text-color: @warn;
     --sidebar-padding: 20px;
+    overflow-anchor: none;
 }
 
 .van-image {

+ 26 - 13
src/components/Banner.vue

@@ -1,5 +1,6 @@
 <template>
     <div class="banner-content" :style="{ height: `${height * 2}rpx` }">
+        <!-- <div class="topBanner" :style="{ backgroundImage: `url(${this.nowImg})`, height: `${height * 2}rpx` }"></div> -->
         <div class="swiperContent" :style="bannerStyle">
             <swiper :autoplay="autoplay" :style="scale" @change="swiperChange" :current="current">
                 <swiper-item v-for="(item, index) in banners" :key="index">
@@ -66,25 +67,21 @@ export default {
     },
     computed: {
         bannerStyle() {
-            if (this.scrollTop < 0) {
+            if (this.scrollTop <= 0 && this.fixed) {
                 return {
                     position: 'fixed',
                     top: 0,
                     left: 0,
-                    bottom: 0,
-                    right: 0
-                };
-            } else if (this.scrollTop === 0 && this.fixed) {
-                return {
-                    position: 'fixed',
-                    top: 0,
-                    left: 0,
-                    bottom: 0,
-                    right: 0
+                    right: 0,
+                    zIndex: 2,
+                    height: this.height * 2 + 'rpx'
                 };
             } else {
                 return {
-                    position: 'relative'
+                    position: 'relative',
+                    zIndex: 2,
+                    top: 0,
+                    height: this.height * 2 + 'rpx'
                 };
             }
         },
@@ -110,6 +107,13 @@ export default {
         },
         oss() {
             return `?x-oss-process=image/resize,h_${this.height * 3},m_lfit`;
+        },
+        nowImg() {
+            if (this.banners.length > this.current) {
+                return this.checkImg(this.banners[this.current].img) ? this.banners[this.current].img : '';
+            } else {
+                return '';
+            }
         }
     },
     methods: {
@@ -194,7 +198,15 @@ export default {
         }
     }
 }
-
+.topBanner {
+    background-position: center center;
+    background-size: cover;
+    position: fixed;
+    top: 0;
+    left: 0;
+    right: 0;
+    z-index: 0;
+}
 #main {
     position: relative;
     z-index: 2;
@@ -219,6 +231,7 @@ export default {
 }
 .swiperContent {
     z-index: 1;
+    transition: all ease-in-out 0.3s;
 }
 
 .video {

+ 25 - 2
src/components/News/Grid.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="news-grid news" @click="navigateTo('/pagesNews/Detail?id=' + info.id, false)">
-        <van-image :src="info.img" fit="cover" :height="180" custom-class="my-img" />
-        <div class="news-grid-info">
+        <van-image :src="info.img" fit="cover" height="490rpx" custom-class="my-img" />
+        <div class="news-grid-info" v-if="info.type !== 'TECHNICAL_INFORMATION'">
             <div class="text1">{{ info.title }}</div>
             <div class="activity" v-if="isActivity">
                 <div class="activity-info">
@@ -39,6 +39,11 @@
                 {{ info.auditTime }}
             </div>
         </div>
+        <div class="news-info-only" v-else>
+            <div class="text">
+                {{ info.title }}
+            </div>
+        </div>
     </div>
 </template>
 <script>
@@ -89,6 +94,7 @@ export default {
     border-radius: 4px;
     overflow: hidden;
     background-color: @bgw;
+    position: relative;
     .news-grid-info {
         padding: 12px;
     }
@@ -150,6 +156,23 @@ export default {
     }
 }
 
+.news-info-only {
+    font-size: 16px;
+    color: #ffffff;
+    line-height: 24px;
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    padding: 11px 12px;
+    background: rgba(0, 0, 0, 0.3);
+    .text {
+        display: -webkit-box;
+        -webkit-box-orient: vertical;
+        -webkit-line-clamp: 2;
+        overflow: hidden;
+    }
+}
 .cancel {
     .van-button--plain {
         --button-border-width: 0px;

+ 2 - 2
src/components/News/Row.vue

@@ -1,9 +1,9 @@
 <template>
     <div class="news" @click="navigateTo('/pagesNews/Detail?id=' + info.id, false)">
-        <van-image :src="info.img" fit="cover" :width="120" :height="120" custom-class="my-img" />
+        <van-image :src="info.img" fit="cover" width="280rpx" height="200rpx" custom-class="my-img" />
         <div class="news-info">
             <div class="text1">{{ info.title }}</div>
-            <p>{{ info.createdAt }}</p>
+            <p v-if="info.type === 'INDUSTRY_NEWS'">{{ info.createdAt }}</p>
         </div>
     </div>
 </template>

+ 1 - 1
src/pagesNews/Detail.vue

@@ -16,7 +16,7 @@
             :title="isActivity ? $t('huo-dong-xiang-qing') : $t('xin-wen-xiang-qing')"
             :barTop="260"
         ></custom-bar>
-        <banner :banners="banners" fixed :height="260" :radius="0"></banner>
+        <banner :banners="banners" fixed :height="267" :radius="0"></banner>
 
         <div class="main" id="main">
             <!-- <h2>{{ info.title }}</h2> -->

+ 5 - 0
src/pagesNews/News.vue

@@ -12,6 +12,7 @@
     <div>
         <custom-bar :pre="0" :title="title" :barTop="140"></custom-bar>
         <banner :banners="banners" fixed :height="140" :radius="0"></banner>
+        <scroll-view class="scroll-height"></scroll-view>
         <div class="main" id="main">
             <van-sticky :offset-top="barHeight" :z-index="100" :container="main">
                 <div class="tab-content">
@@ -156,6 +157,10 @@ export default {
         margin-top: 16px;
     }
 }
+
+.scroll-height {
+    height: calc(100vh- 44px);
+}
 </style>
 <style lang="less">
 .tab-content {

+ 1 - 2
src/utils/appState.js

@@ -51,8 +51,7 @@ const InformationType = new Map([
     [
         'INDUSTRY_NEWS',
         {
-            name: 'hang-ye-xin-wen',
-            type: 'bigImg'
+            name: 'hang-ye-xin-wen'
         }
     ],
     [