From ece9b6bba5a44a06041a8ad4d5f5ac1f14560d3e Mon Sep 17 00:00:00 2001 From: 明梦爽 <2972214568@qq.com> Date: 星期二, 09 八月 2022 09:42:12 +0800 Subject: [PATCH] 完善Readme --- src/views/work.vue | 74 ++++++++++++++++++++++++------------- 1 files changed, 48 insertions(+), 26 deletions(-) diff --git a/src/views/work.vue b/src/views/work.vue index 2170abd..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"> - <span>宸ヤ綔鍔ㄦ��</span> - <span @click="goMore('宸ヤ綔鐘舵��')">鏇村<i class="el-icon-d-arrow-right"></i> </span> + <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"> - <div @click="toWorkMsg(item.title)"> {{ item.title }} </div> + <li :key="index" v-for="(item, index) in workList" class="liPointer"> + <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