shangfutong-ui/jeepay-ui-uapp-agent/pageWork/setUp/latestPost.vue

61 lines
1.4 KiB
Vue

<template>
<view class="post-list" v-for="item in useDataResult.dataList" @tap="toDetail(item.articleId)">
<text>{{ item.title }}</text>
<text>{{ item.createdAt ? item.createdAt.slice(0, 10) : '' }}</text>
</view>
<jeepayListNull :list="useDataResult.dataList"></jeepayListNull>
</template>
<script setup>
import { ref, reactive, watch } from 'vue'
import { onBackPress } from '@dcloudio/uni-app'
import useGetList from '@/hooks/useGetList.js'
import { $getNoticeList } from '@/http/apiManager.js'
import jeepayListNull from '@/components/jeepayListNull/jeepayListNull.vue'
const switchStatePopup = ref()
const { useDataResult, getList } = useGetList($getNoticeList, undefined, { articleType: 1 })
let vdata = reactive({})
// 跳转
const toDetail = (articleId) => {
uni.navigateTo({
url: './postDetail?id=' + articleId
})
}
</script>
<style>
page {
background: #f5f6fc;
}
</style>
<style scoped lang="scss">
.post-list {
box-sizing: border-box;
width: 750rpx;
height: 150rpx;
background: #fff;
margin-top: 2rpx;
padding: 30rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
text {
&:nth-child(1) {
font-weight: bold;
font-size: 30rpx;
color: #000;
overflow: hidden;
text-overflow: ellipsis; //溢出用省略号显示
white-space: nowrap;
}
&:nth-child(2) {
font-weight: 500;
font-size: 23rpx;
color: #a6a6a6;
}
}
}
</style>