提交 38f48110 编写于 作者: 芊里

头像上传

上级 0c1b7031
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
<uni-list-item> <uni-list-item>
<template v-slot:body> <template v-slot:body>
<view class="avatar-box"> <view class="avatar-box">
<image class="avatar-img" :src="userInfo.avatar || '/static/uni-center/logo.png'" @click="chooseImg" mode="aspectFill"></image> <image class="avatar-img" :src="(userInfo && userInfo.avatar) || '/static/uni-center/logo.png'" @click="chooseImg" mode="aspectFill"></image>
</view> </view>
</template> </template>
</uni-list-item> </uni-list-item>
<uni-list-item title="姓名" :right-text="userInfo && userInfo.name"></uni-list-item>
</uni-list> </uni-list>
</view> </view>
</template> </template>
...@@ -31,7 +32,7 @@ ...@@ -31,7 +32,7 @@
}) })
}, },
onLoad() { onLoad() {
console.log(this.userInfo); if(!this.userInfo)console.error('判断登录状态,如果没有登录则没有userinfo,页面报错');
}, },
methods: { methods: {
...mapMutations({ ...mapMutations({
......
...@@ -132,3 +132,5 @@ $edge-border-width = 6rpx ...@@ -132,3 +132,5 @@ $edge-border-width = 6rpx
width 60rpx width 60rpx
height 60rpx height 60rpx
.l-clipper-tools__btns
flex-direction row
\ No newline at end of file
...@@ -113,7 +113,12 @@ ...@@ -113,7 +113,12 @@
checkVersion() { checkVersion() {
checkUpdate(); checkUpdate();
}, },
goLogin() { goLogin() {
uni.navigateTo({
url: './edit/edit'
})
return;
if (!this.login) { if (!this.login) {
console.log('点击前往登录'); console.log('点击前往登录');
uni.navigateTo({ uni.navigateTo({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册