我能吐槽下开放社区的代码插入功能吗?
发布于 7 年前 作者 liaoxiulan 7609 次浏览 来自 问答

我能吐槽下开放社区的代码插入功能吗?非常不方便

5 回复

下面为什么不执行?

let interval = setInterval(()=>{
        let {orderTime, staticTime} = this.state;
        let nowTime = Date.now();
        let sub = Math.floor((orderTime + staticTime - nowTime)/1000);
        console.log('sub',sub);
        if(sub<=0){
            clearInterval(interval);
            this.setState({
                tip:'支付超时',
                isFalse:true
            });
            return;
        }
        let minutes = parseInt(sub/60);
        let Seconds = sub%60;
        let tip = '订单已提交,请在'+minutes+'分'+Seconds+'秒内完成支付';
        console.log(tip);
        this.setState({
            tip:tip,
            isFalse:false
        });
    },1000);

怎么不方便法?

具体是什么问题?

function trace(...args) {
    console.log(...args)
}
trace('为什么不好用?');

你是程序员吗?会写代码吗?你发的那些文章,你觉得能上的了台面吗?多发一些高质量的文章呀,量那么多,没有一个有用的呀。。。

回到顶部