Browse Source

修改部分bug

master
rose 4 years ago
parent
commit
1ccffd2ed1
  1. 8
      src/components/Rotation/Rotation.vue
  2. 3
      src/config/api.js
  3. 13
      src/views/Business/Children/Business.vue
  4. 82
      src/views/FirstPage/FirstPage.vue

8
src/components/Rotation/Rotation.vue

@ -1,7 +1,7 @@
<template>
<div class="head">
<a-carousel :autoplay-speed="time" autoplay>
<div :key="item.id" class="img-box" v-for="item in lists">
<div :key="item.id" class="img-box" @click="jump(index)" v-for="(item,index) in lists">
<img :src="item.url" alt />
</div>
</a-carousel>
@ -21,6 +21,12 @@ export default {
this.getData();
},
methods: {
jump(index){
console.log("jump")
if(this.lists[index].jumpType === 1){
window.location.href=this.lists[index].jumpUrl
}
},
async getData() {
try {
const params = { param: { showPage: 0 } };

3
src/config/api.js

@ -141,6 +141,9 @@ export const findTypeList = params => axios.post(`${releaseTheList}/findTypeList
// 创业学院内容查询
export const back = params => axios.post(`${wiki}/academy/query/back`, params);
// 首页创业学院内容查询
export const home = params => axios.post(`${wiki}/academy/query/home`, params);
// 创业学院栏目查询
export const getqueryMold = params => axios.post(`${wiki}/academy/queryMold`, params);

13
src/views/Business/Children/Business.vue

@ -16,7 +16,7 @@
</video> -->
<img v-else :src="item.picUrl" style="width: 100%; height: 300px; cursor: pointer" @click="openPage(item.contentUrl)" alt="" />
<p class="introduce-title">{{ item.title }}</p>
<p class="introduce-title text-truncate">{{ item.title }}</p>
<p class="introduce-content">{{ item.intro }}</p>
@ -70,7 +70,7 @@ export default {
title: '创业学院',
list: [],
current: 1,
pageSize: 9,
pageSize: 3,
total: 10,
typeNum: '',
bannerNum: [],
@ -87,7 +87,6 @@ export default {
},
async getData(getParam) {
try {
0
const params = {
param: {
banner: this.bannerNum,
@ -130,4 +129,12 @@ video {
width: 100%;
// object-fit: fill;
}
text-truncate{
max-width: 110px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: block
}
</style>

82
src/views/FirstPage/FirstPage.vue

@ -51,7 +51,38 @@
<!-- 创业学院 -->
<div class="d-flex flex-column">
<div class="baseColor font-bold-30 mt-2 py-8">创业学院</div>
<img class="fill-width" src="~assets/index06.png" />
<div class="d-flex flex-wrap" style="margin-top: 50px; margin-bottom: 50px">
<div :key="index" v-for="(item, index) in list" style="width: 30%" :class="(index + 2) % 3 === 0 ? 'mg' : ''">
<div style="height: 500px">
<div v-if="item.type === 1">
<!-- <iframe frameborder="0" height=300px width=100% src='https://player.youku.com/embed/XNTE0MjU3MjEwMA=='></iframe> -->
<iframe frameborder="0" height=300px width=100% :src="item.contentUrl"></iframe>
</div>
<!-- <video v-if="item.type !== 3" :poster="item.picUrl" controls style="width: 100%; height: 300px">
<source :src="item.contentUrl" type="video/mp4" />
<source :src="item.contentUrl" type="video/ogg" />
</video> -->
<img v-else :src="item.picUrl" style="width: 100%; height: 300px; cursor: pointer" @click="openPage(item.contentUrl)" alt="" />
<p class="introduce-title">{{ item.title }}</p>
<p class="introduce-content">{{ item.intro }}</p>
</div>
</div>
<!-- <a-pagination
:current="current"
:page-size="pageSize"
:total="total"
@change="onShowSizeChange"
class="pagination"
style="text-align: right!important;"
show-less-items
show-quick-jumper
v-show="total > 2"
/> -->
</div>
</div>
</div>
</div>
@ -60,7 +91,7 @@
<script>
import { mapState, mapActions, mapMutations } from 'vuex';
import Rotation from 'components/Rotation/Rotation.vue';
import {} from 'config/api';
import { home } from 'config/api';
export default {
components: { Rotation },
@ -78,7 +109,7 @@ export default {
id: 3,
name: '创新服务',
url: 'https://www.sxwikionline.com/gateway/greenvalley/uploads/upload/logo/index03.png',
path: '/ServiceMarket/Institute',
path: '/ServiceMarket/InnovativeService',
},
{
id: 2,
@ -95,16 +126,50 @@ export default {
},
],
lists: [],
list: [],
current: 1,
pageSize: 3,
total: 10,
};
},
created() {
this.getIndustryInfoLists();
this.getData();
},
methods: {
...mapActions('home', ['getIndustryInfoList']),
...mapMutations('home', ['setActDetail']),
onShowSizeChange(current, size) {
this.current = current;
this.getData();
},
async getData(getParam) {
try {
const params = {
param: {
banner: this.bannerNum,
type: this.typeNum,
title: this.titleText,
pageNum: this.current,
pageSize: this.pageSize,
},
};
const res = await home(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.total = parseInt(data.total);
this.list = data.list;
} else {
this.$message.error('查询失败');
}
} catch (error) {
this.$message.error(error);
}
},
//
async getIndustryInfoLists() {
const params = {
@ -181,4 +246,15 @@ export default {
height: 160px !important;
}
}
.mg {
margin: 0 5%;
}
.pagination {
margin-left: 300px;
margin-top: 48px;
text-align: right!important;
}
</style>

Loading…
Cancel
Save