|
|
@ -10,36 +10,36 @@ |
|
|
|
|
|
|
|
<button class="chooseAvatar" open-type="chooseAvatar" @chooseavatar="onChooseAvatar"> |
|
|
|
<view class="line"> |
|
|
|
<view class=""> |
|
|
|
<view > |
|
|
|
头像 |
|
|
|
</view> |
|
|
|
<view class=""> |
|
|
|
<view > |
|
|
|
<image :src="userInfoForm.headImage" v-if="userInfoForm.headImage" |
|
|
|
style="width: 60rpx;height: 60rpx;" mode=""></image> |
|
|
|
style="width: 60rpx;height: 60rpx;border-radius: 50%;" mode=""></image> |
|
|
|
|
|
|
|
<!-- <image src="../static/auth/headImage.png" v-else style="width: 50rpx;height: 50rpx;" mode=""></image> --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</button> |
|
|
|
<view class="line"> |
|
|
|
<view class=""> |
|
|
|
<view > |
|
|
|
昵称 |
|
|
|
</view> |
|
|
|
<view class=""> |
|
|
|
<view > |
|
|
|
<input type="nickname" placeholder="请输入昵称" style="text-align: right;" id="nickName" |
|
|
|
v-model="userInfoForm.nickName" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="line"> |
|
|
|
<view class=""> |
|
|
|
<view > |
|
|
|
手机号 |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="" v-if="userInfoForm.phone"> |
|
|
|
<view v-if="userInfoForm.phone"> |
|
|
|
<input placeholder="请输入手机号" style="text-align: right;" disabled v-model="userInfoForm.phone" /> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="" v-else> |
|
|
|
<view v-else> |
|
|
|
<button class="getPhoneNumber" open-type="getPhoneNumber" @getphonenumber="getPhone"> |
|
|
|
获取电话号码 |
|
|
|
</button> |
|
|
@ -56,7 +56,8 @@ |
|
|
|
import { |
|
|
|
ref, |
|
|
|
getCurrentInstance, |
|
|
|
computed |
|
|
|
computed, |
|
|
|
onMounted |
|
|
|
} from 'vue' |
|
|
|
import { |
|
|
|
ossUpload |
|
|
@ -78,12 +79,6 @@ |
|
|
|
|
|
|
|
const store = useStore() |
|
|
|
|
|
|
|
const userInfo = ref({ |
|
|
|
phone: "", |
|
|
|
nickName: "", |
|
|
|
headImage: "" |
|
|
|
}) |
|
|
|
|
|
|
|
const userInfoForm = ref({ |
|
|
|
headImage: '', |
|
|
|
nickName: '', |
|
|
@ -93,15 +88,19 @@ |
|
|
|
const configList = computed(() => { |
|
|
|
return store.getters.configList |
|
|
|
}) |
|
|
|
|
|
|
|
const userInfo = computed(() => { |
|
|
|
return store.getters.userInfo |
|
|
|
}) |
|
|
|
|
|
|
|
onShow(() => { |
|
|
|
// 可以在这里添加 onShow 的逻辑 |
|
|
|
}) |
|
|
|
|
|
|
|
onLoad(() => { |
|
|
|
userInfoForm.value.phone = userInfo.value.phone || '' |
|
|
|
userInfoForm.value.nickName = userInfo.value.nickName || '' |
|
|
|
userInfoForm.value.headImage = userInfo.value.headImage || '' |
|
|
|
userInfoForm.value.phone = userInfo.value?.userTelephone || '' |
|
|
|
userInfoForm.value.nickName = userInfo.value?.userName || '' |
|
|
|
userInfoForm.value.headImage = configList.value?.applet_info?.paramValueImage || '' |
|
|
|
}) |
|
|
|
|
|
|
|
const onChooseAvatar = (res) => { |
|
|
@ -126,6 +125,7 @@ |
|
|
|
properties: ["value"], |
|
|
|
}) |
|
|
|
.exec((res) => { |
|
|
|
console.log(res) |
|
|
|
const nickName = res?.[0]?.value |
|
|
|
userInfoForm.value.nickName = nickName |
|
|
|
|
|
|
@ -152,6 +152,7 @@ |
|
|
|
userTelephone: userInfoForm.value.phone |
|
|
|
}).then(res => { |
|
|
|
if (res.code == 200) { |
|
|
|
store.dispatch("getUserInfo") |
|
|
|
uni.switchTab({ |
|
|
|
url: "/pages/workbenchManage/index" |
|
|
|
}) |
|
|
@ -219,17 +220,15 @@ |
|
|
|
} |
|
|
|
|
|
|
|
.getPhoneNumber { |
|
|
|
// all: unset; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
// background: $uni-linear-gradient-btn-color; |
|
|
|
// background: $uni-color; |
|
|
|
color: #fff; |
|
|
|
width: 200rpx; |
|
|
|
height: 60rpx; |
|
|
|
border-radius: 30rpx; |
|
|
|
font-size: 24rpx; |
|
|
|
background-color: #FFBF60; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |