diff --git a/member/member/data.vue b/member/member/data.vue index 0c7ad97..3172f71 100644 --- a/member/member/data.vue +++ b/member/member/data.vue @@ -2,25 +2,22 @@ - + - - - + @@ -29,93 +26,48 @@ - + - + - + - + - + - + - + - + - + - +
- - + + @@ -124,17 +76,9 @@ - + - + @@ -143,9 +87,7 @@ - + @@ -154,18 +96,10 @@ - + - + @@ -174,18 +108,10 @@ - + - + @@ -196,13 +122,7 @@ - + @@ -213,19 +133,10 @@ {{ btntext }} - + - @@ -391,11 +302,11 @@ export default { } this.IdentityCodeValid(e.detail.value) ? this.setData({ - isCardNo: true, - }) + isCardNo: true, + }) : this.setData({ - isCardNo: false, - }), + isCardNo: false, + }), this.setData({ user_idcard: e.detail.value, }); @@ -407,15 +318,15 @@ export default { }), that.$.isNull(e.detail.value) ? this.setData({ - isUserEmail: false, - }) + isUserEmail: false, + }) : /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/.test( - e.detail.value - ) - ? this.setData({ + e.detail.value + ) + ? this.setData({ isUserEmail: true, }) - : this.setData({ + : this.setData({ isUserEmail: false, }); }, @@ -440,36 +351,36 @@ export default { this.update(); /* - if (!that.$.isNull(this.user_idcard) && !this.isCardNo) { - return; - } - */ + if (!that.$.isNull(this.user_idcard) && !this.isCardNo) { + return; + } + */ /* - if (!/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/.test(this.user_email)) - { - this.setData({isUserEmail: false}); - return - }*/ + if (!/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/.test(this.user_email)) + { + this.setData({isUserEmail: false}); + return + }*/ /* - if (!that.$.isNull(this.user_mobile)) { - this.update(); - } else if (that.$.isNull(this.user_mobile)) { - this.setData({ - isUserMobile: false - }); - } else if (!/^1[23456789]\d{9}$/.test(this.user_mobile)) { - this.setData({ - isUserMobile: false - }); - } else if (this.user_mobile == this.userInfo.user_mobile) { - that.$.confirm("你已经绑定过该手机!"); - } else if (that.$.isNull(this.mobile_code)) { - this.setData({ - isCode: false - }); - } else {} - */ + if (!that.$.isNull(this.user_mobile)) { + this.update(); + } else if (that.$.isNull(this.user_mobile)) { + this.setData({ + isUserMobile: false + }); + } else if (!/^1[23456789]\d{9}$/.test(this.user_mobile)) { + this.setData({ + isUserMobile: false + }); + } else if (this.user_mobile == this.userInfo.user_mobile) { + that.$.confirm("你已经绑定过该手机!"); + } else if (that.$.isNull(this.mobile_code)) { + this.setData({ + isCode: false + }); + } else {} + */ }, update: function () { @@ -531,42 +442,42 @@ export default { }, IdentityCodeValid: function (e) { var t = { - 11: "北京", - 12: "天津", - 13: "河北", - 14: "山西", - 15: "内蒙古", - 21: "辽宁", - 22: "吉林", - 23: "黑龙江 ", - 31: "上海", - 32: "江苏", - 33: "浙江", - 34: "安徽", - 35: "福建", - 36: "江西", - 37: "山东", - 41: "河南", - 42: "湖北 ", - 43: "湖南", - 44: "广东", - 45: "广西", - 46: "海南", - 50: "重庆", - 51: "四川", - 52: "贵州", - 53: "云南", - 54: "西藏 ", - 61: "陕西", - 62: "甘肃", - 63: "青海", - 64: "宁夏", - 65: "新疆", - 71: "台湾", - 81: "香港", - 82: "澳门", - 91: "国外 ", - }, + 11: "北京", + 12: "天津", + 13: "河北", + 14: "山西", + 15: "内蒙古", + 21: "辽宁", + 22: "吉林", + 23: "黑龙江 ", + 31: "上海", + 32: "江苏", + 33: "浙江", + 34: "安徽", + 35: "福建", + 36: "江西", + 37: "山东", + 41: "河南", + 42: "湖北 ", + 43: "湖南", + 44: "广东", + 45: "广西", + 46: "海南", + 50: "重庆", + 51: "四川", + 52: "贵州", + 53: "云南", + 54: "西藏 ", + 61: "陕西", + 62: "甘肃", + 63: "青海", + 64: "宁夏", + 65: "新疆", + 71: "台湾", + 81: "香港", + 82: "澳门", + 91: "国外 ", + }, n = true; if ( !e || @@ -599,13 +510,13 @@ export default { }), that.$.isNull(e.detail.value) ? this.setData({ - isUserMobile: false, - }) + isUserMobile: false, + }) : /^1[23456789]\d{9}$/.test(e.detail.value) - ? this.setData({ + ? this.setData({ isUserMobile: true, }) - : this.setData({ + : this.setData({ isUserMobile: false, }); }, @@ -616,13 +527,53 @@ export default { }), that.$.isNull(e.detail.value) ? this.setData({ - isCode: false, - }) + isCode: false, + }) : this.setData({ - isCode: true, - }); + isCode: true, + }); }, - upImgs: function (e) { + + onChooseAvatar(event) { + const { avatarUrl } = event.detail + this.user_avatar = avatarUrl; + this.onUploadAvatar(avatarUrl) + }, + + onUploadAvatar(filePath) { + var that = this; + let ukey = uni.getStorageSync("ukey"); + + that.$.showLoading(); + + that.$.uploadFile({ + url: that.Config.URL.upload, + method: "POST", + filePath, + name: "upfile", + formData: { + perm_key: ukey, + }, + success: function (n) { + that.$.hideLoading(); + + var up_res = that.$.parseJSON(n.data); + var s = up_res.data.url; + that.setData({ + user_avatar: s, + }); + that.user_avatar = s; + }, + fail: function (e) { + that.$.hideLoading(); + }, + complete: function (e) { + that.$.hideLoading(); + }, + }); + }, + + chooseAvatar: function (e) { var that = this; let ukey = uni.getStorageSync("ukey"); that.$.chooseImage({ @@ -650,6 +601,7 @@ export default { that.setData({ user_avatar: s, }); + that.user_avatar = s; }, fail: function (e) { that.$.hideLoading(); @@ -695,13 +647,13 @@ export default { var r = setInterval(function () { t > 0 ? that.setData({ - btntext: t-- + "s", - }) + btntext: t-- + "s", + }) : (that.setData({ - isSend: true, - sendTime: 120, - btntext: that.__("重新发送"), - }), + isSend: true, + sendTime: 120, + btntext: that.__("重新发送"), + }), clearInterval(r)); }, 1e3); } else { @@ -717,10 +669,10 @@ export default { // 三级联动选择 showbox() { /* - this.setData({ - isShow: true - }) - */ + this.setData({ + isShow: true + }) + */ this.$refs.mpvueCityPicker.show(); }, @@ -796,6 +748,13 @@ export default { float: right; } + .avatar-wrapper { + background: none; + height: auto; + line-height: auto; + padding: 0; + } + .uni-uploader__file { width: 80rpx; height: 80rpx;