NurseStationPersonAppletUl/pages/Learningtraining/Learningtraining.vue

90 lines
2.1 KiB
Vue
Raw Normal View History

2023-04-21 15:44:00 +08:00
<template>
<view class="app">
2023-04-25 15:06:35 +08:00
<view class="toptitle">
2023-04-21 15:44:00 +08:00
参加知识技能培训通过考试获得护理资格
</view>
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-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) {
// that.nursePersonId = nursePersonId
that.nursePersonId = 61
that.info();
} else {}
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>