3 changed files with 279 additions and 12 deletions
@ -0,0 +1,149 @@ |
|||
<template> |
|||
<div> |
|||
++{{fruitIpt}} |
|||
<div class="inner d-flex flex-wrap"> |
|||
<div |
|||
:class="(index + 1) % 4 === 0 ? 'margin-0' : ''" |
|||
:key="index" |
|||
class="item-box" |
|||
v-for="(item, index) in list" |
|||
> |
|||
<p @click="detail(item.id)" class="font-24 my-3" style="cursor: pointer">{{ item.name }}</p> |
|||
<p |
|||
@click="detail(item.id)" |
|||
class="font-16" |
|||
style="color: rgba(0, 0, 0, 0.45); cursor: pointer" |
|||
>编号:{{ item.identifier }}</p> |
|||
<p class="font-16 baseColor item-more"> |
|||
<intention-model :btn-name="btnName" :type-data="getId(item.id)" style="cursor: pointer" /> |
|||
</p> |
|||
</div> |
|||
</div> |
|||
<div class="inner"> |
|||
<a-pagination |
|||
:current="current" |
|||
:page-size="pageSize" |
|||
:total="total" |
|||
@change="onShowSizeChange" |
|||
class="pagination" |
|||
show-less-items |
|||
show-quick-jumper |
|||
v-show="total > 12" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapMutations, mapState } from 'vuex'; |
|||
import { selTeacher } from 'config/api'; |
|||
import IntentionModel from '../Introduce/IntentionModel.vue'; |
|||
export default { |
|||
name: 'PlatformList', |
|||
components: { IntentionModel }, |
|||
props: { |
|||
fruitIpt: { type: String, default: '' }, |
|||
achList: { type: Array, default: () => [] }, |
|||
}, |
|||
|
|||
data() { |
|||
return { |
|||
list: [], |
|||
current: 1, |
|||
pageSize: 12, |
|||
total: 0, |
|||
typeData: { |
|||
type: 2, |
|||
Id: '', |
|||
}, |
|||
btnName: '技术需求', |
|||
}; |
|||
}, |
|||
|
|||
created() { |
|||
this.getData(); |
|||
}, |
|||
|
|||
methods: { |
|||
...mapMutations('home', ['setAchId']), |
|||
// 改变单当前页数 |
|||
onShowSizeChange(current, size) { |
|||
this.current = current; |
|||
this.getData(); |
|||
}, |
|||
|
|||
/** |
|||
* 获取创业导师列表 |
|||
* @param {string} pageNum 页码 |
|||
* @param {string} pageSize 每页多少条 |
|||
* @param {string} platform 所属平台(0-全部,1-创新平台,2-孵化平台,3-产业平台) |
|||
* @param {string} teacherId 导师id |
|||
* @param {string} teacherName 导师名字 |
|||
* @param {Array} teacherType 导师分类 |
|||
*/ |
|||
async getData() { |
|||
try { |
|||
const params = { |
|||
param: { |
|||
pageNum: this.current, |
|||
pageSize: 10, |
|||
platform: 2, |
|||
teacherName: this.fruitIpt, |
|||
teacherType: this.achList, |
|||
}, |
|||
}; |
|||
const res = await selTeacher(params); |
|||
const { code, msg, data } = res.data; |
|||
if (code === 200) { |
|||
this.list = data.list; |
|||
this.total = parseInt(data.total); |
|||
} |
|||
} catch (error) { |
|||
console.log(error); |
|||
} |
|||
}, |
|||
// 点击查看详情 |
|||
detail(id) { |
|||
this.setAchId(id); |
|||
this.$router.push('/NewPlatform/AchDet'); |
|||
}, |
|||
getId(Id) { |
|||
return (this.typeData = { |
|||
type: 2, |
|||
Id, |
|||
}); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="stylus" scoped> |
|||
.pagination { |
|||
margin: 40px 0; |
|||
text-align: right; |
|||
} |
|||
|
|||
.item-box { |
|||
position: relative; |
|||
width: 20.5%; |
|||
background: #fff; |
|||
margin-right: 6%; |
|||
border-radius: 4px; |
|||
margin-bottom: 40px; |
|||
padding: 10px; |
|||
padding-bottom: 60px; |
|||
} |
|||
|
|||
.margin-0 { |
|||
margin-right: 0% !important; |
|||
} |
|||
|
|||
.item-more { |
|||
position: absolute; |
|||
bottom: 10px; |
|||
right: 10px; |
|||
text-align: right; |
|||
margin-bottom: 0 !important; |
|||
margin-top: 40px; |
|||
} |
|||
</style> |
Loading…
Reference in new issue