修改
This commit is contained in:
parent
f260c6aaec
commit
187a9145c9
@ -1,8 +1,8 @@
|
|||||||
import request from "../request.js"
|
import request from "../request.js"
|
||||||
|
|
||||||
export function personTrainingItem(pageNum, pageSize, trainingCategoryId) {
|
export function personTrainingItem(pageNum, pageSize, trainingCategoryId, nurseStationPersonId) {
|
||||||
return request({
|
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'
|
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
|
"onReachBottomDistance": 50, //距离底部多远时触发 单位为px
|
||||||
"enablePullDownRefresh": true //设置参数为true
|
"enablePullDownRefresh": true //设置参数为true
|
||||||
}
|
}
|
||||||
}, {
|
|
||||||
"path": "pages/MyLearning/MyLearning",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "我的学习",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/startup/startup",
|
"path": "pages/startup/startup",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
}, {
|
},{
|
||||||
|
"path": "pages/MyLearning/MyLearning",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "我的学习",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
}, {
|
||||||
"path": "pages/Graphiclearning/Graphiclearning",
|
"path": "pages/Graphiclearning/Graphiclearning",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "图文学习",
|
"navigationBarTitleText": "图文学习",
|
||||||
|
|||||||
@ -105,7 +105,7 @@
|
|||||||
//点击toptabr
|
//点击toptabr
|
||||||
tapmymission(item) {
|
tapmymission(item) {
|
||||||
var that = this
|
var that = this
|
||||||
const value = uni.getStorageSync('nursePersonId');
|
const value = uni.getStorageSync('personRoleLoginFlag');
|
||||||
if (value) {
|
if (value) {
|
||||||
that.orderStatus = item
|
that.orderStatus = item
|
||||||
that.selectMissioninfo();
|
that.selectMissioninfo();
|
||||||
@ -196,8 +196,9 @@
|
|||||||
onShow() { //加载的时候执行(没有次数限制)
|
onShow() { //加载的时候执行(没有次数限制)
|
||||||
this.baseurl = baseurl
|
this.baseurl = baseurl
|
||||||
var that = this
|
var that = this
|
||||||
const value = uni.getStorageSync('nursePersonId');
|
const personRoleLoginFlag = uni.getStorageSync("personRoleLoginFlag")
|
||||||
if (value) {
|
if (personRoleLoginFlag) {
|
||||||
|
const value = uni.getStorageSync('nursePersonId');
|
||||||
that.nursePersonId = value
|
that.nursePersonId = value
|
||||||
that.selectMissioninfo();
|
that.selectMissioninfo();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -6,12 +6,12 @@
|
|||||||
<view class="title">
|
<view class="title">
|
||||||
{{item.trainingItemTitle}}
|
{{item.trainingItemTitle}}
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="time">
|
<view class="price" v-if="item.trainingItemPrice">
|
||||||
观看至 55:29
|
|
||||||
</view> -->
|
|
||||||
<view class="price">
|
|
||||||
¥{{item.trainingItemPrice}}
|
¥{{item.trainingItemPrice}}
|
||||||
</view>
|
</view>
|
||||||
|
<view class="price" v-else>
|
||||||
|
¥0
|
||||||
|
</view>
|
||||||
<view class="buy" v-if='!item.trainingOrderStatus' @click.stop='buy(item)'>
|
<view class="buy" v-if='!item.trainingOrderStatus' @click.stop='buy(item)'>
|
||||||
购买
|
购买
|
||||||
</view>
|
</view>
|
||||||
@ -48,15 +48,23 @@
|
|||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
trainingCategoryId: undefined,
|
trainingCategoryId: undefined,
|
||||||
|
nurseStationPersonId: undefined,
|
||||||
list: [],
|
list: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
buylist: {},
|
buylist: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
const that = this
|
||||||
|
// this.trainingCategoryId = options.trainingCategoryId
|
||||||
|
this.trainingCategoryId = 2
|
||||||
this.baseurl = baseurl
|
this.baseurl = baseurl
|
||||||
this.trainingCategoryId = options.trainingCategoryId
|
const value = uni.getStorageSync('nursePersonId');
|
||||||
this.info();
|
if (value) {
|
||||||
|
// that.nurseStationPersonId = value
|
||||||
|
that.nurseStationPersonId = 61
|
||||||
|
that.info();
|
||||||
|
} else {}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//购买
|
//购买
|
||||||
@ -71,20 +79,22 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
info() {
|
info() {
|
||||||
personTrainingItem(this.pageNum, this.pageSize, 2).then(res => {
|
personTrainingItem(this.pageNum, this.pageSize, this.trainingCategoryId, this.nurseStationPersonId).then(
|
||||||
this.list = res.rows
|
res => {
|
||||||
this.total = res.total
|
this.list = res.rows
|
||||||
})
|
this.total = res.total
|
||||||
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onReachBottom() { //下滑加载
|
onReachBottom() { //下滑加载
|
||||||
if (this.list.length >= this.total) {} else {
|
if (this.list.length >= this.total) {} else {
|
||||||
this.pageNum++
|
this.pageNum++
|
||||||
personTrainingItem(this.pageNum, this.pageSize, this.trainingCategoryId).then(res => {
|
personTrainingItem(this.pageNum, this.pageSize, this.trainingCategoryId, this.nurseStationPersonId).then(
|
||||||
res.rows.forEach(e => {
|
res => {
|
||||||
this.list.push(e)
|
res.rows.forEach(e => {
|
||||||
|
this.list.push(e)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPullDownRefresh() { //下拉刷新
|
onPullDownRefresh() { //下拉刷新
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
{{list.trainingItemDetails}}
|
{{list.trainingItemDetails}}
|
||||||
</view>
|
</view>
|
||||||
<view class="directory" v-if="tabcurrent==1">
|
<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">
|
<view class="text">
|
||||||
<span class='DirectoryName'>{{item.itemDirectoryName}}</span>
|
<span class='DirectoryName'>{{item.itemDirectoryName}}</span>
|
||||||
<span class='texttitle'>{{item.itemDirectoryTitle}}</span>
|
<span class='texttitle'>{{item.itemDirectoryTitle}}</span>
|
||||||
@ -22,9 +22,27 @@
|
|||||||
<view class="Introduce">
|
<view class="Introduce">
|
||||||
{{item.itemDirectoryIntroduce}}
|
{{item.itemDirectoryIntroduce}}
|
||||||
</view>
|
</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>
|
||||||
|
<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>
|
</view>
|
||||||
<view class="bottom" v-if="!list.trainingOrderStatus">
|
<view class="bottom" v-if="!list.trainingOrderStatus">
|
||||||
@ -35,25 +53,71 @@
|
|||||||
购买
|
购买
|
||||||
</view>
|
</view>
|
||||||
</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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import baseurl from '@/api/baseurl.js'
|
import baseurl from '@/api/baseurl.js'
|
||||||
|
import {
|
||||||
|
insertTrainingItemWatchRecord,
|
||||||
|
getTrainingItemWatchRecord
|
||||||
|
} from '@/api/Videolearningdetails/index.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
baseurl: undefined,
|
baseurl: undefined,
|
||||||
list: {},
|
nurseStationPersonId: undefined,
|
||||||
tablist: [{
|
tabcurrent: 0, //tabsindex
|
||||||
|
tablist: [{ //tabs的list
|
||||||
name: '详情'
|
name: '详情'
|
||||||
}, {
|
}, {
|
||||||
name: '目录'
|
name: '目录'
|
||||||
}],
|
}],
|
||||||
tabcurrent: 0
|
list: {}, //页面数据
|
||||||
|
videoshow: false, //视频开关
|
||||||
|
videoitem: {
|
||||||
|
watchTime: 0,
|
||||||
|
}, //视频对象
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
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
|
//点击tabs
|
||||||
change(index) {
|
change(index) {
|
||||||
this.tabcurrent = index;
|
this.tabcurrent = index;
|
||||||
@ -63,6 +127,13 @@
|
|||||||
this.baseurl = baseurl
|
this.baseurl = baseurl
|
||||||
this.list = JSON.parse(options.list)
|
this.list = JSON.parse(options.list)
|
||||||
},
|
},
|
||||||
|
onShow() {
|
||||||
|
const that = this
|
||||||
|
const value = uni.getStorageSync('nursePersonId');
|
||||||
|
if (value) {
|
||||||
|
that.nurseStationPersonId = value
|
||||||
|
} else {}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user