| | |
| | | }, |
| | | //修改用户类型 |
| | | editUserInfo(e) { |
| | | let { info } = e.currentTarget.dataset |
| | | let { |
| | | info |
| | | } = e.currentTarget.dataset |
| | | if (!this.data.userInfoBox) { |
| | | this.setData({ |
| | | userInfoBox: true, |
| | |
| | | '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) { |
| | |
| | | }, |
| | | //输入手机号 |
| | | 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({ |
| | |
| | | }, |
| | | |
| | | 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({ |
| | |
| | | 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) { |