|
|
@@ -1,27 +1,31 @@
|
|
|
<template>
|
|
|
- <view class="common_page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
|
|
|
+ <view class="common_page adffc" :style="{'height':h+'px', 'padding-top':mt+'px'}">
|
|
|
<cus-header title="我的成就" bgColor="transparent"></cus-header>
|
|
|
<image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/8dbf51e7-85cb-496a-b3d0-d5816fa8ff34.png" class="top_bg_img" mode="widthFix"></image>
|
|
|
<div class="info">
|
|
|
<div class="info-top adfac">
|
|
|
- <image class="avatar" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/5dded84d-8594-4bbe-9204-c693098e7532.png"></image>
|
|
|
- <div class="name">Hi~ {{'周晓瑾'}}</div>
|
|
|
- <div class="level adfac"><text>LV</text><text>{{'04'}}</text></div>
|
|
|
+ <image class="avatar" :src="userInfo?.avatarPath||'https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/5dded84d-8594-4bbe-9204-c693098e7532.png'"></image>
|
|
|
+ <div class="name">Hi~ {{userInfo?.realName??''}}</div>
|
|
|
+ <div class="level adfac"><text>LV</text><text>{{userInfo?.userLevel??1}}</text></div>
|
|
|
</div>
|
|
|
- <div class="info-num">收获勋章:{{3}} <text>枚</text></div>
|
|
|
- <div class="info-memo">共参与<text>{{8}}</text>次公益活动,累计义工时长<text>{{88}}</text>小时</div>
|
|
|
+ <div class="info-num">收获勋章:{{numInfo?.myMedals??0}} <text>枚</text></div>
|
|
|
+ <div class="info-memo">共参与<text>{{numInfo?.activityCount??0}}</text>次公益活动,累计义工时长<text>{{numInfo?.volunteerHours??0}}</text>小时</div>
|
|
|
</div>
|
|
|
<div class="tab adfacjc">
|
|
|
- <div class="tab-pre" :class="{'active':tidx===''}" @tap="changeTab('')">全部</div>
|
|
|
- <div class="tab-pre" :class="{'active':tidx===1}" @tap="changeTab(1)">已获得</div>
|
|
|
+ <div class="tab-pre" :class="{'active':queryParams.obtained===''}" @tap="changeTab('')">全部</div>
|
|
|
+ <div class="tab-pre" :class="{'active':queryParams.obtained===1}" @tap="changeTab(1)">已获得</div>
|
|
|
</div>
|
|
|
- <div class="list">
|
|
|
+ <div class="list" v-if="list.length">
|
|
|
<div class="list-pre adffcac" v-for="(item,index) in list" :key="index" @tap="showSz(item)">
|
|
|
- <image :src="item.img"></image>
|
|
|
- <div class="p">{{item.title}}</div>
|
|
|
- <div class="p tip">{{item.date?(item.date+'点亮'):'未获得'}}</div>
|
|
|
+ <image :src="item.imageUrl??''"></image>
|
|
|
+ <div class="p">{{item?.medalName||''}}</div>
|
|
|
+ <div class="p tip" v-if="item?.lightUp">{{item?.lightUpDate2??''}}点亮</div>
|
|
|
+ <div class="p tip" v-else>未获得</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="dataEmpty" v-else>
|
|
|
+ <page-empty text="暂无勋章"></page-empty>
|
|
|
+ </div>
|
|
|
<div class="btn" @tap="showSave">晒出我的成就</div>
|
|
|
<div class="dialog adffcac" :style="{'height':'calc(100vh - '+mt+')px', 'top':mt+'px'}" v-if="xzShow">
|
|
|
<div class="title">"恭喜您获得荣誉勋章"</div>
|
|
|
@@ -80,41 +84,30 @@
|
|
|
|
|
|
<script setup name="">
|
|
|
import CusHeader from '@/components/CusHeader/index.vue'
|
|
|
- import { ref, onMounted } from 'vue'
|
|
|
+ import PageEmpty from '@/components/pageEmpty/index.vue'
|
|
|
+ import { onLoad } from '@dcloudio/uni-app'
|
|
|
+ import { ref, getCurrentInstance } from 'vue'
|
|
|
+ const { proxy } = getCurrentInstance()
|
|
|
|
|
|
- const tidx = ref('')
|
|
|
- const originData = ref([
|
|
|
- {
|
|
|
- img:'https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/94bda1ce-50c2-4e49-90ed-90db9b98c390.png',
|
|
|
- title:'公益萌新',
|
|
|
- date:'2025-07-30'
|
|
|
- },
|
|
|
- {
|
|
|
- img:'https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/7c0b9a7c-a095-495b-a3e9-d953417ebfb1.png',
|
|
|
- title:'黄金公益',
|
|
|
- date:''
|
|
|
- },
|
|
|
- {
|
|
|
- img:'https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/94bda1ce-50c2-4e49-90ed-90db9b98c390.png',
|
|
|
- title:'公益萌新',
|
|
|
- date:'2025-07-30'
|
|
|
- },
|
|
|
- {
|
|
|
- img:'https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/7c0b9a7c-a095-495b-a3e9-d953417ebfb1.png',
|
|
|
- title:'黄金公益',
|
|
|
- date:''
|
|
|
- },
|
|
|
- {
|
|
|
- img:'https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/94bda1ce-50c2-4e49-90ed-90db9b98c390.png',
|
|
|
- title:'公益萌新',
|
|
|
- date:'2025-07-30'
|
|
|
- },
|
|
|
- {
|
|
|
- img:'https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/29/7c0b9a7c-a095-495b-a3e9-d953417ebfb1.png',
|
|
|
- title:'黄金公益',
|
|
|
- date:''
|
|
|
- },
|
|
|
- ])
|
|
|
+ const userInfo = ref(null)
|
|
|
+ const numInfo = ref(null)
|
|
|
+ const queryParams = ref({
|
|
|
+ page:1,
|
|
|
+ limit:-1,
|
|
|
+ userId:'',
|
|
|
+ obtained:''
|
|
|
+ })
|
|
|
+ const typeDict = ref({
|
|
|
+ 1:'公益萌新',
|
|
|
+ 2:'青铜公益',
|
|
|
+ 3:'白银公益',
|
|
|
+ 4:'黄金公益',
|
|
|
+ 5:'铂金公益',
|
|
|
+ 6:'公益王者',
|
|
|
+ 7:'公益活动能手',
|
|
|
+ 8:'公益活动达人',
|
|
|
+ 9:'月月公益达人'
|
|
|
+ })
|
|
|
const list = ref([])
|
|
|
const xzShow = ref(false)
|
|
|
const xzInfo = ref(null)
|
|
|
@@ -129,9 +122,8 @@
|
|
|
])
|
|
|
|
|
|
const changeTab = type => {
|
|
|
- tidx.value = type;
|
|
|
- let yhd = originData.value.filter(d=>d.date);
|
|
|
- list.value = JSON.parse(JSON.stringify(type?yhd:originData.value));
|
|
|
+ queryParams.value.obtained = type;
|
|
|
+ getList()
|
|
|
}
|
|
|
|
|
|
const showSz = item => {
|
|
|
@@ -144,8 +136,19 @@
|
|
|
saveShow.value = true;
|
|
|
}
|
|
|
|
|
|
- onMounted(()=>{
|
|
|
- list.value = JSON.parse(JSON.stringify(originData.value));
|
|
|
+ const getList = () => {
|
|
|
+ proxy.$api.get('/core/love/value/record/obtainedMedalList',queryParams.value).then(({data:res})=>{
|
|
|
+ if(res.code!==0) return proxy.$showToast(res.msg)
|
|
|
+ list.value = res.data.list;
|
|
|
+ list.value.forEach(l=>l.lightUpDate2 = new Date(l.lightUpDate).Format('yyyy-MM-dd'));
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ onLoad((options)=>{
|
|
|
+ userInfo.value = uni.getStorageSync('userInfo')&&JSON.parse(uni.getStorageSync('userInfo'));
|
|
|
+ numInfo.value = options.numInfo&&JSON.parse(options.numInfo);
|
|
|
+ queryParams.value.userId = userInfo.value&&userInfo.value.id;
|
|
|
+ getList()
|
|
|
})
|
|
|
</script>
|
|
|
|
|
|
@@ -261,6 +264,8 @@
|
|
|
.list{
|
|
|
margin-left: -60rpx;
|
|
|
overflow: hidden;
|
|
|
+ flex: 1;
|
|
|
+ overflow-y: auto;
|
|
|
&-pre{
|
|
|
width: calc(100% / 3 - 60rpx);
|
|
|
margin-top: 48rpx;
|