92 lines
2.2 KiB
Vue
92 lines
2.2 KiB
Vue
<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>
|