const app = getApp();
Page({
  data: {
    iptValue:"",
    isPrem:false
  },
  onLoad: function (options) {

  },
  closePremWin(){
    this.setData({
      isPrem:false
    })
  },
  showPremWin(){
    this.setData({
      iptValue:"",
      isFocus:true,
      isPrem:true
    })
  },
  setValue(e){
    const that = this
    var iptValue = e.detail.value.substr(0,6)
    this.setData({
      iptValue
    })
    if(iptValue && iptValue.length>=6){
      if(iptValue == this.data.password){
        this.setData({
          isPrem:false
        })
        wx.navigateTo({
          url: '/pages/instruct/instruct',
        })
      }else{
        app.showToptip(that, "error","密码错误")
      }
    }
  },
  // getUserPrem(){
  //   var that = this
  //   app.requestP({
  //     url: "/vvm/userPrem/listUserPrem",
  //   }).then(res => {
  //     var userPrem = res.data.data
  //     that.setData({
  //       password:userPrem[0].password,
  //       prem:userPrem[0].prem,
  //     })
  //   })
  // }
  
})