您好。代码片段如下: wxml—> <view class='video-box'> <live-player id="livePlay" src="{{watchUrl == undefined ? '' : watchUrl}}" mode="RTC" autoplay="autoplay" bindtap="touchBottom" data-id="{{watchId}}" > <cover-view class='player_bottom' animation="{{animationData}}" wx:if="{{showModalplayer}}"> <cover-view class='player-play' bindtap="play" wx:if='{{!playindexFlag}}'> <cover-image src='/static/images/icon/play.png' /> </cover-view> <cover-view class='player-pause' bindtap="pause" wx:if='{{playindexFlag}}'> <cover-image src='/static/images/icon/pause.png' /> </cover-view> <cover-view class='player-right' bindtap="showFullScreen"> <cover-image wx:if="{{livePlayFlag1}}" src='/static/images/icon/all_big.png' /> </cover-view> <cover-view class='player-right' bindtap="exitFullScreen"> <cover-image wx:if="{{livePlayFlag2}}" src='/static/images/icon/all.png'></cover-image> </cover-view> </cover-view> </live-player> </view> live-player添加了一个bindtap的touchBottom事件,在js触发 js—> touchBottom: function () { var that = this; var animation = wx.createAnimation({ duration: 200, timingFunction: "linear", delay: 0 }) that.animation = animation animation.translateY(300).step() that.setData({ animationData: animation.export(), showModalplayer: true }); animation.translateY(0).step() that.setData({ animationData: animation.export(), }); }, 我意在直播通过touchBottom事件弹出cover-view层,但是点击时无法响应touchBottom事件,请解答,谢谢。
live-player 在iPhone下响应不了bindtap事件直播组件live-player添加bindtap事件在Android中可以响应,在iPhone响应不了,代码如下: <live-player id="livePlay" src="{{watchUrl == undefined ? '' : watchUrl}}" mode="RTC" autoplay="autoplay" bindstatechange="statechange" data-id="{{watchId}}" bindtap='touchBottom'> <cover-view class='player_bottom' animation="{{animationData}}" wx:if="{{showModalplayer}}"> <cover-view class='player-play' bindtap="play" wx:if='{{!playindexFlag}}'> <cover-image src='/static/images/icon/play.png' /> </cover-view> <cover-view class='player-pause' bindtap="pause" wx:if='{{playindexFlag}}'> <cover-image src='/static/images/icon/pause.png' /> </cover-view> <cover-view class='player-right' bindtap="showFullScreen"> <cover-image wx:if="{{livePlayFlag1}}" src='/static/images/icon/all_big.png' /> </cover-view> <cover-view class='player-right' bindtap="exitFullScreen"> <cover-image wx:if="{{livePlayFlag2}}" src='/static/images/icon/all.png'></cover-image> </cover-view> </cover-view> </live-player>
2018-07-11您好,是有输出的,现在的问题是在Android真机可以显示倒计时,在iPhone真机就显示不了。
在IPhone中使用setInterval无效var interval = setInterval(function () { // 秒数 var second = totalSecond; // 天数位 var day = Math.floor(second / 3600 / 24); var dayStr = day.toString(); if (dayStr.length == 1) dayStr = '0' + dayStr; // 小时位 var hr = Math.floor((second - day * 3600 * 24) / 3600); var hrStr = hr.toString(); if (hrStr.length == 1) hrStr = '0' + hrStr; // 分钟位 var min = Math.floor((second - day * 3600 * 24 - hr * 3600) / 60); var minStr = min.toString(); if (minStr.length == 1) minStr = '0' + minStr; // 秒位 var sec = second - day * 3600 * 24 - hr * 3600 - min * 60; var secStr = sec.toString(); if (secStr.length == 1) secStr = '0' + secStr; that.setData({ liveday: dayStr, livehours: hrStr, livesecond: secStr, liveminute: minStr, }); totalSecond--; //用于判断是否显示天数 if (day == 0) { that.setData({ Downday: false, Downsecond: true }) } else { that.setData({ Downday: true, Downsecond: false }) } }.bind(this), 1000);
2018-06-30