| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281 |
- <template>
- <div class="bg-F5">
- <div class="container">
- <div class="infoTabDiv">
- <el-tabs v-model="activeName" @tab-click="tabChange">
- <el-tab-pane label="通知公告" name="first">
- <div class="listDiv">
- <ul class="listUl">
- <li v-for="item in tzggArr" :key="item.noticeId">
- <div class="dateDiv">
- <div class="day">{{ item.createDay }}</div>
- <div>{{ item.createMonth }}</div>
- </div>
- <router-link class="conDiv" :to="`/home`">
- <div class="tit">{{ item.noticeTitle }}</div>
- <div class="detail">
- <div v-html="item.noticeContent"></div>
- <span class="xq"
- >详情<i class="el-icon-d-arrow-right"></i
- ></span>
- </div>
- </router-link>
- </li>
- </ul>
- </div>
- </el-tab-pane>
- <el-tab-pane label="行业资讯" name="second">
- <div class="listDiv">
- <ul class="listUl">
- <li v-for="item in hyzxArr" :key="item.noticeId">
- <div class="dateDiv">
- <div class="day">{{ item.createDay }}</div>
- <div>{{ item.createMonth }}</div>
- </div>
- <router-link class="conDiv" :to="`/home`">
- <div class="tit">{{ item.noticeTitle }}</div>
- <div class="detail">
- <div v-html="item.noticeContent"></div>
- <span class="xq"
- >详情<i class="el-icon-d-arrow-right"></i
- ></span>
- </div>
- </router-link>
- </li>
- </ul>
- </div>
- </el-tab-pane>
- <el-tab-pane label="家具保养" name="third">
- <div class="listDiv">
- <ul class="listUl">
- <li v-for="item in jjbyArr" :key="item.noticeId">
- <div class="dateDiv">
- <div class="day">{{ item.createDay }}</div>
- <div>{{ item.createMonth }}</div>
- </div>
- <router-link
- class="conDiv"
- :to="`/news/newsDetail?noticeId=${item.noticeId}`"
- >
- <div class="tit">{{ item.noticeTitle }}</div>
- <div class="detail">
- <div v-html="item.noticeContent"></div>
- <span class="xq"
- >详情<i class="el-icon-d-arrow-right"></i
- ></span>
- </div>
- </router-link>
- </li>
- </ul>
- </div>
- </el-tab-pane>
- </el-tabs>
- </div>
- <el-pagination
- class="pageDiv"
- background
- @current-change="handleCurrentChange"
- :page-size="pageSize"
- :current-page="currentPage"
- layout="prev, pager, next,total, jumper"
- :total="total"
- ></el-pagination>
- </div>
- </div>
- </template>
- <script lang="ts">
- import { Component, Vue, Watch } from "vue-property-decorator";
- export default {
- name: "app",
- components: {},
- data() {
- return {
- activeName: "first",
- tzggArr: [],
- hyzxArr: [],
- jjbyArr: [],
- currentPage: 1,
- pageSize: 10,
- total: 0
- };
- },
- methods: {
- tabChange() {
- var that = this;
- that.currentPage = 1;
- if (that.activeName == "first") {
- that.listAll(1);
- } else if (that.activeName == "second") {
- that.listAll(2);
- } else if (that.activeName == "third") {
- that.listAll(3);
- }
- },
- handleCurrentChange(val) {
- this.currentPage = val;
- if (that.activeName == "first") {
- that.listAll(1);
- } else if (that.activeName == "second") {
- that.listAll(2);
- } else {
- that.listAll(3);
- }
- },
- listAll(noticeType) {
- var that = this;
- that
- .$post("interface/notice/getNoticeListAll", {
- pageNum: that.currentPage1,
- pageSize: that.pageSize1,
- noticeType: noticeType
- })
- .then(function(res) {
- console.log(res);
- if (!res[0]) {
- res[1].rows.forEach(function(item, index) {
- let date = [];
- let dateTime = [];
- if (item.createTime) {
- dateTime = item.createTime.split(" ");
- date = dateTime[0].split("-");
- item.createDay = date[2];
- item.createMonth = date[0] + "-" + date[1];
- }
- });
- that.total = res[1].total;
- if (noticeType == 1) {
- that.tzggArr = res[1].rows;
- } else if (noticeType == 2) {
- that.hyzxArr = res[1].rows;
- } else {
- that.jjbyArr = res[1].rows;
- }
- }
- });
- }
- },
- activated() {
- if (this.$route.query.active) {
- this.activeName = this.$route.query.active;
- this.tabChange();
- }
- },
- mounted() {
- this.listAll(1);
- this.listAll(2);
- this.listAll(3);
- }
- };
- </script>
- <style scoped lang="scss">
- .listDiv {
- width: 100%;
- padding-left: 4rem;
- box-sizing: border-box;
- }
- .listUl {
- list-style: none;
- width: 100%;
- border-left: 0.1rem solid #e5e5e5;
- }
- .listUl li {
- width: 100%;
- min-height: 7rem;
- position: relative;
- padding-left: 7rem;
- margin-top: 2rem;
- box-sizing: border-box;
- .dateDiv {
- height: 8rem;
- width: 8rem;
- color: #fff;
- text-align: center;
- background: #fd5522;
- border-radius: 0.5rem;
- position: absolute;
- left: -3.5rem;
- top: 0;
- > div {
- font-size: 1.6rem;
- height: 2.8rem;
- line-height: 2.8rem;
- }
- .day {
- height: 5rem;
- line-height: 5rem;
- font-size: 2.5em;
- font-weight: bolder;
- border-bottom: 0.1rem solid #fff;
- }
- }
- .conDiv {
- width: 100%;
- display: block;
- height: 100%;
- padding: 0 1rem;
- background: #fff;
- box-shadow: 2px 2px 12px #ddd;
- box-sizing: border-box;
- border-radius: 0.3rem;
- .tit {
- height: 3rem;
- line-height: 3rem;
- font-size: 1.6rem;
- font-weight: bolder;
- }
- .detail {
- height: 5rem;
- line-height: 1.6rem;
- div {
- height: 3.2rem;
- line-height: 1.6rem;
- font-size: 1.2rem;
- color: #666;
- word-break: break-all;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: normal;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .xq {
- color: #fd5522;
- margin-left: 1rem;
- }
- }
- }
- }
- .pageDiv {
- text-align: right;
- margin-top: 0.5rem;
- padding: 3rem 0;
- }
- </style>
- <style lang="scss">
- .infoTabDiv {
- .el-tabs__nav-scroll {
- padding: 0 1.6rem;
- box-sizing: border-box;
- }
- .el-tabs__item {
- height: 5rem;
- line-height: 5rem;
- }
- .el-tabs__item:hover {
- color: #fd5522;
- }
- .el-tabs__item.is-active {
- color: #fd5522;
- }
- .el-tabs__active-bar {
- background-color: #fd5522;
- }
- }
- </style>
|