|
@@ -4,7 +4,7 @@
|
|
|
:background="{backgroundColor: '#2795FD',}" :back-text-style="{color: '#ffffff'}"></u-navbar>
|
|
|
<view class="top">
|
|
|
<view class="photo">
|
|
|
- <u-avatar :src="src"></u-avatar>
|
|
|
+ <u-avatar :src="src" :gender="userInfo.gender" ></u-avatar>
|
|
|
</view>
|
|
|
<!-- <view class="login">
|
|
|
请登录
|
|
@@ -23,10 +23,9 @@
|
|
|
<img src="@/assets/img/riFill-shield-user-fill@1x.png" alt="">
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="tel">
|
|
|
- <template v-if="userInfo&&userInfo.id">
|
|
|
- {{userInfo.phone}}
|
|
|
- </template>
|
|
|
+ <view class="tel" @click="changePhone" v-if="userInfo&&userInfo.id">
|
|
|
+ {{userInfo.phone}}
|
|
|
+ <img src="@/pages/tab/as-components/riLine-edit-2-line.svg">
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
@@ -246,6 +245,23 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ changePhone(){
|
|
|
+ var _this=this;
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '是否修改当前手机号',
|
|
|
+ //confirmText:"",
|
|
|
+ showCancel: true,
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ _this.show=true
|
|
|
+ //uni.navigateBack()
|
|
|
+ } else if (res.cancel) {
|
|
|
+ //.log('用户点击取消');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
updateintentionBtn(e){
|
|
|
console.log(e);
|
|
|
var intention=e[0].value
|
|
@@ -454,7 +470,22 @@
|
|
|
})
|
|
|
}
|
|
|
// #endif
|
|
|
- },
|
|
|
+ },
|
|
|
+ changePhoneUser(phone) {
|
|
|
+ console.log("createUser",phone)
|
|
|
+ API.changePhone(phone).then((res2) => {
|
|
|
+
|
|
|
+
|
|
|
+ this.findByOpenId()
|
|
|
+
|
|
|
+ }).catch(error2 => {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: error2
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
createUser(phone) {
|
|
|
console.log("createUser",phone)
|
|
|
API.createUser({
|
|
@@ -491,8 +522,14 @@
|
|
|
success: function(res) {
|
|
|
|
|
|
if (res.confirm) {
|
|
|
- _this.createUser(res.content)
|
|
|
-
|
|
|
+ //_this.createUser(res.content)
|
|
|
+ if (_this.userInfo.id) {
|
|
|
+ _this.changePhoneUser(res.content)
|
|
|
+
|
|
|
+ } else{
|
|
|
+ _this.createUser(res.content)
|
|
|
+
|
|
|
+ }
|
|
|
} else if (res.cancel) {
|
|
|
//.log('用户点击取消');
|
|
|
}
|
|
@@ -515,8 +552,14 @@
|
|
|
}).then((res) => {
|
|
|
|
|
|
console.log(res)
|
|
|
- if (res.data) {
|
|
|
- _this.createUser(res.data)
|
|
|
+ if (res.data) {
|
|
|
+ if (_this.userInfo.id) {
|
|
|
+ _this.changePhoneUser(res.data)
|
|
|
+
|
|
|
+ } else{
|
|
|
+ _this.createUser(res.data)
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
} else {
|
|
|
uni.showToast({
|
|
@@ -665,7 +708,8 @@
|
|
|
|
|
|
.tel {
|
|
|
margin-top: 8rpx;
|
|
|
- font-size: 32rpx;
|
|
|
+ font-size: 32rpx;
|
|
|
+ display: flex;
|
|
|
}
|
|
|
}
|
|
|
|