This commit is contained in:
曹辉 2023-04-25 15:06:35 +08:00
parent 0f6473e4f3
commit abde8d360e
26 changed files with 1565 additions and 1337 deletions

View File

@ -1,18 +1,10 @@
import request from "../request.js" import request from "../request.js"
export function selectTrainingCategory(pageNum, pageSize, nurseStationPersonId) { export function selectNurseAppletPersonTrainingParent(pageNum, pageSize, nurseStationPersonId) {
return request({ return request({
url: `/nurseApplet/personLearn/personTrainingItem?pageNum=${pageNum}&pageSize=${pageSize}&trainingItemType=${'LEARNING_ITEM_GROUP'}&nurseStationPersonId=${nurseStationPersonId}`, url: `/nurseApplet/personLearn/getTrainingItemGroupInfo?pageNum=${pageNum}&pageSize=${pageSize}&nurseStationPersonId=${nurseStationPersonId}`,
method: 'GET' method: 'GET'
}) })
} }
//生成订单
export function trainingItemOrder(data) {
return request({
url: `/nurseApplet/personLearn/trainingItemOrder`,
method: 'POST',
data,
})
}

View File

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

View File

@ -1,9 +1,9 @@
import request from "../request.js" import request from "../request.js"
//订单列表 //订单列表
export function selectTrainingOrderItemList(pageNum, pageSize, nurseStationPersonId) { export function selectTrainingOrderItemGroupList(pageNum, pageSize, nurseStationPersonId) {
return request({ return request({
url: `/nurseApplet/personLearn/selectTrainingOrderItemList?pageNum=${pageNum}&pageSize=${pageSize}&trainingItemType=${''}&nurseStationPersonId=${nurseStationPersonId}`, url: `/nurseApplet/personLearn/selectTrainingOrderItemGroupList?pageNum=${pageNum}&pageSize=${pageSize}&nurseStationPersonId=${nurseStationPersonId}`,
method: 'GET' method: 'GET'
}) })
} }

View File

@ -1,18 +1,26 @@
import request from "../request.js" import request from "../request.js"
//新增修改学习培训项目观看时间点记录信息(退出视频用)
export function insertTrainingItemWatchRecord(data) { export function selectTrainingOrderVideoDetails(trainingItemId, trainingOrderNo) {
return request({ return request({
url: `/nurseApplet/personLearn/insertTrainingItemWatchRecord`, url: `/nurseApplet/personLearn/selectTrainingOrderVideoDetails?trainingItemId=${trainingItemId}&trainingOrderNo=${trainingOrderNo}`,
method: 'post', method: 'GET'
data
}) })
} }
// 查询学习培训项目观看时间点记录信息(观看视频用)
export function getTrainingItemWatchRecord(trainingOrderId, trainingItemId, trainingItemDirectoryId, nurseStationPersonId) { //推出视频
export function insertTrainingItemWatchRecord(data) {
return request({
url: `/nurseApplet/personLearn/insertTrainingItemWatchRecord`,
method: 'POST',
data
})
}
//播放视频
export function getTrainingItemWatchRecord(trainingOrderId,trainingItemId,trainingItemDirectoryId,nurseStationPersonId) {
return request({ return request({
url: `/nurseApplet/personLearn/getTrainingItemWatchRecord?trainingOrderId=${trainingOrderId}&trainingItemId=${trainingItemId}&trainingItemDirectoryId=${trainingItemDirectoryId}&nurseStationPersonId=${nurseStationPersonId}`, url: `/nurseApplet/personLearn/getTrainingItemWatchRecord?trainingOrderId=${trainingOrderId}&trainingItemId=${trainingItemId}&trainingItemDirectoryId=${trainingItemDirectoryId}&nurseStationPersonId=${nurseStationPersonId}`,
method: 'GET', method: 'GET',
}) })
} }

View File

@ -1,10 +1,27 @@
import request from "../request.js" import request from "../request.js"
export function personTrainingItem(pageNum, pageSize, trainingParentId, nurseStationPersonId) {
export function selectNurseAppletPersonTrainingItemDetailsList(trainingItemId, nurseStationPersonId) {
return request({ return request({
url: `/nurseApplet/personLearn/personTrainingItem?pageNum=${pageNum}&pageSize=${pageSize}&trainingParentId=${trainingParentId}&nurseStationPersonId=${nurseStationPersonId}`, url: `/nurseApplet/personLearn/getTrainingItemDetailsInfo?trainingItemId=${trainingItemId}&nurseStationPersonId=${nurseStationPersonId}`,
method: 'GET' method: 'GET'
}) })
} }
//推出视频
export function insertTrainingItemWatchRecord(data) {
return request({
url: `/nurseApplet/personLearn/insertTrainingItemWatchRecord`,
method: 'POST',
data
})
}
//播放视频
export function getTrainingItemWatchRecord(trainingOrderId, trainingItemId, trainingItemDirectoryId,
nurseStationPersonId) {
return request({
url: `/nurseApplet/personLearn/getTrainingItemWatchRecord?trainingOrderId=${trainingOrderId}&trainingItemId=${trainingItemId}&trainingItemDirectoryId=${trainingItemDirectoryId}&nurseStationPersonId=${nurseStationPersonId}`,
method: 'GET',
})
}

23
api/learning/index.js Normal file
View File

@ -0,0 +1,23 @@
import request from "../request.js"
export function selectNurseAppletPersonTrainingItemList(trainingParentId, nurseStationPersonId) {
return request({
url: `/nurseApplet/personLearn/getTrainingVideoAndContentList?trainingParentId=${trainingParentId}&nurseStationPersonId=${nurseStationPersonId}`,
method: 'GET'
})
}
export function selectNurseAppletPersonTrainingParent(id, nurseStationPersonId) {
return request({
url: `/nurseApplet/personLearn/getTrainingItemGroupInfo?pageNum=${1}&pageSize=${10}&id=${id}&nurseStationPersonId=${nurseStationPersonId}`,
method: 'GET'
})
}
//生成订单
export function trainingItemOrder(data) {
return request({
url: `/nurseApplet/personLearn/buyTrainingItemOrder`,
method: 'POST',
data,
})
}

View File

@ -10,24 +10,10 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, { }, {
"path": "pages/Videolearning/Videolearning", "path": "pages/personal/personal",
"style": { "style": {
"navigationBarTitleText": "视频学习", "navigationBarTitleText": "个人信息",
"onReachBottomDistance": 50, // px "navigationStyle": "custom"
"enablePullDownRefresh": true //true
}
}, {
"path": "pages/MyLearning/MyLearning",
"style": {
"navigationBarTitleText": "我的学习",
"enablePullDownRefresh": false
}
}, {
"path": "pages/Graphiclearning/Graphiclearning",
"style": {
"navigationBarTitleText": "图文学习",
"onReachBottomDistance": 50, // px
"enablePullDownRefresh": true //true
} }
}, { }, {
"path": "pages/Learningtraining/Learningtraining", "path": "pages/Learningtraining/Learningtraining",
@ -36,6 +22,18 @@
"onReachBottomDistance": 50, // px "onReachBottomDistance": 50, // px
"enablePullDownRefresh": true //true "enablePullDownRefresh": true //true
} }
}, {
"path": "pages/learning/learning",
"style": {
"navigationBarTitleText": "课程详情",
"enablePullDownRefresh": false //true
}
}, {
"path": "pages/Orderlearning/Orderlearning",
"style": {
"navigationBarTitleText": "我的学习",
"enablePullDownRefresh": false
}
}, { }, {
"path": "pages/Healthknowledge/Healthknowledge", "path": "pages/Healthknowledge/Healthknowledge",
"style": { "style": {
@ -62,12 +60,6 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
// "navigationBarTextStyle": "white" // "navigationBarTextStyle": "white"
} }
}, {
"path": "pages/personal/personal",
"style": {
"navigationBarTitleText": "个人信息",
"navigationStyle": "custom"
}
}, { }, {
"path": "pages/Mymission/Mymission", "path": "pages/Mymission/Mymission",
"style": { "style": {
@ -122,12 +114,6 @@
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, {
"path": "pages/Videolearningdetails/Videolearningdetails",
"style": {
"navigationBarTitleText": "视频学习",
"enablePullDownRefresh": false
}
}, { }, {
"path": "pages/Orderlist/Orderlist", "path": "pages/Orderlist/Orderlist",
"style": { "style": {
@ -140,6 +126,20 @@
"navigationBarTitleText": "我的学习", "navigationBarTitleText": "我的学习",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, {
"path": "pages/Videolearning/Videolearning",
"style": {
"navigationBarTitleText": "视频学习",
"enablePullDownRefresh": false
}
}, {
"path": "pages/Ordervideolearning/Ordervideolearning",
"style": {
"navigationBarTitleText": "视频学习",
"enablePullDownRefresh": false
}
} }
], ],
"globalStyle": { "globalStyle": {

View File

@ -1,120 +0,0 @@
<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">
{{item.trainingItemDetails}}
</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,76 @@
.app {
color: #333333;
padding: 0 0 100rpx;
.card {
width: 96%;
margin: 25rpx auto;
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
.item {
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 5rpx;
width: 100%;
height: 600rpx;
position: relative;
margin-bottom: 15rpx;
background: #FFFFFF;
image {
position: absolute;
top: 20rpx;
transform: translateX(-50%);
left: 50%;
border-radius: 5rpx;
width: 94%;
height: 400rpx;
}
.text {
width: 70%;
font-size: 28rpx;
font-weight: 400;
color: #666666;
position: absolute;
bottom: 30rpx;
left: 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;
}
.price {
position: absolute;
bottom: 30rpx;
right: 40rpx;
color: #EA706A;
font-size: 31rpx;
font-weight: 500;
}
.title {
font-size: 38rpx;
font-weight: 500;
position: absolute;
top: 440rpx;
left: 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;
}
}
}
.toptitle {
margin: 40rpx 0 0 23rpx;
font-size: 24rpx;
}
}

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="app"> <view class="app">
<view class="text"> <view class="toptitle">
参加知识技能培训通过考试获得护理资格 参加知识技能培训通过考试获得护理资格
</view> </view>
<view class="card"> <view class="card">
@ -9,46 +9,22 @@
<view class="title"> <view class="title">
{{item.trainingItemTitle}} {{item.trainingItemTitle}}
</view> </view>
<view class="text">
{{item.trainingItemDetails}}
</view>
<view class="price" v-if="item.trainingItemPrice"> <view class="price" v-if="item.trainingItemPrice">
{{item.trainingItemPrice}} {{item.trainingItemPrice}}
</view> </view>
<view class="price" v-else> <view class="price" v-else>
0 0
</view> </view>
<view class="buy" v-if='!item.trainingOrderStatus' @click.stop='buy(item)'>
购买
</view>
<view class="havebuy" v-else>
已购
</view>
</view> </view>
</view> </view>
<!-- <view class="items" v-for="(item,index) in list" :key="index" @tap='gographicvideo(item)'>
<view class="item">
<image :src="baseurl+item.trainingItemCoverUrl" mode=""></image>
<view class="title">
{{item.trainingItemTitle}}
</view>
</view>
</view> -->
<u-popup v-model="buyshow" mode='bottom' height='500' class='popup' safe-area-inset-bottom>
<view class="popuptitle">请选择支付方式</view>
<view class="buyselect">
<image src="../../static/wechat.png" mode=""></image>
<view class="text">
微信支付
</view>
</view>
<view class="buybtn" @tap='tobuy'>
确认支付{{buylist.trainingItemPrice}}
</view>
</u-popup>
</view> </view>
</template> </template>
<script> <script>
import { import {
selectTrainingCategory, selectNurseAppletPersonTrainingParent,
trainingItemOrder
} from '@/api/Learningtraining/index.js' } from '@/api/Learningtraining/index.js'
import baseurl from '@/api/baseurl.js' import baseurl from '@/api/baseurl.js'
export default { export default {
@ -60,8 +36,6 @@
pageSize: 10, pageSize: 10,
list: [], list: [],
total: 0, total: 0,
buylist: {},
buyshow: false,
}; };
}, },
onShow() {}, onShow() {},
@ -77,61 +51,23 @@
} else {} } else {}
}, },
methods: { methods: {
//
tobuy() {
var obj = {
"trainingItemIdList": [],
"nurseStationId": undefined,
"nurseStationPersonId": undefined,
"trainingOrderAmount": undefined,
"nursePersonName": undefined,
"trainingItemType": undefined
}
obj.nurseStationId = uni.getStorageSync('nurseStationId');
obj.nursePersonName = uni.getStorageSync('nursePersonName');
obj.trainingItemIdList.push(this.buylist.trainingItemId)
obj.nurseStationPersonId = this.nursePersonId
obj.trainingOrderAmount = this.buylist.trainingItemPrice
obj.trainingItemType = this.buylist.trainingItemType
trainingItemOrder(obj).then(res => {
if (res.code == 200) {
this.buyshow = false
this.$refs.uToast.show({
title: '支付成功',
type: 'success',
duration: '1500'
})
}
})
},
//
buy(item) {
this.buylist = item
this.buyshow = true
},
info() { info() {
selectTrainingCategory(this.pageNum, this.pageSize, this.nursePersonId).then(res => { selectNurseAppletPersonTrainingParent(this.pageNum, this.pageSize, this.nursePersonId).then(res => {
this.list = res.rows this.list = res.rows
this.total = res.total this.total = res.total
}) })
}, },
// //
gographicvideo(item) { gographicvideo(item) {
if (item.trainingItemTitle == '图文学习') { uni.navigateTo({
uni.navigateTo({ url: `/pages/learning/learning?trainingParentId=${item.id}`
url: `/pages/Graphiclearning/Graphiclearning?trainingParentId=${item.trainingItemId}` })
}) },
} else if (item.trainingItemTitle == '视频学习') {
uni.navigateTo({
url: `/pages/Videolearning/Videolearning?trainingParentId=${item.trainingItemId}`
})
}
}
}, },
onReachBottom() { // onReachBottom() { //
if (this.list.length >= this.total) {} else { if (this.list.length >= this.total) {} else {
this.pageNum++ this.pageNum++
selectTrainingCategory(this.pageNum, this.pageSize, this.nursePersonId).then(res => { selectNurseAppletPersonTrainingParent(this.pageNum, this.pageSize, this.nursePersonId).then(res => {
res.rows.forEach(e => { res.rows.forEach(e => {
this.list.push(e) this.list.push(e)
}) })
@ -149,183 +85,5 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.app { @import "./Learningtraining.scss";
color: #333333;
padding: 0;
.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 {
margin: 0;
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;
}
}
.card {
width: 96%;
margin: 25rpx auto;
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
.item {
width: 100%;
border-bottom: 1rpx solid #E6E6E6;
position: relative;
height: 200rpx;
margin-bottom: 20rpx;
background: #FFFFFF;
border-radius: 5rpx;
image {
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 15rpx;
width: 216rpx;
height: 136rpx;
}
.havebuy {
width: 125rpx;
height: 55rpx;
background: #CDCDCD;
border-radius: 5rpx;
text-align: center;
line-height: 55rpx;
color: #FFFFFF;
position: absolute;
right: 15rpx;
bottom: 30rpx;
}
.buy {
width: 125rpx;
height: 55rpx;
background: #4271B9;
border-radius: 5rpx;
text-align: center;
line-height: 55rpx;
color: #FFFFFF;
position: absolute;
right: 15rpx;
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;
}
}
}
// .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> </style>

View File

@ -1,180 +0,0 @@
<template>
<view class='app'>
<view class="card">
<view class="toptitle">
<image src="../../static/shipin.png" mode=""></image>
<view class="title">
视频
</view>
</view>
<view class="items">
<view class="item">
<image src="../../static/jnks.png" mode=""></image>
<view class="text">
基础护理技能操作
</view>
</view>
<view class="item">
<image src="../../static/jnks.png" mode=""></image>
<view class="text">
基础护理技能操作
</view>
</view>
<view class="item">
<image src="../../static/jnks.png" mode=""></image>
<view class="text">
基础护理技能操作
</view>
</view>
<view class="item">
<image src="../../static/jnks.png" mode=""></image>
<view class="text">
基础护理技能操作
</view>
</view>
</view>
</view>
<view class="card">
<view class="toptitle">
<image src="../../static/zhibo.png" mode=""></image>
<view class="title">
直播
</view>
</view>
<view class="items">
<view class="item">
<image src="../../static/jnks.png" mode=""></image>
<view class="text">
基础护理技能操作
</view>
</view>
<view class="item">
<image src="../../static/jnks.png" mode=""></image>
<view class="text">
基础护理技能操作
</view>
</view>
<view class="item">
<image src="../../static/jnks.png" mode=""></image>
<view class="text">
基础护理技能操作
</view>
</view>
<view class="item">
<image src="../../static/jnks.png" mode=""></image>
<view class="text">
基础护理技能操作
</view>
</view>
</view>
</view>
<view class="card">
<view class="toptitle">
<image src="../../static/peixun.png" mode=""></image>
<view class="title">
培训
</view>
</view>
<view class="items">
<view class="item">
<image src="../../static/jnks.png" mode=""></image>
<view class="text">
基础护理技能操作
</view>
</view>
<view class="item">
<image src="../../static/jnks.png" mode=""></image>
<view class="text">
基础护理技能操作
</view>
</view>
<view class="item">
<image src="../../static/jnks.png" mode=""></image>
<view class="text">
基础护理技能操作
</view>
</view>
<view class="item">
<image src="../../static/jnks.png" mode=""></image>
<view class="text">
基础护理技能操作
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
};
}
}
</script>
<style lang="scss">
.app {
margin: 15rpx auto 0;
padding: 0 0 60rpx;
color: #000000;
.card {
width: 97%;
margin: 0 auto 15rpx;
background-color: #fff;
.items {
width: 92%;
margin: 30rpx auto 0;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.item {
margin-bottom: 55rpx;
image {
width: 190rpx;
height: 190rpx;
border-radius: 5rpx;
}
.text {
width: 166rpx;
font-size: 27rpx;
font-weight: 500;
line-height: 36rpx;
margin: 0 auto;
}
}
}
.toptitle {
width: 92%;
margin: 0 auto;
position: relative;
height: 90rpx;
border-bottom: 1rpx solid #E6E6E6;
.title {
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 50rpx;
}
image {
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 0;
width: 36rpx;
height: 36rpx;
}
}
}
}
</style>

View File

@ -0,0 +1,136 @@
.app {
padding: 0;
.buy {
background: #FFFFFF;
position: fixed;
bottom: 0;
height: 100rpx;
width: 100%;
.logistics {
width: 216rpx;
height: 68rpx;
text-align: center;
color: #ffffff;
border-radius: 26rpx;
font-size: 36rpx;
line-height: 68rpx;
position: absolute;
right: 260rpx;
top: 50%;
background: #E1AE3C;
transform: translateY(-50%);
z-index: 999;
}
.pay {
width: 216rpx;
height: 68rpx;
text-align: center;
color: #ffffff;
background: #4C7BC9;
border-radius: 26rpx;
font-size: 36rpx;
line-height: 68rpx;
position: absolute;
right: 20rpx;
top: 50%;
transform: translateY(-50%);
}
}
.info {
padding: 30rpx 0;
height: 40%;
background: #FFFFFF;
box-shadow: 0px 9px 31px 9px rgba(0, 0, 0, 0.03);
border-radius: 20rpx;
width: 95%;
margin: 0 auto;
font-size: 30rpx;
color: #020000;
span {
display: block;
line-height: 65rpx;
margin-left: 20rpx;
text {
color: #BFBDBE;
word-break: break-all;
}
}
}
.content {
width: 95%;
background: #FFFFFF;
box-shadow: 0px 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 20rpx;
margin: 30rpx auto;
position: relative;
.details {
height: 380rpx;
position: relative;
.detailslist {
display: flex;
image {
width: 182rpx;
height: 182rpx;
margin: 20rpx 0 0 20rpx;
}
.model {
width: 70%;
margin: 30rpx 0 0 20rpx;
span {
font-size: 32rpx;
color: #000000;
}
span:nth-child(1) {
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 95%;
}
}
}
.payinfo {
width: 95%;
position: absolute;
left: 2.5%;
bottom: 20rpx;
.pay {
font-size: 30rpx;
color: #020000;
}
.price {
float: right;
font-size: 41rpx;
color: #D43953;
margin-right: 10rpx;
}
}
}
}
.time {
height: 80rpx;
width: 95%;
text-align: center;
line-height: 80rpx;
background-color: #fff;
margin: 30rpx auto 0;
border-radius: 20rpx;
}
}

View File

@ -63,140 +63,5 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.app { @import "./Orderdetails.scss";
padding: 0;
.buy {
background: #FFFFFF;
position: fixed;
bottom: 0;
height: 100rpx;
width: 100%;
.logistics {
width: 216rpx;
height: 68rpx;
text-align: center;
color: #ffffff;
border-radius: 26rpx;
font-size: 36rpx;
line-height: 68rpx;
position: absolute;
right: 260rpx;
top: 50%;
background: #E1AE3C;
transform: translateY(-50%);
z-index: 999;
}
.pay {
width: 216rpx;
height: 68rpx;
text-align: center;
color: #ffffff;
background: #4C7BC9;
border-radius: 26rpx;
font-size: 36rpx;
line-height: 68rpx;
position: absolute;
right: 20rpx;
top: 50%;
transform: translateY(-50%);
}
}
.info {
padding: 30rpx 0;
height: 40%;
background: #FFFFFF;
box-shadow: 0px 9px 31px 9px rgba(0, 0, 0, 0.03);
border-radius: 20rpx;
width: 95%;
margin: 0 auto;
font-size: 30rpx;
color: #020000;
span {
display: block;
line-height: 65rpx;
margin-left: 20rpx;
text {
color: #BFBDBE;
word-break: break-all;
}
}
}
.content {
width: 95%;
background: #FFFFFF;
box-shadow: 0px 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 20rpx;
margin: 30rpx auto;
position: relative;
.details {
height: 380rpx;
position: relative;
.detailslist {
display: flex;
image {
width: 182rpx;
height: 182rpx;
margin: 20rpx 0 0 20rpx;
}
.model {
width: 70%;
margin: 30rpx 0 0 20rpx;
span {
font-size: 32rpx;
color: #000000;
}
span:nth-child(1) {
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 95%;
}
}
}
.payinfo {
width: 95%;
position: absolute;
left: 2.5%;
bottom: 20rpx;
.pay {
font-size: 30rpx;
color: #020000;
}
.price {
float: right;
font-size: 41rpx;
color: #D43953;
margin-right: 10rpx;
}
}
}
}
.time {
height: 80rpx;
width: 95%;
text-align: center;
line-height: 80rpx;
background-color: #fff;
margin: 30rpx auto 0;
border-radius: 20rpx;
}
}
</style> </style>

View File

@ -0,0 +1,81 @@
page {
background-color: #fff;
}
.app {
padding: 0;
color: #000000;
::v-deep .u-tabs {
width: 70% !important;
}
.directory {
padding-bottom: 200rpx;
background-color: #fff;
.video {}
.imagetext {}
.items {
width: 87%;
margin: 30rpx auto;
.item {
height: 130rpx;
position: relative;
margin-bottom: 37rpx;
image {
width: 220rpx;
height: 130rpx;
}
.title {
position: absolute;
top: 10rpx;
left: 240rpx;
font-size: 28rpx;
font-weight: 500;
color: #000000;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1; //行数需设置
line-clamp: 1;
-webkit-box-orient: vertical;
}
.text {
position: absolute;
bottom: 10rpx;
left: 240rpx;
font-size: 22rpx;
color: #666666;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2; //行数需设置
line-clamp: 2;
-webkit-box-orient: vertical;
}
}
}
.topheader {
height: 80rpx;
width: 92%;
margin: 0 auto;
border-bottom: 1rpx solid #e6e6e6;
padding-left: 10rpx;
line-height: 80rpx;
font-size: 32rpx;
font-weight: 500;
color: #333333;
}
}
}

View File

@ -0,0 +1,109 @@
<template>
<view class="app">
<view class="" style="background-color: #F4F5F7;height: 17rpx;width:100%"></view>
<u-tabs :list="tablist" :is-scroll="false" :current="tabcurrent" @change="tabchange" font-size='34'
bar-height='7' bar-width='43' inactive-color='#A09F9F' active-color='#4271B9'>
</u-tabs>
<view class="content" v-if="tabcurrent==0">
</view>
<view class="directory" v-if="tabcurrent==1">
<view class="imagetext" v-if="imgtextlist.length>0">
<view class="topheader">
图文学习
</view>
<view class="items">
<view class="item" v-for="(item,index) in imgtextlist" :key='item.trainingItemId'>
<image :src="baseurl+item.trainingItemCoverUrl" mode=""></image>
<view class="title">
{{item.trainingItemTitle}}
</view>
<view class="text">
{{item.trainingItemDetails?item.trainingItemDetails:''}}
</view>
</view>
</view>
</view>
<view class="video" v-if="videolist.length>0">
<view class="topheader">
视频学习
</view>
<view class="items">
<view class="item" v-for="(item,index) in videolist" :key='item.trainingItemId'
@tap='goVideolearningdetails(item)'>
<image :src="baseurl+item.trainingItemCoverUrl" mode=""></image>
<view class="title">
{{item.trainingItemTitle}}
</view>
<view class="text">
{{item.trainingItemDetails?item.trainingItemDetails:''}}
</view>
</view>
</view>
</view>
<view v-if='videolist.length==0&&imgtextlist.length==0' class="" style="padding-top: 100rpx;">
<u-empty text="暂无目录" mode="list" icon-size='240' font-size='32'></u-empty>
</view>
</view>
</view>
</template>
<script>
import {
selectTrainingOrderItemList,
} from '@/api/Orderlearning/index.js'
import baseurl from '@/api/baseurl.js'
export default {
data() {
return {
baseurl: undefined,
videolist: [], //
imgtextlist: [], //
tabcurrent: 1, //tabsindex
tablist: [{ //tabslist
name: '基础课程'
}, {
name: '进阶课程'
}],
trainingParentId: undefined,
nurseStationPersonId: undefined,
};
},
onLoad(options) {
const that = this
this.baseurl = baseurl
this.trainingParentId = options.trainingParentId
const value = uni.getStorageSync('nursePersonId');
if (value) {
that.nurseStationPersonId = value
that.info();
} else {}
},
methods: {
//
goVideolearningdetails(item) {
uni.navigateTo({
url: `/pages/Ordervideolearning/Ordervideolearning?trainingItemId=${item.trainingItemId}&trainingOrderNo=${item.trainingOrderNo}`
})
},
info() {
selectTrainingOrderItemList(this.trainingParentId, this.nurseStationPersonId).then(
res => {
res.data.forEach(e => {
if (e.trainingItemType == 'VIDEO_LEARNING') {
this.videolist.push(e)
} else if (e.trainingItemType == 'GRAPHIC_LEARNING') {
this.imgtextlist.push(e)
}
})
})
},
//tabs
tabchange(index) {
this.tabcurrent = index;
},
},
}
</script>
<style lang="scss">
@import "./Orderlearning.scss";
</style>

View File

@ -0,0 +1,83 @@
.app {
padding: 10rpx 0 100rpx;
.noorder {
margin-top: 20%;
}
.item {
width: 98%;
background: #FFFFFF;
box-shadow: 0px 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 20rpx;
padding: 0 0 100rpx 0;
margin: 0 auto 15rpx;
position: relative;
.name {
width: 95%;
height: 90rpx;
font-size: 30rpx;
color: #969394;
line-height: 90rpx;
border-bottom: 1rpx solid #D8D4D4;
margin: 0 auto;
span {
color: #4C7BC9;
float: right;
}
image {
width: 15rpx;
height: 23rpx;
padding-left: 25rpx;
}
}
.detailslist {
display: flex;
image {
width: 182rpx;
height: 182rpx;
margin: 20rpx 0 0 20rpx;
}
.model {
width: 70%;
margin: 30rpx 0 0 20rpx;
span {
font-size: 34rpx;
color: #000000;
}
span:nth-child(1) {
display: inline-block;
width: 70%;
}
span:nth-child(2) {
color: #969394;
float: right;
margin-right: 30rpx;
}
}
}
.submit {
width: 25%;
height: 68rpx;
line-height: 68rpx;
background: #4C7BC9;
border-radius: 26rpx;
text-align: center;
font-size: 32rpx;
color: #FFFFFF;
position: absolute;
right: 2%;
}
}
}

View File

@ -9,7 +9,7 @@
{{item.trainingOrderStatus=='CANCEL'?'已取消':''}} {{item.trainingOrderStatus=='CANCEL'?'已取消':''}}
</span> </span>
</view> </view>
<view class="detailslist" @tap="goMyLearning(item)"> <view class="detailslist" @tap="goOrderlearning(item)">
<image :src="baseurl+item.trainingItemCoverUrl" mode=""></image> <image :src="baseurl+item.trainingItemCoverUrl" mode=""></image>
<view class="model"> <view class="model">
<span>{{item.trainingItemTitle}}</span> <span>{{item.trainingItemTitle}}</span>
@ -20,20 +20,18 @@
<view class="submit" @tap='goOrderdetails(item)' style="background-color: #4271B9;"> <view class="submit" @tap='goOrderdetails(item)' style="background-color: #4271B9;">
去支付 去支付
</view> </view>
<!-- v-if="item.trainingOrderStatus=='WAIT_PAY'" -->
</view> </view>
</view> </view>
<view class="noorder" v-else> <view class="noorder" v-else>
<u-empty mode="list" icon-size='220' text='暂无服务订单'></u-empty> <u-empty mode="list" icon-size='220' text='暂无'></u-empty>
</view> </view>
<u-toast ref="uToast" /> <u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>
import baseurl from '@/api/baseurl.js' import baseurl from '@/api/baseurl.js'
import { import {
selectTrainingOrderItemList selectTrainingOrderItemGroupList
} from '@/api/Orderlist/index.js' } from '@/api/Orderlist/index.js'
export default { export default {
data() { data() {
@ -65,14 +63,14 @@
}) })
}, },
// //
goMyLearning(item) { goOrderlearning(item) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/MyLearning/MyLearning" url: `/pages/Orderlearning/Orderlearning?trainingParentId=${item.trainingItemId}`
}) })
}, },
// //
info() { info() {
selectTrainingOrderItemList(this.pageNum, this.pageSize, this.nurseStationPersonId) selectTrainingOrderItemGroupList(this.pageNum, this.pageSize, this.nurseStationPersonId)
.then(res => { .then(res => {
this.orderlist = res.rows this.orderlist = res.rows
this.total = res.total this.total = res.total
@ -80,9 +78,9 @@
}, },
}, },
onReachBottom() { // onReachBottom() { //
if (this.list.length >= this.total) {} else { if (this.orderlist.length >= this.total) {} else {
this.pageNum++ this.pageNum++
selectTrainingOrderItemList(this.pageNum, this.pageSize, this.nurseStationPersonId) selectTrainingOrderItemGroupList(this.pageNum, this.pageSize, this.nurseStationPersonId)
.then(res => { .then(res => {
res.rows.forEach(e => { res.rows.forEach(e => {
this.orderlist.push(e) this.orderlist.push(e)
@ -101,87 +99,5 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.app { @import "./Orderlist.scss";
padding: 0;
.noorder {
margin-top: 20%;
}
.item {
width: 99%;
background: #FFFFFF;
box-shadow: 0px 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 20rpx;
padding: 0 0 100rpx 0;
margin: 20rpx auto;
position: relative;
.name {
width: 95%;
height: 90rpx;
font-size: 30rpx;
color: #969394;
line-height: 90rpx;
border-bottom: 1rpx solid #D8D4D4;
margin: 0 auto;
span {
color: #4C7BC9;
float: right;
}
image {
width: 15rpx;
height: 23rpx;
padding-left: 25rpx;
}
}
.detailslist {
display: flex;
image {
width: 182rpx;
height: 182rpx;
margin: 20rpx 0 0 20rpx;
}
.model {
width: 70%;
margin: 30rpx 0 0 20rpx;
span {
font-size: 34rpx;
color: #000000;
}
span:nth-child(1) {
display: inline-block;
width: 70%;
}
span:nth-child(2) {
color: #969394;
float: right;
margin-right: 30rpx;
}
}
}
.submit {
width: 25%;
height: 68rpx;
line-height: 68rpx;
background: #4C7BC9;
border-radius: 26rpx;
text-align: center;
font-size: 32rpx;
color: #FFFFFF;
position: absolute;
right: 2%;
}
}
}
</style> </style>

View File

@ -0,0 +1,141 @@
.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;
text-align: center;
}
.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;
}
}

View File

@ -0,0 +1,164 @@
<template>
<view class="app" v-if="list">
<image class="topimage" :src="baseurl + list.trainingItemPosterUrl" mode=""></image>
<view class="title">
{{list.trainingItemTitle}}
</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.trainingOrderItemDirectoryVOList" :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" @tap='videoplay(item)'
:style="item.itemDirectoryWatchStatus=='NOT_WATCHED'?'background-color: #3D7DCA;color:#fff':''"
v-if="item.itemDirectoryWatchStatus=='NOT_WATCHED'">
开始播放
</view>
<view class="play"
:style="item.itemDirectoryWatchStatus=='WATCHED'?'background-color: #4271B9;color:#3D7DCA':''"
v-if="item.itemDirectoryWatchStatus=='WATCHED'">
继续播放
</view>
<view class="play"
:style="item.itemDirectoryWatchStatus=='FINISHED_READING'?'background-color: #E6E6E6;color:#76777B':''"
v-if="item.itemDirectoryWatchStatus=='FINISHED_READING'">
已看完
</view>
</view>
</view>
<u-popup v-model="videoshow" mode="center" closeable @close='videoshowfalse'>
<view>
<video v-if="videoshow" :src="baseurl+videoitem.itemDirectoryUrl" @timeupdate='videotimeupdate'
:initial-time='videoitem.watchTime'></video>
</view>
</u-popup>
</view>
</template>
<script>
import baseurl from '@/api/baseurl.js'
import {
selectTrainingOrderVideoDetails,
insertTrainingItemWatchRecord,
getTrainingItemWatchRecord
} from '@/api/Ordervideolearning/index.js'
export default {
data() {
return {
list: undefined,
baseurl: undefined,
nurseStationPersonId: undefined,
tabcurrent: 0, //tabsindex
tablist: [{ //tabslist
name: '详情'
}, {
name: '目录'
}],
trainingItemId: undefined, //id
trainingOrderNo: undefined, //orderno
videoshow: false, //
videoitem: {
watchTime: 0,
}, //
};
},
methods: {
//
videotimeupdate(e) {
//e.detail.currentTimee.detail.duration
this.videoitem.watchTime = e.detail.currentTime
},
//
videoshowfalse() {
this.videoitem.watchTime = this.formatSeconds(this.videoitem.watchTime)
insertTrainingItemWatchRecord(this.videoitem).then(res => {
this.videoitem.watchTime = 0
this.info();
this.videoshow = false
})
},
//
videoplay(item) {
if (!item.watchTime) {
this.videoitem.watchTime = 0
}
this.videoitem = item
this.videoitem.trainingOrderId = this.list.trainingOrderId
this.videoitem.trainingItemId = this.list.trainingItemId
this.videoitem.nurseStationPersonId = this.nurseStationPersonId
if (item.itemDirectoryWatchStatus == 'WATCHED') {
getTrainingItemWatchRecord(this.videoitem.trainingOrderId, this.videoitem.trainingItemId, this
.videoitem
.trainingItemDirectoryId, this.videoitem.nurseStationPersonId).then(res => {
if (res.code == 200) {
if (res.data.watchTime) {
this.videoitem.watchTime = res.data.watchTime
this.videoitem.watchTime = this.formatsecond(this.videoitem.watchTime)
}
}
})
} else {}
this.videoshow = true
},
info() {
selectTrainingOrderVideoDetails(this.trainingItemId, this.trainingOrderNo).then(
res => {
this.list = res.data
})
},
//tabs
change(index) {
this.tabcurrent = index;
},
//
formatsecond(value) {
value = value.split(':')
value.forEach(e => {
e = Number(e)
})
value[0] = value[0] * 24 * 60
value[1] = value[1] * 60
value = value[0] + value[1] + value[2]
return value
},
//
formatSeconds(value) {
let result = parseInt(value)
let h = Math.floor(result / 3600) < 10 ? '0' + Math.floor(result / 3600) : Math.floor(result / 3600);
let m = Math.floor((result / 60 % 60)) < 10 ? '0' + Math.floor((result / 60 % 60)) : Math.floor((result /
60 % 60));
let s = Math.floor((result % 60)) < 10 ? '0' + Math.floor((result % 60)) : Math.floor((result % 60));
let res = '';
res += `${h}:`;
res += `${m}:`;
res += `${s}`;
return res;
},
},
onLoad(options) {
const that = this
this.baseurl = baseurl
this.trainingItemId = options.trainingItemId
this.trainingOrderNo = options.trainingOrderNo
console.log(options.trainingItemId)
this.info();
const value = uni.getStorageSync('nursePersonId');
if (value) {
that.nurseStationPersonId = value
} else {}
},
}
</script>
<style lang="scss">
@import "./Ordervideolearning.scss";
</style>

View File

@ -0,0 +1,141 @@
.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;
text-align: center;
}
.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;
}
}

View File

@ -1,233 +1,166 @@
<template> <template>
<view class="app"> <view class="app" v-if="list">
<view class="card"> <image class="topimage" :src="baseurl + list.trainingItemPosterUrl" mode=""></image>
<view class="item" v-for='(item,index) in list' :key="index" @click.stop='goVideolearningdetails(item)'> <view class="title">
<image :src="baseurl + item.trainingItemCoverUrl" mode=""></image> {{list.trainingItemTitle}}
<view class="title"> </view>
{{item.trainingItemTitle}} <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>
<!-- <view class="price" v-if="item.trainingItemPrice"> <view class="Introduce">
{{item.trainingItemPrice}} {{item.itemDirectoryIntroduce}}
</view> </view>
<view class="price" v-else> <view class="play" v-if="!list.trainingOrderId" @tap='videoplay(item)'>
0 开始播放
</view> </view>
<view class="buy" v-if='!item.trainingOrderStatus' @click.stop='buy(item)'> <view class="" v-else>
购买 <view class="play" @tap='videoplay(item)'
:style="item.itemDirectoryWatchStatus=='NOT_WATCHED'?'background-color: #3D7DCA;color:#fff':''"
v-if="item.itemDirectoryWatchStatus=='NOT_WATCHED'">
开始播放
</view>
<view class="play"
:style="item.itemDirectoryWatchStatus=='WATCHED'?'background-color: #4271B9;color:#3D7DCA':''"
v-if="item.itemDirectoryWatchStatus=='WATCHED'">
继续播放
</view>
<view class="play"
:style="item.itemDirectoryWatchStatus=='FINISHED_READING'?'background-color: #E6E6E6;color:#76777B':''"
v-if="item.itemDirectoryWatchStatus=='FINISHED_READING'">
已看完
</view>
</view> </view>
<view class="havebuy" v-else>
已购
</view> -->
</view> </view>
</view> </view>
<u-toast ref="uToast" /> <u-popup v-model="videoshow" mode="center" closeable @close='videoshowfalse'>
<view>
<video v-if="videoshow" :src="baseurl+videoitem.itemDirectoryUrl" @timeupdate='videotimeupdate'
:initial-time='videoitem.watchTime'></video>
</view>
</u-popup>
</view> </view>
</template> </template>
<script> <script>
import {
personTrainingItem,
} from '@/api/Videolearning/index.js'
import baseurl from '@/api/baseurl.js' import baseurl from '@/api/baseurl.js'
import {
selectNurseAppletPersonTrainingItemDetailsList,
insertTrainingItemWatchRecord,
getTrainingItemWatchRecord
} from '@/api/Videolearning/index.js'
export default { export default {
data() { data() {
return { return {
list: undefined,
baseurl: undefined, baseurl: undefined,
pageNum: 1,
pageSize: 10,
trainingParentId: undefined,
nurseStationPersonId: undefined, nurseStationPersonId: undefined,
list: [], tabcurrent: 0, //tabsindex
total: 0, tablist: [{ //tabslist
name: '详情'
}, {
name: '目录'
}],
trainingItemId: {}, //id
videoshow: false, //
videoitem: {
watchTime: 0,
}, //
}; };
}, },
methods: {
//
videotimeupdate(e) {
//e.detail.currentTimee.detail.duration
this.videoitem.watchTime = e.detail.currentTime
},
//
videoshowfalse() {
this.videoitem.watchTime = this.formatSeconds(this.videoitem.watchTime)
insertTrainingItemWatchRecord(this.videoitem).then(res => {
this.videoitem.watchTime = 0
this.info();
this.videoshow = false
})
},
//
videoplay(item) {
if (!item.watchTime) {
this.videoitem.watchTime = 0
}
this.videoitem = item
this.videoitem.trainingOrderId = this.list.trainingOrderId
this.videoitem.trainingItemId = this.list.trainingItemId
this.videoitem.nurseStationPersonId = this.nurseStationPersonId
if (item.itemDirectoryWatchStatus == 'WATCHED') {
getTrainingItemWatchRecord(this.videoitem.trainingOrderId, this.videoitem.trainingItemId, this
.videoitem
.trainingItemDirectoryId, this.videoitem.nurseStationPersonId).then(res => {
if (res.code == 200) {
if (res.data.watchTime) {
this.videoitem.watchTime = res.data.watchTime
this.videoitem.watchTime = this.formatsecond(this.videoitem.watchTime)
}
}
})
} else {}
this.videoshow = true
},
info() {
selectNurseAppletPersonTrainingItemDetailsList(this.trainingItemId, this.nurseStationPersonId).then(
res => {
this.list = res.data
})
},
//tabs
change(index) {
this.tabcurrent = index;
},
//
formatsecond(value) {
value = value.split(':')
value.forEach(e => {
e = Number(e)
})
value[0] = value[0] * 24 * 60
value[1] = value[1] * 60
value = value[0] + value[1] + value[2]
return value
},
//
formatSeconds(value) {
let result = parseInt(value)
let h = Math.floor(result / 3600) < 10 ? '0' + Math.floor(result / 3600) : Math.floor(result / 3600);
let m = Math.floor((result / 60 % 60)) < 10 ? '0' + Math.floor((result / 60 % 60)) : Math.floor((result /
60 % 60));
let s = Math.floor((result % 60)) < 10 ? '0' + Math.floor((result % 60)) : Math.floor((result % 60));
let res = '';
res += `${h}:`;
res += `${m}:`;
res += `${s}`;
return res;
},
},
onLoad(options) { onLoad(options) {
const that = this const that = this
this.trainingParentId = options.trainingParentId
// this.trainingParentId = 2
this.baseurl = baseurl this.baseurl = baseurl
this.trainingItemId = options.trainingItemId
const value = uni.getStorageSync('nursePersonId'); const value = uni.getStorageSync('nursePersonId');
if (value) { if (value) {
// that.nurseStationPersonId = value that.nurseStationPersonId = value
that.nurseStationPersonId = 61
that.info(); that.info();
} else {} } else {}
}, },
methods: {
//
goVideolearningdetails(item) {
uni.navigateTo({
url: `/pages/Videolearningdetails/Videolearningdetails?list=${JSON.stringify(item)}`
})
},
info() {
personTrainingItem(this.pageNum, this.pageSize, this.trainingParentId, this.nurseStationPersonId).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.trainingParentId, this.nurseStationPersonId).then(
res => {
res.rows.forEach(e => {
this.list.push(e)
})
})
}
},
onPullDownRefresh() { //
this.pageNum = 1
this.info();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.app { @import "./Videolearning.scss";
padding: 15rpx 0 0;
color: #000000;
.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;
}
}
.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: 125rpx;
height: 55rpx;
background: #CDCDCD;
border-radius: 5rpx;
text-align: center;
line-height: 55rpx;
color: #FFFFFF;
position: absolute;
right: 15rpx;
bottom: 30rpx;
}
.buy {
width: 125rpx;
height: 55rpx;
background: #4271B9;
border-radius: 5rpx;
text-align: center;
line-height: 55rpx;
color: #FFFFFF;
position: absolute;
right: 15rpx;
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> </style>

View File

@ -1,301 +0,0 @@
<template>
<view class="app">
<image class="topimage" :src="baseurl + list.trainingItemPosterUrl" mode=""></image>
<view class="title">
{{list.trainingItemTitle}}
</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.trainingOrderItemDirectoryList" :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="background-color: #3D7DCA;color:#fff" v-if="!list.trainingOrderStatus"
@tap='videoplay(item)'>
开始播放
</view>
<view class="" v-else>
<view class="play" @tap='videoplay(item)'
:style="item.itemDirectoryWatchStatus=='NOT_WATCHED'?'background-color: #3D7DCA;color:#fff':''"
v-if="item.itemDirectoryWatchStatus=='NOT_WATCHED'">
开始播放
</view>
<view class="play"
:style="item.itemDirectoryWatchStatus=='WATCHED'?'background-color: #4271B9;color:#3D7DCA':''"
v-if="item.itemDirectoryWatchStatus=='WATCHED'">
继续播放
</view>
<view class="play"
:style="item.itemDirectoryWatchStatus=='FINISHED_READING'?'background-color: #E6E6E6;color:#76777B':''"
v-if="item.itemDirectoryWatchStatus=='FINISHED_READING'">
已看完
</view>
</view>
</view>
</view>
<view class="bottom" v-if="!list.trainingOrderStatus">
<view class="price">
{{list.trainingItemPrice}}
</view>
<view class="buy">
购买
</view>
</view>
<u-popup v-model="videoshow" mode="center" closeable @close='videoshowfalse'>
<view>
<video :src="baseurl+videoitem.itemDirectoryUrl" @timeupdate='videotimeupdate'
:initial-time='videoitem.watchTime'></video>
</view>
</u-popup>
</view>
</template>
<script>
import baseurl from '@/api/baseurl.js'
import {
insertTrainingItemWatchRecord,
getTrainingItemWatchRecord
} from '@/api/Videolearningdetails/index.js'
export default {
data() {
return {
baseurl: undefined,
nurseStationPersonId: undefined,
tabcurrent: 0, //tabsindex
tablist: [{ //tabslist
name: '详情'
}, {
name: '目录'
}],
list: {}, //
videoshow: false, //
videoitem: {
watchTime: 0,
}, //
};
},
methods: {
//
videotimeupdate(e) {
//e.detail.currentTimee.detail.duration
this.videoitem.watchTime = e.detail.currentTime
},
//
videoshowfalse() {
this.videoitem.watchTime = this.formatSeconds(this.videoitem.watchTime)
insertTrainingItemWatchRecord(this.videoitem).then(res => {})
},
//
videoplay(item) {
if (!item.watchTime) {
this.videoitem.watchTime = 0
}
this.videoitem = item
this.videoitem.trainingOrderId = this.list.trainingOrderId
this.videoitem.trainingItemId = this.list.trainingItemId
// this.videoitem.nurseStationPersonId = this.nurseStationPersonId
this.videoitem.nurseStationPersonId = 61
getTrainingItemWatchRecord(this.videoitem.trainingOrderId, this.videoitem.trainingItemId, this.videoitem
.trainingItemDirectoryId, this.videoitem.nurseStationPersonId).then(res => {
if (res.code == 200) {
if (res.data.watchTime) {
this.videoitem.watchTime = res.data.watchTime
this.videoitem.watchTime = this.formatsecond(this.videoitem.watchTime)
}
this.videoshow = true
}
})
},
//tabs
change(index) {
this.tabcurrent = index;
},
//
formatsecond(value) {
value = value.split(':')
value.forEach(e => {
e = Number(e)
})
value[0] = value[0] * 24 * 60
value[1] = value[1] * 60
value = value[0] + value[1] + value[2]
return value
},
//
formatSeconds(value) {
let result = parseInt(value)
let h = Math.floor(result / 3600) < 10 ? '0' + Math.floor(result / 3600) : Math.floor(result / 3600);
let m = Math.floor((result / 60 % 60)) < 10 ? '0' + Math.floor((result / 60 % 60)) : Math.floor((result /
60 % 60));
let s = Math.floor((result % 60)) < 10 ? '0' + Math.floor((result % 60)) : Math.floor((result % 60));
let res = '';
res += `${h}:`;
res += `${m}:`;
res += `${s}`;
return res;
},
},
onLoad(options) {
this.baseurl = baseurl
this.list = JSON.parse(options.list)
},
onShow() {
const that = this
const value = uni.getStorageSync('nursePersonId');
if (value) {
that.nurseStationPersonId = value
} else {}
},
}
</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

@ -0,0 +1,197 @@
page {
background-color: #fff;
}
.app {
padding: 0;
color: #000000;
::v-deep .u-tabs {
width: 70% !important;
}
.content {
padding: 30rpx 0 200rpx;
background-color: #fff;
text-indent: 2em;
}
.directory {
padding-bottom: 200rpx;
background-color: #fff;
.video {}
.imagetext {}
.items {
width: 87%;
margin: 30rpx auto;
.item {
height: 130rpx;
position: relative;
margin-bottom: 37rpx;
image {
width: 220rpx;
height: 130rpx;
}
.title {
position: absolute;
top: 10rpx;
left: 240rpx;
font-size: 28rpx;
font-weight: 500;
color: #000000;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1; //行数需设置
line-clamp: 1;
-webkit-box-orient: vertical;
}
.text {
position: absolute;
bottom: 10rpx;
left: 240rpx;
font-size: 22rpx;
color: #666666;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2; //行数需设置
line-clamp: 2;
-webkit-box-orient: vertical;
}
}
}
.topheader {
height: 80rpx;
width: 92%;
margin: 0 auto;
border-bottom: 1rpx solid #e6e6e6;
padding-left: 10rpx;
line-height: 80rpx;
font-size: 32rpx;
font-weight: 500;
color: #333333;
}
}
.bottomitem {
position: fixed;
bottom: 0;
width: 100%;
height: 150rpx;
background: #FFFFFF;
box-shadow: 0rpx 1rpx 21rpx 0rpx rgba(204, 204, 204, 0.75);
.buy {
width: 150rpx;
height: 70rpx;
background: #4271B9;
line-height: 70rpx;
border-radius: 5rpx;
text-align: center;
color: #fff;
position: absolute;
right: 50rpx;
top: 50%;
transform: translateY(-50%);
}
.price {
position: absolute;
left: 50rpx;
top: 50%;
transform: translateY(-50%);
font-size: 42rpx;
font-weight: 500;
color: #EA706A;
line-height: 130rpx;
}
}
.topitem {
height: 181rpx;
background: #FFFFFF;
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 5rpx;
width: 100%;
background-color: #fff;
margin: 0 auto;
.toptitle {
font-weight: 600;
font-size: 38rpx;
padding-top: 32rpx;
margin: 0 0 0 53rpx;
}
.toptext {
font-size: 28rpx;
font-weight: 400;
color: #666666;
margin: 31rpx 0 0 56rpx;
}
}
.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;
}
}
}

180
pages/learning/learning.vue Normal file
View File

@ -0,0 +1,180 @@
<template>
<view class="app" v-if="infoslist">
<view class="" style="background-color: #F4F5F7;height: 13rpx;width:100%"></view>
<view class="topitem">
<view class="toptitle">
{{infoslist.trainingItemTitle}}
</view>
<view class="toptext">
{{infoslist.trainingItemDetails?infoslist.trainingItemDetails:''}}
</view>
</view>
<view class="" style="background-color: #F4F5F7;height: 17rpx;width:100%"></view>
<u-tabs :list="tablist" :is-scroll="false" :current="tabcurrent" @change="tabchange" font-size='34'
bar-height='7' bar-width='43' inactive-color='#A09F9F' active-color='#4271B9'>
</u-tabs>
<view class="content" v-if="tabcurrent==0">
<u-parse :html="infoslist.trainingItemContent"></u-parse>
</view>
<view class="directory" v-if="tabcurrent==1">
<view class="imagetext" v-if="imgtextlist.length>0">
<view class="topheader">
图文学习
</view>
<view class="items">
<view class="item" v-for="(item,index) in imgtextlist" :key='item.id'>
<image :src="baseurl+item.trainingItemCoverUrl" mode=""></image>
<view class="title">
{{item.trainingItemTitle}}
</view>
<view class="text">
{{item.trainingItemDetails?item.trainingItemDetails:''}}
</view>
</view>
</view>
</view>
<view class="video" v-if="videolist.length>0">
<view class="topheader">
视频学习
</view>
<view class="items">
<view class="item" v-for="(item,index) in videolist" :key='item.id' @tap='goVideolearning(item)'>
<image :src="baseurl+item.trainingItemCoverUrl" mode=""></image>
<view class="title">
{{item.trainingItemTitle}}
</view>
<view class="text">
{{item.trainingItemDetails?item.trainingItemDetails:''}}
</view>
</view>
</view>
</view>
<view v-if='videolist.length==0&&imgtextlist.length==0' class="" style="padding-top: 100rpx;">
<u-empty text="暂无目录" mode="list" icon-size='240' font-size='32'></u-empty>
</view>
</view>
<view class="bottomitem">
<view class="price">
{{infoslist.trainingItemPrice}}
</view>
<view class="buy" @tap='buy'>
购买
</view>
</view>
<u-popup v-model="buyshow" mode='bottom' height='500' class='popup' safe-area-inset-bottom>
<view class="popuptitle">请选择支付方式</view>
<view class="buyselect">
<image src="../../static/wechat.png" mode=""></image>
<view class="text">
微信支付
</view>
</view>
<view class="buybtn" @tap='tobuy'>
确认支付{{infoslist.trainingItemPrice}}
</view>
</u-popup>
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
selectNurseAppletPersonTrainingItemList,
selectNurseAppletPersonTrainingParent,
trainingItemOrder
} from '@/api/learning/index.js'
import baseurl from '@/api/baseurl.js'
export default {
data() {
return {
baseurl: undefined,
videolist: [], //
imgtextlist: [], //
infoslist: undefined, //
tabcurrent: 0, //tabsindex
tablist: [{ //tabslist
name: '课程介绍'
}, {
name: '课程目录'
}],
trainingParentId: undefined,
nurseStationPersonId: undefined,
buyshow: false, //
};
},
onLoad(options) {
const that = this
this.baseurl = baseurl
this.trainingParentId = options.trainingParentId
const value = uni.getStorageSync('nursePersonId');
if (value) {
that.nurseStationPersonId = value
that.infos();
that.info();
} else {}
},
methods: {
//
tobuy() {
var obj = {
"trainingItemId": undefined,
"nurseStationId": undefined,
"nurseStationPersonId": undefined,
"trainingOrderAmount": undefined,
"nursePersonName": undefined,
}
obj.trainingItemId = this.infoslist.id
obj.nurseStationId = uni.getStorageSync('nurseStationId');
obj.nurseStationPersonId = this.nurseStationPersonId
obj.nursePersonName = uni.getStorageSync('nursePersonName');
obj.trainingOrderAmount = this.infoslist.trainingItemPrice
trainingItemOrder(obj).then(res => {
if (res.code == 200) {
this.buyshow = false
this.$refs.uToast.show({
title: '支付成功',
type: 'success',
duration: '1500'
})
}
})
},
//
buy() {
this.buyshow = true
},
//
goVideolearning(item) {
uni.navigateTo({
url: `/pages/Videolearning/Videolearning?trainingItemId=${item.id}`
})
},
info() {
selectNurseAppletPersonTrainingItemList(this.trainingParentId, this
.nurseStationPersonId).then(
res => {
res.data.forEach(e => {
if (e.trainingItemType == 'VIDEO_LEARNING') {
this.videolist.push(e)
} else if (e.trainingItemType == 'GRAPHIC_LEARNING') {
this.imgtextlist.push(e)
}
})
})
},
//
infos() {
selectNurseAppletPersonTrainingParent(this.trainingParentId, this.nurseStationPersonId).then(res => {
this.infoslist = res.rows[0]
})
},
//tabs
tabchange(index) {
this.tabcurrent = index;
},
},
}
</script>
<style lang="scss">
@import "./learning.scss";
</style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB