setting.js 1019 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. const app = getApp();
  2. Page({
  3. data: {
  4. iptValue:"",
  5. isPrem:false
  6. },
  7. onLoad: function (options) {
  8. },
  9. closePremWin(){
  10. this.setData({
  11. isPrem:false
  12. })
  13. },
  14. showPremWin(){
  15. this.setData({
  16. iptValue:"",
  17. isFocus:true,
  18. isPrem:true
  19. })
  20. },
  21. setValue(e){
  22. const that = this
  23. var iptValue = e.detail.value.substr(0,6)
  24. this.setData({
  25. iptValue
  26. })
  27. if(iptValue && iptValue.length>=6){
  28. if(iptValue == this.data.password){
  29. this.setData({
  30. isPrem:false
  31. })
  32. wx.navigateTo({
  33. url: '/pages/instruct/instruct',
  34. })
  35. }else{
  36. app.showToptip(that, "error","密码错误")
  37. }
  38. }
  39. },
  40. // getUserPrem(){
  41. // var that = this
  42. // app.requestP({
  43. // url: "/vvm/userPrem/listUserPrem",
  44. // }).then(res => {
  45. // var userPrem = res.data.data
  46. // that.setData({
  47. // password:userPrem[0].password,
  48. // prem:userPrem[0].prem,
  49. // })
  50. // })
  51. // }
  52. })