收藏
回答

async在事件函数中的问题

async在input输入第二次的时候直接打印出 [object Promise] 55,这该怎么解决

<input type="number" placeholder-class="gd1" bindinput="inputverifycode" class="f17" placeholder="输入验证码" value="{{code}}"/>

inputverifycode:async function(e){
        console.log(e.detail.value,55)
        var that = this;
        this.setData({
            verifycode: e.detail.value
        })
        if (e.detail.value.length == 6) {
             
            var data = {
                "code": e.detail.value,
                "phone": this.data.phone
            }
            //app.outTime(that);
          const result = await request({url:'phonecode/validateCode', data, method:'POST'})
          console.log(result,43);
        }
 
    },


最后一次编辑于  2018-11-19  (未经腾讯允许,不得转载)
回答关注问题邀请回答
收藏

1 个回答

  • 是柿子啊
    是柿子啊
    2018-11-23

    单独输出input会这样吗?

    2018-11-23
    赞同
    回复