|
|
@@ -1,10 +1,9 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
<view class="container">
|
|
|
- <view class="flex justify-between align-center" style="height: 200upx;">
|
|
|
+ <view class="flex justify-between align-center" style="height: 200upx;" v-if="isLogin">
|
|
|
<view class="padding-left">
|
|
|
- <view class="text-black text-bold text-xl">{{name}}</view>
|
|
|
- <button @click="toAuth">授权</button>
|
|
|
+ <view class="text-black text-bold text-xl">{{userData.nickname}}</view>
|
|
|
<view class="flex align-center padding-top-sm">
|
|
|
<view>
|
|
|
<view class="text-black text-bold">205</view>
|
|
|
@@ -25,10 +24,16 @@
|
|
|
</view>
|
|
|
<view class="flex align-center">
|
|
|
<view class="padding-right">
|
|
|
- <u-avatar src="/static/avatar.png" size="120"></u-avatar>
|
|
|
+ <u-avatar :src="userData.headimgurl" size="120"></u-avatar>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="text-center padding-sm" v-else>
|
|
|
+ <view class="margin-bottom">
|
|
|
+ <u-avatar size="120"></u-avatar>
|
|
|
+ </view>
|
|
|
+ <u-button class="custom-style" shape="circle" @click="toAuth">授权登录</u-button>
|
|
|
+ </view>
|
|
|
<view class="padding-lg flex justify-around align-center">
|
|
|
<view class="flex" @click="navByIcon('/pages/activityList/mine/pointsDetail')">
|
|
|
<image src="/static/icon-points.png" style="width: 80upx;height: 80upx;"></image>
|
|
|
@@ -69,13 +74,18 @@
|
|
|
import {authUrl } from '@/common/conf/config.js'
|
|
|
export default {
|
|
|
props: {
|
|
|
-
|
|
|
+ userData: {
|
|
|
+ type: Object,
|
|
|
+ default() {
|
|
|
+ return {}
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- name: 'Daniel Hua',
|
|
|
hotVaule: '205',
|
|
|
points: '886',
|
|
|
+ isLogin: false,
|
|
|
iconList: [
|
|
|
{name: '我的礼品', icon: '/static/icon-gift.png', width: '36upx', height: '33upx', url: '/pages/activityList/mine/myGift'},
|
|
|
{name: '我的音乐', icon: '/static/icon-music.png', width: '33upx', height: '32upx', url: '/pages/activityList/mine/myMusic'},
|
|
|
@@ -89,6 +99,13 @@
|
|
|
],
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ if (this.$u.test.isEmpty(this.userData)) {
|
|
|
+ this.isLogin = false;
|
|
|
+ } else {
|
|
|
+ this.isLogin = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
toAuth() {
|
|
|
window.location.href = authUrl;
|
|
|
@@ -96,12 +113,12 @@
|
|
|
//跳转需要带参数
|
|
|
edit() {
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/activityList/mine/edit'
|
|
|
+ url: '/pages/activityList/mine/edit?openid=' + this.userData.openid
|
|
|
})
|
|
|
},
|
|
|
navByIcon(url) {
|
|
|
uni.navigateTo({
|
|
|
- url: url
|
|
|
+ url: url
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
@@ -115,4 +132,10 @@
|
|
|
border-radius: 28upx;
|
|
|
box-shadow: -1upx -1upx 60upx #d8d8d8;
|
|
|
}
|
|
|
+ .custom-style {
|
|
|
+ background-color: #5b3ee7;
|
|
|
+ width: 200upx;
|
|
|
+ height: 60upx;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
</style>
|