微信小程序promise解决onload异步

  onLoad: function (options) {
    this.con(4).then(res=>{
      console.log(res)
        
    })
  },
  con(id){
    let thaT=this
    return new Promise((r,t)=>{
      if(id==1){
        r(2)
      }else{
        t(3)
      }
    })
  },