cc0011 4 dienas atpakaļ
vecāks
revīzija
580b8e9191

BIN
src/assets/1.png


BIN
src/assets/2.png


BIN
src/assets/221.png


BIN
src/assets/222.png


BIN
src/assets/223.png


BIN
src/assets/224.png


BIN
src/assets/225.png


BIN
src/assets/226.png


BIN
src/assets/227.png


BIN
src/assets/228.png


BIN
src/assets/3.png


BIN
src/assets/4.png


BIN
src/assets/5.png


+ 3 - 3
src/views/Profile.vue

@@ -114,15 +114,15 @@
           <span>资金明细</span>
         </div>
         <div class="function-item button-click-effect" @click="$router.push('/asset-center')">
-          <img src="@/assets/225.png" alt="股权管理" />
+          <img src="@/assets/226.png" alt="股权管理" />
           <span>股权管理</span>
         </div>
         <div class="function-item button-click-effect" @click="$router.push('/retirement-subsidy')">
-          <img src="@/assets/225.png" alt="退休补贴" />
+          <img src="@/assets/227.png" alt="退休补贴" />
           <span>退休补贴</span>
         </div>
         <div class="function-item button-click-effect" @click="$router.push('/order-management')">
-          <img src="@/assets/225.png" alt="订单管理" />
+          <img src="@/assets/228.png" alt="订单管理" />
           <span>订单管理</span>
         </div>
         <!-- <div class="function-item button-click-effect" @click="$router.push('/lever-list')">

+ 43 - 12
src/views/cultureDetail.vue

@@ -7,10 +7,14 @@
       <div class="title">央企文化</div>
     </div>
     <div class="content">
-        <div class="title">{{newsDetail.title}}</div>
+      <div class="title">{{newsDetail.title}}</div>
+      <template v-if="processedContent.type === 'iframe'">
+        <iframe :src="processedContent.url" frameborder="0" class="content-iframe"></iframe>
+      </template>
+      <template v-else>
         <div class="content" v-html="newsDetail.content"></div>
+      </template>
     </div>
-
   </div>
 </template>
 
@@ -23,21 +27,41 @@ export default {
       newsDetail: {}
     }
   },
+  computed: {
+    processedContent() {
+      if (!this.newsDetail.content) return { type: 'content', content: '' };
+      
+      // 尝试从content中提取URL
+      const urlMatch = this.newsDetail.content.match(/https?:\/\/[^\s<>"']+/g);
+      
+      if (urlMatch && (urlMatch[0].includes('.html') || urlMatch[0].includes('.com'))) {
+        // 如果找到URL并且是HTML页面或.com网站,使用iframe展示
+        return {
+          type: 'iframe',
+          url: urlMatch[0]
+        };
+      } else {
+        // 否则保持原有的content展示方式
+        return {
+          type: 'content',
+          content: this.newsDetail.content
+        };
+      }
+    }
+  },
   methods: {
     goBack() {
       this.$router.go(-1)
     },
     async getNewsDetail() {
-        const formData = new FormData();
-        formData.append('id', 8)
-        const res = await getNewsDetail(formData)
-        this.newsDetail = res.data
+      const formData = new FormData();
+      formData.append('id', 8)
+      const res = await getNewsDetail(formData)
+      this.newsDetail = res.data
     }
   },
   mounted() {
     this.getNewsDetail()
-    console.log(this.newsDetail);
-
   }
 }
 </script>
@@ -60,7 +84,7 @@ export default {
       position: absolute;
       left: 15px;
       font-size: 20px;
-      img{
+      img {
         width: 20px;
         height: 20px;
       }
@@ -72,18 +96,25 @@ export default {
     }
   }
 
-  .content{
+  .content {
     padding: 10px;
-    .title{
+    .title {
       margin-bottom: 10px;
       text-align: center;
       font-size: 18px;
       font-weight: 500;
     }
-    .content{
+    .content {
       font-size: 16px;
       line-height: 24px;
     }
+    .content-iframe {
+      width: 100%;
+      height: calc(100vh - 120px); // 减去header和padding的高度
+      border: none;
+      border-radius: 4px;
+      background: #fff;
+    }
   }
 }
 </style> 

+ 68 - 12
src/views/home/index.vue

@@ -14,9 +14,9 @@
       <div class="kefu">
         <img src="@/assets/kefu.jpg" alt="客服" />
       </div>
-      <div class="row">
-        <button class="btn" @click="toAppDownload">
-          <img src="@/assets/3.png" alt="APP下载" class="btn-icon" />
+      <div class="row" >
+        <button class="btn" @click="toAppDownload" style="padding:0 6px;">
+          <img src="@/assets/3.png" alt="APP下载" class="btn-icon" style="width: 22px; height: 22px;" />
           <span>APP下载</span>
         </button>
         <button class="btn" @click="toCultureDetail">
@@ -29,13 +29,13 @@
       <van-swipe
         :autoplay="3000"
         indicator-color="#ed4b39"
-        style="width: 100%; height: 100px; border-radius: 8px; overflow: hidden;"
+        style="width: 100%; height: 200px; border-radius: 8px; overflow: hidden;"
       >
         <van-swipe-item v-for="(banner, index) in banners" :key="index">
           <img
             :src="banner"
             alt="轮播图"
-            style="width: 100%; height: 100px; object-fit: cover;"
+            style="width: 100%; height: 200px; object-fit: cover;"
           />
         </van-swipe-item>
       </van-swipe>
@@ -67,10 +67,16 @@
     <div class="news-list">
       <div
         class="news_content"
-        v-for="(news, index) in newsList"
+        v-for="(news, index) in processedNewsList"
         :key="index"
-        v-html="news.content"
-      ></div>
+      >
+        <template v-if="news.type === 'iframe'">
+          <iframe :src="news.url" frameborder="0" class="news-iframe"></iframe>
+        </template>
+        <template v-else>
+          <div v-html="news.content" @click="handleNewsClick($event)"></div>
+        </template>
+      </div>
     </div>
     <van-dialog
       v-model="showAuthDialog"
@@ -138,6 +144,28 @@ export default {
     this.getUserInfo();
     this.getNewsDetail()
   },
+  computed: {
+    processedNewsList() {
+      return this.newsList.map(news => {
+        // 尝试从content中提取URL
+        const urlMatch = news.content.match(/https?:\/\/[^\s<>"']+/g);
+        
+        if (urlMatch && (urlMatch[0].includes('.html') || urlMatch[0].includes('.com'))) {
+          // 如果找到URL并且是HTML页面或.com网站,使用iframe展示
+          return {
+            type: 'iframe',
+            url: urlMatch[0]
+          };
+        } else {
+          // 否则保持原有的content展示方式
+          return {
+            type: 'content',
+            content: news.content
+          };
+        }
+      });
+    }
+  },
   methods: {
     async getUserInfo() {
       const res = await getUserInfo();
@@ -152,9 +180,9 @@ export default {
       const res = await getBanners(formData);
       this.banners = res.data
     },
-     async getNewsDetail() {
-        const res = await getNews()
-        this.newsList = res.data
+    async getNewsDetail() {
+      const res = await getNews();
+      this.newsList = res.data;
     },
     toOfficialGroup() {
       window.open(this.userInfo.link[2].value, '_blank');
@@ -174,6 +202,15 @@ export default {
     toAuth() {
       this.$router.push('/user-center');
       this.showAuthDialog = false;
+    },
+    handleNewsClick(event) {
+      const link = event.target.closest('a');
+      if (link) {
+        event.preventDefault();
+        if (link.href) {
+          window.open(link.href, '_blank');
+        }
+      }
     }
   }
 };
@@ -212,10 +249,12 @@ export default {
     background: #fff;
     border: 2px solid #fff;
     width: 24%;
+    border-radius: 50%;
     img {
       width: 100%;
       height: 100%;
       object-fit: cover;
+      border-radius: 50%;
     }
   }
 
@@ -258,7 +297,7 @@ export default {
   width: 100%;
   max-width: 500px;
   margin: 0 auto 16px auto;
-  height: 100px;
+  height: 200px;
   background: #fff;
   border-radius: 8px;
   display: flex;
@@ -362,6 +401,13 @@ export default {
     margin-bottom: 20px;
   }
 
+  .news-iframe {
+    width: 100%;
+    height: 500px;
+    border: none;
+    border-radius: 4px;
+  }
+
   :deep(p) {
     margin: 0;
     padding: 0;
@@ -399,6 +445,16 @@ export default {
     max-width: 100%;
     word-break: break-word;
   }
+
+  :deep(a) {
+    color: #1890ff;
+    text-decoration: none;
+    cursor: pointer;
+    
+    &:hover {
+      text-decoration: underline;
+    }
+  }
 }
 
 .close-icon-wrapper {