NurseStationPersonAppletUl/pages/Learningtraining/Learningtraining.vue

96 lines
2.3 KiB
Vue
Raw Normal View History

2023-04-21 15:44:00 +08:00
<template>
<view class="app">
2023-04-24 14:24:50 +08:00
<view class="card">
<view class="item" v-for='(item,index) in list' :key="index" @click.stop='gographicvideo(item)'>
<image :src="baseurl + item.trainingItemCoverUrl" mode=""></image>
<view class="title">
{{item.trainingItemTitle}}
</view>
2023-04-25 15:06:35 +08:00
<view class="text">
{{item.trainingItemDetails}}
</view>
2023-04-24 14:24:50 +08:00
<view class="price" v-if="item.trainingItemPrice">
{{item.trainingItemPrice}}
</view>
<view class="price" v-else>
0
</view>
</view>
</view>
2023-04-26 11:39:25 +08:00
<view v-if='list.length == 0' class="" style="padding-top: 100rpx;">
<u-empty text="暂无" mode="list" icon-size='240' font-size='32'></u-empty>
</view>
2023-04-26 15:12:17 +08:00
<u-toast ref="uToast" />
2023-04-21 15:44:00 +08:00
</view>
</template>
<script>
import {
2023-04-25 15:06:35 +08:00
selectNurseAppletPersonTrainingParent,
2023-04-21 15:44:00 +08:00
} from '@/api/Learningtraining/index.js'
import baseurl from '@/api/baseurl.js'
export default {
data() {
return {
2023-04-24 14:06:37 +08:00
nursePersonId: null, //护理员id
2023-04-21 15:44:00 +08:00
baseurl: undefined,
pageNum: 1,
pageSize: 10,
list: [],
total: 0,
};
},
2023-04-24 14:06:37 +08:00
onShow() {},
2023-04-21 15:44:00 +08:00
onLoad() {
2023-04-24 14:06:37 +08:00
const that = this
2023-04-21 15:44:00 +08:00
this.baseurl = baseurl
this.pageNum = 1
2023-04-24 14:06:37 +08:00
const nursePersonId = uni.getStorageSync('nursePersonId');
if (nursePersonId) {
2023-04-26 11:39:25 +08:00
that.nursePersonId = nursePersonId
2023-04-24 14:06:37 +08:00
that.info();
2023-04-26 15:12:17 +08:00
} else {
that.$refs.uToast.show({
title: '您未登录',
type: 'error',
duration: '1000'
})
}
2023-04-21 15:44:00 +08:00
},
methods: {
info() {
2023-04-25 15:06:35 +08:00
selectNurseAppletPersonTrainingParent(this.pageNum, this.pageSize, this.nursePersonId).then(res => {
2023-04-21 15:44:00 +08:00
this.list = res.rows
this.total = res.total
})
},
//跳转图文或者视频学习
gographicvideo(item) {
2023-04-25 15:06:35 +08:00
uni.navigateTo({
url: `/pages/learning/learning?trainingParentId=${item.id}`
})
},
2023-04-21 15:44:00 +08:00
},
onReachBottom() { //下滑加载
if (this.list.length >= this.total) {} else {
this.pageNum++
2023-04-25 15:06:35 +08:00
selectNurseAppletPersonTrainingParent(this.pageNum, this.pageSize, this.nursePersonId).then(res => {
2023-04-21 15:44:00 +08:00
res.rows.forEach(e => {
this.list.push(e)
})
})
}
},
onPullDownRefresh() { //下拉刷新
this.pageNum = 1
this.info();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
}
</script>
<style lang="scss">
2023-04-25 15:06:35 +08:00
@import "./Learningtraining.scss";
2023-04-21 15:44:00 +08:00
</style>