Browse Source

首页

master
我叫MT 1 year ago
parent
commit
5f66d04aa7
8 changed files with 46 additions and 47 deletions
  1. +2
    -2
      src/api/metadaily.js
  2. +5
    -1
      src/components/swiper/index.vue
  3. +1
    -1
      src/layouts/index.vue
  4. +2
    -1
      src/views/about/index.vue
  5. +5
    -2
      src/views/aigc/index.vue
  6. +2
    -2
      src/views/home/index.vue
  7. +27
    -36
      src/views/information/index.vue
  8. +2
    -2
      src/views/metadaily/index.vue

+ 2
- 2
src/api/metadaily.js View File

@@ -51,7 +51,7 @@ export const hotnews = (num = 1, size = 10) => {
export const zixun = (num = 1, size = 10, flag = 'XR') => { export const zixun = (num = 1, size = 10, flag = 'XR') => {
return request({ return request({
method: 'GET', method: 'GET',
url: `/news/list?pageNum=${num}&pageSize=${size}&type=3&subType=31&tag=${flag}`
url: `/news/list?pageNum=${num}&pageSize=4&type=3&subType=31&tag=${flag}`
}) })
} }
@@ -62,6 +62,6 @@ export const zixun = (num = 1, size = 10, flag = 'XR') => {
export const shendu = (num = 1, size = 10, flag = 'XR') => { export const shendu = (num = 1, size = 10, flag = 'XR') => {
return request({ return request({
method: 'GET', method: 'GET',
url: `/news/list?pageNum=${num}&pageSize=${size}&type=3&subType=32&tag=${flag}`
url: `/news/list?pageNum=${num}&pageSize=4&type=3&subType=32&tag=${flag}`
}) })
} }

+ 5
- 1
src/components/swiper/index.vue View File

@@ -95,7 +95,11 @@ export default {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
.swiper-content {
img {
width: 100%;
}
}
.swiper-container { .swiper-container {
height: 590px !important; height: 590px !important;
img { img {


+ 1
- 1
src/layouts/index.vue View File

@@ -46,7 +46,7 @@ export default {
height: 77px; height: 77px;
background: #00000081; background: #00000081;
align-items: center; align-items: center;
z-index: 999;
z-index: 99999;
#logo { #logo {
width: 163px; width: 163px;
height: 43px; height: 43px;


+ 2
- 1
src/views/about/index.vue View File

@@ -186,6 +186,7 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
flex: 1;
img { img {
width: 170px; width: 170px;
height: 170px; height: 170px;
@@ -202,7 +203,7 @@ export default {
line-height: 30px; line-height: 30px;
} }
.title { .title {
font-size: 24px;
font-size: 20px;
font-weight: bold; font-weight: bold;
color: #07CAAF; color: #07CAAF;
line-height: 30px; line-height: 30px;


+ 5
- 2
src/views/aigc/index.vue View File

@@ -41,7 +41,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="gg">
<div class="gg" v-if="gg1.img">
<a :href="gg1.link" target="_blank"> <a :href="gg1.link" target="_blank">
<img :src="gg1.img" alt=""> <img :src="gg1.img" alt="">
</a> </a>
@@ -55,7 +55,7 @@
<SwiperHor :banner-array="aigczb" /> <SwiperHor :banner-array="aigczb" />
</div> </div>
</div> </div>
<div class="gg gg2">
<div class="gg gg2" v-if="gg2.img">
<a :href="gg2.link" target="_blank"> <a :href="gg2.link" target="_blank">
<img :src="gg2.img" alt=""> <img :src="gg2.img" alt="">
</a> </a>
@@ -395,6 +395,9 @@ export default {
width: 100%; width: 100%;
margin-bottom: 15px; margin-bottom: 15px;
} }
img{
width: 100%;
}
} }
.aitxt { .aitxt {


+ 2
- 2
src/views/home/index.vue View File

@@ -16,7 +16,7 @@
<img src="@/assets/tt.png"> <img src="@/assets/tt.png">
{{ item.news.title }} {{ item.news.title }}
</div> </div>
<p class="content" v-html="item.news.content"></p>
<p class="content">{{ item.news.detailText }}</p>
</div> </div>
<div class="btn"> <div class="btn">
<el-button plain class="more" size="small" @click="routerToCar">MORE</el-button> <el-button plain class="more" size="small" @click="routerToCar">MORE</el-button>
@@ -59,7 +59,7 @@
<div class="title"> <div class="title">
{{ item.news.title }} {{ item.news.title }}
</div> </div>
<p class="content" v-html="item.news.detail"></p>
<p class="content">{{ item.news.detailText }}</p>
</div> </div>
<div class="btn"> <div class="btn">
<el-button plain class="more" size="small" @click="routerToMate">MORE</el-button> <el-button plain class="more" size="small" @click="routerToMate">MORE</el-button>


+ 27
- 36
src/views/information/index.vue View File

@@ -21,8 +21,8 @@
</div> </div>
</div> </div>
</div> </div>
<a :href="gg1.link" target="_blank">
<div class="bottom" :style="{ backgroundImage: `url(${gg1.img})` }"/>
<a :href="gg1.link" v-if="gg1.img" target="_blank">
<img class="bottom" :src="gg1.img" alt="">
</a> </a>
</div> </div>
</div> </div>
@@ -32,15 +32,16 @@
<el-carousel :interval="4000" type="card" height="200px" arrow="always"> <el-carousel :interval="4000" type="card" height="200px" arrow="always">
<el-carousel-item v-for="(item, index) in carvideoList" :key="index"> <el-carousel-item v-for="(item, index) in carvideoList" :key="index">
<div class="carvideo"> <div class="carvideo">
<video :id="'davideo'+index" :src="item.video" @click="videoPlayer(`davideo${index}`, `daplay${index}`)"/>
<img class="play" src="@/assets/play.png" @click="videoPlayer(`davideo${index}`, `daplay${index}`)" :id="'daplay'+index">
<!-- <video :id="'davideo'+index" :src="item.video" @click="videoPlayer(`davideo${index}`, `daplay${index}`)"/> -->
<img class="videoImage" :src="item.image" />
<img class="play" src="@/assets/play.png" @click="videoPlayer(item)" :id="'daplay'+index">
</div> </div>
<a>{{ item.title }}</a> <a>{{ item.title }}</a>
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
</div> </div>
<a :href="gg2.link" target="_blank">
<div class="bottom" :style="{ backgroundImage: `url(${gg2.img})` }"/>
<a :href="gg2.link" v-if="gg2.img" target="_blank">
<img class="bottom" :src="gg2.img" alt="">
</a> </a>
</div> </div>
</div> </div>
@@ -61,11 +62,16 @@
</div> </div>
</div> </div>
</div> </div>
<el-dialog title="" v-if="videoDialogVisible" :visible.sync="videoDialogVisible" width="50%">
<VideoDialog :url="videoUrl"></VideoDialog>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
/* eslint-disable */
import Swiper from '@/components/swiper' import Swiper from '@/components/swiper'
import { lunboList, hotNewsConfig, guanggao, hotlist, videoList } from '@/api/car.js' import { lunboList, hotNewsConfig, guanggao, hotlist, videoList } from '@/api/car.js'
import VideoDialog from '@/components/video'
export default { export default {
name: 'information', name: 'information',
data () { data () {
@@ -83,11 +89,15 @@ export default {
carList: [], carList: [],
display: 1, display: 1,
gg1: {}, gg1: {},
gg2: {}
gg2: {},
activeIndex: null,
videoDialogVisible: '',
videoUrl: ''
} }
}, },
components: { components: {
Swiper
Swiper,
VideoDialog
}, },
mounted () { mounted () {
this.gethotnewsConfig() this.gethotnewsConfig()
@@ -95,6 +105,7 @@ export default {
this.getguanggao() this.getguanggao()
this.gethotlist() this.gethotlist()
this.getvideoList() this.getvideoList()
}, },
methods: { methods: {
routerToarticleDetails (value) { routerToarticleDetails (value) {
@@ -155,26 +166,12 @@ export default {
async getvideoList () { async getvideoList () {
const { data: { message, data } } = await videoList() const { data: { message, data } } = await videoList()
if (message === 'success') { if (message === 'success') {
for (const iter of data.list) {
console.log(iter)
this.carvideoList.push({
title: iter.title,
img: iter.image,
video: iter.link
})
}
this.carvideoList = data.list
} }
}, },
videoPlayer (value, play) {
const id = document.getElementById(value)
const playid = document.getElementById(play)
if (id.paused) {
id.play()
playid.style.display = 'none'
} else {
id.pause()
playid.style.display = 'block'
}
videoPlayer (item) {
this.videoUrl = item.link
this.videoDialogVisible = true
} }
} }
} }
@@ -325,11 +322,6 @@ export default {
} }
} }
} }
.bottom {
min-height: 120px;
background-image: url('../../assets/bottom.png');
background-size: 100% 100%;
}
} }
} }
#hot { #hot {
@@ -415,8 +407,8 @@ export default {
// justify-content: center; // justify-content: center;
align-items: center; align-items: center;
.carvideo { .carvideo {
width: 660px;
height: 90%;
// width: 660px;
// height: 90%;
position: relative; position: relative;
.play { .play {
position: absolute; position: absolute;
@@ -425,10 +417,9 @@ export default {
margin-left: 45%; margin-left: 45%;
margin-top: -50px; margin-top: -50px;
} }
video {
.videoImage {
width: 100%; width: 100%;
height: 100%;
border-radius: 20%;
border-radius: 10px;
} }
} }
a { a {


+ 2
- 2
src/views/metadaily/index.vue View File

@@ -23,7 +23,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="gg">
<div class="gg" v-if="gg1.img" >
<a :href="gg1.link" target="_blank"> <a :href="gg1.link" target="_blank">
<img :src="gg1.img" alt=""> <img :src="gg1.img" alt="">
</a> </a>
@@ -50,7 +50,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="gg">
<div class="gg" v-if="gg2.img">
<a :href="gg2.link" target="_blank"> <a :href="gg2.link" target="_blank">
<img :src="gg2.img" alt=""> <img :src="gg2.img" alt="">
</a> </a>


Loading…
Cancel
Save