litian
2024-03-29 437634b6c3f4fb1fd05a64f62feb0d8501e0360d
packagePersonal/pages/userSetting/index.js
@@ -97,7 +97,9 @@
  },
  //修改用户类型
  editUserInfo(e) {
    let { info } = e.currentTarget.dataset
    let {
      info
    } = e.currentTarget.dataset
    if (!this.data.userInfoBox) {
      this.setData({
        userInfoBox: true,
@@ -154,13 +156,14 @@
                      'userInfoForm.icon': app.config.requestCtx + `/file/GetPreViewImage?md5=` + e,
                    });
                    let userTypeInfo = {
                      requests: [
                        {
                          data: JSON.stringify({ nickName: that.data.userInfo.nickName, icon: that.data.userInfoForm.icon }),
                      "requests": [{
                        data: JSON.stringify({
                          nickName: that.data.userInfo.nickName,
                          icon: that.data.userInfoForm.icon
                        }),
                          name: '用户昵称头像',
                          type: 'nickName'
                        }
                      ]
                      }]
                    }
                    app.MG.identity.setAppUserInfo(userTypeInfo).then((res) => {
                      if (res) {
@@ -194,7 +197,9 @@
  },
  //输入手机号
  onPhoneInput(e) {
    const { phoneError } = this.data;
    const {
      phoneError
    } = this.data;
    const isPhoneNumber = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(e.detail.value);
    if (phoneError === isPhoneNumber) {
      this.setData({
@@ -205,7 +210,9 @@
  },
  onEmailInput(e) {
    const { emailError } = this.data;
    const {
      emailError
    } = this.data;
    const isPhoneNumber = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(e.detail.value);
    if (emailError === isPhoneNumber) {
      this.setData({
@@ -328,13 +335,14 @@
  confirmInfo() {
    if (this.data.editType == 'nickName') {
      let userTypeInfo = {
        requests: [
          {
            data: JSON.stringify({ nickName: this.data.userInfoForm.nickName, icon: this.data.userInfo.icon }),
        "requests": [{
          data: JSON.stringify({
            nickName: this.data.userInfoForm.nickName,
            icon: this.data.userInfo.icon
          }),
            name: '用户昵称头像',
            type: 'nickName'
          }
        ]
        }]
      }
      app.MG.identity.setAppUserInfo(userTypeInfo).then((res) => {
        if (res) {