对接上报记录、bannar
This commit is contained in:
@@ -39,17 +39,28 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { logout } from '../../api/api.js'
|
||||
import { logout, getSettingInfo } from '../../api/api.js'
|
||||
|
||||
// 响应式数据
|
||||
const phoneNumber = ref('') // 绑定手机号
|
||||
const passwordNumber = ref('')
|
||||
|
||||
// 获取用户信息中的手机号
|
||||
const fetchUserInfo = () => {
|
||||
getSettingInfo().then(res => {
|
||||
if (res.code === 200 && res.data) {
|
||||
phoneNumber.value = res.data.phonenumber || ''
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 页面显示时读取最新数据(从修改页返回也会触发)
|
||||
onShow(() => {
|
||||
const userInfo = uni.getStorageSync('tempChangePwdParams')
|
||||
if (userInfo.phoneNumber) {
|
||||
if (userInfo && userInfo.phoneNumber) {
|
||||
phoneNumber.value = userInfo.phoneNumber
|
||||
} else {
|
||||
fetchUserInfo()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user