| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <template>
- <view>
- <view class="container">
- <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">{{userData.nickName}}</view>
- <view class="flex align-center padding-top-sm">
- <view>
- <view class="text-black text-bold">{{+userData.totalHot}}</view>
- <view class="text-gray text-sm margin-top-xs">热力</view>
- </view>
- <view style="height: 60upx;border: #dadada 1px solid; margin: 0 30upx;"></view>
- <view>
- <view class="text-black text-bold">{{+userData.totalPoints}}</view>
- <view class="text-gray text-sm margin-top-xs">积分</view>
- </view>
- <view class="padding-left">
- <button class="cu-btn sm line-black round" @click="edit">
- <text class="cuIcon-post padding-right-xs"></text>
- <text v-if="!$u.test.isEmpty(userData.phone)">修改资料</text>
- <text v-else>完善个人信息</text>
- </button>
- </view>
- </view>
- </view>
- <view class="flex align-center">
- <view class="padding-right">
- <u-avatar :src="userData.avatar" 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>
- <view class="padding-left-sm">
- <view class="text-bold text-lg">积分明细</view>
- <view class="text-gray">消费赚积分</view>
- </view>
- </view>
- <view class="flex" @click="navByIcon('/pages/activityList/mine/boostDetail')">
- <image src="/static/icon-order.png" style="width: 80upx;height: 80upx;"></image>
- <view class="padding-left-sm">
- <view class="text-bold text-lg">热力明细</view>
- <view class="text-gray">助力奖赏</view>
- </view>
- </view>
- </view>
- </view>
- <view class="container">
- <block v-for="(item, index) in iconList" :key="index">
- <block v-if="item.name == '分割线'">
- <view class="padding">
- <u-line color="#d3d3d3"></u-line>
- </view>
- </block>
- <block v-else>
- <view class="flex justify-between align-center padding" @click="navByIcon(item.url)" v-if="item.show">
- <view class="flex align-center">
- <view class="flex align-center" style="width: 38rpx;height: 38rpx;">
- <image :src="item.icon" :style="{width: item.width, height: item.height}"></image>
- </view>
- <view class="text-black text-bold text-lg padding-left">{{item.name}}</view>
- </view>
- <view class="cuIcon-right"></view>
- </view>
- </block>
- </block>
- </view>
- </view>
- </template>
- <script>
- import {authUrl} from '@/common/conf/config.js'
- export default {
- props: {
- activityId: {
- type: String,
- default: '',
- }
- },
- data() {
- return {
- userId: '',
- userData: {},
- isLogin: true,
- isAgency: false,
- iconList: [
- {name: '我的礼品', icon: '/static/icon-gift.png', width: '36upx', height: '33upx', url: '/pages/activityList/mine/myGift', show: true},
- {name: '我的音乐', icon: '/static/icon-music.png', width: '33upx', height: '32upx', url: '/pages/activityList/mine/myMusic', show: true},
- {name: '我的助力', icon: '/static/icon-history.png', width: '32upx', height: '32upx', url: '/pages/activityList/mine/myBoost', show: true},
- {name: '我的公益', icon: '/static/icon-welfare.png', width: '31upx', height: '31upx', url: '/pages/activityList/mine/myWelfare', show: true},
- {name: '分割线', icon: '', width: '', height: '', url: ''},
- {name: '成为代理', icon: '/static/icon-agency.png', width: '33upx', height: '32upx', url: '/pages/activityList/mine/agent/agentDetail', show: true},
- {name: '去推广', icon: '/static/icon-promote.png', width: '31upx', height: '30upx', url: '/pages/activityList/mine/agent/promote', show: true},
- {name: '我的推广', icon: '/static/icon-myPromote.png', width: '29upx', height: '30upx', url: '/pages/activityList/mine/agent/myPromote', show: true},
- {name: '我的收益', icon: '/static/icon-income.png', width: '24upx', height: '34upx', url: '/pages/activityList/mine/agent/myIncome/myIncome', show: true},
- {name: '花积分', icon: '/static/icon-mall.png', width: '30upx', height: '26upx', url: '', show: true},
- {name: '更多活动', icon: '/static/icon-activity.png', width: '26upx', height: '31upx', url: '', show: true},
- {name: '活动规则', icon: '/static/icon-rule.png', width: '29upx', height: '33upx', url: '', show: true}
- ],
- }
- },
- mounted() {
- this.userId = uni.getStorageSync("userId")
- if (this.$u.test.isEmpty(this.userId)) {
- this.isLogin = false;
- } else {
- this.isLogin = true;
- this.getUserInfo();
- }
- },
- methods: {
- toAuth() {
- let param = "pages/activityList/home/home?current=2&activityId=" + this.activityId;
- window.location.href = authUrl(param);
- },
- getUserInfo() {
- this.$u.api.user.detail({id: this.userId}).then(res => {
- this.userData = res;
- })
- },
- //跳转需要带参数
- edit() {
- uni.navigateTo({
- url: '/pages/activityList/mine/edit?userId=' + this.userData.id
- })
- },
- navByIcon(url) {
- if (!this.isLogin) {
- this.toAuth();
- } else {
- uni.navigateTo({
- url: url
- })
- }
- }
- }
- }
- </script>
- <style>
- .container {
- margin: 30upx;
- background-color: #ffffff;
- border-radius: 28upx;
- box-shadow: -1upx -1upx 60upx #d8d8d8;
- }
- .custom-style {
- background-color: #5b3ee7;
- width: 200upx;
- height: 60upx;
- color: #ffffff;
- }
- </style>
|