You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
176 lines
3.6 KiB
176 lines
3.6 KiB
<template>
|
|
<view>
|
|
<view class="view-li" v-for="(item, index) in infos" :key="index">
|
|
<view class="li-item" v-if="item.type == 'title'">
|
|
<view class="li-title">{{item.title}}</view>
|
|
</view>
|
|
<view class="li-item " v-if="item.type == 'file-pdf'">
|
|
<view class="li-pdf" @click="handlePdf(item)"> {{item.filePdfName}}</view>
|
|
<view class="view-pdf" v-if="pdfId == item.id">
|
|
<div class="tools">
|
|
<button :theme="'default'" type="submit" :title="'基础按钮'" @click.stop="prePage" class="mr10">
|
|
上一页
|
|
</button>
|
|
<div class="page">{{pageNum}}/{{pageTotalNum}}</div>
|
|
<button :theme="'default'" type="submit" :title="'基础按钮'" @click.stop="nextPage" class="mr10">
|
|
下一页
|
|
</button>
|
|
</div>
|
|
<pdf ref="pdf" :page="pageNum" @progress="loadedRatio = $event" @page-loaded="pageLoaded($event)"
|
|
@num-pages="pageTotalNum=$event" @error="pdfError($event)" @link-clicked="page = $event"
|
|
:src="item.filePdfUrl">
|
|
</pdf>
|
|
</view>
|
|
</view>
|
|
<view class="li-item" v-if="item.type == 'richtext'">
|
|
<view class="li-text">{{item.richtext}}</view>
|
|
</view>
|
|
<view class="view-ul" v-if="item.infos && item.infos.length">
|
|
<MeetingList :infos='item.infos'></MeetingList>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import pdf from 'vue-pdf'
|
|
export default {
|
|
name: 'MeetingList',
|
|
props: ['infos'],
|
|
components: {
|
|
pdf
|
|
},
|
|
data() {
|
|
return {
|
|
url: "http://storage.xuetangx.com/public_assets/xuetangx/PDF/PlayerAPI_v1.0.6.pdf",
|
|
pageNum: 1,
|
|
pageTotalNum: 1,
|
|
// 加载进度
|
|
loadedRatio: 0,
|
|
curPageNum: 0,
|
|
pdfId: '',
|
|
};
|
|
},
|
|
onShow() {
|
|
console.log('infos', infos)
|
|
},
|
|
methods: {
|
|
// 上一页函数,
|
|
prePage() {
|
|
var page = this.pageNum
|
|
page = page > 1 ? page - 1 : this.pageTotalNum
|
|
this.pageNum = page
|
|
},
|
|
// 下一页函数
|
|
nextPage() {
|
|
var page = this.pageNum
|
|
page = page < this.pageTotalNum ? page + 1 : 1
|
|
this.pageNum = page
|
|
},
|
|
// 页面加载回调函数,其中e为当前页数
|
|
pageLoaded(e) {
|
|
this.curPageNum = e
|
|
},
|
|
// 其他的一些回调函数。
|
|
pdfError(error) {
|
|
console.error(error)
|
|
},
|
|
// 显示pdf
|
|
handlePdf(_item) {
|
|
this.pdfId = _item.id
|
|
},
|
|
},
|
|
// 页面显示调用接口
|
|
onLoad() {},
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.view-li{
|
|
padding-left: 10px;
|
|
}
|
|
.view-pdf {
|
|
margin: 16px 0;
|
|
padding: 16px;
|
|
border: 1px solid #999;
|
|
.tools {
|
|
display: flex;
|
|
uni-button{
|
|
font-size: 18px;
|
|
line-height: 44px;
|
|
height: 44px;
|
|
flex:1
|
|
}
|
|
.page{
|
|
line-height: 44px;
|
|
height: 44px;
|
|
width: 100px;
|
|
text-align: center;
|
|
}
|
|
}
|
|
}
|
|
|
|
.pathsName {
|
|
color: #fff;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.pdfBox .el-button {
|
|
background: rgba(255, 255, 255, 0);
|
|
border: none;
|
|
/* width: 30px; */
|
|
}
|
|
|
|
.pdfBox>>>.el-icon-arrow-left,
|
|
.pdfBox>>>.el-icon-arrow-right {
|
|
font-size: 18px;
|
|
color: #000;
|
|
}
|
|
|
|
.pdfBox .page {
|
|
margin: 0 10px;
|
|
}
|
|
|
|
.pdfBox .el-button-group {
|
|
width: 100%;
|
|
justify-content: center;
|
|
display: flex;
|
|
align-items: center;
|
|
padding-top: 20px;
|
|
}
|
|
|
|
.pdfBox {
|
|
padding-bottom: 20px;
|
|
margin-top: 20px;
|
|
background: #fff;
|
|
min-height: 300px;
|
|
}
|
|
|
|
.contLeft-pane>>>.el-form-item__label {
|
|
text-align: right;
|
|
margin-right: 10px !important;
|
|
padding: 0 !important;
|
|
}
|
|
|
|
.contLeft-pane>>>.el-form-item--medium .el-form-item__content {
|
|
flex: 1;
|
|
}
|
|
|
|
.view-pdf {
|
|
width: 70%;
|
|
}
|
|
|
|
.li-item {
|
|
uni-view {
|
|
font-size: 20px;
|
|
line-height: 40px;
|
|
}
|
|
|
|
.li-title {
|
|
font-size: 20px;
|
|
//font-weight: bold;
|
|
line-height: 30px;
|
|
}
|
|
}
|
|
</style>
|
|
<style></style>
|