This commit is contained in:
曹辉 2023-04-21 15:44:00 +08:00
parent 2701a974de
commit 5277aa7715
8 changed files with 676 additions and 2 deletions

View File

@ -0,0 +1,8 @@
import request from "../request.js"
export function selectTrainingCategory(pageNum, pageSize) {
return request({
url: `/nurseApplet/personLearn/selectTrainingCategory?pageNum=${pageNum}&pageSize=${pageSize}`,
method: 'GET'
})
}

View File

@ -0,0 +1,8 @@
import request from "../request.js"
export function personTrainingItem(pageNum, pageSize, trainingCategoryId) {
return request({
url: `/nurseApplet/personLearn/personTrainingItem?pageNum=${pageNum}&pageSize=${pageSize}&trainingCategoryId=${trainingCategoryId}`,
method: 'GET'
})
}

View File

@ -9,7 +9,31 @@
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},{
"path": "pages/Videolearning/Videolearning",
"style": {
"navigationBarTitleText": "视频学习",
"enablePullDownRefresh": false,
"onReachBottomDistance": 50, // px
"enablePullDownRefresh": true //true
}
}, {
"path": "pages/Graphiclearning/Graphiclearning",
"style": {
"navigationBarTitleText": "图文学习",
"enablePullDownRefresh": false,
"onReachBottomDistance": 50, // px
"enablePullDownRefresh": true //true
}
}, {
"path": "pages/Learningtraining/Learningtraining",
"style": {
"navigationBarTitleText": "学习培训",
"enablePullDownRefresh": false,
"onReachBottomDistance": 50, // px
"enablePullDownRefresh": true //true
}
}, {
"path": "pages/Healthknowledge/Healthknowledge",
"style": {
"navigationBarTitleText": "护理新闻",
@ -96,7 +120,16 @@
"enablePullDownRefresh": false
}
}
],
,{
"path" : "pages/Videolearningdetails/Videolearningdetails",
"style" :
{
"navigationBarTitleText": "视频学习",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "",

View File

@ -0,0 +1,120 @@
<template>
<view class="app">
<view class="card">
<view class="item" v-for='(item,index) in list' :key="index">
<image :src="baseurl + item.trainingItemCoverUrl" mode=""></image>
<view class="title">
{{item.trainingItemTitle}}
</view>
<view class="time">
思路讲解技巧点拨
</view>
</view>
</view>
</view>
</template>
<script>
import {
personTrainingItem
} from '@/api/Videolearning/index.js'
import baseurl from '@/api/baseurl.js'
export default {
data() {
return {
baseurl: undefined,
pageNum: 1,
pageSize: 10,
trainingCategoryId: undefined,
list: [],
total: 0,
};
},
onLoad(options) {
this.baseurl = baseurl
this.trainingCategoryId = options.trainingCategoryId
this.info();
},
methods: {
info() {
personTrainingItem(this.pageNum, this.pageSize, 1).then(res => {
this.list = res.rows
this.total = res.total
})
},
},
onReachBottom() { //
if (this.list.length >= this.total) {} else {
this.pageNum++
personTrainingItem(this.pageNum, this.pageSize, this.trainingCategoryId).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">
.app {
padding: 15rpx 0 0;
color: #000000;
.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;
}
.time {
font-size: 24rpx;
color: #666666;
position: absolute;
top: 120rpx;
left: 250rpx;
}
.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>

View File

@ -0,0 +1,119 @@
<template>
<view class="app">
<view class="text">
参加知识技能培训通过考试获得护理资格
</view>
<view class="items" v-for="(item,index) in list" :key="index" @tap='gographicvideo(item)'>
<view class="item">
<image :src="baseurl+item.trainingCategoryPictureUrl" mode=""></image>
<view class="title">
{{item.trainingCategoryName}}
</view>
</view>
</view>
</view>
</template>
<script>
import {
selectTrainingCategory
} from '@/api/Learningtraining/index.js'
import baseurl from '@/api/baseurl.js'
export default {
data() {
return {
baseurl: undefined,
pageNum: 1,
pageSize: 10,
list: [],
total: 0,
};
},
onLoad() {
this.baseurl = baseurl
this.pageNum = 1
this.info();
},
methods: {
info() {
selectTrainingCategory(this.pageNum, this.pageSize).then(res => {
this.list = res.rows
this.total = res.total
})
},
//
gographicvideo(item) {
if (item.trainingCategoryName == '图文学习') {
uni.navigateTo({
url: `/pages/Graphiclearning/Graphiclearning?trainingCategoryId=${item.id}`
})
} else if (item.trainingCategoryName == '视频学习') {
uni.navigateTo({
url: `/pages/Videolearning/Videolearning?trainingCategoryId=${item.id}`
})
}
}
},
onReachBottom() { //
if (this.list.length >= this.total) {} else {
this.pageNum++
selectTrainingCategory(this.pageNum, this.pageSize).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">
.app {
color: #333333;
padding: 0;
.items {
width: 96%;
margin: 25rpx auto;
.item {
width: 100%;
height: 132rpx;
background: #FFFFFF;
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 5rpx;
margin-bottom: 20rpx;
position: relative;
.title {
display: inline-block;
font-size: 32rpx;
position: absolute;
top: 50%;
left: 120rpx;
transform: translateY(-50%);
}
image {
width: 60rpx;
height: 60rpx;
position: absolute;
top: 50%;
left: 41rpx;
transform: translateY(-50%);
}
}
}
.text {
margin: 40rpx 0 0 23rpx;
font-size: 24rpx;
}
}
</style>

View File

@ -0,0 +1,170 @@
<template>
<view class="app">
<view class="card">
<view class="item" v-for='(item,index) in list' :key="index" @tap='goVideolearningdetails(item)'>
<image :src="baseurl + item.trainingItemCoverUrl" mode=""></image>
<view class="title">
{{item.trainingItemTitle}}
</view>
<!-- <view class="time">
观看至 5529
</view> -->
<view class="price">
{{item.trainingItemPrice}}
</view>
<view class="buy" v-if='!item.trainingOrderStatus'>
购买
</view>
<view class="havebuy" v-else>
已购
</view>
</view>
</view>
</view>
</template>
<script>
import {
personTrainingItem
} from '@/api/Videolearning/index.js'
import baseurl from '@/api/baseurl.js'
export default {
data() {
return {
baseurl: undefined,
pageNum: 1,
pageSize: 10,
trainingCategoryId: undefined,
list: [],
total: 0,
};
},
onLoad(options) {
this.baseurl = baseurl
this.trainingCategoryId = options.trainingCategoryId
this.info();
},
methods: {
//
goVideolearningdetails(item) {
uni.navigateTo({
url: `/pages/Videolearningdetails/Videolearningdetails?list=${JSON.stringify(item)}`
})
},
info() {
personTrainingItem(this.pageNum, this.pageSize, 2).then(res => {
this.list = res.rows
this.total = res.total
})
},
},
onReachBottom() { //
if (this.list.length >= this.total) {} else {
this.pageNum++
personTrainingItem(this.pageNum, this.pageSize, this.trainingCategoryId).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">
.app {
padding: 15rpx 0 0;
color: #000000;
.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 {
width: 115rpx;
height: 48rpx;
background: #CDCDCD;
border-radius: 5rpx;
text-align: center;
line-height: 48rpx;
color: #FFFFFF;
position: absolute;
right: 20rpx;
bottom: 30rpx;
}
.buy {
width: 115rpx;
height: 48rpx;
background: #4271B9;
border-radius: 5rpx;
text-align: center;
line-height: 48rpx;
color: #FFFFFF;
position: absolute;
right: 20rpx;
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>

View File

@ -0,0 +1,210 @@
<template>
<view class="app">
<image class="topimage" :src="baseurl + list.trainingItemPosterUrl" mode=""></image>
<view class="title">
{{list.trainingItemTitle}}
</view>
<!-- <view class="time">
有效期2023.12.31
</view> -->
<view class="border"></view>
<u-tabs :list="tablist" :is-scroll="false" :current="tabcurrent" @change="change" font-size='34' bar-height='3'>
</u-tabs>
<view class="detail" v-if="tabcurrent==0">
{{list.trainingItemDetails}}
</view>
<view class="directory" v-if="tabcurrent==1">
<view class="item" v-for="(item,index) in list.trainingItemDirectoryList" :key="index">
<view class="text">
<span class='DirectoryName'>{{item.itemDirectoryName}}</span>
<span class='texttitle'>{{item.itemDirectoryTitle}}</span>
</view>
<view class="Introduce">
{{item.itemDirectoryIntroduce}}
</view>
<view class="play" :style="list.trainingOrderStatus?'background-color: #3D7DCA;color:#fff':''">
开始播放
</view>
</view>
</view>
<view class="bottom" v-if="!list.trainingOrderStatus">
<view class="price">
{{list.trainingItemPrice}}
</view>
<view class="buy">
购买
</view>
</view>
</view>
</template>
<script>
import baseurl from '@/api/baseurl.js'
export default {
data() {
return {
baseurl: undefined,
list: {},
tablist: [{
name: '详情'
}, {
name: '目录'
}],
tabcurrent: 0
};
},
methods: {
//tabs
change(index) {
this.tabcurrent = index;
}
},
onLoad(options) {
this.baseurl = baseurl
this.list = JSON.parse(options.list)
},
}
</script>
<style lang="scss">
.app {
width: 96%;
padding: 0;
margin: 15rpx auto;
color: #666666;
background-color: #fff;
.directory {
padding-bottom: 420rpx;
.item {
position: relative;
width: 96%;
margin: 0 auto;
padding-bottom: 35rpx;
border-bottom: 1rpx solid #E6E6E6;
color: #888787;
.play {
font-size: 24rpx;
width: 141rpx;
height: 52rpx;
background: #E6E6E6;
border-radius: 5rpx;
line-height: 52rpx;
text-align: center;
position: absolute;
right: 30rpx;
top: 50%;
transform: translateY(-50%);
}
.Introduce {
width: 300rpx;
font-size: 26rpx;
line-height: 36rpx;
margin: 18rpx 0 0 176rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.text {
margin-top: 40rpx;
.DirectoryName {
display: inline-block;
width: 176rpx;
font-size: 28rpx;
font-weight: 400;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.texttitle {
display: inline-block;
width: 300rpx;
font-size: 32rpx;
font-weight: 400;
color: #666666;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
.bottom {
width: 100%;
height: 160rpx;
background: #FFFFFF;
box-shadow: 0rpx 1rpx 21rpx 0rpx rgba(204, 204, 204, 0.75);
position: fixed;
bottom: 0;
.buy {
width: 140rpx;
height: 60rpx;
background: #4271B9;
border-radius: 5rpx;
color: #fff;
text-align: center;
line-height: 60rpx;
position: absolute;
right: 60rpx;
top: 50%;
transform: translateY(-50%);
}
.price {
font-size: 42rpx;
font-weight: 500;
color: #EA706A;
line-height: 120rpx;
position: absolute;
left: 44rpx;
top: 50%;
transform: translateY(-50%);
}
}
.detail {
width: 90%;
margin: 40rpx auto 0;
font-size: 32rpx;
padding-bottom: 420rpx;
}
::v-deep .u-tabs {
width: 50% !important;
}
.border {
width: 94%;
margin: 40rpx auto;
border-bottom: 1rpx solid #E6E6E6;
}
.time {
font-size: 30rpx;
margin: 21rpx 0 0 20rpx;
}
.title {
font-size: 38rpx;
font-weight: 500;
color: #000000;
line-height: 36rpx;
margin: 36rpx 0 0 20rpx;
}
.topimage {
display: block;
width: 100%;
height: 407rpx;
border-radius: 5rpx;
}
}
</style>

View File

@ -40,7 +40,7 @@
在线学习
</view>
<view class="cards">
<image src="../../static/xxpx.png" mode="" @tap='gostudy'></image>
<image src="../../static/xxpx.png" mode="" @tap='goLearningtraining'></image>
<image src="../../static/jnks.png" mode="" @tap='gostudy'></image>
<image src="../../static/zxkf.png" mode="" @tap='gostudy'></image>
</view>
@ -133,6 +133,12 @@
url: '/pages/Healthknowledge/Healthknowledge',
});
},
//
goLearningtraining() {
uni.navigateTo({
url: '/pages/Learningtraining/Learningtraining'
})
},
},
}
</script>