From 5d3f2aa7ccd9f761a6fd4224e7b49ceb6830abea Mon Sep 17 00:00:00 2001
From: 明梦爽 <2972214568@qq.com>
Date: 星期二, 09 八月 2022 10:02:51 +0800
Subject: [PATCH] 删除未用到的依赖

---
 src/views/work.vue |   68 ++++++++++++++++++++++-----------
 1 files changed, 45 insertions(+), 23 deletions(-)

diff --git a/src/views/work.vue b/src/views/work.vue
index e02715e..24096ba 100644
--- a/src/views/work.vue
+++ b/src/views/work.vue
@@ -1,47 +1,64 @@
 <template>
   <div>
-    <el-row type="flex" justify="space-between" class="underline">
+    <el-row type="flex" justify="space-between" class="underline row-bg">
       <span class="color"><b>宸ヤ綔鍔ㄦ��</b></span>
       <span @click="goMore('宸ヤ綔鐘舵��')" class="liPointer">鏇村<i class="el-icon-d-arrow-right"></i> </span>
     </el-row>
-    <div>
+    <div style="max-height:420px;overflow:hidden;">
       <ul>
         <li :key="index" v-for="(item, index) in workList" class="liPointer">
-          <div @click="toWorkMsg(item.title)"> {{ item.title }} </div>
+          <div @click="toWorkMsg(item.id)" class="bgc mart10">
+            {{ item.title }}
+          </div>
         </li>
       </ul>
     </div>
   </div>
 </template>
 <script>
+import { getNewsList } from '../api/api'
 export default {
-  name:'work',
-  data(){
-    return{
-      workList: [
-        { id:'1', title: '宸ヤ綔鐘舵��1' },
-        { id:'2', title: '宸ヤ綔鐘舵��2' },
-        { id:'3', title: '宸ヤ綔鐘舵��3' },
-        { id:'4', title: '宸ヤ綔鐘舵��4' },
-        { id:'5', title: '宸ヤ綔鐘舵��5' },
-        { id:'6', title: '宸ヤ綔鐘舵��6' },
-      ]
+  name: 'work',
+  data() {
+    return {
+      workList: []
     }
   },
-  methods:{
-    toWorkMsg(t) {
+  created() {
+    this.getnews()
+  },
+  methods: {
+    //鑾峰彇鏂伴椈鍒楄〃
+    getnews() {
+      const data = {
+        current: 1,
+        newsCategoryId: 43,
+        size: 6
+      }
+      getNewsList(data)
+        .then(res => {
+          console.log(res)
+          if (res.code == 200) {
+            this.workList = res.data.records
+          }
+        })
+        .catch(error => {
+          console.log(error)
+        })
+    },
+    toWorkMsg(id) {
       this.$router.push({
-        path:'/home/workMessage',
+        path: '/home/news',
         query: {
-          title:t
+          id: id
         }
       })
     },
     goMore(val) {
       this.$router.push({
-        path:'moreMessage',
-        query:{
-          type:val,
+        path: 'moreMessage',
+        query: {
+          type: val
         }
       })
     }
@@ -50,7 +67,7 @@
 </script>
 <style lang="less" scoped>
 .underline {
-  border-bottom: 1px solid rgb(0, 110, 215);
+  border-bottom: 1px solid rgb(1, 72, 153);
 }
 ul {
   padding-left: 0;
@@ -63,4 +80,9 @@
 a {
   text-decoration: none;
 }
-</style>
\ No newline at end of file
+.bgc {
+  background: rgb(241, 241, 241);
+  height: 55px;
+  line-height: 55px;
+}
+</style>

--
Gitblit v1.8.0