dl_uniapp/pages/components/notice-item.vue
2025-03-27 09:50:13 +08:00

200 lines
4.5 KiB
Vue

<template>
<view class="dl-components">
<view v-for="(item,index) in dataList" class="dl-notice-box" @click="goDetail(item)">
<view class="dl-notice-title">
<image class="dl-image" :src="'/static/platform/'+item.platformCode+'.png'" mode="aspectFit"></image>
<view class="dl-text">{{item.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="0==item.feeUp" class="dl-content">奖励:无稿费</view>
<view v-else class="dl-content">奖励:¥{{item.feeDown}}-{{item.feeUp}}</view>
</view>
<view class="text-item">
<image class="dl-icon" src="@/static/index/my.png" mode="aspectFit"></image>
<view class="dl-content">
粉丝:{{formatNumberWithUnits(item.fansDown)}}-{{formatNumberWithUnits(item.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">类型:{{item.bloggerTypesText}}</view>
</view>
<view class="text-item" style="padding-top: 10rpx;">
<view class="item-box" style="width: 40%;">
<image class="dl-icon2" :src="imageUrl+item.avatar" mode="aspectFit"></image>
<view class="dl-item-right">{{item.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">{{item.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">{{item.viewNum}}</view>
</view>
</view>
</view>
<image class="right-image" :src="imageUrl+item.mainImage" mode="aspectFit"></image>
</view>
</view>
</view>
</template>
<script>
import {
formatNumberWithUnits
} from '@/utils/common.js'
import config from '@/config'
export default {
props: {
dataList: {
type: Array,
default: []
}
},
data() {
return {
imageUrl: config.baseUrl
}
},
methods: {
/**
* 数值单位转换
* @param {Object} number
*/
formatNumberWithUnits(number) {
return formatNumberWithUnits(number)
},
/**
* 查看通告详情
* @param {Object} item
*/
goDetail(item) {
this.$emit("goDetail", item)
}
}
}
</script>
<style lang="scss">
.dl-components {
width: 100%;
height: 100%;
.dl-notice-box {
font-size: 29rpx;
width: 100%;
padding: 18rpx;
background-color: white;
border-radius: 30rpx;
margin-bottom: 20rpx;
.dl-notice-title {
display: flex;
width: 100%;
padding-bottom: 10rpx;
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;
}
}
.dl-notice-content {
font-size: 27rpx;
display: flex;
color: #363636;
width: 100%;
align-items: center;
justify-content: center;
.left-text {
flex: 1;
min-width: 0;
margin-right: 10rpx;
.text-item {
display: flex;
padding: 5rpx;
width: 100%;
align-items: center;
justify-content: center;
.dl-icon {
flex: none;
width: 40rpx;
height: 44rpx;
}
.dl-content {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
padding-left: 15rpx;
}
.item-box {
display: flex;
width: 100%;
align-items: center;
justify-content: center;
.dl-icon2 {
flex: none;
width: 40rpx;
height: 44rpx;
border-radius: 50%;
}
.dl-icon3 {
flex: none;
width: 30rpx;
height: 29rpx;
}
.dl-item-right {
flex: 1;
padding-left: 10rpx;
min-width: 100rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
}
.dl-number {
font-size: 26rpx;
margin-right: 5rpx;
}
}
}
}
.right-image {
flex: none;
width: 220rpx;
height: 220rpx;
border-radius: 20rpx;
}
}
}
}
</style>