yiming
2024-04-28 04acf6421dded7b6f6eef9d2cf41d0b4a0e8dd0d
packagePersonal/pages/userSetting/index.js
@@ -10,7 +10,7 @@
  data: {
    userInfo: {},
    defaultAvatarUrl: 'https://cdn-we-retail.ym.tencent.com/miniapp/usercenter/icon-user-center-avatar@2x.png',
    userInfoBox: false,
    editType: '',
    userInfoForm: {
      icon: '',
@@ -24,6 +24,9 @@
    emailError: false,
    imgCode: '',
    countDown: 0,
    mailCountDown: 0,
    userInfoBox: false,
    height: '', //屏幕高度
  },
  /**
@@ -46,7 +49,15 @@
   * 生命周期函数--监听页面显示
   */
  onShow() {
    var that = this;
    // 动态获取屏幕高度
    wx.getSystemInfo({
      success: (result) => {
        that.setData({
          height: result.windowHeight
        });
      },
    })
  },
  // 获取登录用户身份
  getUserInfo() {
@@ -107,7 +118,7 @@
        editType: info,
        "userInfoForm.captcha": "",
        "userInfoForm.code": "",
        "userInfoForm.nickName": ''
        "userInfoForm.nickName": this.data.userInfo.nickName,
      });
    }
    this.getImgCapcha()
@@ -116,6 +127,7 @@
    this.setData({
      userInfoBox: e.detail.visible,
      countDown: 0,
      mailCountDown:0
    });
  },
  editIconInfo(e) {
@@ -333,6 +345,8 @@
              icon: 'none',
              duration: 1000
            })
            // 开启短信验证倒计时
            this.getSecondEmail(60)
          } else {
            wx.showToast({
              title: '邮箱验证码发送失败',
@@ -348,6 +362,24 @@
        icon: 'none',
        duration: 1000
      })
    }
  },
  getSecondEmail(time) {
    if (this.data.mailCountDown <= 0) {
      this.setData({
        mailCountDown: time,
      });
      let timer = setInterval(() => {
        let count = this.data.mailCountDown - 1;
        this.setData({
          mailCountDown: count,
        });
        if (count === 0) {
          clearInterval(timer);
        }
      }, 1000);
    }
  },
@@ -413,18 +445,12 @@
            icon: 'none',
            duration: 1000
          })
          this.setData({
            countDown: 0,
          });
        } else if (res == '此手机号码已被其它账号绑定') {
          wx.showToast({
            title: res + ',请更换其他手机号。',
            icon: 'none',
            duration: 1000
          })
          this.setData({
            countDown: 0,
          });
        } else {
          wx.showToast({
            title: res,