Commit d8a9fcb5 authored by Damon's avatar Damon

refator: 无需用户授权获取头像和昵称

parent 04508295
<template>
<view>
<view class="u-flex user-box u-p-l-30 u-p-t-30 u-p-r-20 u-p-b-30">
<view class="u-m-r-10">
<u-avatar :src="avatar" size="140"></u-avatar>
</view>
<view class="u-flex-1">
<view class="u-font-18 u-p-b-20">{{ nikeName }}</view>
<view class="u-font-14 u-tips-color">累计刷题俩999次</view>
</view>
</view>
<view class="u-m-t-20">
<u-cell-group>
<u-cell-item icon="star" title="个人信息" value="完善度40%" @tap="login"></u-cell-item>
<u-cell-item icon="photo" title="我的题库"></u-cell-item>
<u-cell-item icon="coupon" title="联系客服"></u-cell-item>
</u-cell-group>
</view>
</view>
<view>
<view class="u-flex user-box u-p-l-30 u-p-t-30 u-p-r-20 u-p-b-30">
<view class="u-m-r-10">
<view class="avatar">
<open-data type="userAvatarUrl"></open-data>
</view>
</view>
<view class="u-flex-1">
<view class="u-font-18 u-p-b-20">
<open-data type="userNickName"></open-data>
</view>
<view class="u-font-14 u-tips-color">累计刷题俩999次</view>
</view>
</view>
<view class="u-m-t-20">
<u-cell-group>
<u-cell-item icon="star" title="个人信息" value="完善度40%" @tap="login"></u-cell-item>
<u-cell-item icon="photo" title="我的题库"></u-cell-item>
<u-cell-item icon="coupon" title="联系客服"></u-cell-item>
</u-cell-group>
</view>
</view>
</template>
<script>
export default {
data() {
return {
pic:'https://uviewui.com/common/logo.png',
show:true
}
},
computed: {
avatar() {
return this.userInfo.avatarUrl || this.pic
},
nikeName() {
return this.userInfo.nickName || '未登录'
}
},
onLoad() {
},
methods: {
login() {
this.$u.route({
url: 'pages/login/index'
})
}
}
}
export default {
data() {
return {
pic: 'https://uviewui.com/common/logo.png',
show: true,
}
},
computed: {},
onLoad() {},
methods: {
login() {
this.$u.route({
url: 'pages/login/index',
})
},
},
}
</script>
<style lang="scss">
page{
background-color: #ededed;
page {
background-color: #ededed;
}
.camera{
width: 54px;
height: 44px;
&:active{
background-color: #ededed;
}
.camera {
width: 54px;
height: 44px;
&:active {
background-color: #ededed;
}
}
.user-box{
background-color: #fff;
.user-box {
background-color: #fff;
.avatar {
width: 120rpx;
height: 120rpx;
}
}
</style>
\ No newline at end of file
......@@ -34,7 +34,6 @@ export default {
if (code_res.errMsg == 'login:ok') {
let code = code_res.code
console.log('user, code', user, code)
this.$u.vuex('userInfo', user.userInfo)
this.$u.route({
type: 'back'
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment