NurseStationPersonAppletUl/pages/Videolearning/Videolearning.vue

234 lines
4.6 KiB
Vue
Raw Normal View History

2023-04-21 15:44:00 +08:00
<template>
<view class="app">
<view class="card">
2023-04-21 17:08:47 +08:00
<view class="item" v-for='(item,index) in list' :key="index" @click.stop='goVideolearningdetails(item)'>
2023-04-21 15:44:00 +08:00
<image :src="baseurl + item.trainingItemCoverUrl" mode=""></image>
<view class="title">
{{item.trainingItemTitle}}
</view>
2023-04-24 14:24:50 +08:00
<!-- <view class="price" v-if="item.trainingItemPrice">
2023-04-21 15:44:00 +08:00
{{item.trainingItemPrice}}
</view>
2023-04-24 14:24:50 +08:00
<view class="price" v-else>
2023-04-23 14:06:07 +08:00
0
</view>
2023-04-21 17:08:47 +08:00
<view class="buy" v-if='!item.trainingOrderStatus' @click.stop='buy(item)'>
2023-04-21 15:44:00 +08:00
购买
</view>
<view class="havebuy" v-else>
已购
2023-04-24 14:24:50 +08:00
</view> -->
2023-04-21 15:44:00 +08:00
</view>
</view>
2023-04-24 10:49:20 +08:00
<u-toast ref="uToast" />
2023-04-21 15:44:00 +08:00
</view>
</template>
<script>
import {
2023-04-24 10:49:20 +08:00
personTrainingItem,
2023-04-21 15:44:00 +08:00
} from '@/api/Videolearning/index.js'
import baseurl from '@/api/baseurl.js'
export default {
data() {
return {
baseurl: undefined,
pageNum: 1,
pageSize: 10,
2023-04-24 15:53:03 +08:00
trainingParentId: undefined,
2023-04-23 14:06:07 +08:00
nurseStationPersonId: undefined,
2023-04-21 15:44:00 +08:00
list: [],
total: 0,
};
},
onLoad(options) {
2023-04-23 14:06:07 +08:00
const that = this
2023-04-24 15:53:03 +08:00
this.trainingParentId = options.trainingParentId
// this.trainingParentId = 2
2023-04-21 15:44:00 +08:00
this.baseurl = baseurl
2023-04-23 14:06:07 +08:00
const value = uni.getStorageSync('nursePersonId');
if (value) {
// that.nurseStationPersonId = value
that.nurseStationPersonId = 61
that.info();
} else {}
2023-04-21 15:44:00 +08:00
},
methods: {
//跳转视频学习详情
goVideolearningdetails(item) {
uni.navigateTo({
url: `/pages/Videolearningdetails/Videolearningdetails?list=${JSON.stringify(item)}`
})
},
info() {
2023-04-24 15:53:03 +08:00
personTrainingItem(this.pageNum, this.pageSize, this.trainingParentId, this.nurseStationPersonId).then(
2023-04-23 14:06:07 +08:00
res => {
this.list = res.rows
this.total = res.total
})
2023-04-21 15:44:00 +08:00
},
},
onReachBottom() { //下滑加载
if (this.list.length >= this.total) {} else {
this.pageNum++
2023-04-24 15:53:03 +08:00
personTrainingItem(this.pageNum, this.pageSize, this.trainingParentId, this.nurseStationPersonId).then(
2023-04-23 14:06:07 +08:00
res => {
res.rows.forEach(e => {
this.list.push(e)
})
2023-04-21 15:44:00 +08:00
})
}
},
onPullDownRefresh() { //下拉刷新
this.pageNum = 1
this.info();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
}
</script>
<style lang="scss">
.app {
padding: 15rpx 0 0;
color: #000000;
2023-04-21 17:20:04 +08:00
.popup {
position: fixed;
bottom: 0;
.buyselect {
width: 100%;
height: 100rpx;
margin: 40rpx auto 0;
position: absolute;
top: 100rpx;
image {
position: absolute;
top: 50%;
left: 48rpx;
transform: translateY(-50%);
width: 70rpx;
height: 70rpx;
}
.text {
position: absolute;
left: 150rpx;
top: 50%;
transform: translateY(-50%);
line-height: 100rpx;
font-size: 32rpx;
}
}
.buybtn {
width: 70%;
height: 70rpx;
background: #4271B9;
border-radius: 5rpx;
line-height: 70rpx;
color: #fff;
text-align: center;
position: absolute;
bottom: 40rpx;
left: 15%;
}
.popuptitle {
width: 100%;
font-size: 41rpx;
text-align: center;
position: absolute;
top: 40rpx;
}
2023-04-21 17:08:47 +08:00
}
2023-04-21 15:44:00 +08:00
.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;
}
.havebuy {
2023-04-21 17:08:47 +08:00
width: 125rpx;
height: 55rpx;
2023-04-21 15:44:00 +08:00
background: #CDCDCD;
border-radius: 5rpx;
text-align: center;
2023-04-21 17:08:47 +08:00
line-height: 55rpx;
2023-04-21 15:44:00 +08:00
color: #FFFFFF;
position: absolute;
2023-04-21 17:08:47 +08:00
right: 15rpx;
2023-04-21 15:44:00 +08:00
bottom: 30rpx;
}
.buy {
2023-04-21 17:08:47 +08:00
width: 125rpx;
height: 55rpx;
2023-04-21 15:44:00 +08:00
background: #4271B9;
border-radius: 5rpx;
text-align: center;
2023-04-21 17:08:47 +08:00
line-height: 55rpx;
2023-04-21 15:44:00 +08:00
color: #FFFFFF;
position: absolute;
2023-04-21 17:08:47 +08:00
right: 15rpx;
2023-04-21 15:44:00 +08:00
bottom: 30rpx;
}
.time {
font-size: 24rpx;
color: #666666;
position: absolute;
top: 120rpx;
left: 250rpx;
}
.price {
position: absolute;
top: 120rpx;
left: 250rpx;
font-size: 28rpx;
font-weight: 500;
color: #EA706A;
}
.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>