| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- <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">205</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">886</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>修改资料</text>
- </button>
- </view>
- </view>
- </view>
- <view class="flex align-center">
- <view class="padding-right">
- <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>
- <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">
- <view class="padding" v-if="item.name == '分割线'">
- <u-line color="#d3d3d3"></u-line>
- </view>
- <view class="flex justify-between align-center padding" @click="navByIcon(item.url)" v-else>
- <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>
- </view>
- </view>
- </template>
- <script>
- import {authUrl } from '@/common/conf/config.js'
- export default {
- props: {
- activityId: {
- type: String,
- default: '',
- }
- },
- data() {
- return {
- userData: {},
- 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'},
- // {name: '我的奖金', icon: '/static/icon-awards.png', width: '29upx', height: '38upx', url: '/pages/activityList/mine/myAwards'},
- {name: '我的助力', icon: '/static/icon-history.png', width: '32upx', height: '32upx', url: '/pages/activityList/mine/myBoost'},
- {name: '我的公益', icon: '/static/icon-welfare.png', width: '31upx', height: '31upx', url: '/pages/activityList/mine/myWelfare'},
- {name: '分割线', icon: '', width: '', height: '', url: ''},
- {name: '花积分', icon: '/static/icon-mall.png', width: '30upx', height: '26upx', url: ''},
- {name: '更多活动', icon: '/static/icon-activity.png', width: '26upx', height: '31upx', url: ''},
- {name: '活动规则', icon: '/static/icon-rule.png', width: '29upx', height: '33upx', url: ''}
- ],
- }
- },
- mounted() {
- if (this.$u.test.isEmpty(uni.getStorageSync("userId"))) {
- this.isLogin = false;
- } else {
- this.isLogin = true;
- this.getUserInfo();
- }
- },
- methods: {
- toAuth() {
- window.location.href = authUrl(this.activityId);
- },
- getUserInfo() {
- this.$u.api.user.detail({id: this.userId}).then(res => {
- this.userData = res;
- })
- },
- //跳转需要带参数
- edit() {
- uni.navigateTo({
- url: '/pages/activityList/mine/edit'
- })
- },
- navByIcon(url) {
- 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>
|