优化样式

This commit is contained in:
dengjie
2023-01-31 00:14:42 +08:00
parent 7502bab1c0
commit 6445aa4783
10 changed files with 113 additions and 227 deletions

View File

@@ -14,11 +14,6 @@
<view style="height: 230rpx;"></view>
<u-button type="success" text="确定" color="#0EBB5B" @click="handleSubmit()"></u-button>
</view>
<view style="margin:0 20rpx;">
<u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view>
</view>
</template>
@@ -26,11 +21,7 @@
import {
apiService
} from '../../service/request'
import login from 'pages/my/login/login'
export default {
components: {
login
},
data() {
return {
avatar: '',
@@ -39,26 +30,17 @@
userInfo: {
name: ''
},
},
isLoad: true,
}
}
},
onLoad() {
this.getUser()
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
},
methods: {
//获取头像昵称
getUser() {
this.$apiServe.getUser().then(res => {
// console.log('头像昵称', res.data);
console.log('头像昵称', res.data);
var data = res.data.data
this.avatar = data.avatar
this.model.userInfo.name = data.nickname
@@ -114,23 +96,6 @@
url: '/pages/my/my'
})
}).finally(_ => {})
},
reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
},
failToLoad() {
// uni.navigateBack({
// url: '/pages/my/my'
// })
this.$toast.warn('登录失败请重试')
}
}
}