index.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. // pages/ucenter/accountsecurity/accountsecurity.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. isBindPhone: 0,
  8. reviserPasswordScene: 'MDF_PWD',
  9. unbindPhoneScene: 'UN_PHONE'
  10. },
  11. goModifuPassword(e) {
  12. if (this.data.isBindPhone==0) {
  13. let url = `/pages/bindPhone/bindPhone`;
  14. wx.navigateTo({
  15. url
  16. });
  17. return;
  18. }
  19. let url = '/pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity?scene='+this.data.reviserPasswordScene;
  20. wx.navigateTo({
  21. url
  22. });
  23. },
  24. goModifyPhone(e) {
  25. if (this.data.isBindPhone==0) {
  26. let url = `/pages/bindPhone/bindPhone`;
  27. wx.navigateTo({
  28. url
  29. });
  30. return;
  31. }
  32. let url = '/pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity?scene='+this.data.unbindPhoneScene;
  33. wx.navigateTo({
  34. url
  35. });
  36. },
  37. /**
  38. * 生命周期函数--监听页面加载
  39. */
  40. onLoad(options) {
  41. let userInfo = wx.getStorageSync('userInfo');
  42. this.setData({
  43. isBindPhone: userInfo.bindingPhone
  44. });
  45. },
  46. /**
  47. * 生命周期函数--监听页面初次渲染完成
  48. */
  49. onReady() {
  50. },
  51. /**
  52. * 生命周期函数--监听页面显示
  53. */
  54. onShow() {
  55. },
  56. /**
  57. * 生命周期函数--监听页面隐藏
  58. */
  59. onHide() {
  60. },
  61. /**
  62. * 生命周期函数--监听页面卸载
  63. */
  64. onUnload() {
  65. },
  66. /**
  67. * 页面相关事件处理函数--监听用户下拉动作
  68. */
  69. onPullDownRefresh() {
  70. },
  71. /**
  72. * 页面上拉触底事件的处理函数
  73. */
  74. onReachBottom() {
  75. },
  76. /**
  77. * 用户点击右上角分享
  78. */
  79. onShareAppMessage() {
  80. }
  81. })