index.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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.phoneCheck()){
  13. let url = '/pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity?scene='+this.data.reviserPasswordScene;
  14. wx.navigateTo({
  15. url
  16. });
  17. }
  18. },
  19. goModifyPhone(e) {
  20. if(this.phoneCheck()){
  21. let url = '/pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity?scene='+this.data.unbindPhoneScene;
  22. wx.navigateTo({
  23. url
  24. });
  25. }
  26. },
  27. phoneCheck(){
  28. if (this.data.isBindPhone==0) {
  29. wx.showModal({
  30. title: '提示',
  31. content: '当前账户未绑定手机号,请您进行手机号绑定操作',
  32. showCancel:false,
  33. confirmText: '去绑定',
  34. confirmColor:'#00aadd',
  35. success: function (res1) {
  36. let url = `/pages/bindPhone/bindPhone`;
  37. wx.navigateTo({
  38. url
  39. });
  40. }
  41. })
  42. return false;
  43. }else{
  44. return true;
  45. }
  46. },
  47. /**
  48. * 生命周期函数--监听页面加载
  49. */
  50. onLoad(options) {
  51. let userInfo = wx.getStorageSync('userInfo');
  52. this.setData({
  53. isBindPhone: userInfo.bindingPhone
  54. });
  55. },
  56. /**
  57. * 生命周期函数--监听页面初次渲染完成
  58. */
  59. onReady() {
  60. },
  61. /**
  62. * 生命周期函数--监听页面显示
  63. */
  64. onShow() {
  65. },
  66. /**
  67. * 生命周期函数--监听页面隐藏
  68. */
  69. onHide() {
  70. },
  71. /**
  72. * 生命周期函数--监听页面卸载
  73. */
  74. onUnload() {
  75. },
  76. /**
  77. * 页面相关事件处理函数--监听用户下拉动作
  78. */
  79. onPullDownRefresh() {
  80. },
  81. /**
  82. * 页面上拉触底事件的处理函数
  83. */
  84. onReachBottom() {
  85. },
  86. /**
  87. * 用户点击右上角分享
  88. */
  89. onShareAppMessage() {
  90. }
  91. })