|
|
@@ -1,17 +1,252 @@
|
|
|
<template>
|
|
|
<div class="home">
|
|
|
- <el-button type="primary" size="default">255</el-button>
|
|
|
+ <div class="center-content">
|
|
|
+ <div class="news">
|
|
|
+ <div class="carousel news-item" @mouseover="autoplay = false" @mouseout="autoplay = true">
|
|
|
+ <el-carousel
|
|
|
+ :autoplay="autoplay"
|
|
|
+ ref="carousel"
|
|
|
+ height="360px"
|
|
|
+ arrow="never"
|
|
|
+ trigger="hover"
|
|
|
+ @change="changeCarousl"
|
|
|
+ >
|
|
|
+ <el-carousel-item v-for="item in 4" :key="item">
|
|
|
+ <h3 class="small">{{ item }}</h3>
|
|
|
+ </el-carousel-item>
|
|
|
+ </el-carousel>
|
|
|
+
|
|
|
+ <div class="indicators">
|
|
|
+ <span
|
|
|
+ v-for="(item, index) in 4"
|
|
|
+ @mouseover="changeIndex(index)"
|
|
|
+ :key="item"
|
|
|
+ :class="{ active: activeIndex === index }"
|
|
|
+ >{{ item }}</span
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="tab news-item">
|
|
|
+ <el-link :underline="false" class="more">
|
|
|
+ 更多<i class="el-icon-view el-icon-arrow-right"></i>
|
|
|
+ </el-link>
|
|
|
+ <el-tabs v-model="activeName">
|
|
|
+ <el-tab-pane label="行业动态" name="first"></el-tab-pane>
|
|
|
+ <el-tab-pane label="新闻资讯" name="second"></el-tab-pane>
|
|
|
+ <el-tab-pane label="通知公告" name="third"></el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+
|
|
|
+ <div class="news-list">
|
|
|
+ <router-link v-for="i in 20" :key="i" :to="{ name: 'newsDetail' }" class="news-link">
|
|
|
+ <span class="text1">习近平在江西考察并主持召开推动中部地区崛起工作座谈会</span>
|
|
|
+ <span class="text2">05.23</span>
|
|
|
+ </router-link>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <divider-title>
|
|
|
+ <template #prim>运营</template>
|
|
|
+ <template #sub>Hot products</template>
|
|
|
+ </divider-title>
|
|
|
+
|
|
|
+ <div class="hot">
|
|
|
+ <div class="hto-btn">
|
|
|
+ <div class="btn-item">
|
|
|
+ <el-button icon="el-icon-edit" type="primary">供给发布</el-button>
|
|
|
+ <el-button icon="el-icon-edit" type="primary">需求发布</el-button>
|
|
|
+ </div>
|
|
|
+ <div class="btn-item">
|
|
|
+ <el-button type="primary">
|
|
|
+ <i class="iconfont iconfont-nav_icon_xiaoxi1"></i>
|
|
|
+ 咨询客服
|
|
|
+ </el-button>
|
|
|
+ <el-button icon="el-icon-s-comment" type="primary">提交留言</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="products">
|
|
|
+ <hot-product v-for="i in 6" :key="i"></hot-product>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import DividerTitle from '../components/DividerTitle.vue';
|
|
|
+import HotProduct from '../components/HotProduct.vue';
|
|
|
export default {
|
|
|
- name: 'Home'
|
|
|
+ components: { DividerTitle, HotProduct },
|
|
|
+ name: 'Home',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ activeIndex: 0,
|
|
|
+ autoplay: true,
|
|
|
+ activeName: 'first'
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ changeCarousl() {
|
|
|
+ this.activeIndex = this.$refs.carousel.activeIndex;
|
|
|
+ },
|
|
|
+ changeIndex(index) {
|
|
|
+ this.$refs.carousel.setActiveItem(index);
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
.home {
|
|
|
background-color: #fff;
|
|
|
+ padding: 80px 0;
|
|
|
+}
|
|
|
+
|
|
|
+.news {
|
|
|
+ .flex();
|
|
|
+ justify-content: space-between;
|
|
|
+ .carousel {
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-carousel__item {
|
|
|
+ background-color: #99a9bf;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-carousel__indicators {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .indicators {
|
|
|
+ position: absolute;
|
|
|
+ right: 12px;
|
|
|
+ bottom: 12px;
|
|
|
+ z-index: 2;
|
|
|
+ span {
|
|
|
+ width: 22px;
|
|
|
+ height: 22px;
|
|
|
+ background: rgba(0, 0, 0, 0.46);
|
|
|
+ text-align: center;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #ffffff;
|
|
|
+ line-height: 22px;
|
|
|
+ display: inline-block;
|
|
|
+ cursor: pointer;
|
|
|
+
|
|
|
+ &.active {
|
|
|
+ background-color: @danger;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.news-item {
|
|
|
+ width: calc(50% - 10px);
|
|
|
+}
|
|
|
+
|
|
|
+.tab {
|
|
|
+ height: 360px;
|
|
|
+ background: #ffffff;
|
|
|
+ box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.1);
|
|
|
+ padding: 16px 16px 10px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ position: relative;
|
|
|
+ .flex-col();
|
|
|
+ overflow: hidden;
|
|
|
+
|
|
|
+ /deep/.el-tabs__nav-wrap {
|
|
|
+ &::after {
|
|
|
+ height: 1px;
|
|
|
+ background-color: @bg;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-tabs__active-bar {
|
|
|
+ height: 1px;
|
|
|
+ }
|
|
|
+ .el-tabs__item {
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/.el-tabs__header {
|
|
|
+ margin: 0 0 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .more {
|
|
|
+ position: absolute;
|
|
|
+ right: 16px;
|
|
|
+ top: 26px;
|
|
|
+ z-index: 20;
|
|
|
+ }
|
|
|
+}
|
|
|
+.news-list {
|
|
|
+ flex-grow: 1;
|
|
|
+ overflow: auto;
|
|
|
+ padding: 25px 5px 15px;
|
|
|
+ .news-link {
|
|
|
+ text-decoration: none;
|
|
|
+ .flex();
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 20px;
|
|
|
+
|
|
|
+ .text1 {
|
|
|
+ color: #000;
|
|
|
+ flex-grow: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ .text2 {
|
|
|
+ color: @info;
|
|
|
+ }
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ .text1 {
|
|
|
+ color: @prim;
|
|
|
+ }
|
|
|
+
|
|
|
+ .text2 {
|
|
|
+ color: fade(@prim, 60%);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .news-link + .news-link {
|
|
|
+ margin-top: 25px;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.hto-btn {
|
|
|
+ .flex();
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .el-button {
|
|
|
+ border-radius: 0;
|
|
|
+ font-size: 12px;
|
|
|
+
|
|
|
+ /deep/ i {
|
|
|
+ font-size: 22px;
|
|
|
+ line-height: 42px;
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: middle;
|
|
|
+ }
|
|
|
+ line-height: 42px;
|
|
|
+ padding: 0 20px;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.products {
|
|
|
+ .flex();
|
|
|
+ flex-wrap: wrap;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 50px 0;
|
|
|
+
|
|
|
+ .hot-product {
|
|
|
+ width: 31%;
|
|
|
+
|
|
|
+ &:nth-child(n + 4) {
|
|
|
+ margin-top: 30px;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|