|
@@ -10,15 +10,41 @@ Page({
|
|
data: {
|
|
data: {
|
|
id: null,
|
|
id: null,
|
|
item: null,
|
|
item: null,
|
|
- creator: null
|
|
|
|
|
|
+ creator: null,
|
|
|
|
+ cHeight: 0,
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
*/
|
|
onLoad: function (options) {
|
|
onLoad: function (options) {
|
|
- this.setData({ id: options.vid })
|
|
|
|
|
|
+ this.setData({
|
|
|
|
+ id: options.vid
|
|
|
|
+ })
|
|
this.loadInfo()
|
|
this.loadInfo()
|
|
|
|
+
|
|
|
|
+ let wHeight = wx.getSystemInfoSync().windowHeight
|
|
|
|
+ let psHeight = 0
|
|
|
|
+ wx.createSelectorQuery().select('#playShow').boundingClientRect(rect => {
|
|
|
|
+ psHeight = rect.height;
|
|
|
|
+ console.log(psHeight)
|
|
|
|
+ }).exec();
|
|
|
|
+ let tHeight = 0
|
|
|
|
+ wx.createSelectorQuery().select('.title').boundingClientRect(rect => {
|
|
|
|
+ tHeight = rect.height;
|
|
|
|
+ console.log(tHeight)
|
|
|
|
+ }).exec();
|
|
|
|
+ let evHeight = 0
|
|
|
|
+ wx.createSelectorQuery().select('.edit-view').boundingClientRect(rect => {
|
|
|
|
+ evHeight = rect.height;
|
|
|
|
+ console.log(evHeight)
|
|
|
|
+ console.log(wHeight)
|
|
|
|
+ const cHeight = wHeight - psHeight - evHeight - tHeight - 40
|
|
|
|
+ this.setData({
|
|
|
|
+ cHeight
|
|
|
|
+ })
|
|
|
|
+ }).exec();
|
|
|
|
+
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -76,24 +102,32 @@ Page({
|
|
loadInfo: function () {
|
|
loadInfo: function () {
|
|
const urls = urlDef.urls;
|
|
const urls = urlDef.urls;
|
|
let stu = wx.getStorageSync('student');
|
|
let stu = wx.getStorageSync('student');
|
|
- this.setData({ curStu: stu })
|
|
|
|
|
|
+ this.setData({
|
|
|
|
+ curStu: stu
|
|
|
|
+ })
|
|
|
|
|
|
util.apiPost(urls.person_video_list + '&q.videoId=' + this.data.id).then((rs) => {
|
|
util.apiPost(urls.person_video_list + '&q.videoId=' + this.data.id).then((rs) => {
|
|
if (rs && rs.length > 0) {
|
|
if (rs && rs.length > 0) {
|
|
let o = rs[0]
|
|
let o = rs[0]
|
|
o.viewsCount = this.formatCount(o.viewsCount)
|
|
o.viewsCount = this.formatCount(o.viewsCount)
|
|
- this.setData({ item: o })
|
|
|
|
|
|
+ this.setData({
|
|
|
|
+ item: o
|
|
|
|
+ })
|
|
util.apiPost(urls.video_loadInfo + this.data.id).then((rs) => {
|
|
util.apiPost(urls.video_loadInfo + this.data.id).then((rs) => {
|
|
o.imgUrl = rs.img
|
|
o.imgUrl = rs.img
|
|
o.playUrl = rs.url
|
|
o.playUrl = rs.url
|
|
- this.setData({ item: o })
|
|
|
|
|
|
+ this.setData({
|
|
|
|
+ item: o
|
|
|
|
+ })
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
- let goodEntity = { videoId: this.data.id, personId: stu.studentId, personType: 1 };
|
|
|
|
- util.apiPost(urls.person_video_view_save, goodEntity, 'application/json').then(rs => {
|
|
|
|
- }).catch(e => {
|
|
|
|
- });
|
|
|
|
|
|
+ let goodEntity = {
|
|
|
|
+ videoId: this.data.id,
|
|
|
|
+ personId: stu.studentId,
|
|
|
|
+ personType: 1
|
|
|
|
+ };
|
|
|
|
+ util.apiPost(urls.person_video_view_save, goodEntity, 'application/json').then(rs => {}).catch(e => {});
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
@@ -105,7 +139,9 @@ Page({
|
|
u = {}
|
|
u = {}
|
|
u.imageUrl = urls.oss_file + 'image/' + u.imageUrl
|
|
u.imageUrl = urls.oss_file + 'image/' + u.imageUrl
|
|
}
|
|
}
|
|
- this.setData({ creator: u })
|
|
|
|
|
|
+ this.setData({
|
|
|
|
+ creator: u
|
|
|
|
+ })
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|