This commit is contained in:
Vinjor 2025-03-26 10:09:11 +08:00
parent 6b0e104d51
commit 9127778c6f
4 changed files with 138 additions and 93 deletions

View File

@ -1,15 +1,11 @@
import upload from '@/utils/upload' import upload from '@/utils/upload'
import request from '@/utils/request' import request from '@/utils/request'
// 根据code查分类树 // 根据条件查询通告列表
export function getCatgByCode(code) { export function getNoticeList(params) {
const data = { return request({
oldPassword, url: '/busi/notice/appList',
newPassword method: 'get',
} params: params
return request({ })
url: '/system/user/profile/updatePwd', }
method: 'put',
data: data
})
}

View File

@ -2,45 +2,51 @@
<view class="dl-components"> <view class="dl-components">
<view v-for="(item,index) in dataList" class="dl-notice-box"> <view v-for="(item,index) in dataList" class="dl-notice-box">
<view class="dl-notice-title"> <view class="dl-notice-title">
<image class="dl-image" src="@/static/index/xiaohongshu.png" mode="aspectFit"></image> <image class="dl-image" :src="'/static/platform/'+item.platformCode+'.png'" mode="aspectFit"></image>
<view class="dl-text">某品牌鞋子上海宁波博主探店招募某品牌鞋子上海宁波博主探店招募</view> <view class="dl-text">{{item.title}}</view>
</view> </view>
<view class="dl-notice-content"> <view class="dl-notice-content">
<view class="left-text"> <view class="left-text">
<view class="text-item"> <view class="text-item">
<image class="dl-icon" src="@/static/index/money.png" mode="aspectFit"></image> <image class="dl-icon" src="@/static/index/money.png" mode="aspectFit"></image>
<view class="dl-content">奖励¥30-400</view> <view v-if="0==item.feeUp" class="dl-content">奖励无稿费</view>
<view v-else class="dl-content">奖励¥{{item.feeDown}}-{{item.feeUp}}</view>
</view> </view>
<view class="text-item"> <view class="text-item">
<image class="dl-icon" src="@/static/index/my.png" mode="aspectFit"></image> <image class="dl-icon" src="@/static/index/my.png" mode="aspectFit"></image>
<view class="dl-content">粉丝1K-10w</view> <view class="dl-content">
粉丝{{formatNumberWithUnits(item.fansDown)}}-{{formatNumberWithUnits(item.fansUp)}}</view>
</view> </view>
<view class="text-item" style="border-bottom: 1rpx solid #F4F4F4;padding-bottom: 17rpx;"> <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> <image class="dl-icon" src="@/static/index/xing.png" mode="aspectFit"></image>
<view class="dl-content">类型时尚 探店 运动 颜值</view> <view class="dl-content">类型{{item.bloggerTypesText}}</view>
</view> </view>
<view class="text-item" style="padding-top: 20rpx;"> <view class="text-item" style="padding-top: 10rpx;">
<view class="item-box" style="width: 40%;"> <view class="item-box" style="width: 40%;">
<image class="dl-icon2" src="@/static/images/profile.jpg" mode="aspectFit"></image> <image class="dl-icon2" :src="imageUrl+item.avatar" mode="aspectFit"></image>
<view class="dl-item-right">资深Pr资深</view> <view class="dl-item-right">{{item.userNickName}}</view>
</view> </view>
<view class="item-box"> <view class="item-box">
<image class="dl-icon3" src="@/static/index/person.png" mode="aspectFit"></image> <image class="dl-icon3" src="@/static/index/person.png" mode="aspectFit"></image>
<view class="dl-item-right dl-number">659</view> <view class="dl-item-right dl-number">{{item.reportNum}}</view>
</view> </view>
<view class="item-box"> <view class="item-box">
<image class="dl-icon3" src="@/static/index/eye.png" mode="aspectFit"></image> <image class="dl-icon3" src="@/static/index/eye.png" mode="aspectFit"></image>
<view class="dl-item-right dl-number">659</view> <view class="dl-item-right dl-number">{{item.viewNum}}</view>
</view> </view>
</view> </view>
</view> </view>
<image class="right-image" src="@/static/images/profile.jpg" mode="aspectFit"></image> <image class="right-image" :src="imageUrl+item.mainImage" mode="aspectFit"></image>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import {
formatNumberWithUnits
} from '@/utils/common.js'
import config from '@/config'
export default { export default {
props: { props: {
dataList: { dataList: {
@ -50,11 +56,13 @@
}, },
data() { data() {
return { return {
imageUrl: config.baseUrl
} }
}, },
methods: { methods: {
formatNumberWithUnits(number) {
return formatNumberWithUnits(number)
}
} }
} }
</script> </script>
@ -67,7 +75,7 @@
.dl-notice-box { .dl-notice-box {
font-size: 29rpx; font-size: 29rpx;
width: 100%; width: 100%;
padding: 20rpx; padding: 18rpx;
background-color: white; background-color: white;
border-radius: 30rpx; border-radius: 30rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
@ -75,7 +83,7 @@
.dl-notice-title { .dl-notice-title {
display: flex; display: flex;
width: 100%; width: 100%;
padding-bottom: 20rpx; padding-bottom: 10rpx;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -93,35 +101,37 @@
white-space: nowrap; white-space: nowrap;
width: 100%; width: 100%;
font-weight: bold; font-weight: bold;
} }
} }
.dl-notice-content{
.dl-notice-content {
font-size: 27rpx; font-size: 27rpx;
display: flex; display: flex;
color: #363636; color: #363636;
width: 100%; width: 100%;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.left-text{ .left-text {
flex: 1; flex: 1;
min-width: 0; min-width: 0;
margin-right: 10rpx; margin-right: 10rpx;
.text-item{ .text-item {
display: flex; display: flex;
padding: 5rpx; padding: 5rpx;
width: 100%; width: 100%;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.dl-icon{ .dl-icon {
flex: none; flex: none;
width: 40rpx; width: 40rpx;
height: 44rpx; height: 44rpx;
} }
.dl-content{
.dl-content {
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@ -129,43 +139,48 @@
width: 100%; width: 100%;
padding-left: 15rpx; padding-left: 15rpx;
} }
.item-box{
.item-box {
display: flex; display: flex;
width: 100%; width: 100%;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.dl-icon2{ .dl-icon2 {
flex: none; flex: none;
width: 40rpx; width: 40rpx;
height: 44rpx; height: 44rpx;
border-radius: 50%; border-radius: 50%;
} }
.dl-icon3{
.dl-icon3 {
flex: none; flex: none;
width: 30rpx; width: 30rpx;
height: 29rpx; height: 29rpx;
} }
.dl-item-right{
.dl-item-right {
flex: 1; flex: 1;
padding-left: 10rpx; padding-left: 10rpx;
min-width: 0; min-width: 100rpx;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
width: 100%; width: 100%;
} }
.dl-number{
.dl-number {
font-size: 26rpx; font-size: 26rpx;
margin-right: 5rpx; margin-right: 5rpx;
} }
} }
} }
} }
.right-image{
.right-image {
flex: none; flex: none;
width: 230rpx; width: 220rpx;
height: 230rpx; height: 220rpx;
border-radius: 20rpx; border-radius: 20rpx;
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -1,4 +1,9 @@
import { getJSONData,setJSONData,removeJSONData,setStrData } from '@/utils/auth' import {
getJSONData,
setJSONData,
removeJSONData,
setStrData
} from '@/utils/auth'
// 用户权益code // 用户权益code
const UserRightsKey = 'User-Rights' const UserRightsKey = 'User-Rights'
//用户当前身份code //用户当前身份code
@ -12,7 +17,7 @@ export function hasRights(code) {
let userRights = getJSONData(UserRightsKey) let userRights = getJSONData(UserRightsKey)
//默认无权限 //默认无权限
let rtnData = false let rtnData = false
if(''!=userRights && userRights.con){ if ('' != userRights && userRights.con) {
} }
return rtnData return rtnData
@ -23,60 +28,89 @@ export function hasRights(code) {
* @param {Object} value 身份值 * @param {Object} value 身份值
*/ */
export function changeUserType(value) { export function changeUserType(value) {
setStrData(UserTypeKey,value) setStrData(UserTypeKey, value)
} }
/** /**
* 显示消息提示框 * 显示消息提示框
* @param content 提示的标题 * @param content 提示的标题
*/ */
export function toast(content) { export function toast(content) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: content title: content
}) })
} }
/** /**
* 显示模态弹窗 * 显示模态弹窗
* @param content 提示的标题 * @param content 提示的标题
*/ */
export function showConfirm(content) { export function showConfirm(content) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: content, content: content,
cancelText: '取消', cancelText: '取消',
confirmText: '确定', confirmText: '确定',
success: function(res) { success: function(res) {
resolve(res) resolve(res)
} }
}) })
}) })
} }
/** /**
* 参数处理 * 参数处理
* @param params 参数 * @param params 参数
*/ */
export function tansParams(params) { export function tansParams(params) {
let result = '' let result = ''
for (const propName of Object.keys(params)) { for (const propName of Object.keys(params)) {
const value = params[propName] const value = params[propName]
var part = encodeURIComponent(propName) + "=" var part = encodeURIComponent(propName) + "="
if (value !== null && value !== "" && typeof (value) !== "undefined") { if (value !== null && value !== "" && typeof(value) !== "undefined") {
if (typeof value === 'object') { if (typeof value === 'object') {
for (const key of Object.keys(value)) { for (const key of Object.keys(value)) {
if (value[key] !== null && value[key] !== "" && typeof (value[key]) !== 'undefined') { if (value[key] !== null && value[key] !== "" && typeof(value[key]) !== 'undefined') {
let params = propName + '[' + key + ']' let params = propName + '[' + key + ']'
var subPart = encodeURIComponent(params) + "=" var subPart = encodeURIComponent(params) + "="
result += subPart + encodeURIComponent(value[key]) + "&" result += subPart + encodeURIComponent(value[key]) + "&"
} }
} }
} else { } else {
result += part + encodeURIComponent(value) + "&" result += part + encodeURIComponent(value) + "&"
} }
} }
} }
return result return result
} }
/**
* 数字单位转换
* @param {Object} num
*/
export function formatNumberWithUnits(num) {
const units = ['', 'k', 'w', 'kw'];
const absNum = Math.abs(num); // 获取绝对值以处理负数
// 处理小于1000的情况直接返回原数字的字符串形式
if (absNum < 1000) {
return absNum.toString();
}
// 寻找合适的单位
let unitIndex = 0;
if (absNum > 10000000) {
absNum /= 10000000;
unitIndex = 3;
} else if (absNum > 10000) {
absNum /= 10000;
unitIndex = 2;
} else if (absNum > 1000) {
absNum /= 1000;
unitIndex = 1;
}
// 格式化数字,并添加单位
const formattedNum = absNum.toFixed(2).replace(/\.?0+$/, ''); // 保留两位小数并去除末尾的零
return formattedNum + units[unitIndex];
}