IOS live-player中的组件包含 setInterval时,数据不正常?
发布于 3 年前 作者 kzhang 8442 次浏览 来自 官方Issues

在live-player组件中嵌入了一个组件,这个组件有个setInterval操作,IOS下不正常。

代码如下:

showToast({ title`${count}`icon'none' }); // 这里的count是好的,但下面的count 不正常
    return <View
        style={`width: ${_pixel}pxheight: ${_pixel}px;`}
        className="countdown-container flex flex-item-center flex-justify-center">
        <Canvas style={`width: ${_pixel}pxheight: ${_pixel}px;z-index: 0;`} id="cvs1" type="2d"></Canvas>
        <Canvas style={`width: ${_pixel}pxheight: ${_pixel}px;z-index: 1;`} id="cvs2" type="2d"></Canvas>
        <Canvas style={`width: ${_pixel}pxheight: ${_pixel}px;z-index: 2;`} id="cvs3" type="2d"></Canvas>
        <View className="flex flex-col flex-justify-center flex-item-center">
            <View className="timer-count flex flex-item-center flex-justify-center"> {count} </View>
            <View className="timer-tips flex flex-item-center" > 倒计时 (S) </View>
        </View>
    </View >
    

2 回复

video不要包裹任何东西,使用定时器 你可以跟video同级。

<view style="position: relative">
  <video src="xxx" />
  <view style="position: absolute">倒计时</view>
</view>

https://developers.weixin.qq.com/s/jbd1zqmP7rsC

已经排除taro的问题,写了一个测试代码。

https://developers.weixin.qq.com/s/6rV7hlmo7Gsz

回到顶部