NurseStationPersonAppletUl/pages/Graphiclearning/Graphiclearning.vue
2023-04-21 15:44:31 +08:00

121 lines
2.3 KiB
Vue

<template>
<view class="app">
<view class="card">
<view class="item" v-for='(item,index) in list' :key="index">
<image :src="baseurl + item.trainingItemCoverUrl" mode=""></image>
<view class="title">
{{item.trainingItemTitle}}
</view>
<view class="time">
{{item.trainingItemDetails}}
</view>
</view>
</view>
</view>
</template>
<script>
import {
personTrainingItem
} from '@/api/Videolearning/index.js'
import baseurl from '@/api/baseurl.js'
export default {
data() {
return {
baseurl: undefined,
pageNum: 1,
pageSize: 10,
trainingCategoryId: undefined,
list: [],
total: 0,
};
},
onLoad(options) {
this.baseurl = baseurl
this.trainingCategoryId = options.trainingCategoryId
this.info();
},
methods: {
info() {
personTrainingItem(this.pageNum, this.pageSize, 1).then(res => {
this.list = res.rows
this.total = res.total
})
},
},
onReachBottom() { //下滑加载
if (this.list.length >= this.total) {} else {
this.pageNum++
personTrainingItem(this.pageNum, this.pageSize, this.trainingCategoryId).then(res => {
res.rows.forEach(e => {
this.list.push(e)
})
})
}
},
onPullDownRefresh() { //下拉刷新
this.pageNum = 1
this.info();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
}
</script>
<style lang="scss">
.app {
padding: 15rpx 0 0;
color: #000000;
.card {
width: 96%;
margin: 0 auto;
background: #FFFFFF;
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 5rpx;
.item {
width: 94%;
margin: 0 auto;
border-bottom: 1rpx solid #E6E6E6;
position: relative;
height: 200rpx;
image {
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 15rpx;
width: 216rpx;
height: 136rpx;
}
.time {
font-size: 24rpx;
color: #666666;
position: absolute;
top: 120rpx;
left: 250rpx;
}
.title {
width: 281rpx;
position: absolute;
top: 35rpx;
left: 250rpx;
font-weight: 500;
font-size: 30rpx;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2; //行数需设置
line-clamp: 2;
-webkit-box-orient: vertical;
}
}
}
}
</style>