<template> <view class="mine_container" > <!--style="height:{{wh}}px;"--> <view class="user_info"> <view class="self"> <view class="float_l"> <view class="left_info"> <text class="nick_name">{{userInfo.userName}}</text> <!--{{userInfo.userName}}--> <!--<text class="nick_name">我是一直现象啊都是大神撒戒指的hunyin</text>--> <image class="zj" src="{{imageUrl +'/bkzj.png' + randomNum }}" wx:if="{{userInfo.isBlogVip && imageUrl}}"></image> </view> <view class="tiping">{{userInfo.desc}}</view> </view> <view class="heads" style="{{!userInfo.isPaid ? 'margin-top:0rpx': 'margin-top:0rpx'}}; background-image: url({{imageUrl}}/cir.png);background-size:100% 100%;"> <image wx:if="{{imageUrl}}" src="{{userInfo.avatar + randomNum}}" class="header"></image> <image wx:if="{{userInfo.isPaid && imageUrl}}" class="vip" src ="{{imageUrl +'/gold_crown.png' + randomNum }}"></image> </view> <view style="clear:both"></view> </view> <!--先用mock的 图片--> <view class="fen_box"> <view class="fen"> <view class="fen_num">{{userInfo.grades.blog.score}}</view> <view class="fen_name">博客积分</view> <view class="line" style="{{userInfo.gender === 0 ?'background:#b1d1fc': 'background:#b1d1fc'}}"></view> </view> <view class="fen"> <view class="fen_num">{{userInfo.grades.download.score}}</view> <view class="fen_name" >下载积分</view> <view class="line" style="{{userInfo.gender === 0 ?'background:#b1d1fc': 'background:#b1d1fc'}}"></view> </view> <view class="fen last"> <view class="fen_num">{{userInfo.grades.bbs.score}}</view> <view class="fen_name">论坛积分</view> </view> </view> <!--新增分享button--> <button class="shareFriends" open-type="share" hover-class="hover_share"> <image class="share" src="{{imageUrl +'/share.png' + randomNum }}" wx:if="{{imageUrl}}"></image> <text class="words">分享给朋友</text> </button> </view> <view class="content"> <view class="my_class"> <text class="word">等级</text> <view class="box"> <view class="blog"> <image src="{{imageUrl + userInfo.grades.blog.imgUrl + randomNum}}"></image> <!--<view class="express">--> <!--<image src="{{imageUrl + '/mount.png' + randomNum}}" class="mount"></image>--> <!--<text class="rate">25%</text>--> <!--<text class="tip">博客用户被你打败</text>--> <!--</view>--> </view> <view class="blog"> <image src="{{imageUrl + userInfo.grades.download.imgUrl + randomNum}}"></image> <!--<view class="express">--> <!--<image src="{{imageUrl + '/mount.png' + randomNum}}" class="mount"></image>--> <!--<text class="rate">55%</text>--> <!--<text class="tip">下载用户被你打败</text>--> <!--</view>--> </view> </view> <view class="box"> <view class="blog"> <image src="{{imageUrl + userInfo.grades.bbs.imgUrl + randomNum}}"></image> <!--<view class="express">--> <!--<image src="{{imageUrl + '/mount.png' + randomNum}}" class="mount"></image>--> <!--<text class="rate">65%</text>--> <!--<text class="tip">论坛用户被你打败</text>--> <!--</view>--> </view> <view class="blog"> <image src="{{imageUrl + userInfo.grades.ask.imgUrl + randomNum}}"></image> <!--<view class="express">--> <!--<image src="{{imageUrl + '/mount.png' + randomNum}}" class="mount"></image>--> <!--<text class="rate">85%</text>--> <!--<text class="tip">问答用户被你打败</text>--> <!--</view>--> </view> </view> </view> <!--<view class="line"></view>--> <view class="my_class"> <text class="word">成就</text> <view class="arrow_box" wx:if="{{userInfo.achieveList.length && userInfo.achieveList.length>3}}" @tap="closeArrow"> <image src="{{imageUrl + pullUrl }}" class="arrow"></image> </view> <view class="newbox"> <repeat key="{{item}}" for="{{userInfo.achieveList}}" item="item" wx:if="{{userInfo.achieveList.length}}"> <view class="blocks" wx:if="{{index<3}}"> <text class="num">{{item.count}}</text> <text class="typ">{{item.title}}</text> </view> <view class="blocks" wx:if="{{index&&index>2&&showMore}}"> <text class="num">{{item.count}}</text> <text class="typ">{{item.title}}</text> </view> </repeat> <view wx:if="{{!userInfo.achieveList.length}}" class="blanked"> <image src="{{imageUrl}}/default_icon.png" wx:if="{{imageUrl}}" class="default"></image> <view class="kong">空空如也</view> </view> </view> <view style="clear:both"></view> </view> <!--<view class="line"></view>--> <view class="my_class no_line"> <text class="word">勋章</text> <view wx:if="{{userInfo.medals.length && userInfo.medals.length>5}}" @tap="closeArrow1" class="arrow_box"> <image src="{{imageUrl + pullUrl1 }}" class="arrow"></image> </view> <view class="newbox"> <repeat key="{{item}}" for="{{userInfo.medals}}" item="item" wx:if="{{userInfo.medals.length}}"> <view class="regard_block css_{{ userInfo.medals.length }}" wx:if="{{index<5 && item.type!==301}}"> <image src="{{imageUrl + item.imgUrl + randomNum}}" class="xunzhang"></image> <text class="icon {{styleRight}}" wx:if="{{item.score>1}}">x{{item.score}}</text> <text class="tag">{{item.codename}}</text> </view> <view class="regard_block" wx:if="{{index&&index>4&&showMore1 && item.type!==301}}"> <!--{{imageUrl + item.imgUrl}}--> <image src="{{imageUrl + item.imgUrl + randomNum}}" class="xunzhang"></image> <text class="tag">{{item.codename}}</text> <text class="icon" wx:if="{{item.score>1}}">x{{item.score}}</text> </view> </repeat> <view wx:if="{{!userInfo.medals.length}}" class="blanked"> <image src="{{imageUrl}}/default_icon.png" wx:if="{{imageUrl}}" class="default"></image> <view class="kong">空空如也</view> </view> </view> <view style="clear:both"></view> </view> <!--开通vip功能先隐藏 --> </view> </view> </template> <script> import wepy from 'wepy' import { imageUrl } from '@/utils/config' export default class Other extends wepy.component { props = { userInfo: Object, styleClass: String, styleRight: String } components={ } data = { pullUrl: '/bot_arrow.png', pullUrl1: '/bot_arrow.png', showMore: false, showMore1: false, isVip: true, isZJ: true, bbsFen: 0, downFen: 0, blogFen: 0, wh: '' // 测试是vip展示 测试是专家 }; computed = { imageUrl() { return this.$root.$parent.globalData.imageUrl }, randomNum() { return '?' + parseInt(new Date().getTime() / 1000) + '' } } onLoad() { // const windowHeight = wepy.getSystemInfoSync().windowHeight // this.wh = windowHeight } methods = { toDetails(type) { this.$emit('itemToDetail', type) }, toMyCenter(type) { this.$emit('toMyCenter') this.$parent.$wxapp.aldstat.sendEvent('个人信息', { '进入方式': type }) }, toMyCenterData(type) { this.$emit('toMyCenterData') this.$parent.$wxapp.aldstat.sendEvent('个人信息', { '进入方式': type }) }, closeArrow() { if (this.pullUrl === '/up_arrow.png') { this.pullUrl = '/bot_arrow.png' this.showMore = false } else { this.pullUrl = '/up_arrow.png' this.showMore = true } }, closeArrow1() { if (this.pullUrl1 === '/up_arrow.png') { this.pullUrl1 = '/bot_arrow.png' this.showMore1 = false } else { this.pullUrl1 = '/up_arrow.png' this.showMore1 = true } } } } </script> <style lang="less" src="other.less" scoped> </style>
小程序个人中心原来代码片段
最新推荐文章于 2024-04-30 15:31:03 发布