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.
 
 
 
 

101 lines
2.1 KiB

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