| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288 |
- <template>
- <div class="news-tab-box">
- <div class="news-first-box">
- <div class="news-first">
- <div class="news-first-left">
- <img
- :src="indexFirstNewsList.articleImg.articleImgSrc"
- :alt="indexFirstNewsList.articleImg.articleImgAlt"
- >
- </div>
- <div class="news-first-right">
- <div class="news-first-right-title-box">
- <div class="news-first-title">
- <nuxt-link
- target="_blank"
- :to="{name:'news-newsView-id',params:{id:indexFirstNewsList.articleId},query: {category: indexFirstNewsList.articleCategoryId}}"
- >
- <b>{{indexFirstNewsList.articleName}}</b>
- </nuxt-link>
- </div>
- <div class="news-first-times">
- <p>{{indexFirstNewsList.articleAddTime}}</p>
- </div>
- </div>
- <div class="news-first-intro">{{getTxt(indexFirstNewsList.articleText)}}</div>
- <div class="news-first-more">
- <nuxt-link
- target="_blank"
- :to="{name:'news-category',params:{category: indexFirstNewsList.articleCategoryId}}"
- >了解更多 ></nuxt-link>
- </div>
- </div>
- </div>
- </div>
- <div class="news-list">
- <ul>
- <li v-for="(item,index) in indexNewsList" :key="index">
- <div class="news-list-title">
- <nuxt-link
- target="_blank"
- :to="{name:'news-newsView-id',params:{id:item.articleId},query: {category: item.articleCategoryId}}"
- >
- <b>{{item.articleName}}</b>
- </nuxt-link>
- </div>
- <div class="news-list-times">
- <p>{{getTime(item.articleAddTime)}}</p>
- </div>
- </li>
- </ul>
- </div>
- </div>
- </template>
- <script>
- export default {
- name: "indexNewsListShow",
- props: {
- indexFirstNewsList: Object,
- indexNewsList: Array,
- },
- methods: {
- getTxt(str) {
- var txt = str
- .replace(/<\/?.+?>/g, "")
- .replace(/(^\s+)|(\s+$)/g, "")
- .replace(/\s/g, "");
- txt = txt.length < 150 ? txt : txt.substring(0, 150).concat("...");
- return txt;
- },
- getTime(time) {
- var time = time.slice(5, 10);
- return time;
- },
- },
- };
- </script>
- <style scoped>
- .news-tab-box {
- width: 100%;
- height: auto;
- }
- .news-tab-content .news-tab-box:first-child {
- display: block;
- }
- .news-first {
- overflow: hidden;
- width: 100%;
- height: 398px;
- padding-bottom: 90px;
- box-sizing: border-box;
- }
- .news-first-left {
- float: left;
- overflow: hidden;
- width: 422px;
- height: 308px;
- }
- .news-first-right {
- float: right;
- overflow: hidden;
- width: 737px;
- height: auto;
- }
- .news-first-left img {
- width: 100%;
- height: 100%;
- }
- .news-first-right-title-box {
- overflow: hidden;
- width: 100%;
- height: auto;
- padding-bottom: 30px;
- border-bottom: 2px solid #eaeaeb;
- }
- .news-first-title {
- float: left;
- overflow: hidden;
- max-width: 645px;
- height: 50px;
- font-size: 20px;
- font-weight: bold;
- line-height: 50px;
- text-align: left;
- }
- .news-first-times {
- float: right;
- overflow: hidden;
- width: 92px;
- height: 50px;
- color: #858585;
- font-size: 14px;
- line-height: 50px;
- text-align: center;
- }
- .news-first-title a {
- display: block;
- overflow: hidden;
- width: 100%;
- height: 100%;
- color: #22202b;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .news-tab-box b {
- overflow: hidden;
- display: block;
- width: 100%;
- height: 100%;
- font-weight: normal;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .news-first-intro {
- overflow: hidden;
- width: 100%;
- height: 152px;
- padding: 50px 0 40px;
- border-bottom: 2px solid #eaeaeb;
- box-sizing: border-box;
- color: #858585;
- font-size: 14px;
- line-height: 20px;
- text-align: left;
- }
- .news-first-more {
- float: right;
- overflow: hidden;
- width: 163px;
- height: 40px;
- margin: 28px auto 0;
- border: 3px solid #000;
- font-size: 14px;
- line-height: 40px;
- text-align: center;
- -webkit-transition: all 0.5s ease;
- -o-transition: all 0.5s ease;
- transition: all 0.5s ease;
- }
- .news-first-more:hover {
- -webkit-transform: translateY(-5px);
- -ms-transform: translateY(-5px);
- -o-transform: translateY(-5px);
- transform: translateY(-5px);
- }
- .news-first-more a {
- display: block;
- width: 100%;
- height: 100%;
- color: #22202b;
- font-weight: bold;
- -webkit-transition: all 0.5s ease;
- -o-transition: all 0.5s ease;
- transition: all 0.5s ease;
- }
- .news-first-more:hover a {
- background: #22202b;
- color: #feeabd;
- }
- .news-list {
- overflow: hidden;
- width: 100%;
- height: auto;
- }
- .news-list ul {
- overflow: hidden;
- width: 100%;
- }
- .news-list ul li {
- position: relative;
- float: left;
- overflow: hidden;
- width: 400px;
- height: 26px;
- color: #999;
- font-size: 14px;
- line-height: 26px;
- text-align: left;
- }
- .news-list ul li::after {
- position: absolute;
- top: 50%;
- left: 0;
- content: "";
- width: 2px;
- height: 2px;
- border-radius: 50%;
- background: #999;
- }
- .news-list-title {
- float: left;
- overflow: hidden;
- max-width: 300px;
- height: 100%;
- padding-left: 6px;
- box-sizing: border-box;
- }
- .news-list-title a {
- display: block;
- overflow: hidden;
- width: 100%;
- height: 100%;
- color: #999;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .news-list-times {
- float: right;
- width: 90px;
- height: 26px;
- padding-left: 10px;
- box-sizing: border-box;
- }
- .news-list-times p {
- overflow: hidden;
- width: 100%;
- height: 100%;
- }
- .news-list ul li:hover,
- .news-list ul li:hover a {
- color: #000;
- }
- </style>
|