123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- import {
- getSelfRead
- } from '~/api/user'
- let videoContext = null
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- list: [],
- currentVideo: '',
- videoState: true
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
- this.getSelfRead()
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
- },
- //获取自己作品列表
- async getSelfRead() {
- let params = {
- uid: wx.getStorageSync('uid'),
- pageNo: 1,
- pageSize: 99
- }
- let list = await getSelfRead(params)
- this.setData({
- list
- })
- console.log(list[0]);
- },
- // 开始播放
- playVideo({
- currentTarget
- }) {
- this.setData({
- videoState: true,
- currentId: currentTarget.dataset.id
- })
- },
- changeVideoState() {
- this.videoContext = wx.createVideoContext('myVideo')
- console.log(this.data.videoState);
- let videoState = this.data.videoState
- if (videoState) {
- this.videoContext.pause()
- } else {
- this.videoContext.play()
- }
- this.setData({
- videoState: !videoState
- })
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
- }
- })
|