陈鹏铭 10 kuukautta sitten
vanhempi
commit
0b0faecae4
2 muutettua tiedostoa jossa 89 lisäystä ja 86 poistoa
  1. 31 30
      src/pages/citySafeNotic/detail.vue
  2. 58 56
      src/pages/citySafeNotic/index.vue

+ 31 - 30
src/pages/citySafeNotic/detail.vue

@@ -3,7 +3,7 @@
     <div class="title">{{ detail.title }}</div>
     <div class="time">
       <van-icon name="underway-o" />
-      <div>发布日期:{{ detail.noticeTime }}</div>
+      <div>发布日期:{{ $common.transBaseDateTime(detail.createTime) }}</div>
     </div>
     <div class="text" v-html="detail.content"></div>
     <div class="fj">
@@ -16,37 +16,38 @@
 </template>
 
 <script>
-import { getNoticeById } from "@/service/api_company.js";
+import { getNoticeById } from '@/service/api_company.js'
 export default {
-  data() {
-    return {
-      detail: {},
-      annex: [],
-      search: {
-        pageNum: "1",
-        createdBy: "smx_h5_userId",
-        pageSize: "10",
-      },
-    };
-  },
-  mounted() {
-    this.getNoticeById();
-  },
-  methods: {
-    openFiled(url) {
-      window.open(url);
+    data() {
+        return {
+            detail: {},
+            annex: [],
+            search: {
+                pageNum: '1',
+                createdBy: 'smx_h5_userId',
+                pageSize: '10'
+            }
+        }
     },
-    async getNoticeById() {
-      let { data } = await getNoticeById({
-        id: this.$route.query.id,
-        createdBy: "smx_h5_userId",
-      });
-      this.detail = data;
-      this.annex = JSON.parse(data.annex);
-      console.log(JSON.parse(data.annex));
+    mounted() {
+        this.getNoticeById()
     },
-  },
-};
+    methods: {
+        openFiled(url) {
+            location.href = url
+            // window.open(url, "_blank");
+        },
+        async getNoticeById() {
+            const { data } = await getNoticeById({
+                id: this.$route.query.id,
+                createdBy: 'smx_h5_userId'
+            })
+            this.detail = data
+            this.annex = JSON.parse(data.annex)
+            console.log(JSON.parse(data.annex))
+        }
+    }
+}
 </script>
 
 <style lang="scss">
@@ -81,4 +82,4 @@ export default {
     color: rgba(31, 106, 255, 1);
   }
 }
-</style>
+</style>

+ 58 - 56
src/pages/citySafeNotic/index.vue

@@ -25,7 +25,9 @@
             {{ item.title }}
           </div>
           <div class="flex6 response flex justify-between">
-            <div class="text7">提交时间:{{ item.noticeTime }}</div>
+            <div class="text7">
+              提交时间:{{ $common.transBaseDateTime(item.createTime) }}
+            </div>
             <div class="text8" v-if="item.isRead == 1">已阅</div>
             <div class="text8" v-else style="color: rgba(226, 81, 0, 1)">
               待阅
@@ -39,64 +41,64 @@
   </div>
 </template>
 <script>
-import { listForApp } from "@/service/api_company.js";
+import { listForApp } from '@/service/api_company.js'
 export default {
-  data() {
-    return {
-      active: "",
-      isUpLoading: false,
-      isDownLoading: false,
-      upFinished: false,
-      noticList: [],
-      search: {
-        pageNum: 1,
-        pageSize: "10",
-        createdBy: "smx_h5_userId",
-      },
-    };
-  },
-  mounted() {
-    this.getList();
-  },
-  methods: {
-    getTabs(e) {
-      console.log(e);
-      this.search.isRead = e == "全部" ? "" : e;
-      this.search.pageNum = 1;
-      this.isUpLoading = false;
-      this.isDownLoading = false;
-      this.upFinished = false;
-      this.noticList = [];
-      this.getList();
-    },
-    toDetail(id) {
-      this.$router.push("/citySafeNoticDetail?id=" + id);
-    },
-    async getList() {
-      listForApp(this.search).then((res) => {
-        if (res.data.rows.length) {
-          if (this.noticList.length >= res.data.total) {
-            this.upFinished = true;
-          } else {
-            this.isDownLoading = false;
-            this.noticList.push(...res.data.rows);
-            this.isUpLoading = false;
-          }
-        } else {
-          this.noticList = [];
-          this.isDownLoading = false;
-          this.isUpLoading = false;
-          this.upFinished = true;
+    data() {
+        return {
+            active: '',
+            isUpLoading: false,
+            isDownLoading: false,
+            upFinished: false,
+            noticList: [],
+            search: {
+                pageNum: 1,
+                pageSize: '10',
+                createdBy: 'smx_h5_userId'
+            }
         }
-      });
     },
-    onLoadList() {
-      this.search.pageNum++;
-      this.isDownLoading = false;
-      this.getList();
+    mounted() {
+        this.getList()
     },
-  },
-};
+    methods: {
+        getTabs(e) {
+            console.log(e)
+            this.search.isRead = e == '全部' ? '' : e
+            this.search.pageNum = 1
+            this.isUpLoading = false
+            this.isDownLoading = false
+            this.upFinished = false
+            this.noticList = []
+            this.getList()
+        },
+        toDetail(id) {
+            this.$router.push('/citySafeNoticDetail?id=' + id)
+        },
+        async getList() {
+            listForApp(this.search).then((res) => {
+                if (res.data.rows.length) {
+                    if (this.noticList.length >= res.data.total) {
+                        this.upFinished = true
+                    } else {
+                        this.isDownLoading = false
+                        this.noticList.push(...res.data.rows)
+                        this.isUpLoading = false
+                    }
+                } else {
+                    this.noticList = []
+                    this.isDownLoading = false
+                    this.isUpLoading = false
+                    this.upFinished = true
+                }
+            })
+        },
+        onLoadList() {
+            this.search.pageNum++
+            this.isDownLoading = false
+            this.getList()
+        }
+    }
+}
 </script>
 
 <style lang="scss">
@@ -157,4 +159,4 @@ export default {
 .text8 {
   color: rgba(45, 140, 240, 1);
 }
-</style>
+</style>