<template>
    <div>
      <Header></Header>
<!--      <div class="notice-search">-->
<!--        <div class="notice">-->
<!--          最新公告：-->
<!--          <router-link to="/">湖北省某部三相分离设备采购项目（二次） 中标结果公告</router-link>-->
<!--       </div>-->
<!--      </div>-->
      <SlideNotice :imgNews="imgNews" :noticeList="noticeList"></SlideNotice>
      <BidWin :biddingList="biddingList" :winBidList="winBidList"></BidWin>
      <CorrectAbolish :correctionList="correctionList" :abandonedList="abandonedList"></CorrectAbolish>
      <SourcePolicies :sourceList="sourceList" :policiesList="policiesList"></SourcePolicies>
      <Footer></Footer>
    </div>
</template>

<script>
import Header from '@/assets/components/Header'
import Footer from '@/assets/components/Footer'
import SlideNotice from './components/SlideNotice'
import BidWin from './components/BidWin'
import SourcePolicies from './components/SourcePolicies'
import CorrectAbolish from './components/CorrectAbolish'
import axios from 'axios'
import url from '@/assets/public/url'
export default {
    name: 'Index',
    components: {
      Header,
      SlideNotice,
      BidWin,
      SourcePolicies,
      CorrectAbolish,
      Footer
    },
    data () {
        return {
          keyword: '',
          requestUrl: url.url,
          // 图文
          imgNews: [],
          // 通知公告
          noticeList: [],
          // 招标
          biddingList: [],
          // 中标
          winBidList: [],
          // 更正
          correctionList: [],
          // 废标
          abandonedList: [],
          // 单一来源
          sourceList: [],
          // 政策法规
          policiesList: []
        }
    },
    methods: {

      // 获取图文公告
      getImgNews: function () {
        var self = this
        var info = {
          page: 1,
          rows: 6,
          newsDirectoriesId: '1c6db3db-0ee5-4a6c-8e31-6b57c5d18de1'
        }
        axios.get(self.requestUrl + '/news/app/newscontent/listpagenewscontentrelease', {
          params: info
        }).then(function (res) {
          for (var i = 0; i < res.data.rows.length; i++) {
            res.data.rows[i].newsContentCoverList = res.data.rows[i].newsContentCoverList[0].contentCoverId
          }
          self.imgNews = res.data.rows
        })
      },
      // 获取通知公告
      getNotice: function () {
        var self = this
        var info = {
          page: 1,
          rows: 10,
          newsDirectoriesId: '96de5eea-97e6-433c-841d-f44e51c00bb6'
        }
        axios.get(self.requestUrl + '/news/app/newscontent/listpagenewscontentrelease', {
          params: info
        }).then(function (res) {
          self.noticeList = res.data.rows
        })
      },
      // 获取招标公告
      getBidding: function () {
        var self = this
        var info = {
          page: 1,
          rows: 10,
          newsDirectoriesId: '8a04b2dc-ec8a-4d4f-aa6c-e45f79a4894e'
        }
        axios.get(self.requestUrl + '/news/app/newscontent/listpagenewscontentrelease', {
          params: info
        }).then(function (res) {
          self.biddingList = res.data.rows
        })
      },
      // 获取中标公告
      getwinBid: function () {
        var self = this
        var info = {
          page: 1,
          rows: 10,
          newsDirectoriesId: '3bab7a91-a986-4292-a8c0-675d79bbc2eb'
        }
        axios.get(self.requestUrl + '/news/app/newscontent/listpagenewscontentrelease', {
          params: info
        }).then(function (res) {
          self.winBidList = res.data.rows
        })
      },
      // 获取更正公告
      getCorrection: function () {
        var self = this
        var info = {
          page: 1,
          rows: 10,
          newsDirectoriesId: 'e6797e37-1371-4140-8559-f5d9d5e9a5dc'
        }
        axios.get(self.requestUrl + '/news/app/newscontent/listpagenewscontentrelease', {
          params: info
        }).then(function (res) {
          self.correctionList = res.data.rows
        })
      },
      // 获取废标公告
      getAbandoned: function () {
        var self = this
        var info = {
          page: 1,
          rows: 10,
          newsDirectoriesId: '3509f3c0-025a-4383-bd9f-b2f13780c893'
        }
        axios.get(self.requestUrl + '/news/app/newscontent/listpagenewscontentrelease', {
          params: info
        }).then(function (res) {
          self.abandonedList = res.data.rows
        })
      },
      // 获取单一来源公示
      getSource: function () {
        var self = this
        var info = {
          page: 1,
          rows: 10,
          newsDirectoriesId: '80fa4fd9-7254-4df9-823b-40cdf4263f44'
        }
        axios.get(self.requestUrl + '/news/app/newscontent/listpagenewscontentrelease', {
          params: info
        }).then(function (res) {
          self.sourceList = res.data.rows
        })
      },
      // 获取政策法规
      getPolicies: function () {
        var self = this
        var info = {
          page: 1,
          rows: 10,
          newsDirectoriesId: '0d9f6316-5aec-471c-bc25-5c661f5aa363'
        }
        axios.get(self.requestUrl + '/news/app/newscontent/listpagenewscontentrelease', {
          params: info
        }).then(function (res) {
          self.policiesList = res.data.rows
        })
      },
    },
    mounted: function () {
      this.getImgNews()
      this.getNotice()
      this.getBidding()
      this.getwinBid()
      this.getCorrection()
      this.getAbandoned()
      this.getSource()
      this.getPolicies()
    }
}
</script>

<style lang="stylus" rel="stylesheet/stylus" scoped>
.notice-search
  width 1200px
  margin 20px auto
  padding 5px 20px
  background #ff4f01
  overflow hidden
  box-sizing border-box
  position relative
  &:after
    content ''
    display block
    background #2a5ca1
    width 5px
    height 16px
    position absolute
    top 50%
    left 0
    transform translate(0, -50%)
  .notice
    float left
    width 60%
    line-height 25px
    color #fff
    white-space nowrap
    overflow hidden
    text-overflow ellipsis
    font-size 14px
    a
      color #fff

</style>
