| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- <template>
- <view :style="vuex_skin">
- <mescroll-body ref="mescrollRef" @init="mescrollInit" :down="downOption" @down="downCallback"
- @up="upCallback">
- <image :src="cover" style="width: 100vw;" mode="widthFix"></image>
- <view class="head">
- <image :src="userInfo.avatar" mode="" class="avatar"></image>
- <view style="margin: 0 30upx 30upx 70upx;">
- <view class="flex align-center">
- <view class="text-black text-bold text-xl padding-right">{{userInfo.nickName}}</view>
- </view>
- <view class="flex align-center margin-top-20">
- <view>
- <text class="text-sm">共获热力</text>
- <text class="cuIcon-hotfill padding-lr-xs text-base"></text>
- <text class="text-lg text-bold">{{totalHeatValue}}</text>
- </view>
- </view>
- </view>
- </view>
- <view class="margin-top bg-white">
- <view class="padding-30 flex justify-start align-center">
- <view class="margin-left-sm text-lg text-black text-bold">我的作品</view>
- </view>
- </view>
- <view @click.stop="$jump('/pages/activity/activityDetail?id='+item.id+'&isCustomBack=false')" v-for="(item, index) in list" :key="index">
- <view class="flex bg-white" style="padding:10rpx 30rpx 30rpx">
- <view class="">
- <image :src="item.imgUrl" style="width: 120upx;height: 120upx;margin-right: 20upx;" mode="aspectFill"></image>
- </view>
- <view style="width: 100%;">
- <view class="flex justify-between margin-bottom-10">
- <view class="music" style="width: 75%">
- <view class="name text-cut-1" style="height: 34rpx;">{{item.title}}</view>
- <view style="margin: 20rpx 20rpx 20rpx 0;">
- <rich-text class="desc text-cut-2 "
- style="font-size: 24rpx;font-weight: 400;color: #969696;"
- :nodes="decodeURIComponent(item.content)"></rich-text>
- </view>
- </view>
- <view class="" style="width: 20%;">
- <view class="text-base center">
- <text class="cuIcon-hotfill padding-right-xs"></text>
- <text class="text-lg text-bold">{{item.heatValue}}</text>
- </view>
- <view class="music-rank">NO.{{item.rank}}</view>
- </view>
- </view>
- <view class="">
- <u-line color="#cacaca"></u-line>
- </view>
- </view>
- </view>
- </view>
- </mescroll-body>
- </view>
- </template>
- <script>
- import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
- export default {
- mixins: [MescrollMixin],
- data() {
- return {
- downOption: {
- auto: false
- },
- cover: 'https://vote.guosen-fumao.cn/obsfile/a1f19f8ee28a4a39ad892a9908a85807-%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20211119175930.jpg',
- userInfo: {},
- totalHeatValue:0,
- list: []
- }
- },
- onLoad(options) {
- this.fetchUserInfo()
- this.fetchCover()
- },
- methods: {
- async fetchCover() {
- let {
- ACTIVE_SETTING
- } = (await this.$api.platform.getPlatformParams({
- keys: 'ACTIVE_SETTING'
- })).data.data;
- this.cover = JSON.parse(ACTIVE_SETTING).myProductImage
- },
- fetchUserInfo() {
- if (this.$cache.get('userInfo')) {
- this.userInfo = this.$cache.get('userInfo')
- return
- }
- let params = {
- id: this.vuex_userId
- }
- this.$api.loginUser.detail(params).then(res => {
- this.userInfo = res.data.data
- })
- },
- fetchMyTotalHeatValue(){
- let params={
- phone: this.vuex_phone
- }
- this.$api.activity.getMyTotalHeat(params).then(res=>{
- this.totalHeatValue=res.data.data || 0
- })
- },
- downCallback() {
- setTimeout(() => {
- this.mescroll.resetUpScroll();
- }, 1000)
- },
- upCallback(mescroll) {
- console.log(mescroll.num);
- if (mescroll.num==1) {
- this.fetchMyTotalHeatValue()
- }
- try {
- let params = {
- current: mescroll.num,
- size: mescroll.size,
- phone: this.vuex_phone
- }
- this.$api.activity.list(params).then(res => {
- let data = res.data.data.records
- let total = res.data.data.total
- mescroll.endBySize(data.length, total);
- if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
- this.list = this.list.concat(data); //追加新数据
- })
- } catch (e) {
- console.error(e);
- this.mescroll.endErr()
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .head {
- background-color: #ffffff;
- margin-top: -10upx;
- height: 220upx;
- border-radius: 26upx 26upx 0 0;
- }
- .avatar {
- border-radius: 50%;
- width: 120upx;
- height: 120upx;
- margin: -50upx 0 30upx 80upx;
- }
- .rank {
- display: flex;
- justify-content: center;
- background-color: #583be6;
- width: 40%;
- color: #ffffff;
- border-radius: 16upx;
- line-height: 60upx;
- }
- .music {
- .name {
- font-size: 28upx;
- font-family: PingFang SC;
- font-weight: 400;
- color: #333;
- padding-bottom: 20upx;
- }
- .author {
- font-size: 28upx;
- font-family: PingFang SC;
- font-weight: 400;
- color: #9A9A9A;
- }
- }
- .music-rank {
- display: flex;
- margin-top: 18upx;
- line-height: 40upx;
- justify-content: center;
- border: #9d9d9d 1px solid;
- color: #9d9d9d;
- border-radius: 50upx;
- font-style: italic;
- }
- </style>
|