dl_uniapp/pages/components/notice-item.vue

306 lines
8.1 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-04-25 14:33:03 +08:00
<view class="dl-is-urgent" v-if="'1'==item.isUrgent">急招</view>
2025-04-28 17:32:19 +08:00
<view class="dl-is-platform" v-if="'1'==item.isPlatformFree && '1'!=item.isUrgent">平台结算</view>
<view class="dl-is-platform-2" v-if="'1'==item.isPlatformFree && '1'==item.isUrgent">平台结算</view>
2025-03-21 17:57:53 +08:00
<view class="dl-notice-title">
2025-04-25 15:59:26 +08:00
<image class="dl-image" :src="'/static/platform/'+item.platformCode+'.png'" mode="aspectFit">
2025-04-25 14:33:03 +08:00
</image>
2025-03-26 10:09:11 +08:00
<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-05-12 13:59:02 +08:00
<view class="dl-content">奖励¥{{item.feeDown}}-{{item.feeUp==null?'无上限':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-06-16 15:12:54 +08:00
<view class="dl-content">类型{{item.bloggerTypes||'无限制'}}</view>
2025-03-21 17:57:53 +08:00
</view>
2025-04-24 10:20:03 +08:00
<view class="text-item" style="padding-top: 16rpx;">
<view class="item-box" style="flex: 1;">
2025-04-25 14:33:03 +08:00
<image class="dl-icon2" :src="imageUrl+item.avatar" mode="scaleToFill"></image>
2025-06-16 15:12:54 +08:00
<view class="dl-item-right" style="color: #929292;font-size: 20rpx;">{{item.userNickName}}
</view>
2025-03-21 17:57:53 +08:00
</view>
2025-04-25 09:58:33 +08:00
<!-- <view class="item-box" style="width: 28%;">
2025-03-21 17:57:53 +08:00
<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-04-25 09:58:33 +08:00
</view> -->
2025-06-16 15:12:54 +08:00
<!-- <view class="item-box" style="width: 35%;">
2025-03-21 17:57:53 +08:00
<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-06-16 15:12:54 +08:00
</view> -->
2025-04-28 17:32:19 +08:00
<!-- <view class="item-box" style="width: 25%;">
2025-04-28 15:09:33 +08:00
<view>
{{item.isPlatformFree==1?'平台结算':''}}
</view>
2025-04-28 17:32:19 +08:00
</view> -->
2025-03-21 17:57:53 +08:00
</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>
2025-05-12 13:59:02 +08:00
<view class="dl-content">奖励¥{{dataObj.feeDown}}-{{dataObj.feeUp==null?'无上限':dataObj.feeUp}}
</view>
2025-04-03 16:46:51 +08:00
</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>
2025-06-16 15:12:54 +08:00
<view class="dl-content">类型{{dataObj.bloggerTypes||'无限制'}}</view>
2025-04-03 16:46:51 +08:00
</view>
<view class="text-item" style="padding-top: 10rpx;">
2025-04-24 10:20:03 +08:00
<view class="item-box">
2025-04-03 16:46:51 +08:00
<image class="dl-icon2" :src="imageUrl+dataObj.avatar" mode="aspectFit"></image>
2025-06-16 15:12:54 +08:00
<view class="dl-item-right" style="color: #929292;font-size: 16rpx;">
{{dataObj.userNickName}}
</view>
2025-04-03 16:46:51 +08:00
</view>
2025-04-25 09:58:33 +08:00
<!-- <view class="item-box" style="width: 25%;">
2025-04-03 16:46:51 +08:00
<image class="dl-icon3" src="@/static/index/person.png" mode="aspectFit"></image>
<view class="dl-item-right dl-number">{{dataObj.reportNum}}</view>
2025-04-25 09:58:33 +08:00
</view> -->
2025-06-16 15:12:54 +08:00
<!-- <view class="item-box" style="width: 25%;">
2025-04-03 16:46:51 +08:00
<image class="dl-icon3" src="@/static/index/eye.png" mode="aspectFit"></image>
<view class="dl-item-right dl-number">{{dataObj.viewNum}}</view>
2025-06-16 15:12:54 +08:00
</view> -->
2025-04-28 15:02:08 +08:00
2025-04-03 16:46:51 +08:00
</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-04-25 15:38:40 +08:00
imageUrl: ''
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-04-25 17:25:48 +08:00
padding: 38rpx 18rpx 10rpx 18rpx;
2025-03-21 17:57:53 +08:00
background-color: white;
2025-04-25 14:33:03 +08:00
border-radius: 25rpx;
2025-03-21 17:57:53 +08:00
margin-bottom: 20rpx;
2025-04-25 14:33:03 +08:00
position: relative;
.dl-is-urgent {
position: absolute;
color: white;
background-color: #FC1F3E;
2025-04-25 17:25:48 +08:00
padding: 5rpx 25rpx;
2025-04-25 14:33:03 +08:00
font-size: 24rpx;
border-radius: 0 25rpx 0 25rpx;
top: 0;
right: 0;
}
2025-03-21 17:57:53 +08:00
2025-04-28 17:32:19 +08:00
.dl-is-platform {
position: absolute;
color: white;
background-color: #FC1F3E;
padding: 5rpx 25rpx;
font-size: 24rpx;
border-radius: 0 25rpx 0 25rpx;
top: 0;
right: 0;
}
.dl-is-platform-2 {
position: absolute;
color: white;
background-color: #FC1F3E;
padding: 5rpx 25rpx;
font-size: 24rpx;
border-radius: 0 0 25rpx 25rpx;
top: 0;
right: 120rpx;
}
2025-03-21 17:57:53 +08:00
.dl-notice-title {
display: flex;
width: 100%;
2025-04-25 14:33:03 +08:00
padding-bottom: 3rpx;
2025-03-21 17:57:53 +08:00
align-items: center;
justify-content: center;
.dl-image {
flex: none;
width: 50rpx;
height: 50rpx;
}
.dl-text {
2025-04-24 10:20:03 +08:00
font-size: 30rpx;
2025-03-21 17:57:53 +08:00
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;
2025-04-24 10:20:03 +08:00
width: 25rpx;
height: 30rpx;
2025-03-21 17:57:53 +08:00
}
2025-03-26 10:09:11 +08:00
.dl-content {
2025-04-24 10:20:03 +08:00
font-size: 24rpx;
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-04-25 14:33:03 +08:00
flex: 1;
2025-03-21 17:57:53 +08:00
display: flex;
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;
2025-04-24 10:20:03 +08:00
height: 40rpx;
2025-03-21 17:57:53 +08:00
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-04-24 10:20:03 +08:00
font-size: 26rpx;
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-04-24 10:20:03 +08:00
color: #929292;
font-size: 24rpx;
2025-03-21 17:57:53 +08:00
margin-right: 5rpx;
}
}
}
}
2025-03-26 10:09:11 +08:00
.right-image {
2025-03-21 17:57:53 +08:00
flex: none;
2025-04-24 10:20:03 +08:00
width: 180rpx;
height: 180rpx;
2025-03-21 17:57:53 +08:00
border-radius: 20rpx;
}
}
}
}
2025-04-25 17:25:48 +08:00
</style>