123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- import {
- getSelfRead
- } from '~/api/user'
- let videoContext = null
- Page({
-
- data: {
- list: [],
- currentId: '',
- videoState: true
- },
- onLoad(options) {
- this.getSelfRead()
- },
-
- async getSelfRead() {
- let list = await getSelfRead()
- this.setData({
- list
- })
- console.log(list[0]);
- },
-
- changStatus({
- detail
- }) {
- console.log(detail);
- this.setData(detail)
- },
-
- 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
- })
- },
- onShareAppMessage() {
- }
- })
|