Commit 9510c320 by zeyang

视频播放统计 相关

parent 1c781af0
...@@ -42,10 +42,7 @@ export default { ...@@ -42,10 +42,7 @@ export default {
courseList(params){ courseList(params){
return request(`${cffpURL}/course/list`,"POST",params) return request(`${cffpURL}/course/list`,"POST",params)
}, },
// 讲师信息查询
lecturerQuery(params){
return request(`${apiURL}/college/lecturerQuery`, "POST", params)
},
//账户信息获取 //账户信息获取
queryAreaCenterInfo(params){ queryAreaCenterInfo(params){
return request(`${cffpURL}/areaCenter/queryAreaCenterInfo`, "POST", params) return request(`${cffpURL}/areaCenter/queryAreaCenterInfo`, "POST", params)
...@@ -78,14 +75,8 @@ export default { ...@@ -78,14 +75,8 @@ export default {
queryCertificateInfo(params){ queryCertificateInfo(params){
return request(`${cffpURL}/certificate/queryCertificateInfo`, "POST", params) return request(`${cffpURL}/certificate/queryCertificateInfo`, "POST", params)
}, },
// 课程详情
courseDetail(params){
return request(`${cffpURL}/course/detail`, "POST", params)
},
// 相关课程黎贝澳查询
relatedCoursesList(params){
return request(`${cffpURL}/course/relatedCoursesList`, "POST", params)
},
//邀请加盟与申请加盟保存接口 //邀请加盟与申请加盟保存接口
saveApplyInfo(params){ saveApplyInfo(params){
return request(`${cffpURL}/partner/saveApplyInfo`, "POST", params) return request(`${cffpURL}/partner/saveApplyInfo`, "POST", params)
...@@ -210,14 +201,8 @@ export default { ...@@ -210,14 +201,8 @@ export default {
queryInviteList(params){ queryInviteList(params){
return request(`${cffpURL}/partner/queryInviteList`, "POST", params) return request(`${cffpURL}/partner/queryInviteList`, "POST", params)
}, },
// 视频播放轨迹保存
saveVideoPlayback(params){
return request(`${apiURL}/videoPlay/saveVideoPlayback`, "POST", params)
},
// 查询视频播放最新记录
findVideoPlayback(params){
return request(`${apiURL}/videoPlay/findVideoPlayback`, "POST", params)
},
// 教育等级查询 // 教育等级查询
educationLevelQuery() { educationLevelQuery() {
return request(`${apiURL}/metadata/educationLevelQuery`, "GET") return request(`${apiURL}/metadata/educationLevelQuery`, "GET")
...@@ -360,14 +345,36 @@ export default { ...@@ -360,14 +345,36 @@ export default {
verification(params){ verification(params){
return request(`${cffpURL}/user/verification`, "POST", params) return request(`${cffpURL}/user/verification`, "POST", params)
}, },
//获取权限
powerQuery(params){
return request(`${cffpURL}/user/powerQuery`, "POST", params)
},
//保存访问记录接口 //保存访问记录接口
accessLogSave(params){ accessLogSave(params){
return request(`${cffpURL}/accessLog/accessLogSave`, "POST", params) return request(`${cffpURL}/accessLog/accessLogSave`, "POST", params)
}, },
//获取权限 // 课程详情
powerQuery(params){ courseDetail(params){
return request(`${cffpURL}/user/powerQuery`, "POST", params) return request(`${cffpURL}/course/detail`, "POST", params)
},
// 相关课程黎贝澳查询
relatedCoursesList(params){
return request(`${cffpURL}/course/relatedCoursesList`, "POST", params)
},
// 讲师信息查询
lecturerQuery(params){
return request(`${apiURL}/college/lecturerQuery`, "POST", params)
},
// 查询视频播放最新记录
findVideoPlayback(params){
return request(`${apiURL}/videoPlay/findVideoPlayback`, "POST", params)
},
// 视频播放轨迹保存
saveVideoPlayback(params){
return request(`${apiURL}/videoPlay/saveVideoPlayback`, "POST", params)
} }
} }
<template>
<view class="loginContent">
<view class="loginLogBox">
<view class="log">
<image src="../../static/videoProject/logo.png" mode="widthFix"></image>
</view>
<view class="title">
您好,欢迎登录!
</view>
</view>
<view class="loginInputBox">
<view class="loginInputLine" style="margin-bottom: 40rpx;">
<view class="phoneImage">
<image src="../../static/videoProject/phone.png" mode="widthFix"></image>
</view>
<input v-model="mobile" maxlength="11" type="number" placeholder="请输入手机号">
</view>
<view class="codeBox">
<view class="loginInputLine">
<view class="codeImage">
<image src="../../static/videoProject/code.png" mode="widthFix"></image>
</view>
<input v-model="code" maxlength="6" type="number" placeholder="请输入验证码">
</view>
<view class="code" @click="c_sendCode">
{{sendCodeHtml}}
</view>
</view>
</view>
<view class="loginButtonBox" @click="loginVerification">
<view>
登录
</view>
</view>
<view class="wxLoginBox">
<view class="wxLoginLabel">
微信登录
</view>
</view>
</view>
</template>
<script lang="ts" setup>
import { ref } from "vue";
import api from "@/api/api";
import common from '../../common/common';
import { onLoad } from "@dcloudio/uni-app";
//验证码倒计时
let remainTimes = ref(60);
//验证码文字
let sendCodeHtml = ref('获取验证码');
//计时器
let timer = ref();
//手机号
let mobile = ref(null);
//验证码
let code = ref(null);
let videoId = ref('');
//点击发送验证码
const c_sendCode = () => {
let phoneRs = common.mobileNoValid(mobile.value);
if (remainTimes.value != 60) {
return;
}
if (phoneRs) {
uni.showLoading({
mask: true
});
api.verificationCode({ "mobileNo": mobile.value, "type": "1", "source": "cffp" }).then(res => {
uni.hideLoading();
if (res['success']) {
uni.showToast({
icon:'none',
title:'发送成功',
duration:2000
})
delayTime();
} else {
uni.showToast({
icon:'none',
title:res['message'],
duration:2000
})
}
})
} else {
uni.showToast({
icon:'none',
title:'手机号格式错误',
duration:2000
})
}
}
//开启计时器
const delayTime = () => {
timer.value = setInterval(() => {
remainTimes.value--;
sendCodeHtml.value = `${remainTimes.value}(S)`;
if (remainTimes.value <= 0) {
sendCodeHtml.value = '获取验证码';
remainTimes.value = 60;
clearInterval(timer.value);
}
}, 1000);
}
//登录
const loginVerification = () => {
if(!common.mobileNoValid(mobile.value)){
uni.showToast({
icon:'none',
title:'手机号格式错误',
duration:2000
})
return;
}
if(!code.value){
uni.showToast({
icon:'none',
title:'请输入验证码',
duration:2000
})
return;
}
api.loginVerification({ "loginType": 3, "mobile": mobile.value, "code": code.value, "password": null, "loginSystem": "1" }).then((res) => {
if (res['success']) {
uni.setStorageSync('cffp_userId', String(res['data']['userId']));
uni.setStorageSync('uni-token',res['data']['token']);
next();
} else {
uni.showToast({
title: res['message'],
duration: 2000,
icon: 'none'
})
}
})
}
const next = ()=>{
uni.navigateTo({
url:'/myPackageA/videoProject/videoDetail?videoId='+videoId.value
})
};
onLoad(option =>{
videoId.value = option.videoId ?? 1;
if(uni.getStorageSync('cffp_userId')){
next();
}
})
</script>
<style lang="scss">
.loginContent {
min-height: 100vh;
padding: 0rpx 50rpx;
background: linear-gradient(rgba(232, 207, 181, 1) 0%,rgba(242, 240, 237, 1) 60%);
position: relative;
.wxLoginBox{
position: absolute;
bottom: 12vh;
text-align: center;
left: 42vw;
.wxLoginLabel{
color: rgba(102, 102, 102, 1);
font-size: 34rpx;
letter-spacing: 1rpx;
}
}
.loginLogBox {
padding-top: 10vh;
.log{
width: 20vw;
margin-bottom: 1vh;
margin-left: 2vw;
}
.title{
font-size: 40rpx;
color: #000;
font-weight: 600;
}
}
.loginInputBox {
margin: 5vh 0;
.loginInputLine {
display: flex;
align-items: center;
background: rgba(244, 246, 248, 1);
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.1);
padding: 20rpx 40rpx;
border-radius: 5rpx;
.phoneImage{
width: 55rpx;
margin-bottom: -6rpx;
margin-right: 10rpx;
}
}
.codeBox{
display: flex;
align-items: center;
justify-content: space-between;
.loginInputLine{
width: 300rpx;
display: flex;
.codeImage{
width: 95rpx;
margin-bottom: -10rpx;
margin-right: 10rpx;
}
}
}
.code{
color: #fff;
padding: 30rpx 0;
border-radius: 2px;
background: linear-gradient(90deg, rgba(235, 196, 155, 1) 0%, rgba(209, 158, 103, 1) 100%);
box-shadow: 0px 5px 13px rgba(209, 158, 104, 0.3);
flex-grow: 0.7;
text-align: center;
}
}
.loginButtonBox {
view {
font-size: 38rpx;
color: #fff;
border-radius: 200rpx;
padding: 35rpx 0;
text-align: center;
background: linear-gradient(90deg, rgba(235, 196, 155, 1) 0%, rgba(209, 158, 103, 1) 100%);
box-shadow: 0px 5px 13px rgba(209, 158, 104, 0.3);
}
}
}
</style>
\ No newline at end of file
<template>
<view class="content">
<view class="video">
<video id="myVideo" :src="courseInfo.filePathOss" :poster="courseInfo.fileFirstImage" object-fit="contain" :title="courseInfo.fileTitle"
:initial-time="viewTime" title="11" @play="playVideo" @pause="pause" @timeupdate="timeupdate"
style="width: 100vw;height: 500rpx;"></video>
</view>
<scroll-view id="scrollView" scroll-y="true" :style="{height:scrollViewHeight+'px'}"
@scrolltolower="scrolltolower">
<view class="videoDetailBox">
<view class="videoTitleBox">
{{courseInfo.fileTitle}}
</view>
<view class="videoUser">
</view>
<view class="videoDetail">
</view>
</view>
<view style="border-top: 1rpx solid #eee;">
</view>
<view class="relatedVideoBox">
<view class="tagBox">
<view class="tagItem">
相关视频
</view>
</view>
<view class="relatedVideoList">
<view class="relatedVideoItem" v-for="item in 10">
<view style="width: 46.5vw;">
<image style="height: 25vw;border-radius: 16rpx;" src="../../static/images/irrNavBg.jpg"
mode="aspectFill"></image>
</view>
<view class="relatedVideoTitle">
这是一个标题················
</view>
</view>
</view>
<uni-load-more iconType="circle" :status="moreStatus"></uni-load-more>
</view>
</scroll-view>
</view>
</template>
<script lang="ts" setup>
import { ref, onMounted } from "vue";
import api from "@/api/api";
import { cffpURL } from "@/environments/environment";
import common from '../../common/common';
import { onLoad, onPageScroll } from "@dcloudio/uni-app";
let windowHeight = ref(0);
let scrollViewHeight = ref(0);
// more/loading/noMore
let moreStatus = ref('more');
let userId = ref('');
let videoId = ref('');
let courseInfo = ref({
filePathOss: '',
fileFirstImage: '',
fileTitle:''
});
let lecturerInfo = ref({});
//滑动到底事件
const scrolltolower = res => {
if (moreStatus.value != 'loading') {
moreStatus.value = 'loading';
}
}
//增加访问记录
const accessLogSave = () => {
api.accessLogSave({
"userId": userId.value, "sessionId": 'sessionId',
"accessUrl": cffpURL + "/myPackageA/videoProject/videoDetail?videoId=" + videoId.value, "accessType": 'cffpVideo', businessId: videoId.value, remark: '视频播放'
}).then(res => {
if (res['success']) {
}
});
}
//查询课程详情
const loadCourseDetail = () => {
api.courseDetail({
fileId: videoId.value,
userId: userId.value,
}).then(res => {
if (res['success']) {
courseInfo.value = res['data']['data'];
lecturerQuery(res['data']['data']['fileLecturerId']);
// relatedCoursesList();
// if (uni.getStorageSync('h5_coursesharing')) {
// coursesharing = uni.getStorageSync('h5_coursesharing')
// getshareData()
// }
// if (courseInfo.status == 2) {
// findVideoPlayback();
// } else {
// isRenderVideo = true;
// }
}
})
}
// 讲师信息查询
const lecturerQuery = (fileLecturerId) => {
api.lecturerQuery({
id: fileLecturerId
}).then(res => {
if (res['success']) {
lecturerInfo.value = res['data']['lecturerInfos'][0];
} else {
uni.showToast({
title: res['message'],
duration: 2000,
icon: 'none'
})
}
})
}
onLoad(option => {
//视频Id
videoId.value = option.videoId;
//用户Id
userId.value = uni.getStorageSync('cffp_userId');
accessLogSave();
loadCourseDetail();
})
onMounted(() => {
//窗口高度
windowHeight.value = uni.getSystemInfoSync().windowHeight;
//元素距离顶部距离
uni.createSelectorQuery().select('#scrollView').boundingClientRect(data => {
scrollViewHeight.value = windowHeight.value - data['top'];
}).exec();
})
</script>
<style lang="scss">
.content {
.videoDetailBox {
padding: 25rpx;
.videoTitleBox {
font-weight: 600;
font-size: 32rpx
}
}
.relatedVideoBox {
.tagBox {
display: flex;
justify-content: center;
.tagItem {
padding: 20rpx 0;
font-size: 32rpx;
color: #ff5e84;
border-bottom: 6rpx solid #ff5e84;
}
}
.relatedVideoList {
display: flex;
flex-wrap: wrap;
gap: 3vw;
padding: 2vw;
.relatedVideoItem {
width: 46.5vw;
.relatedVideoTitle {
font-size: 30rpx;
overflow: hidden;
}
}
}
}
}
</style>
\ No newline at end of file
...@@ -474,6 +474,16 @@ ...@@ -474,6 +474,16 @@
"style": { "style": {
"navigationBarTitleText": "CFFP法条摘要" "navigationBarTitleText": "CFFP法条摘要"
} }
},{
"path": "videoProject/login",
"style": {
"navigationBarTitleText": "登录"
}
},{
"path": "videoProject/videoDetail",
"style": {
"navigationBarTitleText": "法条摘要"
}
}] }]
}], }],
"tabBar": { "tabBar": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment