// pages/module_common/pagevideo/pagevideo.js import ListPage from '../../../base/ListPage' import bFetch from '../behaviors/bFetch' const lawservice = require("../../../service/lawservice") const moment = require('../../../utils/moment.min') const app = getApp() ListPage({ behaviors: [bFetch], /** * 页面的初始数据 */ data: { video: {}, series: [], thisVideo: 1, showDialog: false, groups: [ 'actionSlot1', ] }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { var that = this this.getOpenerEventChannel().on('acceptDataFromOpenerPage', function (data) { setTimeout(() => { that.setData({ video: data }) }, 500); // 页面标题 if (data.lrResourcetitle) { wx.setNavigationBarTitle({ title: data.lrResourcetitle, }) } // 视频所在合集 if (data.lrExtension2 && data.lrExtension2 != '') { if (data.lrExtension3) { that.setData({ thisVideo: parseInt(data.lrExtension3) }) } that.getSerise(data.lrExtension2) } }) this.getResources({fileType: 4}) }, getSerise(seriesId) { var that = this lawservice.getSerise(app.globalData.userInfo.guid, seriesId, { success(data) { that.setData({ series: data }) }, }) }, showSeries() { this.setData({ showDialog: true }) }, selectVideo(e) { let thisVideo = e.currentTarget.dataset.index const video = this.data.series[thisVideo] thisVideo++ this.setData({ video, thisVideo, showDialog: false }) } })