修改
This commit is contained in:
parent
f260c6aaec
commit
187a9145c9
@ -1,8 +1,8 @@
|
||||
import request from "../request.js"
|
||||
|
||||
export function personTrainingItem(pageNum, pageSize, trainingCategoryId) {
|
||||
export function personTrainingItem(pageNum, pageSize, trainingCategoryId, nurseStationPersonId) {
|
||||
return request({
|
||||
url: `/nurseApplet/personLearn/personTrainingItem?pageNum=${pageNum}&pageSize=${pageSize}&trainingCategoryId=${trainingCategoryId}`,
|
||||
url: `/nurseApplet/personLearn/personTrainingItem?pageNum=${pageNum}&pageSize=${pageSize}&trainingCategoryId=${trainingCategoryId}&nurseStationPersonId=${nurseStationPersonId}`,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
||||
18
api/Videolearningdetails/index.js
Normal file
18
api/Videolearningdetails/index.js
Normal file
@ -0,0 +1,18 @@
|
||||
import request from "../request.js"
|
||||
|
||||
//新增修改学习培训项目观看时间点记录信息(退出视频用)
|
||||
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',
|
||||
})
|
||||
}
|
||||
14
pages.json
14
pages.json
@ -10,19 +10,19 @@
|
||||
"onReachBottomDistance": 50, //距离底部多远时触发 单位为px
|
||||
"enablePullDownRefresh": true //设置参数为true
|
||||
}
|
||||
}, {
|
||||
"path": "pages/MyLearning/MyLearning",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的学习",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
}, {
|
||||
"path": "pages/startup/startup",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},{
|
||||
"path": "pages/MyLearning/MyLearning",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的学习",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
}, {
|
||||
"path": "pages/Graphiclearning/Graphiclearning",
|
||||
"style": {
|
||||
"navigationBarTitleText": "图文学习",
|
||||
|
||||
@ -105,7 +105,7 @@
|
||||
//点击toptabr
|
||||
tapmymission(item) {
|
||||
var that = this
|
||||
const value = uni.getStorageSync('nursePersonId');
|
||||
const value = uni.getStorageSync('personRoleLoginFlag');
|
||||
if (value) {
|
||||
that.orderStatus = item
|
||||
that.selectMissioninfo();
|
||||
@ -196,8 +196,9 @@
|
||||
onShow() { //加载的时候执行(没有次数限制)
|
||||
this.baseurl = baseurl
|
||||
var that = this
|
||||
const value = uni.getStorageSync('nursePersonId');
|
||||
if (value) {
|
||||
const personRoleLoginFlag = uni.getStorageSync("personRoleLoginFlag")
|
||||
if (personRoleLoginFlag) {
|
||||
const value = uni.getStorageSync('nursePersonId');
|
||||
that.nursePersonId = value
|
||||
that.selectMissioninfo();
|
||||
} else {
|
||||
|
||||
@ -6,12 +6,12 @@
|
||||
<view class="title">
|
||||
{{item.trainingItemTitle}}
|
||||
</view>
|
||||
<!-- <view class="time">
|
||||
观看至 55:29
|
||||
</view> -->
|
||||
<view class="price">
|
||||
<view class="price" v-if="item.trainingItemPrice">
|
||||
¥{{item.trainingItemPrice}}
|
||||
</view>
|
||||
<view class="price" v-else>
|
||||
¥0
|
||||
</view>
|
||||
<view class="buy" v-if='!item.trainingOrderStatus' @click.stop='buy(item)'>
|
||||
购买
|
||||
</view>
|
||||
@ -48,15 +48,23 @@
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
trainingCategoryId: undefined,
|
||||
nurseStationPersonId: undefined,
|
||||
list: [],
|
||||
total: 0,
|
||||
buylist: {},
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
const that = this
|
||||
// this.trainingCategoryId = options.trainingCategoryId
|
||||
this.trainingCategoryId = 2
|
||||
this.baseurl = baseurl
|
||||
this.trainingCategoryId = options.trainingCategoryId
|
||||
this.info();
|
||||
const value = uni.getStorageSync('nursePersonId');
|
||||
if (value) {
|
||||
// that.nurseStationPersonId = value
|
||||
that.nurseStationPersonId = 61
|
||||
that.info();
|
||||
} else {}
|
||||
},
|
||||
methods: {
|
||||
//购买
|
||||
@ -71,20 +79,22 @@
|
||||
})
|
||||
},
|
||||
info() {
|
||||
personTrainingItem(this.pageNum, this.pageSize, 2).then(res => {
|
||||
this.list = res.rows
|
||||
this.total = res.total
|
||||
})
|
||||
personTrainingItem(this.pageNum, this.pageSize, this.trainingCategoryId, 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.trainingCategoryId).then(res => {
|
||||
res.rows.forEach(e => {
|
||||
this.list.push(e)
|
||||
personTrainingItem(this.pageNum, this.pageSize, this.trainingCategoryId, this.nurseStationPersonId).then(
|
||||
res => {
|
||||
res.rows.forEach(e => {
|
||||
this.list.push(e)
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() { //下拉刷新
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
{{list.trainingItemDetails}}
|
||||
</view>
|
||||
<view class="directory" v-if="tabcurrent==1">
|
||||
<view class="item" v-for="(item,index) in list.trainingItemDirectoryList" :key="index">
|
||||
<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>
|
||||
@ -22,9 +22,27 @@
|
||||
<view class="Introduce">
|
||||
{{item.itemDirectoryIntroduce}}
|
||||
</view>
|
||||
<view class="play" :style="list.trainingOrderStatus?'background-color: #3D7DCA;color:#fff':''">
|
||||
<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">
|
||||
@ -35,25 +53,71 @@
|
||||
购买
|
||||
</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,
|
||||
list: {},
|
||||
tablist: [{
|
||||
nurseStationPersonId: undefined,
|
||||
tabcurrent: 0, //tabsindex
|
||||
tablist: [{ //tabs的list
|
||||
name: '详情'
|
||||
}, {
|
||||
name: '目录'
|
||||
}],
|
||||
tabcurrent: 0
|
||||
list: {}, //页面数据
|
||||
videoshow: false, //视频开关
|
||||
videoitem: {
|
||||
watchTime: 0,
|
||||
}, //视频对象
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//播放进度变化
|
||||
videotimeupdate(e) {
|
||||
//e.detail.currentTime是已经播放了多久,e.detail.duration是该视频多长
|
||||
this.videoitem.watchTime = e.detail.currentTime
|
||||
},
|
||||
//关闭播放弹出框
|
||||
videoshowfalse() {
|
||||
insertTrainingItemWatchRecord(this.videoitem).then(res => {
|
||||
console.log(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.videoshow = true
|
||||
}
|
||||
})
|
||||
},
|
||||
//点击tabs
|
||||
change(index) {
|
||||
this.tabcurrent = index;
|
||||
@ -63,6 +127,13 @@
|
||||
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>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user