|
@@ -13,7 +13,9 @@ import {
|
|
|
import {
|
|
|
setFans
|
|
|
} from '~/api/user'
|
|
|
-
|
|
|
+import {
|
|
|
+ setDuration
|
|
|
+} from '~/utils/util'
|
|
|
Component({
|
|
|
behaviors: [storeBindingsBehavior],
|
|
|
storeBindings: {
|
|
@@ -33,9 +35,9 @@ Component({
|
|
|
type: Object,
|
|
|
value: {},
|
|
|
observer(newVal) {
|
|
|
- if (newVal.userReadExtend && newVal.userReadExtend.resourcesType == 1) {
|
|
|
- newVal.userRead.title = newVal.userRead.title.split('\n')
|
|
|
- }
|
|
|
+ /* if (newVal.userReadExtend && newVal.userReadExtend.resourcesType == 1) {
|
|
|
+ newVal.userRead.title = newVal.userRead.title.split('\n')
|
|
|
+ } */
|
|
|
this.setData({
|
|
|
videoInfoCopy: newVal
|
|
|
})
|
|
@@ -51,22 +53,36 @@ Component({
|
|
|
},
|
|
|
sliderValue: {
|
|
|
type: Number,
|
|
|
- value: 0
|
|
|
+ value: 0,
|
|
|
+ },
|
|
|
+ currentTime: {
|
|
|
+ type: String,
|
|
|
+ value: '00:00',
|
|
|
}
|
|
|
},
|
|
|
data: {
|
|
|
selfUid: wx.getStorageSync('uid'),
|
|
|
videoInfoCopy: {},
|
|
|
},
|
|
|
+ lifetimes: {
|
|
|
+ attached() {
|
|
|
+ let {
|
|
|
+ userReadExtend,
|
|
|
+ userRead
|
|
|
+ } = this.data.videoInfoCopy
|
|
|
+ if (userReadExtend.resourcesType == 1) {
|
|
|
+ this.setData({
|
|
|
+ endTime: setDuration(userRead.duration)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
// 播放视频
|
|
|
playVideo() {
|
|
|
this.triggerEvent('playVideo', this.properties.videoInfo.userRead.id)
|
|
|
this.submitPlayLog(this.properties.videoInfo.userRead.id)
|
|
|
},
|
|
|
- slider(v) {
|
|
|
- console.log(v);
|
|
|
- },
|
|
|
// 设置视频公开还是隐私
|
|
|
async setVideoPublic() {
|
|
|
let info = this.properties.videoInfo.userRead
|
|
@@ -238,7 +254,6 @@ Component({
|
|
|
},
|
|
|
// 控制音频播放
|
|
|
audioPlay() {
|
|
|
- console.log('zzzz');
|
|
|
this.triggerEvent('playAudio')
|
|
|
this.submitPlayLog(this.properties.videoInfo.userRead.id)
|
|
|
},
|