|
@@ -42,6 +42,7 @@
|
|
|
:src="item.video_url"
|
|
|
enable-play-gesture
|
|
|
:id="item.community_video_id"
|
|
|
+ @ended="curVideoId=0"
|
|
|
v-if="item.community_video_id==curVideoId"
|
|
|
></video>
|
|
|
<image @click="handelClickPlay(item)" v-else class="poster" :src="item.cover_img_url" mode="aspectFill" lazy-load/>
|
|
@@ -92,8 +93,9 @@
|
|
|
|
|
|
</template>
|
|
|
<script>
|
|
|
-import {apiVideoList} from '@/api/video'
|
|
|
+import {apiVideoList,apiVideoPlayLog} from '@/api/video'
|
|
|
import {apiOptionList} from '@/api/question'
|
|
|
+import {apiGetSceneToParams} from '@/api/common'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -112,8 +114,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
onLoad(options){
|
|
|
- this.videoId=options.videoId||0
|
|
|
- this.getList()
|
|
|
+ this.init(options)
|
|
|
this.getPermissionList()
|
|
|
},
|
|
|
onHide(){
|
|
@@ -148,11 +149,25 @@ export default {
|
|
|
}, 1500)
|
|
|
},
|
|
|
methods: {
|
|
|
+ async init(options){
|
|
|
+ if(options.scene){
|
|
|
+ const resScene=await apiGetSceneToParams({scene_key:options.scene})
|
|
|
+ if(resScene.code===200){
|
|
|
+ const obj=JSON.parse(resScene.data)
|
|
|
+ this.videoId=obj.videoId||0
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.videoId=options.videoId||0
|
|
|
+ }
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+
|
|
|
goSearchPage(){
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/video/videoSearch',
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
change(e){
|
|
|
this.active=e.detail
|
|
|
},
|
|
@@ -200,6 +215,12 @@ export default {
|
|
|
|
|
|
handelClickPlay(item){
|
|
|
this.curVideoId=item.community_video_id
|
|
|
+ // 记录播放
|
|
|
+ apiVideoPlayLog({video_id:Number(item.community_video_id)}).then(res=>{
|
|
|
+ if(res.code===200){
|
|
|
+ console.log('视频埋点成功');
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
}
|