record.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // pages/login/login.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. showEyes: false,
  8. form: {
  9. phone: "",
  10. password: ''
  11. },
  12. phone: ''
  13. },
  14. /**
  15. * 生命周期函数--监听页面加载
  16. */
  17. onLoad: function (options) {
  18. // const token = wx.getStorageSync('token')
  19. // console.log(token);
  20. // if (!token || token == '') {
  21. // wx.setNavigationBarTitle({
  22. // title: '分拣系统',
  23. // })
  24. // }else{
  25. // wx.switchTab({
  26. // url: '/pages/tabber/home/index',
  27. // })
  28. // }
  29. },
  30. onReady(){
  31. },
  32. close() {
  33. this.data.form.phone = ''
  34. this.setData({
  35. phone: ''
  36. })
  37. console.log(this.data.phone);
  38. },
  39. inputValue1(e) {
  40. let { value } = e.detail
  41. this.data.form.phone = value
  42. this.setData({
  43. phone: value
  44. })
  45. console.log(this.data.phone);
  46. },
  47. inputValue2(e) {
  48. let { value } = e.detail
  49. this.data.form.password = value
  50. },
  51. changeEyes() {
  52. this.setData({
  53. showEyes: !this.data.showEyes
  54. })
  55. },
  56. login() {
  57. console.log(this.data.form);
  58. wx.setStorageSync('token', "测试值")
  59. wx.switchTab({
  60. url: '/pages/tabber/home/index',
  61. })
  62. }
  63. })