NurseStationPersonAppletUl/pages/Learningtraining/Learningtraining.vue
2023-04-26 11:39:25 +08:00

92 lines
2.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="app">
<view class="toptitle">
参加知识技能培训通过考试获得护理资格
</view>
<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>
<view class="text">
{{item.trainingItemDetails}}
</view>
<view class="price" v-if="item.trainingItemPrice">
{{item.trainingItemPrice}}
</view>
<view class="price" v-else>
0
</view>
</view>
</view>
<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>
</view>
</template>
<script>
import {
selectNurseAppletPersonTrainingParent,
} from '@/api/Learningtraining/index.js'
import baseurl from '@/api/baseurl.js'
export default {
data() {
return {
nursePersonId: null, //护理员id
baseurl: undefined,
pageNum: 1,
pageSize: 10,
list: [],
total: 0,
};
},
onShow() {},
onLoad() {
const that = this
this.baseurl = baseurl
this.pageNum = 1
const nursePersonId = uni.getStorageSync('nursePersonId');
if (nursePersonId) {
that.nursePersonId = nursePersonId
that.info();
} else {}
},
methods: {
info() {
selectNurseAppletPersonTrainingParent(this.pageNum, this.pageSize, this.nursePersonId).then(res => {
this.list = res.rows
this.total = res.total
})
},
//跳转图文或者视频学习
gographicvideo(item) {
uni.navigateTo({
url: `/pages/learning/learning?trainingParentId=${item.id}`
})
},
},
onReachBottom() { //下滑加载
if (this.list.length >= this.total) {} else {
this.pageNum++
selectNurseAppletPersonTrainingParent(this.pageNum, this.pageSize, this.nursePersonId).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">
@import "./Learningtraining.scss";
</style>