updatepassword.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. const app = require('../../utils/util.js');
  2. var util = require('../../utils/md5.js')
  3. Page({
  4. data: {
  5. defaultType1: true,
  6. passwordType1: true,
  7. defaultType2: true,
  8. passwordType2: true,
  9. defaultType3: true,
  10. passwordType3: true,
  11. info:{},
  12. },
  13. eyeStatus1() {
  14. if (this.data.defaultType1) {
  15. this.setData({
  16. passwordType1: false,
  17. defaultType1: false,
  18. })
  19. } else {
  20. this.setData({
  21. passwordType1: true,
  22. defaultType1: true,
  23. })
  24. }
  25. },
  26. eyeStatus2() {
  27. if (this.data.defaultType2) {
  28. this.setData({
  29. passwordType2: false,
  30. defaultType2: false,
  31. })
  32. } else {
  33. this.setData({
  34. passwordType2: true,
  35. defaultType2: true,
  36. })
  37. }
  38. },
  39. eyeStatus3() {
  40. if (this.data.defaultType3) {
  41. this.setData({
  42. passwordType3: false,
  43. defaultType3: false,
  44. })
  45. } else {
  46. this.setData({
  47. passwordType3: true,
  48. defaultType3: true,
  49. })
  50. }
  51. },
  52. formSubmit(e) {
  53. console.log(e.detail, "daying");
  54. var password = e.detail.value.pwd;
  55. wx.request({
  56. url: app.globalData.publicUrl + '/applet/updatePwd',
  57. method: "GET",
  58. header: {
  59. appletsId: wx.getStorageSync('openId')
  60. },
  61. data: e.detail.value,
  62. success: (res) => {
  63. }
  64. })
  65. // wx.switchTab({
  66. // url: '/pages/index/index',
  67. // })
  68. },
  69. onLoad: function () {
  70. wx.request({
  71. url: app.globalData.publicUrl + '/sys/login/session',
  72. method: "GET",
  73. header: {
  74. appletsId: wx.getStorageSync('openId')
  75. },
  76. success: (res) => {
  77. console.log(res,"000");
  78. this.setData({
  79. info:res.data.data
  80. })
  81. }
  82. })
  83. },
  84. })