dl_uniapp/pages/components/notice-item.vue

254 lines
6.8 KiB
Vue
Raw Normal View History

2025-03-21 17:57:53 +08:00
<template>
<view class="dl-components">
2025-03-27 09:50:13 +08:00
<view v-for="(item,index) in dataList" class="dl-notice-box" @click="goDetail(item)">
2025-03-21 17:57:53 +08:00
<view class="dl-notice-title">
2025-03-26 10:09:11 +08:00
<image class="dl-image" :src="'/static/platform/'+item.platformCode+'.png'" mode="aspectFit"></image>
<view class="dl-text">{{item.title}}</view>
2025-03-21 17:57:53 +08:00
</view>
<view class="dl-notice-content">
<view class="left-text">
<view class="text-item">
<image class="dl-icon" src="@/static/index/money.png" mode="aspectFit"></image>
2025-03-31 14:31:41 +08:00
<view v-if="null==item.feeUp" class="dl-content">奖励无稿费</view>
2025-03-26 10:09:11 +08:00
<view v-else class="dl-content">奖励¥{{item.feeDown}}-{{item.feeUp}}</view>
2025-03-21 17:57:53 +08:00
</view>
<view class="text-item">
<image class="dl-icon" src="@/static/index/my.png" mode="aspectFit"></image>
2025-03-26 10:09:11 +08:00
<view class="dl-content">
粉丝{{formatNumberWithUnits(item.fansDown)}}-{{formatNumberWithUnits(item.fansUp)}}</view>
2025-03-21 17:57:53 +08:00
</view>
2025-03-26 10:09:11 +08:00
<view class="text-item" style="border-bottom: 1rpx solid #F4F4F4;padding-bottom: 10rpx;">
2025-03-21 17:57:53 +08:00
<image class="dl-icon" src="@/static/index/xing.png" mode="aspectFit"></image>
2025-04-14 14:24:40 +08:00
<view class="dl-content">类型{{item.bloggerTypesText||'无限制'}}</view>
2025-03-21 17:57:53 +08:00
</view>
2025-03-26 10:09:11 +08:00
<view class="text-item" style="padding-top: 10rpx;">
2025-03-21 17:57:53 +08:00
<view class="item-box" style="width: 40%;">
2025-03-26 10:09:11 +08:00
<image class="dl-icon2" :src="imageUrl+item.avatar" mode="aspectFit"></image>
<view class="dl-item-right">{{item.userNickName}}</view>
2025-03-21 17:57:53 +08:00
</view>
<view class="item-box">
<image class="dl-icon3" src="@/static/index/person.png" mode="aspectFit"></image>
2025-03-26 10:09:11 +08:00
<view class="dl-item-right dl-number">{{item.reportNum}}</view>
2025-03-21 17:57:53 +08:00
</view>
<view class="item-box">
<image class="dl-icon3" src="@/static/index/eye.png" mode="aspectFit"></image>
2025-03-26 10:09:11 +08:00
<view class="dl-item-right dl-number">{{item.viewNum}}</view>
2025-03-21 17:57:53 +08:00
</view>
</view>
</view>
2025-03-26 10:09:11 +08:00
<image class="right-image" :src="imageUrl+item.mainImage" mode="aspectFit"></image>
2025-03-21 17:57:53 +08:00
</view>
</view>
2025-04-03 16:46:51 +08:00
<!-- 单个数据 -->
<view v-if="null!=dataObj" class="dl-notice-box no-bg" @click="goDetail(item)">
<view class="dl-notice-title">
<image class="dl-image" :src="'/static/platform/'+dataObj.platformCode+'.png'" mode="aspectFit"></image>
<view class="dl-text">{{dataObj.title}}</view>
</view>
<view class="dl-notice-content">
<view class="left-text">
<view class="text-item">
<image class="dl-icon" src="@/static/index/money.png" mode="aspectFit"></image>
<view v-if="null==dataObj.feeUp" class="dl-content">奖励无稿费</view>
<view v-else class="dl-content">奖励¥{{dataObj.feeDown}}-{{dataObj.feeUp}}</view>
</view>
<view class="text-item">
<image class="dl-icon" src="@/static/index/my.png" mode="aspectFit"></image>
<view class="dl-content">
粉丝{{formatNumberWithUnits(dataObj.fansDown)}}-{{formatNumberWithUnits(dataObj.fansUp)}}
</view>
</view>
<view class="text-item" style="border-bottom: 1rpx solid #F4F4F4;padding-bottom: 10rpx;">
<image class="dl-icon" src="@/static/index/xing.png" mode="aspectFit"></image>
<view class="dl-content">类型{{dataObj.bloggerTypesText}}</view>
</view>
<view class="text-item" style="padding-top: 10rpx;">
<view class="item-box" style="width: 40%;">
<image class="dl-icon2" :src="imageUrl+dataObj.avatar" mode="aspectFit"></image>
<view class="dl-item-right">{{dataObj.userNickName}}</view>
</view>
<view class="item-box">
<image class="dl-icon3" src="@/static/index/person.png" mode="aspectFit"></image>
<view class="dl-item-right dl-number">{{dataObj.reportNum}}</view>
</view>
<view class="item-box">
<image class="dl-icon3" src="@/static/index/eye.png" mode="aspectFit"></image>
<view class="dl-item-right dl-number">{{dataObj.viewNum}}</view>
</view>
</view>
</view>
<image class="right-image" :src="imageUrl+dataObj.mainImage" mode="aspectFit"></image>
</view>
</view>
2025-03-21 17:57:53 +08:00
</view>
</template>
<script>
2025-03-26 10:09:11 +08:00
import {
formatNumberWithUnits
} from '@/utils/common.js'
import config from '@/config'
2025-03-21 17:57:53 +08:00
export default {
props: {
dataList: {
type: Array,
default: []
2025-04-03 16:46:51 +08:00
},
dataObj: {
type: Object,
default: null
2025-03-21 17:57:53 +08:00
}
},
data() {
return {
2025-03-26 10:09:11 +08:00
imageUrl: config.baseUrl
2025-03-21 17:57:53 +08:00
}
},
methods: {
2025-03-27 09:50:13 +08:00
/**
* 数值单位转换
* @param {Object} number
*/
2025-03-26 10:09:11 +08:00
formatNumberWithUnits(number) {
return formatNumberWithUnits(number)
2025-03-27 09:50:13 +08:00
},
/**
* 查看通告详情
* @param {Object} item
*/
goDetail(item) {
this.$emit("goDetail", item)
2025-03-26 10:09:11 +08:00
}
2025-03-21 17:57:53 +08:00
}
}
</script>
<style lang="scss">
.dl-components {
2025-04-03 16:46:51 +08:00
.dl-notice-box:first-child {
margin-top: 20rpx;
}
.no-bg {
background: none !important;
margin-bottom: 0 !important;
padding-top: 0 !important;
}
2025-03-21 17:57:53 +08:00
.dl-notice-box {
font-size: 29rpx;
width: 100%;
2025-03-26 10:09:11 +08:00
padding: 18rpx;
2025-03-21 17:57:53 +08:00
background-color: white;
border-radius: 30rpx;
margin-bottom: 20rpx;
.dl-notice-title {
display: flex;
width: 100%;
2025-03-26 10:09:11 +08:00
padding-bottom: 10rpx;
2025-03-21 17:57:53 +08:00
align-items: center;
justify-content: center;
.dl-image {
flex: none;
width: 50rpx;
height: 50rpx;
}
.dl-text {
margin-left: 10rpx;
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
font-weight: bold;
2025-03-26 10:09:11 +08:00
2025-03-21 17:57:53 +08:00
}
}
2025-03-26 10:09:11 +08:00
.dl-notice-content {
2025-03-21 17:57:53 +08:00
font-size: 27rpx;
display: flex;
color: #363636;
width: 100%;
align-items: center;
justify-content: center;
2025-03-26 10:09:11 +08:00
.left-text {
2025-03-21 17:57:53 +08:00
flex: 1;
min-width: 0;
margin-right: 10rpx;
2025-03-26 10:09:11 +08:00
.text-item {
2025-03-21 17:57:53 +08:00
display: flex;
padding: 5rpx;
width: 100%;
align-items: center;
justify-content: center;
2025-03-26 10:09:11 +08:00
.dl-icon {
2025-03-21 17:57:53 +08:00
flex: none;
width: 40rpx;
height: 44rpx;
}
2025-03-26 10:09:11 +08:00
.dl-content {
2025-03-21 17:57:53 +08:00
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
padding-left: 15rpx;
}
2025-03-26 10:09:11 +08:00
.item-box {
2025-03-21 17:57:53 +08:00
display: flex;
width: 100%;
align-items: center;
justify-content: center;
2025-03-26 10:09:11 +08:00
.dl-icon2 {
2025-03-21 17:57:53 +08:00
flex: none;
width: 40rpx;
height: 44rpx;
border-radius: 50%;
}
2025-03-26 10:09:11 +08:00
.dl-icon3 {
2025-03-21 17:57:53 +08:00
flex: none;
width: 30rpx;
height: 29rpx;
2025-03-31 14:31:41 +08:00
margin-left: 6rpx;
2025-03-21 17:57:53 +08:00
}
2025-03-26 10:09:11 +08:00
.dl-item-right {
2025-03-21 17:57:53 +08:00
flex: 1;
padding-left: 10rpx;
2025-03-26 10:09:11 +08:00
min-width: 100rpx;
2025-03-21 17:57:53 +08:00
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
}
2025-03-26 10:09:11 +08:00
.dl-number {
2025-03-21 17:57:53 +08:00
font-size: 26rpx;
margin-right: 5rpx;
}
}
}
}
2025-03-26 10:09:11 +08:00
.right-image {
2025-03-21 17:57:53 +08:00
flex: none;
2025-03-26 10:09:11 +08:00
width: 220rpx;
height: 220rpx;
2025-03-21 17:57:53 +08:00
border-radius: 20rpx;
}
}
}
}
2025-04-14 14:24:40 +08:00
</style>