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.

111 lines
2.3 KiB

3 years ago
<template>
3 years ago
<view class="wrap">
3 years ago
<view class="stabar"></view>
<!-- <view class="secbar">
3 years ago
<view class="title">知识库</view>
</view> -->
<navigation :is-back="false" title="知识库"></navigation>
3 years ago
<view class="mainwrap">
<view class="subwrap">
<view class="message-list">
<view class="artlist" v-for="(item, i) in knowledgeList" :key="i" @click="navClickHandler(item)">
3 years ago
<view class="timetop">{{item.createTime}}</view>
<view class="txtlist">{{item.title}}</view>
</view>
3 years ago
</view>
3 years ago
</view>
3 years ago
</view>
<tabbar :page="page"></tabbar>
3 years ago
</view>
3 years ago
</template>
<script>
import tabbar from "@/components/tabbar/tabbar.vue";
import navigation from "@/components/navigation/navigation.vue";
3 years ago
export default {
components: {navigation},
3 years ago
data() {
return {
page: "",
3 years ago
queryObj: {
pageNum: 1,
pageSize: 10
3 years ago
},
3 years ago
total: 0,
isloading: false,
3 years ago
//数据列表
3 years ago
knowledgeList: []
3 years ago
};
},
onShow() {
3 years ago
this.page = "know"
},
3 years ago
onLoad() {
3 years ago
this.getContentList();
},
3 years ago
methods: {
3 years ago
async getContentList() {
this.isloading = true
const {
data: res
3 years ago
} = await uni.$http.post('/small/library/listApp', this.queryObj)
3 years ago
this.isloading = false
3 years ago
3 years ago
res.rows.forEach(item => {
item.uploadPath = uni.$http.baseUrl + item.uploadPath
3 years ago
})
3 years ago
this.knowledgeList = [...this.knowledgeList, ...res.rows]
3 years ago
this.total = res.total
},
navClickHandler(item) {
3 years ago
uni.navigateTo({
url: '/subpkg/knowledgeInfo/knowledgeInfo?guid=' + item.guid
})
3 years ago
}
},
3 years ago
onReachBottom() {
if (this.queryObj.pageNum * this.queryObj.pageSize >= this.total) return uni.$showMsg('已展示所有内容')
if (this.isloading) return
3 years ago
this.queryObj.pageNum++
this.getContentList()
},
3 years ago
components: {
tabbar
},
3 years ago
}
</script>
<style lang="scss">
3 years ago
@import url("@/static/base_css.css");
.wrap{
height: 101%;
}
3 years ago
.mainwrap {
2 years ago
top: 0;
height: calc(100% - 260rpx);
3 years ago
}
3 years ago
// .title {
// margin-top: 0;
// padding-top: 16rpx;
// }
3 years ago
.artlist {
margin: 2% 0 3.5%;
padding: 4% 3%;
width: 100%;
font-size: 1.05rem;
box-shadow: 0 0 10rpx #ddd;
background: #fff;
border-radius: 20rpx;
box-sizing: border-box;
}
.timetop {
margin: 0 0 3%;
/* padding: 0 0 2%;
3 years ago
border-bottom: 1px solid #eee; */
3 years ago
color: #999;
font-size: 0.9rem;
}
</style>