|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
import { useEffect, useState } from 'react' |
|
|
|
|
import Taro, { useLoad, useShareAppMessage, useShareTimeline } from '@tarojs/taro' |
|
|
|
|
import Taro, { useLoad, useShareAppMessage, useShareTimeline, useDidHide } from '@tarojs/taro' |
|
|
|
|
import { View, Text, Video, Image, ScrollView, CoverView, CoverImage } from '@tarojs/components' |
|
|
|
|
|
|
|
|
|
import './index.less' |
|
|
|
@ -129,6 +129,23 @@ export default function Index() { |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// 页面隐藏(用于播放视频的时候进入小窗模式时发送埋点)
|
|
|
|
|
useDidHide(() => { |
|
|
|
|
console.log('页面离开', alldata[displayindex['index']].ResId) |
|
|
|
|
Taro.request({ |
|
|
|
|
method: 'POST', |
|
|
|
|
url: 'https://interapi.jm-kid.com/api/embedpoint', |
|
|
|
|
header: { |
|
|
|
|
authorization: `bearer ${Taro.getStorageSync('UserToken')}` |
|
|
|
|
}, |
|
|
|
|
data: { |
|
|
|
|
timestamp: Date.now(), |
|
|
|
|
action_code: '1005006', |
|
|
|
|
value: alldata[displayindex['index']].ResId |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
useLoad((query) => { |
|
|
|
|
console.log('id=>', query.id) |
|
|
|
|
if(Taro.getStorageSync('UserToken')){ |
|
|
|
@ -318,6 +335,20 @@ export default function Index() { |
|
|
|
|
poster: rres.data.data.body.videoBase.coverURL, |
|
|
|
|
title: rres.data.data.body.playInfoList.playInfo[0].ResTitle || '', |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// 埋点
|
|
|
|
|
Taro.request({ |
|
|
|
|
method: 'POST', |
|
|
|
|
url: 'https://interapi.jm-kid.com/api/embedpoint', |
|
|
|
|
header: { |
|
|
|
|
authorization: `bearer ${Taro.getStorageSync('UserToken')}` |
|
|
|
|
}, |
|
|
|
|
data: { |
|
|
|
|
timestamp: Date.now(), |
|
|
|
|
action_code: '1005007', |
|
|
|
|
value: alldata[nowindex].ResId |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|