Files
vpUni/.svn/pristine/01/01377af61a85fcca34e8641ddef521d143d62cdb.svn-base
2026-03-09 16:39:03 +08:00

100 lines
3.1 KiB
Plaintext

<template>
<view style="padding: 20rpx;">
<view class="" v-for="(item,index) in noticeList " :key="index" @click="Service.GoPage('/pages/article/articleCom?noticeId='+item.noticeId)"
style=" padding: 20rpx; margin-top: 20rpx; border-radius: 20rpx; box-shadow: 0 0 10rpx 4rpx #e2e2e2; ">
<view class="" style="display: flex; align-items: center; ">
<view class="tag" v-if="index==0"
style=" color: #fff; border-radius: 12rpx; background-color: #FF6B35; padding: 4rpx 20rpx; ">
<img :src="Service.GetIconImg('/static/index/community/top.png')"
style="width: 30rpx; height: 30rpx; " alt="" />
<text style="margin-left: 10rpx; font-size: 24rpx;">置顶</text>
</view>
<view class="tag" v-else
style=" color: #fff; border-radius: 12rpx; background-color: #FF6B35; padding: 4rpx 20rpx; ">
<img :src="Service.GetIconImg('/static/index/community/top.png')"
style="width: 30rpx; height: 30rpx; " alt="" />
<text style="margin-left: 10rpx; font-size: 24rpx;">{{item.sign}}</text>
</view>
<text style="font-size: 32rpx; font-weight: 600; margin-left: 15rpx; ">{{item.title}}</text>
</view>
<view class=""
style=" margin: 16rpx 0; color: #666666; font-size: 26rpx; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; ">
{{item.remark}}
</view>
<view class="" style=" font-size: 22rpx; color: #999999; display: flex; align-items: center;">
<up-icon name="clock" size="12" color='#999999' ></up-icon>
<text style="margin-left: 10rpx;" >{{Service.formatDate(item.addTime,2)}}</text>
<!-- <text style="margin: 0 15rpx;">·</text>
<view class="" style="display: flex;align-items: center;">
<img :src="Service.GetIconImg('/static/index/community/see.png')"
style="width: 30rpx; height: 30rpx; " alt="" />
<text style="margin-left: 10rpx;">1200人阅读</text>
</view> -->
</view>
</view>
<up-loadmore :status="status" />
</view>
</template>
<script setup lang="ts">
import { onShow, onLoad, onReachBottom } from "@dcloudio/uni-app";
import { Service } from "@/Service/Service"
import { ref } from "vue";
import { vpCommunityService } from '@/Service/vp/vpCommunityService'
interface notice{
addTime:string
noticeId:string
remark:string
sign:string
title:string
}
let status = ref('nomore')
let page=ref(1)
let noticeList=ref<notice[]>([])
let comId=ref()
onLoad((data:any) => {
comId.value=data.comId
getData()
});
onShow(() => {
});
onReachBottom(()=>{
getList()
})
const getData=()=>{
status.value='loadmore'
page.value=1
noticeList.value=[]
getList()
}
const getList=()=>{
if (status.value !== 'loadmore') {
return
}
status.value = 'loading'
vpCommunityService.GetCommunityNoticeList(comId.value,page.value).then(res=>{
noticeList.value=[...noticeList.value,...res.data.noticeList]
status.value = res.data.noticeList.length == 10 ? 'loadmore' : 'nomore'
page.value++
})
}
</script>
<style lang="scss">
.tag {
display: flex;
align-items: center;
justify-content: center;
width: fit-content;
font-size: 24rpx;
}
</style>