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.

102 lines
2.1 KiB

3 years ago
<template>
3 years ago
<view class="wrap">
3 years ago
<view class="stabar"></view>
<view class="secbar">
<view class="title">知识库</view>
3 years ago
</view>
3 years ago
<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>
3 years ago
</view>
3 years ago
</template>
<script>
import tabbar from "@/components/tabbar/tabbar.vue";
3 years ago
export default {
data() {
return {
page: "",
3 years ago
queryObj:{
pageNum:1,
pageSize:10
},
total:0,
isloading:false,
//数据列表
knowledgeList:[]
3 years ago
};
},
onShow() {
this.page= "know"
},
3 years ago
onLoad() {
this.getContentList();
},
3 years ago
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},
3 years ago
}
</script>
<style lang="scss">
3 years ago
3 years ago
@import url("@/static/base_css.css");
3 years ago
3 years ago
.title {
margin-top: 0;
padding-top: 16rpx;
3 years ago
}
3 years ago
.mainwrap2 {
height: calc(100% - 300rpx);
3 years ago
}
3 years ago
.artlist {
margin: 2% 0 3.5%;
padding: 4% 3%;
3 years ago
width: 100%;
3 years ago
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;
3 years ago
}
3 years ago
</style>