| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- <template>
- <view class="common_page" :style="{'height':h+'px', 'padding-top':mt+'px'}">
- <cus-header title="义工时长" bgColor="#FFFFFF"></cus-header>
- <view class="hours">义工时长:{{volunteerHours}}<text>小时</text></view>
- <view class="list" v-if="list.length">
- <up-list @scrolltolower="scrolltolower" style="height: 100%;">
- <up-list-item class="list-item" v-for="(item, index) in list" :key="index">
- <view class="time">{{item.createDate||""}}</view>
- <view class="content adfacjb">
- <view class="left adfac">
- <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/24/d5b79c0e-bcda-49ff-8cc5-5f6275b6bac1.png"></image>
- <view class="texts">
- <view class="p">{{item.activityName??''}}</view>
- <view class="p tip">{{item.typeName??''}}</view>
- </view>
- </view>
- <view class="right adfac">
- <text>+{{item.volunteerHours??0}}</text>
- </view>
- </view>
- </up-list-item>
- </up-list>
- </view>
- <view class="dataEmpty" v-else>
- <page-empty text="暂无义工时长记录"></page-empty>
- </view>
- </view>
- </template>
- <script setup name="">
- import CusHeader from '@/components/CusHeader/index.vue'
- import PageEmpty from '@/components/pageEmpty/index.vue'
- import { onLoad } from '@dcloudio/uni-app'
- import { ref, getCurrentInstance } from 'vue'
- const { proxy } = getCurrentInstance()
-
- const queryParams = ref({
- page:1,
- limit:10,
- userId:''
- })
- const volunteerHours = ref(0)
- const isOver = ref(false)
- const list = ref([])
-
- const scrolltolower = () => {
- if(isOver.value) return
- getList()
- }
-
- const getList = () => {
- proxy.$api.get('/core/love/value/record/volunteerHoursList',queryParams.value).then(({data:res})=>{
- if(res.code!==0) return proxy.$showToast(res.msg)
- list.value= [...list.value,...res.data.list];
- queryParams.value.page++
- if(res.data.list.length===0) isOver.value = true;
- })
- }
-
- onLoad(options=>{
- volunteerHours.value = options.volunteerHours??0;
- queryParams.value.userId = uni.getStorageSync('userInfo')&&JSON.parse(uni.getStorageSync('userInfo')).id;
- getList()
- })
- </script>
- <style scoped lang="scss">
- .common_page{
- .hours{
- padding: 0 24rpx;
- height: 120rpx;
- background: #FFFFFF;
- border-radius: 24rpx;
- margin-top: 20rpx;
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 32rpx;
- color: #151B29;
- line-height: 120rpx;
- text{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #989998;
- line-height: 120rpx;
- margin-left: 5rpx;
- }
- }
-
- .list{
- height: calc(100% - 160rpx);
- background: #FFFFFF;
- border-radius: 24rpx;
- margin-top: 20rpx;
- padding: 0 21rpx;
- &-item{
- padding: 36rpx 0;
- border-bottom: 1rpx solid #E7E7E7;
- .time{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #989998;
- line-height: 24rpx;
- }
- .content{
- margin-top: 36rpx;
- .left{
- width: calc(100% - 200rpx);
- image{
- width: 64rpx;
- height: 64rpx;
- display: table;
- }
- .texts{
- width: 100%;
- margin-left: 20rpx;
- .p{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 32rpx;
- color: #151B29;
- line-height: 32rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- &.tip{
- font-size: 24rpx;
- color: #989998;
- line-height: 24rpx;
- margin-top: 18rpx;
- }
- }
- }
- }
- .right{
- width: 200rpx;
- justify-content: flex-end;
- text{
- font-family: DINAlternate, DINAlternate;
- font-weight: bold;
- font-size: 36rpx;
- color: #252525;
- line-height: 42rpx;
- text-align: right;
- }
- }
- }
- }
- }
- }
- </style>
|