Ver código fonte

新闻,政策,通知的详情跳转

gcz 2 anos atrás
pai
commit
1775e0a8c1

+ 13 - 1
src/api/NewsCenter/index.js

@@ -3,7 +3,7 @@
  * @Author: gcz
  * @Date: 2022-08-22 16:08:25
  * @LastEditors: gcz
- * @LastEditTime: 2022-08-22 17:41:07
+ * @LastEditTime: 2022-08-23 09:51:33
  * @FilePath: \veterans_client_web\src\api\NewsCenter\index.js
  * @Copyright: Copyright (c) 2016~2022 by gcz, All Rights Reserved. 
  */
@@ -35,3 +35,15 @@ export function getNoticeDetail(params) {
     }
   })
 }
+
+// 获取政策资讯内容
+export function getPolicyDetail(params) {
+  return request({
+    url: `/app//policy/article/door/info`,
+    method: 'get',
+    headers: {
+      noLoginFlag: true
+    },
+    params
+  })
+}

+ 7 - 4
src/views/Home/HomeIndex.vue

@@ -2,8 +2,8 @@
  * @Description: 首页
  * @Author: 空白格
  * @Date: 2022-08-10 11:26:40
- * @LastEditors: 空白格
- * @LastEditTime: 2022-08-22 15:19:59
+ * @LastEditors: gcz
+ * @LastEditTime: 2022-08-23 10:05:08
  * @FilePath: \veterans_client_web\src\views\Home\HomeIndex.vue
  * @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved.
 -->
@@ -64,6 +64,7 @@
                   <el-tab-pane label="新闻动态" name="first">
                     <ul class="news-infomation">
                       <li
+                        @click="jumpPage('newsdetails',{ id: item.artId,type:'news' })"
                         class="news-infomation-item"
                         v-for="(item, index) in newsList"
                         :key="index"
@@ -78,6 +79,7 @@
                   <el-tab-pane label="通知公告" name="second">
                     <ul class="news-infomation">
                       <li
+                        @click="jumpPage('noticedetails',{ id: item.id })"
                         class="news-infomation-item"
                         v-for="(item, index) in noticeList"
                         :key="index"
@@ -154,6 +156,7 @@
                           v-if="policyObj.policyList.length"
                         >
                           <div
+                          @click="jumpPage('newsdetails',{ id: item.artId,type:'policy' })"
                             class="hmpc-left-list-item"
                             v-for="(item, index) in policyObj.policyList"
                             :key="index"
@@ -417,9 +420,9 @@ export default {
      * @param {any} path
      * @returns {any}
      */
-    jumpPage(path) {
+    jumpPage(path,param) {
       if (path) {
-        this.$router.push(path);
+        this.$router.push({path:path,query:param});
       }
     },
     /**

+ 2 - 2
src/views/NewsCenter/NewsCenterIndex.vue

@@ -3,7 +3,7 @@
  * @Author: 空白格
  * @Date: 2022-08-22 10:20:21
  * @LastEditors: gcz
- * @LastEditTime: 2022-08-22 17:38:18
+ * @LastEditTime: 2022-08-23 09:25:17
  * @FilePath: \veterans_client_web\src\views\NewsCenter\NewsCenterIndex.vue
  * @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved.
 -->
@@ -176,7 +176,7 @@ export default {
       this.getNotice()
     },
     goNewsDetails(id){
-      this.$router.push({ path: 'newsdetails', query:{ id: id }});
+      this.$router.push({ path: 'newsdetails', query:{ id: id,type:'news' }});
     },
     goNoticeDetails(id){
       this.$router.push({ path: 'noticedetails', query:{ id: id }});

+ 17 - 1
src/views/NewsCenter/NewsDetails/NewsDetailsIndex.vue

@@ -3,7 +3,7 @@
  * @Author: 空白格
  * @Date: 2022-08-22 15:30:47
  * @LastEditors: gcz
- * @LastEditTime: 2022-08-22 17:32:47
+ * @LastEditTime: 2022-08-23 09:52:25
  * @FilePath: \veterans_client_web\src\views\NewsCenter\NewsDetails\NewsDetailsIndex.vue
  * @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved.
 -->
@@ -32,6 +32,7 @@
 <script>
 import BannerBreadcrumb from "@/components/BannerBreadcrumb";
 import {getNewsData} from "@/api/Home";
+import {getPolicyDetail} from "@/api/NewsCenter";
 export default{
   name:'Newsdetails',
   components: {
@@ -47,10 +48,25 @@ export default{
   },
   methods:{
     getNewsDetails() {
+      if(!this.$route.query.type){
+        this.$message('请传文章类别!')
+      }
+      let page = {
+        news: this.getNewsData,
+        policy: this.getPolicyData,
+      };
+      page[this.$route.query.type] && page[this.$route.query.type]();
+    },
+    getNewsData(){
       getNewsData({id:this.$route.query.id}).then((res) => {
         this.newsData = res.data
       });
     },
+    getPolicyData(){
+      getPolicyDetail({id:this.$route.query.id}).then((res) => {
+        this.newsData = res.data
+      });
+    },
   }
 }
 </script>

+ 14 - 3
src/views/PolicyAdvice/PolicyAdviceIndex.vue

@@ -2,8 +2,8 @@
  * @Description: 政策咨询
  * @Author: 空白格
  * @Date: 2022-08-11 09:15:53
- * @LastEditors: 空白格
- * @LastEditTime: 2022-08-12 08:58:41
+ * @LastEditors: gcz
+ * @LastEditTime: 2022-08-23 10:10:16
  * @FilePath: \veterans_client_web\src\views\PolicyAdvice\PolicyAdviceIndex.vue
  * @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved.
 -->
@@ -28,7 +28,7 @@
             :name="item.text"
           >
             <ul class="policy-list" v-loading="loading">
-              <li class="policy-list-item" v-for="(item, index) in policyList" :key="index">
+              <li class="policy-list-item" @click="jumpPage('newsdetails',{ id: item.artId,type:'policy' })" v-for="(item, index) in policyList" :key="index">
                 <div class="policy-list-title">{{ item.artTitle }}</div>
                 <div class="policy-list-icon">
                   <i class="el-icon-arrow-right"></i>
@@ -102,6 +102,17 @@ export default {
       this.queryParams.artCategoryId = tab.name;
       this.getPolicyList();
     },
+    /**
+     * 跳转到指定页面
+     * @date 2022-08-11
+     * @param {any} path
+     * @returns {any}
+     */
+    jumpPage(path,param) {
+      if (path) {
+        this.$router.push({path:path,query:param});
+      }
+    },
   },
 };
 </script>