Browse Source

update:埋点优化

pull/1/head
Wangwei-王伟 2 years ago
parent
commit
e1e8452b01
  1. 46
      src/views/video/play.vue

46
src/views/video/play.vue

@ -18,8 +18,7 @@
<div class="nullData flex-4" v-if="!com_user_token"> <div class="nullData flex-4" v-if="!com_user_token">
<span>抱歉需登录后观看课程</span> <span>抱歉需登录后观看课程</span>
<a :href="com_id_url+'/signin/?referrer='+com_jump_url" <a :href="com_id_url+'/signin/?referrer='+com_jump_url" class="el-btn medium ff18">马上登录</a>
class="el-btn medium ff18">马上登录</a>
</div> </div>
<div class="autotime" v-show="showAutoBox"> <div class="autotime" v-show="showAutoBox">
@ -41,7 +40,7 @@
<div class="btn_sty" style="margin: 0 auto;" @click="getvideo_click(playThisId,1);">重播</div> <div class="btn_sty" style="margin: 0 auto;" @click="getvideo_click(playThisId,1);">重播</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@ -138,7 +137,7 @@
showAutoBox: false, showAutoBox: false,
is_duration: true, is_duration: true,
is_scroll: false, is_scroll: false,
playThisId:route.params.playid playThisId: route.params.playid
}) })
@ -178,20 +177,24 @@
const postSourceDeviceLog = async () => { const postSourceDeviceLog = async () => {
let get_from = route.query.from || null; let get_from = route.query.from || null;
const params = { const params = {
source:get_from, source: get_from,
device:isMobileValue() device: isMobileValue()
} }
await sourceDeviceLog(params); await sourceDeviceLog(params);
} }
// //
const postlogData = async (logData) => { const postlogData = async (logData) => {
await classlog(logData); let logParams = {
...logData,
vid: state.videoid
}
await classlog(logParams);
} }
// //
const getvideo_click = async (id, replay=0) => { const getvideo_click = async (id, replay = 0) => {
state.playThisId = id; state.playThisId = id;
state.is_duration = false; state.is_duration = false;
clearInterval(state.timerTxt); clearInterval(state.timerTxt);
@ -201,7 +204,7 @@
state.ckPlayer = null; state.ckPlayer = null;
document.getElementById("VideoPlay").innerHTML = ""; document.getElementById("VideoPlay").innerHTML = "";
setTimeout(function () { setTimeout(function () {
getvideoDom(id, replay); getvideoDom(id, replay);
getNextId(id); getNextId(id);
state.videoObject.autoplay = true; state.videoObject.autoplay = true;
@ -227,10 +230,10 @@
* @replay 1=重播 * @replay 1=重播
* @resOne 1=第一次进入页面播放 * @resOne 1=第一次进入页面播放
**/ **/
const getvideoDom = async (id, replay=0, resOne=0) => { const getvideoDom = async (id, replay = 0, resOne = 0) => {
// //
if(resOne === 1){ if (resOne === 1) {
postSourceDeviceLog(); postSourceDeviceLog();
} }
@ -242,7 +245,7 @@
state.play_title = res.data.it618_name; state.play_title = res.data.it618_name;
state.videoObject.video = res.data.it618_videourl; state.videoObject.video = res.data.it618_videourl;
console.log('res.data',res.data); console.log('res.data', res.data);
if (res.data.playtime > 0) { if (res.data.playtime > 0) {
state.videoObject.seek = res.data.playtime; state.videoObject.seek = res.data.playtime;
@ -252,7 +255,7 @@
} }
// console.log('replay',replay); // console.log('replay',replay);
// console.log('seek',state.videoObject.seek); // console.log('seek',state.videoObject.seek);
state.msg = res.message; state.msg = res.message;
if (res.status === -1) { if (res.status === -1) {
state.isAuth = false; state.isAuth = false;
@ -338,7 +341,7 @@
// //
let get_duration = localStorage.getItem(state.videoid + '_duration_video'); let get_duration = localStorage.getItem(state.videoid + '_duration_video');
if(resOne !=1 && get_duration){ if (resOne != 1 && get_duration) {
let logData = { let logData = {
logid: state.logid, logid: state.logid,
pytime: localStorage.getItem(state.videoid + '_playTime_video'), pytime: localStorage.getItem(state.videoid + '_playTime_video'),
@ -350,7 +353,7 @@
// id // id
state.logid = res.data.logid; state.logid = res.data.logid;
state.videoid = res.data.id; state.videoid = res.data.id;
console.log('log_videoid',state.videoid); console.log('log_videoid', state.videoid);
// //
let winState = { url: id }; let winState = { url: id };
@ -535,16 +538,18 @@
font-size: 24px; font-size: 24px;
padding-bottom: 20px; padding-bottom: 20px;
} }
.txt_next{
.txt_next {
color: #fff; color: #fff;
font-size: 16px; font-size: 16px;
margin-bottom: 36px; margin-bottom: 36px;
} }
.sel_btn_box{ .sel_btn_box {
width: 310px; width: 310px;
margin: 0 auto; margin: 0 auto;
.btn_sty{
.btn_sty {
width: 46%; width: 46%;
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
@ -554,6 +559,7 @@
border: 1px solid #fff; border: 1px solid #fff;
border-radius: 6px; border-radius: 6px;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
background-color: #0082fc; background-color: #0082fc;
border: 1px solid #0082fc; border: 1px solid #0082fc;
@ -785,7 +791,7 @@
display: block !important; display: block !important;
} }
.autotime{ .autotime {
height: 35vh; height: 35vh;
top: 50px; top: 50px;
} }

Loading…
Cancel
Save