From c6f7dd819ffc8678d1be74d706ce9908093504b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9C=E2=80=9Cshijing?= <“1378914240@qq.com>
Date: Wed, 25 Aug 2021 14:08:53 +0800
Subject: [PATCH] mp_video
---
client/package.json | 4 +-
client_mp/.hbuilderx/launch.json | 19 +++--
client_mp/common/http.api.js | 12 +++-
client_mp/pages.json | 24 ++++++-
client_mp/pages/my/my.vue | 11 ++-
client_mp/pages/my/videoWatchRecords.vue | 89 ++++++++++++++++++++++++
client_mp/pages/vod/video.vue | 74 +++++++++++++++++---
client_mp/pages/vod/watchPage.vue | 61 ++++++++++++++++
8 files changed, 274 insertions(+), 20 deletions(-)
create mode 100644 client_mp/pages/my/videoWatchRecords.vue
create mode 100644 client_mp/pages/vod/watchPage.vue
diff --git a/client/package.json b/client/package.json
index a7eed94..a0475b7 100644
--- a/client/package.json
+++ b/client/package.json
@@ -16,7 +16,7 @@
},
"dependencies": {
"@riophae/vue-treeselect": "^0.4.0",
- "axios": "0.18.1",
+ "axios": "^0.21.1",
"element-ui": "2.13.0",
"file-saver": "^2.0.2",
"js-cookie": "2.2.0",
@@ -27,7 +27,7 @@
"vue": "2.6.10",
"vue-router": "3.0.6",
"vuex": "3.1.0",
- "xlsx": "^0.15.5"
+ "xlsx": "^0.17.1"
},
"devDependencies": {
"@babel/core": "7.0.0",
diff --git a/client_mp/.hbuilderx/launch.json b/client_mp/.hbuilderx/launch.json
index 501e01c..075b9c5 100644
--- a/client_mp/.hbuilderx/launch.json
+++ b/client_mp/.hbuilderx/launch.json
@@ -2,10 +2,19 @@
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version": "0.0",
"configurations": [{
- "type": "uniCloud",
- "default": {
- "launchtype": "remote"
- }
- }
+ "default" :
+ {
+ "launchtype" : "remote"
+ },
+ "h5" :
+ {
+ "launchtype" : "remote"
+ },
+ "mp-weixin" :
+ {
+ "launchtype" : "remote"
+ },
+ "type" : "uniCloud"
+ }
]
}
diff --git a/client_mp/common/http.api.js b/client_mp/common/http.api.js
index 90377a5..cc6265c 100644
--- a/client_mp/common/http.api.js
+++ b/client_mp/common/http.api.js
@@ -42,8 +42,13 @@ const install = (Vue, vm) => {
let appointChecker = (params) => vm.$u.post('/quality/inspectrecord/appoint/', params);//检查指派
let getDocument = (params={})=>vm.$u.get('/quality/document/', params);//文档
let getVideos = (params={})=>vm.$u.get('/vod/video/', params);//点播视频
+ let getThisVideo = (id,params)=>vm.$u.get(`/vod/video/${id}/`, params);//点播视频
let getDickey = (params={})=>vm.$u.get('/system/dict/', params);//查询字典
- let putMyVideoView =(id)=>vm.$u.put(`/vod/video/${id}/myview/`);//更新本人观看信息
+
+ let putMyVideoView =(id,params)=>vm.$u.put(`/vod/video/${id}/myview/`,params);//更新本人观看信息
+
+ let getMyVideoRecord =(id)=>vm.$u.get(`/vod/video/myview/`);//获取本人观看记录
+ let getVideoRecord =(id)=>vm.$u.get(`/vod/video/${id}/myview/`);//获取本人观看记录
vm.$u.api = {getUserInfo,
getCode,
codeLogin,
@@ -64,7 +69,10 @@ const install = (Vue, vm) => {
getDocument,
getVideos,
getDickey,
- putMyVideoView
+ putMyVideoView,
+ getMyVideoRecord,
+ getVideoRecord,
+ getThisVideo
};
}
diff --git a/client_mp/pages.json b/client_mp/pages.json
index e330e3c..7e9c229 100644
--- a/client_mp/pages.json
+++ b/client_mp/pages.json
@@ -128,7 +128,21 @@
"enablePullDownRefresh": false
}
- }
+ },{
+ "path":"pages/my/videoWatchRecords",
+ "style" :
+ {
+ "navigationBarTitleText": "观看记录",
+ "enablePullDownRefresh": false
+ }
+ },{
+ "path":"pages/vod/watchPage",
+ "style" :
+ {
+ "navigationBarTitleText": "云视频",
+ "enablePullDownRefresh": false
+ }
+ }
],
"globalStyle": {
"navigationBarTextStyle": "white",
@@ -160,5 +174,11 @@
"text": "个人中心"
}
]
- }
+ },
+ "plugins": {
+ "tencentvideo": {
+ "version": "1.4.9",
+ "provider": "wxa75efa648b60994b"
+ }
+ }
}
diff --git a/client_mp/pages/my/my.vue b/client_mp/pages/my/my.vue
index 13754f9..9c13fdc 100644
--- a/client_mp/pages/my/my.vue
+++ b/client_mp/pages/my/my.vue
@@ -43,6 +43,10 @@
+
+
+
+
@@ -83,7 +87,12 @@
}).catch(e=>{})
}
});
- }
+ },
+ ViewRecord(){
+ uni.navigateTo({
+ url: '/pages/my/videoWatchRecords'
+ });
+ },
}
}
diff --git a/client_mp/pages/my/videoWatchRecords.vue b/client_mp/pages/my/videoWatchRecords.vue
new file mode 100644
index 0000000..a2685bc
--- /dev/null
+++ b/client_mp/pages/my/videoWatchRecords.vue
@@ -0,0 +1,89 @@
+
+
+
+
+ {{loadingText}}
+
+
+
+
+
+
+
+
diff --git a/client_mp/pages/vod/video.vue b/client_mp/pages/vod/video.vue
index 8a5a0d6..43efd7c 100644
--- a/client_mp/pages/vod/video.vue
+++ b/client_mp/pages/vod/video.vue
@@ -21,14 +21,20 @@
@refresherrefresh="handleRefre" :refresher-enabled="true" class="swiper-scroll" scroll-y="true"
@scrolltolower="swiperScrollLower">
-
-
@@ -62,8 +78,13 @@
content: []
}],
refreStatus: false,
+ videoDialog:false,
loadingText: "加载中",
- search:""
+ search:"",
+ videoCoverurl:'',
+ videoUrl:'',
+ videoId:0,
+ current:0,
};
},
computed: {
@@ -102,11 +123,23 @@
})
},
methods: {
+ videoOpen(video){
+ // debugger;
+ // console.log(video)
+
+ uni.navigateTo({
+ url: '/pages/vod/watchPage?id='+video.id
+ });
+ },
+ closeVideo(){
+ this.videoDialog = false;
+ },
doPlay(e, index) {
if (e.type == 'play') {
var playingVideoStr = e.target.id
- this.list[this.swiperIndex].content[index].showTitle = false
- this.$u.api.putMyVideoView(this.list[this.swiperIndex].content[index].id).then(res=>{})
+ // this.list[this.swiperIndex].content[index].showTitle = false
+ // this.$u.api.putMyVideoView(this.list[this.swiperIndex].content[index].id).then(res=>{})
+ this.$u.api.putMyVideoView(this.videoId).then(res=>{})
//暂停其他视频播放
if(this.playingVideoStr==null){
this.playingVideoStr = playingVideoStr
@@ -117,7 +150,7 @@
this.playingVideoStr = playingVideoStr
}
} else {
- this.list[this.swiperIndex].content[index].showTitle = true
+ // this.list[this.swiperIndex].content[index].showTitle = true
}
},
// 获取dom信息
@@ -330,6 +363,7 @@
// height: 400upx;
border-bottom: 4upx solid pink;
// line-height: 400upx;
+ position: relative;
}
.swiper-scroll {
@@ -348,6 +382,30 @@
font-size: 16px;
color: white;
background-color: black;
- opacity: 0.3;
+ opacity: 0.6;
+ position: absolute;
+ }
+ .playIcon{
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ z-index: 100;
+ transform: translate(-50%, -50%);
+ }
+ #videoDialog{
+ position: fixed;
+ width: 100%;
+ height: 100%;
+ top: 0;
+ left: 0;
+ background-color: rgba(0, 0, 0, 0.5);
+ }
+ .closeIconWrap{
+ position: relative;
+ text-align: right;
+ }
+ .closeIcon{
+ padding: 20px;
+ margin-bottom: 10px;
}
diff --git a/client_mp/pages/vod/watchPage.vue b/client_mp/pages/vod/watchPage.vue
new file mode 100644
index 0000000..00af809
--- /dev/null
+++ b/client_mp/pages/vod/watchPage.vue
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+