小程序页面的倒计时在苹果手机中不显示,安卓手机正常 []

- 当前 Bug 的表现(可附上截图)



在苹果手机里,倒计时在小程序的预览里面,正式上线版本里不显示,但苹果手机调试的控制台会打印倒计时在执行,开发工具和远程调试会显示,安卓手机一切正常。





  • 这是因为iOS时间戳转换问题,



    let arr = that.data.gmtDate.split(/[- :]/);// that.data.gmtDate时间格式为'2018-08-07 10:23:00'

    let nndate = new Date(arr[0], arr[1] - 1, arr[2], arr[3], arr[4], arr[5]);

        nndate=Date.parse(nndate)

    let timeLeft = nndate- new Date();


    上面代码是我之前从网上找来的可兼容安卓苹果端的代码


    • 谢谢   出来了

    • 你好,怎么解决呢?