# Conflicts:
#	api/business/notice.js
This commit is contained in:
PQZ 2025-04-14 17:05:02 +08:00
commit a7ede5a6cc
15 changed files with 933 additions and 234 deletions

View File

@ -63,6 +63,24 @@ export function saveReport(data) {
}) })
} }
// 我报名查询通告列表
export function myNoticeList(params) {
return request({
url: '/busi/notice/myNoticeList',
method: 'get',
params: params
})
}
// 发布通告
export function saveNotice(data) {
return request({
url: '/busi/notice/saveOrUpdate',
method: 'post',
data: data
})
}
//平台意见反馈 //平台意见反馈
export function uniAddFeedBack(data) { export function uniAddFeedBack(data) {
return request({ return request({

View File

@ -1,6 +1,6 @@
// 应用全局配置 // 应用全局配置
module.exports = { module.exports = {
baseUrl: 'http://192.168.1.4:8080', baseUrl: 'http://192.168.1.17:8080',
// baseUrl: 'http://localhost:8080', // baseUrl: 'http://localhost:8080',
// 应用信息 // 应用信息
appInfo: { appInfo: {

View File

@ -70,10 +70,9 @@
} }
}, },
{ {
"path" : "public-notice", "path": "public-notice",
"style" : "style": {
{ "navigationBarTitleText": ""
"navigationBarTitleText" : ""
} }
} }
] ]
@ -219,6 +218,15 @@
"notice-item": "view" "notice-item": "view"
} }
} }
},
{
"path": "member/member-index",
"style": {
"navigationBarTitleText": "",
"componentPlaceholder": {
"notice-item": "view"
}
}
} }
] ]
}], }],

View File

@ -1,19 +1,18 @@
<template> <template>
<view> <view>
<view class="my-notice-item-box" v-for="(item,index) in dataList"> <view class="my-notice-item-box" v-for="(item,index) in dataList">
<view class="notice-status">进行中</view> <view class="notice-status">{{item.signStatus||''}}</view>
<view class="report-title"> <view class="report-title">
<text class="status-text">已报名</text> <text class="status-text">已报名</text>
<view class="time-text">2025-04-03 10:07:32</view> <view class="time-text">{{item.signTime||''}}</view>
</view> </view>
<!-- 通告信息 --> <!-- 通告信息 -->
<view class="notice-main-box"> <view class="notice-main-box">
<notice-item :dataObj="itemObj"></notice-item> <notice-item :dataObj="item"></notice-item>
</view> </view>
<!-- 操作按钮 --> <!-- 操作按钮 -->
<view class="opt-button-box"> <view class="opt-button-box">
<view class="opt-item">追加留言</view> <view class="opt-item" @click="goDetail(item)">查看详情</view>
<view class="opt-item">查看详情</view>
</view> </view>
</view> </view>
</view> </view>
@ -86,7 +85,15 @@
} }
} }
}, },
methods: {} methods: {
/**
* 查看通告详情
* @param {Object} item
*/
goDetail(item) {
this.$tab.navigateTo(`/pages/notice/detail?id=${item.id}`)
}
}
} }
</script> </script>
@ -168,4 +175,4 @@
} }
} }
} }
</style> </style>

View File

@ -30,15 +30,22 @@
hasRights hasRights
} from '@/utils/common.js' } from '@/utils/common.js'
import myNoticeItem from '@/pages/components/my-notice-item.vue' import myNoticeItem from '@/pages/components/my-notice-item.vue'
import {
myNoticeList
} from '@/api/business/notice.js'
import rightsCode from '@/utils/rightsCode'
import {
getCatgByCode
} from '@/api/system/config.js'
export default { export default {
components: { components: {
myNoticeItem myNoticeItem
}, },
data() { data() {
return { return {
menus: ['全部', '已报名', '待审核', '待发布', '已完成', '未合作'], menus: ['全部', '审核中', '已通过', '未合作'],
menuIndex: 0, menuIndex: 0,
dataList: ['', ''], dataList: [],
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
@ -48,7 +55,63 @@
isTriggered: false isTriggered: false
} }
}, },
mounted() {
this.initData("dl_platform", "platformList")
this.initData("dl_blogger_type", "bloggerTypeList")
this.selectDataList()
},
methods: { methods: {
/**
* 初始化数据
* @param {Object} code
* @param {Object} dataObj
*/
initData(code, dataObj) {
let that = this
getCatgByCode({
code: code
}).then(res => {
if (res.code == 200) {
this[dataObj] = res.data
}
}).catch((e) => {
uni.showToast({
icon: 'error',
duration: 2000,
title: e
});
})
},
/**
* 查询数据
*/
selectDataList() {
myNoticeList(this.queryParams).then(res => {
this.isTriggered = false
if (res.code == 200) {
if (this.queryParams.pageNum == 1) {
this.dataList = res.data.records
} else {
this.dataList = this.dataList.concat(res.data.records)
}
this.total = res.data.total
}
}).catch((e) => {
this.isTriggered = false
uni.showToast({
icon: 'error',
duration: 2000,
title: e
});
})
},
/**
* 查看通告详情
* @param {Object} item
*/
goDetail(item) {
this.$tab.navigateTo(`/pages/notice/detail?id=${item.id}`)
},
/** /**
* 菜单点击 * 菜单点击
* @param {Object} index * @param {Object} index
@ -56,6 +119,10 @@
*/ */
itemClick(index, item) { itemClick(index, item) {
this.menuIndex = index this.menuIndex = index
this.queryParams.reportStatus = item
this.queryParams.pageNum = 1
this.total = 0
this.selectDataList()
}, },
/** /**
* 上滑加载数据 * 上滑加载数据
@ -68,6 +135,7 @@
} }
//+1, //+1,
this.queryParams.pageNum++ this.queryParams.pageNum++
this.selectDataList()
}, },
/** /**
* 下拉刷新数据 * 下拉刷新数据
@ -76,6 +144,8 @@
this.isTriggered = true this.isTriggered = true
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.total = 0 this.total = 0
this.selectDataList()
}, },
} }
} }
@ -143,4 +213,4 @@
} }
} }
} }
</style> </style>

View File

@ -19,7 +19,7 @@
</view> </view>
<view class="text-item" style="border-bottom: 1rpx solid #F4F4F4;padding-bottom: 10rpx;"> <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">类型{{item.bloggerTypesText}}</view> <view class="dl-content">类型{{item.bloggerTypesText||'无限制'}}</view>
</view> </view>
<view class="text-item" style="padding-top: 10rpx;"> <view class="text-item" style="padding-top: 10rpx;">
<view class="item-box" style="width: 40%;"> <view class="item-box" style="width: 40%;">
@ -250,4 +250,4 @@
} }
} }
} }
</style> </style>

View File

@ -26,7 +26,7 @@
<view v-if="!ifChoose" class="item-opt" @click="toEdit(item.id)"> <view v-if="!ifChoose" class="item-opt" @click="toEdit(item.id)">
<uni-icons type="compose" color="#565656" size="16"></uni-icons><text></text> <uni-icons type="compose" color="#565656" size="16"></uni-icons><text></text>
</view> </view>
<view v-if="ifChoose" class="item-opt" @click="chooseItem(item.id)"> <view v-if="ifChoose" class="item-opt" @click="chooseItem(item)">
<uni-icons type="paperplane" color="#565656" size="16"></uni-icons><text></text> <uni-icons type="paperplane" color="#565656" size="16"></uni-icons><text></text>
</view> </view>
</view> </view>
@ -68,7 +68,7 @@
isTriggered: false, isTriggered: false,
dataList: [], dataList: [],
// //
ifChoose: true, ifChoose: false,
} }
}, },
@ -141,7 +141,10 @@
* 选择地址 * 选择地址
* @param {Object} id * @param {Object} id
*/ */
chooseItem(id) {}, chooseItem(item) {
uni.$emit('updateAddr', item)
uni.navigateBack()
},
/**复制*/ /**复制*/
toCopy(id) { toCopy(id) {
this.$tab.navigateTo(`/pages/mine/addr/addr-detail?id=` + id + `&isCopy=1`) this.$tab.navigateTo(`/pages/mine/addr/addr-detail?id=` + id + `&isCopy=1`)
@ -299,4 +302,4 @@
} }
} }
</style> </style>

View File

@ -0,0 +1,327 @@
<template>
<view class="auth-choose-box">
<navigation-bar-vue title="通告主详情" style="width: 100%;" background-color="#ffffff"
title-color="#000000"></navigation-bar-vue>
<view class="choose-detail">
<view class="people-info-box">
<view class="image-box">
<image src="@/static/images/profile.jpg" mode="aspectFit"></image>
</view>
<view class="people-name-box">
<view class="name-box">
<view class="name-dom">资深PR</view>
<view class="fans-dom">61关注</view>
</view>
<view class="renzheng-dom">
<image src="@/static/mine/auth/renzhen.png" mode="aspectFit"></image>
认证代运营公司
</view>
</view>
<view class="opt-box">
<view class="lahei">拉黑</view>
<view class="guanzhu">关注</view>
</view>
</view>
<view class="bozhu-type-box">
<view class="item-dom">好物</view>
<view class="item-dom">颜值</view>
</view>
<view class="pingjia-box">
<view class="pingjia-content">
<view class="top-title">
<image src="@/static/mine/auth/pingjia.png" mode="aspectFit"></image>
合作博主评价
</view>
<view class="item-box">
<view class="item-dom">定人快(<text>1</text>)</view>
<view class="item-dom">审稿快(<text>2</text>)</view>
<view class="item-dom">审稿快(<text>2</text>)</view>
<view class="item-dom">审稿快(<text>2</text>)</view>
<view class="item-dom">审稿快(<text>2</text>)</view>
</view>
</view>
</view>
<view class="dl-title">
<image src="@/static/mine/auth/dian.png" mode="aspectFit"></image>
<text>进行中的通告(<text>14</text>)</text>
</view>
<view class="data-list-box">
<scroll-view style="height: 100%;" scroll-y="true" @scrolltolower="onReachBottomCus" refresher-enabled
@refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
<notice-item v-if="dataList.length>0" :dataList="dataList" @goDetail="goDetail()"></notice-item>
<view style="text-align: center" v-if="dataList.length==0">
<image class="" src="@/static/images/nothing.png"></image>
</view>
</scroll-view>
</view>
</view>
</view>
</template>
<script>
import {
toast
} from '@/utils/common.js'
import noticeItem from '@/pages/components/notice-item.vue'
import navigationBarVue from '@/components/navigation/navigationBar.vue';
export default {
components: {
navigationBarVue,
noticeItem
},
data() {
return {
dataList: ['', ''],
queryParams: {
pageNum: 1,
pageSize: 10
},
total: 0,
//
isTriggered: false
}
},
methods: {
/**
* 上滑加载数据
*/
onReachBottomCus() {
// *
if (this.queryParams.pageNum * this.queryParams.pageSize >= this.total) {
toast("没有更多数据了")
return
}
//+1,
this.queryParams.pageNum++
},
/**
* 下拉刷新数据
*/
onRefresherrefresh() {
this.isTriggered = true
this.queryParams.pageNum = 1
this.total = 0
},
}
}
</script>
<style lang="scss">
.auth-choose-box {
padding-top: calc(90rpx + var(--status-bar-height));
border-top: 1rpx solid #F4F4F4;
background-color: white;
width: 100%;
color: #363636;
font-size: 30rpx;
height: 100%;
display: flex;
flex-direction: column;
align-items: self-start;
justify-content: center;
position: relative;
.choose-detail {
border-top: 1rpx solid #F4F4F4;
width: 100%;
background-color: #F2F2F2;
border-radius: 20rpx;
display: flex;
flex-direction: column;
align-items: self-start;
justify-content: start;
position: relative;
.people-info-box {
width: 100%;
padding: 30rpx;
background-color: white;
display: flex;
align-items: center;
justify-content: center;
.image-box {
display: flex;
align-items: center;
justify-content: center;
image {
border-radius: 50%;
width: 100rpx;
height: 100rpx;
}
}
.people-name-box {
flex: 1;
display: flex;
flex-direction: column;
align-items: self-start;
justify-content: center;
padding: 0 15rpx;
.name-box {
flex: 1;
min-width: 0;
display: flex;
align-items: center;
justify-content: center;
.name-dom {
font-size: 34rpx;
font-weight: bold;
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding-right: 20rpx;
}
.fans-dom {
font-size: 22rpx;
padding: 5rpx 15rpx;
border: 1rpx solid #FC1F3E;
color: #FC1F3E;
border-radius: 25rpx 25rpx 25rpx 0;
}
}
.renzheng-dom {
padding: 8rpx 0;
flex: 1;
display: flex;
align-items: center;
justify-content: center;
image {
width: 30rpx;
height: 30rpx;
margin-right: 10rpx;
}
}
}
.opt-box {
width: 230rpx;
font-size: 25rpx;
display: flex;
align-items: center;
justify-content: flex-end;
.lahei {
display: flex;
align-items: center;
justify-content: center;
border-radius: 20rpx;
color: white;
background-color: #929292;
padding: 5rpx 20rpx;
}
.guanzhu {
display: flex;
align-items: center;
justify-content: center;
margin-left: 20rpx;
background-color: #FC1F3E;
color: white;
border-radius: 20rpx;
padding: 5rpx 20rpx;
}
}
}
.bozhu-type-box {
width: 100%;
background-color: white;
border-bottom: 1rpx solid #F4F4F4;
.item-dom {
display: flex;
align-items: center;
justify-content: center;
float: left;
padding: 4rpx 25rpx;
background-color: #F4F4F4;
color: #363636;
margin: 0 0 30rpx 30rpx;
border-radius: 30rpx;
}
}
.pingjia-box {
width: 100%;
background-color: white;
padding: 30rpx;
.pingjia-content {
width: 100%;
background-color: #FAFAFA;
border-radius: 30rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.top-title {
width: 100%;
padding: 30rpx 30rpx 20rpx 30rpx;
display: flex;
align-items: center;
justify-content: start;
image {
width: 50rpx;
height: 50rpx;
margin-right: 10rpx;
font-weight: bold;
}
}
.item-box {
width: 100%;
.item-dom {
float: left;
padding: 5rpx 25rpx;
color: #363636;
border-radius: 30rpx;
border: 1rpx solid #E5E5E5;
margin: 0 0 15rpx 30rpx;
}
}
}
}
.dl-title {
padding: 20rpx 30rpx;
width: 100%;
display: flex;
align-items: center;
justify-content: start;
margin-bottom: 20rpx;
image {
width: 30rpx;
height: 30rpx;
}
text {
margin-left: 10rpx;
font-weight: bold;
font-size: 32rpx;
}
}
.data-list-box {
padding: 5rpx 30rpx 20rpx 30rpx;
display: flex;
flex-direction: column;
align-items: self-start;
justify-content: start;
width: 100%;
height: calc(100vh - var(--status-bar-height) - var(--window-bottom) - 400rpx);
}
}
}
</style>

View File

@ -30,7 +30,7 @@
<view class="up-box"> <view class="up-box">
<view class="item-dom-guanzhu" v-if="!isLove" @click="forkUser('1')">关注</view> <view class="item-dom-guanzhu" v-if="!isLove" @click="forkUser('1')">关注</view>
<view class="item-dom-yiguanzhu" v-if="isLove" @click="forkUser('0')">已关注</view> <view class="item-dom-yiguanzhu" v-if="isLove" @click="forkUser('0')">已关注</view>
<view class="item-dom-zhuye">主页</view> <view class="item-dom-zhuye" @click="goMemberIndex()">主页</view>
</view> </view>
<view class="down-box" @click="goReportForm()"> <view class="down-box" @click="goReportForm()">
<image src="@/static/detail/jubao.png" mode="aspectFit"></image>举报 <image src="@/static/detail/jubao.png" mode="aspectFit"></image>举报
@ -75,13 +75,14 @@
{{formatNumberWithUnits(noticeDetail.fansDown)||'0'}}-{{formatNumberWithUnits(noticeDetail.fansUp)||''}} {{formatNumberWithUnits(noticeDetail.fansDown)||'0'}}-{{formatNumberWithUnits(noticeDetail.fansUp)||''}}
</view> </view>
</view> </view>
<view class="dl-item"> <view class="dl-item" v-if='noticeDetail.province'>
<view class="dl-label"> <view class="dl-label">
地区要求 地区要求
</view> </view>
<view class="dl-value">{{noticeDetail.city||''}} </view> <view class="dl-value">{{noticeDetail.province+(noticeDetail.city?('-'+noticeDetail.city):'')}}
</view>
</view> </view>
<view class="dl-item"> <view class="dl-item" v-if='noticeDetail.bloggerTypes'>
<view class="dl-label"> <view class="dl-label">
博主类型 博主类型
</view> </view>
@ -107,28 +108,26 @@
<!-- 联系方式 --> <!-- 联系方式 -->
<view class="info-box notice-detail"> <view class="info-box notice-detail">
<view class="detail-title">联系方式</view> <view class="detail-title">联系方式</view>
<view class="field-box"> <view class="field-box" v-if="passSign">
<view class="dl-item"> <view class="dl-item">
<view class="dl-label"> <view class="dl-label">
联系人 微信群码图片
</view> </view>
<view class="dl-value">报名后可查看 </view>
</view> <view class="dl-value">
<view class="dl-item"> <image v-if="noticeDetail.groupImage" @click="preview([noticeDetail.groupImage])"
<view class="dl-label"> :src="imageUrl+noticeDetail.groupImage" mode="widthFix"></image>
微信号 <text v-else>未上传请等待通告主联系</text>
</view> </view>
<view class="dl-value">报名后可查看 </view>
</view> </view>
</view>
<view class="field-box" v-else>
<view class="dl-item"> <view class="dl-item">
<view class="dl-label"> <view class="dl-label">
微信二维码 微信群码图片
</view>
<view class="dl-value">报名后可查看 </view>
</view>
<view class="dl-item">
<view class="dl-label">
加入通告二维码
</view> </view>
<view class="dl-value">报名后可查看 </view> <view class="dl-value">报名后可查看 </view>
</view> </view>
@ -136,19 +135,24 @@
</view> </view>
<!-- 报名列表 --> <!-- 报名列表 -->
<view class="info-box notice-detail" v-if="!viewMy"> <view class="info-box notice-detail" v-if="!viewMy">
<view class="detail-title">已报名{{imageArray.length||0}}</view> <view class="detail-title">已报名{{allImgNum}}</view>
<view class="image-box" v-if="imageArray.length>0" <view class="image-box" v-if="imageArray.length>0"
:style="{height:(imageArray.length*(imageWidth+10)+20)+'rpx'}"> :style="{height:(imageArray.length*(imageWidth+10)+20)+'rpx'}">
<view class="image-row" v-for="(row,rowIndex) in imageArray"> <view class="image-row" v-for="(row,rowIndex) in imageArray">
<image v-for="(item,i) in row" <span v-for=" (item,i) in row">
:style="{ top:(imageWidth+10)*rowIndex+'rpx',left:imageWidth*i+'rpx'}" <image v-if="item" :style="{ top:(imageWidth+10)*rowIndex+'rpx',left:imageWidth*i+'rpx'}"
src="@/static/images/profile.jpg" mode="aspectFit"> :src="item" mode="aspectFit">
</image> </image>
<image v-else :style="{ top:(imageWidth+10)*rowIndex+'rpx',left:imageWidth*i+'rpx'}"
src="@/static/images/profile.jpg" mode="aspectFit">
</image>
</span>
</view> </view>
</view> </view>
</view> </view>
<!-- 去报名始终浮动下方 --> <!-- 去报名始终浮动下方 -->
<view class="dl-bottom-box" v-show="showBottom"> <view class="dl-bottom-box" v-show="showBottom&&type=='common'">
<!-- 报名 --> <!-- 报名 -->
<view class="report-box"> <view class="report-box">
<view @click="goHome()"> <view @click="goHome()">
@ -158,7 +162,8 @@
<image src="@/static/detail/share.png" mode="aspectFit"></image> <image src="@/static/detail/share.png" mode="aspectFit"></image>
</view> </view>
<view v-if="null==userInfo" class="join-report">请登录后报名</view> <view v-if="null==userInfo" class="join-report">请登录后报名</view>
<view v-else-if="ifBz" @click="goReport()" class="join-report">报名参加</view> <view v-else-if="!isSign && ifBz" @click="goReport()" class="join-report">报名参加</view>
<view v-else-if="isSign && ifBz" class="join-report">已报名</view>
<view v-else class="join-report" @click="changeUserType()">切换博主后报名</view> <view v-else class="join-report" @click="changeUserType()">切换博主后报名</view>
</view> </view>
<!-- 通告发布人能操作的 --> <!-- 通告发布人能操作的 -->
@ -236,6 +241,8 @@
imageArray: [ imageArray: [
], ],
//
allImgNum: 0,
//rpx-- //rpx--
imageWidth: 70, imageWidth: 70,
// //
@ -243,7 +250,8 @@
// //
isLove: false, isLove: false,
// //
isSign: false, passSign: false,
isSign: true,
// //
userDetail: { userDetail: {
avatar: '', avatar: '',
@ -282,10 +290,11 @@
shareImage: '/static/bg.jpg', // shareImage: '/static/bg.jpg', //
qrSize: 100, // qrSize: 100, //
qrUrl: 'https://ext.dcloud.net.cn/plugin?id=5747', // qrUrl: 'https://ext.dcloud.net.cn/plugin?id=5747', //
type: 'common'
} }
}, },
onReady() { onReady() {
this.calculateImagesPerRow();
// //
this.checkUserType() this.checkUserType()
this.showBottom = true this.showBottom = true
@ -295,10 +304,16 @@
if (params.viewMy) { if (params.viewMy) {
this.viewMy = true this.viewMy = true
} }
if (params.type) {
this.type = params.type
}
this.noticeId = params.id this.noticeId = params.id
if (null != getJSONData(constant.userInfo)) { if (null != getJSONData(constant.userInfo)) {
this.userInfo = getJSONData(constant.userInfo) this.userInfo = getJSONData(constant.userInfo)
} }
},
onShow() {
this.getDetail() this.getDetail()
this.viewNotice() this.viewNotice()
}, },
@ -379,6 +394,9 @@
goReportForm() { goReportForm() {
this.$tab.navigateTo('/pages/mine/set/report-form?userId='+this.userDetail.userId+'&noticeId='+this.noticeId) this.$tab.navigateTo('/pages/mine/set/report-form?userId='+this.userDetail.userId+'&noticeId='+this.noticeId)
}, },
goMemberIndex() {
this.$tab.navigateTo('/pages/mine/member/member-index')
},
/** /**
* 去报名列表 * 去报名列表
*/ */
@ -395,12 +413,14 @@
if (res.code == 200) { if (res.code == 200) {
this.noticeDetail = res.data.noticeDetail this.noticeDetail = res.data.noticeDetail
this.userDetail = res.data.userDetail this.userDetail = res.data.userDetail
this.imageArray = res.data.signUserAvatarList
this.isLove = res.data.isLove this.isLove = res.data.isLove
this.passSign = res.data.passSign
this.isSign = res.data.isSign this.isSign = res.data.isSign
if (this.noticeDetail.images) { if (this.noticeDetail.images) {
this.noticeDetail.imageArray = this.noticeDetail.images.split(",") this.noticeDetail.imageArray = this.noticeDetail.images.split(",")
} }
this.allImgNum = res.data.signUserAvatarList.length
this.calculateImagesPerRow(res.data.signUserAvatarList)
} }
}).catch((e) => { }).catch((e) => {
this.isTriggered = false this.isTriggered = false
@ -518,7 +538,12 @@
/** /**
* 计算头像显示区域高度 * 计算头像显示区域高度
*/ */
calculateImagesPerRow() { calculateImagesPerRow(imgs) {
let tempImg = []
imgs.forEach(it => {
tempImg.push(this.imageUrl + it)
})
console.log(tempImg);
const systemInfo = uni.getSystemInfoSync(); const systemInfo = uni.getSystemInfoSync();
//1rpx px //1rpx px
let rpxUnit = (systemInfo.screenWidth / 750) let rpxUnit = (systemInfo.screenWidth / 750)
@ -529,10 +554,7 @@
// //
let imagesPerRow = Math.floor(screenWidth / imageWidthPx); let imagesPerRow = Math.floor(screenWidth / imageWidthPx);
// //
let thisArray = [] let thisArray = tempImg
for (var i = 0; i < 50; i++) {
thisArray.push('/static/images/profile.jpg')
}
for (let i = 0; i < thisArray.length; i += imagesPerRow) { for (let i = 0; i < thisArray.length; i += imagesPerRow) {
this.imageArray.push(thisArray.slice(i, i + imagesPerRow)); this.imageArray.push(thisArray.slice(i, i + imagesPerRow));
} }
@ -574,6 +596,7 @@
position: relative; position: relative;
.notice-detail-last-box { .notice-detail-last-box {
width: 100%;
height: calc(100vh - var(--status-bar-height) - var(--window-bottom) - 90rpx); height: calc(100vh - var(--status-bar-height) - var(--window-bottom) - 90rpx);
overflow-y: scroll; overflow-y: scroll;
padding: 30rpx 30rpx 115rpx 30rpx; padding: 30rpx 30rpx 115rpx 30rpx;
@ -799,14 +822,27 @@
.dl-item { .dl-item {
display: flex; display: flex;
justify-content: center; justify-content: start;
align-items: flex-start; align-items: center;
margin-bottom: 10rpx; margin-bottom: 10rpx;
.dl-label {} .dl-label {
width: 300rpx;
display: flex;
justify-content: start;
align-items: center;
}
.dl-value { .dl-value {
flex: 1; flex: 1;
display: flex;
justify-content: center;
align-items: center;
image {
width: 200rpx;
height: 80rpx;
}
} }
} }
} }
@ -908,4 +944,4 @@
} }
} }
} }
</style> </style>

View File

@ -19,8 +19,11 @@
<view class="data-list-box"> <view class="data-list-box">
<view class="form-warn"> <view class="form-warn">
<image src="@/static/detail/warn.png" mode="aspectFit"></image> <image src="@/static/detail/warn.png" mode="aspectFit"></image>
<text>注意请勿发布直发代发等虚假通告</text> <text>注意请勿发布直发代发等虚假通告
为了您的信息安全平台不建议填写您的银行卡号身份证号密码等隐私信息</text>
</view> </view>
<view class="form-content"> <view class="form-content">
<view class="item-field"> <view class="item-field">
<view class="item-lable is-required"> <view class="item-lable is-required">
@ -40,36 +43,6 @@
:imgCode="dataObj.platformCode"></uni-data-select> :imgCode="dataObj.platformCode"></uni-data-select>
</view> </view>
</view> </view>
<view class="item-field">
<view class="item-lable is-required">
稿费
</view>
<view class="item-value">
<uni-data-select v-model="dataObj.feeLimit" :localdata="ifHasRange"
@change="change($event,'fee')" :clear="false"></uni-data-select>
<view class="dl-drawer-item" v-if="dataObj.feeLimit">
<input class="uni-input" v-model="dataObj.feeDown" type="digit" placeholder="最低" />
<view></view>
<input class="uni-input" v-model="dataObj.feeUp" type="digit" placeholder="最高" />
</view>
</view>
</view>
<view class="item-field">
<view class="item-lable is-required">
赠品
</view>
<view class="item-value">
<uni-data-select v-model="dataObj.giftLimit" :localdata="ifHasRange"
@change="change($event,'gift')" :clear="false"></uni-data-select>
<view class="dl-drawer-item" v-if="dataObj.giftLimit">
<textarea v-model="dataObj.giftDetail" type="text" placeholder="请输入赠品明细" />
</view>
<view class="dl-drawer-item" v-if="dataObj.giftLimit">
<input class="uni-input" v-model="dataObj.giftDetail" type="number"
placeholder="请输入赠品价值(元)" />
</view>
</view>
</view>
<view class="item-field"> <view class="item-field">
<view class="item-lable is-required"> <view class="item-lable is-required">
截止时间 截止时间
@ -79,6 +52,67 @@
@maskClick="maskClick" /> @maskClick="maskClick" />
</view> </view>
</view> </view>
<view class="item-field">
<view class="item-lable is-required">
稿费下限
</view>
<view class="item-value">
<input class="uni-input" v-model="dataObj.feeDown" type="digit" placeholder="最低" />
</view>
</view>
<view class="item-field">
<view class="item-lable">
稿费上限
</view>
<view class="item-value">
<input class="uni-input" v-model="dataObj.feeUp" type="digit" placeholder="最高(不填代表无上限)" />
</view>
</view>
<view class="item-field">
<view class="item-lable">
招募名额
</view>
<view class="item-value">
<input class="uni-input" v-model="dataObj.needNum" type="number"
placeholder="请输入(不填代表无上限)" />
</view>
</view>
<view class="item-field">
<view class="item-lable is-required">
是否需自报价
</view>
<view class="item-value">
<uni-data-select v-model="dataObj.isSelfPrice" :localdata="ifHasRange"
@change="change($event,'isSelfPrice')" :clear="false"></uni-data-select>
</view>
</view>
<view class="item-field">
<view class="item-lable is-required">
是否平台结算
</view>
<view class="item-value">
<uni-data-select v-model="dataObj.isPlatformFree" :localdata="ifHasRange"
@change="change($event,'isPlatformFree')" :clear="false"></uni-data-select>
</view>
</view>
<view class="item-field">
<view class="item-lable is-required">
是否有赠品
</view>
<view class="item-value">
<uni-data-select v-model="dataObj.haveGift" :localdata="ifHasRange"
@change="change($event,'gift')" :clear="false"></uni-data-select>
</view>
</view>
<view class="item-field">
<view class="item-lable is-required">
是否公开品牌
</view>
<view class="item-value">
<uni-data-select v-model="dataObj.isShowBrand" :localdata="ifHasRange"
@change="change($event,'isShowBrand')" :clear="false"></uni-data-select>
</view>
</view>
<view class="item-field"> <view class="item-field">
<view class="item-lable is-required"> <view class="item-lable is-required">
品牌 品牌
@ -87,53 +121,39 @@
<input class="uni-input" v-model="dataObj.brand" type="text" placeholder="请输入" /> <input class="uni-input" v-model="dataObj.brand" type="text" placeholder="请输入" />
</view> </view>
</view> </view>
<view class="item-field"> <view class="item-field">
<view class="item-lable is-required"> <view class="item-lable is-required">
名额 粉丝下限
</view> </view>
<view class="item-value"> <view class="item-value">
<input class="uni-input" v-model="dataObj.needNum" type="number" placeholder="请输入" /> <input class="uni-input" v-model="dataObj.fansDown" type="digit" placeholder="最低" />
</view> </view>
</view> </view>
<view class="item-field"> <view class="item-field">
<view class="item-lable is-required"> <view class="item-lable ">
粉丝 粉丝上限
</view> </view>
<view class="item-value"> <view class="item-value">
<uni-data-select v-model="dataObj.fansLimit" :localdata="limitRange" <input class="uni-input" v-model="dataObj.fansUp" type="digit" placeholder="最高(不填代表无上限)" />
@change="change($event,'fans')" :clear="false"></uni-data-select> </view>
<view class="dl-drawer-item" v-if="dataObj.fansLimit"> </view>
<input class="uni-input" v-model="dataObj.fansDown" type="digit" placeholder="最低" />
<view></view> <view class="item-field">
<input class="uni-input" v-model="dataObj.fansUp" type="digit" placeholder="最高" /> <view class="item-lable ">
</view> 地区要求
<view class="dl-drawer-item" v-if="dataObj.fansLimit"> </view>
<uni-data-checkbox @change="chooseBoxFun($event,'isEligible')" multiple <view class="item-value">
:localdata="isEligibleList" /> <uni-data-picker placeholder="请选择" popup-title="请选择收件地址" :localdata="dataTree"
</view> v-model="dataObj.city" @change="onchange" @nodeclick="onnodeclick"
@popupopened="onpopupopened" @popupclosed="onpopupclosed">
</uni-data-picker>
</view> </view>
</view> </view>
<view class="item-field"> <view class="item-field">
<view class="item-lable is-required"> <view class="item-lable">
通告明细
</view>
<view class="item-value">
<textarea v-model="dataObj.giftDetail" style="height: 600rpx;" type="text"
placeholder="请输入赠品明细" />
</view>
</view>
<view class="item-field">
<view class="item-lable is-required">
产品图
</view>
<view class="item-value">
<uni-file-picker :value="fileList" :sizeType="sizeType"
@select="afterRead($event,'fileList')" @delete="deleteFile($event,'fileList')"
limit="9"></uni-file-picker>
</view>
</view>
<view class="item-field">
<view class="item-lable is-required">
博主类型 <text class="little-text">(可多选)</text> 博主类型 <text class="little-text">(可多选)</text>
</view> </view>
<view class="item-value"> <view class="item-value">
@ -148,65 +168,19 @@
</view> </view>
</view> </view>
</view> </view>
</view>
<view class="form-content">
<view class="item-field"> <view class="item-field">
<view class="item-lable is-required"> <view class="item-lable ">
联系方式 产品图
</view> </view>
<view class="item-value"> <view class="item-value">
<uni-file-picker :value="fileList" :sizeType="sizeType"
@select="afterRead($event,'fileList')" @delete="deleteFile($event,'fileList')"
limit="9"></uni-file-picker>
</view> </view>
</view> </view>
<view class="item-field-row">
<view class="item-lable is-required">
电话
</view>
<view class="item-value">
<input class="uni-input" v-model="dataObj.tel" type="text" placeholder="请输入" />
</view>
</view>
<view class="item-field-row">
<view class="item-lable is-required">
微信
</view>
<view class="item-value">
<input class="uni-input" v-model="dataObj.wechat" type="text" placeholder="请输入" />
</view>
</view>
<view class="item-field-row">
<view class="line-row">
<uni-data-checkbox @change="chooseBoxFun($event,'isShowTel')" multiple
:localdata="isShowTelList" />
</view>
</view>
</view>
<!-- 自定义表单 -->
<view class="form-content">
<view class="item-field-row" style="padding-top: 0;">
<view class="item-lable is-required" style="flex: 1;">
自定义报名信息收集
</view>
<view class="item-value" style="width: 200rpx;">
<uni-icons type="plusempty" size="18"></uni-icons><text @click="addNewField()"></text>
</view>
</view>
<view class="form-warn">
<image src="@/static/detail/warn.png" mode="aspectFit"></image>
<text>注意为了您的信息安全平台不建议填写您的银行卡号身份证号密码等隐私信息</text>
</view>
<view class="item-field-row" v-for="(item,index) in customFieldList">
<view class="item-lable is-required">
{{item.labelTitle}}
</view>
<view class="item-value">
<input class="uni-input" v-model="item.value" type="text" placeholder="请输入" />
</view>
</view>
</view>
<!-- 微信群码 -->
<view class="form-content">
<view class="item-field"> <view class="item-field">
<view class="item-lable is-required"> <view class="item-lable ">
微信群码<text class="little-text">(选填)</text> 微信群码<text class="little-text">(选填)</text>
</view> </view>
<view class="item-value"> <view class="item-value">
@ -215,20 +189,45 @@
@delete="deleteFile($event,'groupImageList')" limit="1"></uni-file-picker> @delete="deleteFile($event,'groupImageList')" limit="1"></uni-file-picker>
</view> </view>
</view> </view>
<view class="item-field">
<view class="item-lable is-required">
通告明细
</view>
<view class="item-value">
<textarea v-model="dataObj.detail" style="height: 600rpx;" type="text"
placeholder="请输入通告明细" />
</view>
</view>
</view> </view>
<view class="line-row-bottom"> <!-- 自定义表单 -->
<uni-data-checkbox @change="chooseBoxFun($event,'isRead')" multiple :localdata="readBookList" /> <view class="form-content">
<text @click="handleUserAgrement(globalConfig.appInfo.agreements[1])" <view class="item-field-row" style="padding-top: 0;">
class="text-red">{{globalConfig.appInfo.agreements[1].title}}</text> <view class="item-lable " style="flex: 1;">
自定义报名信息收集
</view>
<view class="item-value" style="width: 200rpx;">
<uni-icons type="plusempty" size="18"></uni-icons><text @click="addNewField()"></text>
</view>
</view>
<view class="item-field-row" v-for="(item,index) in customFieldList">
<view class="item-lable is-required">
{{item}}
</view>
<view class="item-value">
<input class="uni-input" type="text" placeholder="请输入" />
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
<view class="dl-bottom-box"> <view class="dl-bottom-box">
<!-- 预览 --> <!-- 预览 -->
<view class="view-dom"> <view class="view-dom" @click="preview()">
预览 预览
</view> </view>
<view class="public-dom"> <view class="public-dom" @click="publish()">
发布 发布
</view> </view>
</view> </view>
@ -255,12 +254,20 @@
uniListByParentCode uniListByParentCode
} from '@/api/system/config.js' } from '@/api/system/config.js'
import config from '@/config'; import config from '@/config';
import {
treeCity
} from '@/api/business/base.js'
import {
saveNotice
} from '@/api/business/notice';
export default { export default {
components: { components: {
navigationBarVue, navigationBarVue,
}, },
data() { data() {
return { return {
//
dataTree: [],
// //
showNum: 4, showNum: 4,
globalConfig: getApp().globalData.config, globalConfig: getApp().globalData.config,
@ -276,33 +283,25 @@
// //
groupImageList: [], groupImageList: [],
// //
customFieldList: [{ customFieldList: [],
labelTitle: "姓名",
value: "",
sort: 1
}, {
labelTitle: "身份证号",
value: "",
sort: 2
}],
dataObj: { dataObj: {
isRead: false, isRead: 0,
title: "", title: "",
brand: "", brand: "",
platformCode: "", platformCode: "xiaohongshu",
feeLimit: false, feeLimit: 0,
feeDown: null, feeDown: null,
feeUp: null, feeUp: null,
giftLimit: false, haveGift: null,
giftDetail: "", giftDetail: "",
giftPrice: null, giftPrice: null,
endDate: null, endDate: null,
needNum: null, needNum: null,
fansLimit: false, fansLimit: 0,
fansDown: null, fansDown: null,
fansUp: null, fansUp: null,
// (0|1) // (0|1)
isEligible: 0, isEligible: null,
// //
bloggerTypes: "", bloggerTypes: "",
//便 //便
@ -310,7 +309,7 @@
tel: "", tel: "",
wechat: "", wechat: "",
// (0|1) // (0|1)
isShowTel: 0, isShowTel: null,
}, },
isEligibleList: [{ isEligibleList: [{
text: '报名需符合粉丝要求', text: '报名需符合粉丝要求',
@ -326,21 +325,21 @@
}], }],
// //
ifHasRange: [{ ifHasRange: [{
value: false, value: 0,
text: "" text: ""
}, },
{ {
value: true, value: 1,
text: "" text: ""
} }
], ],
// //
limitRange: [{ limitRange: [{
value: false, value: 0,
text: "不限制" text: "不限制"
}, },
{ {
value: true, value: 1,
text: "限制" text: "限制"
} }
], ],
@ -350,8 +349,201 @@
onLoad() { onLoad() {
this.initData("dl_platform", 'platFormRange') this.initData("dl_platform", 'platFormRange')
this.initData("dl_blogger_type", "bloggerTypeList") this.initData("dl_blogger_type", "bloggerTypeList")
this.initAddress()
}, },
methods: { methods: {
validForm(data) {
if (!data.title) {
uni.showToast({
title: '标题必填',
icon: 'none',
duration: 1000
})
return true;
}
if (!data.platformCode) {
uni.showToast({
title: '平台必填',
icon: 'none',
duration: 1000
})
return true;
}
if (!data.endDate) {
uni.showToast({
title: '截止时间必填',
icon: 'none',
duration: 1000
})
return true;
}
if (!data.feeDown) {
uni.showToast({
title: '稿费下限必填',
icon: 'none',
duration: 1000
})
return true;
}
if (data.isSelfPrice == null || data.isSelfPrice == undefined) {
uni.showToast({
title: '是否需自报价必填',
icon: 'none',
duration: 1000
})
return true;
}
if (data.isPlatformFree == null || data.isPlatformFree == undefined) {
uni.showToast({
title: '是否平台结算必填',
icon: 'none',
duration: 1000
})
return true;
}
if (data.haveGift == null || data.haveGift == undefined) {
uni.showToast({
title: '是否有赠品必填',
icon: 'none',
duration: 1000
})
return true;
}
if (data.isShowBrand == null || data.isShowBrand == undefined) {
uni.showToast({
title: '是否公开品牌必填',
icon: 'none',
duration: 1000
})
return true;
}
if (!data.brand) {
uni.showToast({
title: '品牌必填',
icon: 'none',
duration: 1000
})
return true;
}
if (!data.fansDown) {
uni.showToast({
title: '粉丝下限必填',
icon: 'none',
duration: 1000
})
return true;
}
if (!data.detail) {
uni.showToast({
title: '通告明细必填',
icon: 'none',
duration: 1000
})
return true;
}
},
//
preview() {
if (this.validForm(this.dataObj)) {
return
}
//稿
this.dataObj.approvalStatus = '8'
if (this.fileList && this.fileList.length > 0) {
this.dataObj.images = []
this.dataObj.groupImage = ''
this.fileList.forEach(it => {
this.dataObj.images.push(it.url.replace(config.baseUrl, ''))
})
if (this.dataObj.images && this.dataObj.images.length > 0) {
this.dataObj.images = this.dataObj.images.join(',')
}
}
this.groupImageList.forEach(it => {
this.dataObj.groupImage = it.url.replace(config.baseUrl, '')
})
this.dataObj.customForm = this.customFieldList
saveNotice(this.dataObj).then(res => {
this.dataObj.id = res.data.noticeId
this.goDetail(res.data.noticeId)
})
},
publish() {
if (this.validForm(this.dataObj)) {
return
}
//
this.dataObj.approvalStatus = '0'
if (this.fileList && this.fileList.length > 0) {
this.dataObj.images = []
this.dataObj.groupImage = ''
this.fileList.forEach(it => {
this.dataObj.images.push(it.url.replace(config.baseUrl, ''))
})
if (this.dataObj.images && this.dataObj.images.length > 0) {
this.dataObj.images = this.dataObj.images.join(',')
}
}
this.groupImageList.forEach(it => {
this.dataObj.groupImage = it.url.replace(config.baseUrl, '')
})
this.dataObj.customForm = this.customFieldList
saveNotice(this.dataObj).then(res => {
this.dataObj.id = res.data.noticeId
uni.showToast({
title: '发布成功等待审核',
icon: 'none',
duration: 1000
})
setTimeout(function() {
uni.navigateBack()
}, 1000)
})
},
/**
* 查看通告详情
* @param {Object} item
*/
goDetail(noticeId) {
this.$tab.navigateTo(`/pages/notice/detail?id=${noticeId}&type=preview`)
},
saveData() {
console.log(this.dataObj, 357);
},
/**初始化树结构*/
initAddress() {
treeCity().then(res => {
res.data.forEach(it => {
if (it.children) {
it.children.forEach(item => {
item.children = null
})
}
})
this.dataTree = res.data
}).catch((e) => {
uni.showToast({
icon: 'error',
duration: 2000,
title: e
});
})
},
// //
handleUserAgrement(site) { handleUserAgrement(site) {
this.$tab.navigateTo(`/pages/common/richview/index?title=${site.title}&code=${site.code}`) this.$tab.navigateTo(`/pages/common/richview/index?title=${site.title}&code=${site.code}`)
@ -475,18 +667,7 @@
this.$refs.inputDialog.close() this.$refs.inputDialog.close()
}, },
dialogInputConfirmCus(val) { dialogInputConfirmCus(val) {
let thisObj = { let thisObj = val
labelTitle: val,
value: ""
}
if (this.customFieldList.length == 0) {
//
thisObj.sort = 1
} else {
//
let endFieldObj = this.customFieldList[this.customFieldList.length - 1]
thisObj.sort = endFieldObj.sort + 1
}
this.customFieldList.push(thisObj) this.customFieldList.push(thisObj)
// //
this.$refs.inputDialogCus.close() this.$refs.inputDialogCus.close()
@ -620,7 +801,10 @@
justify-content: center; justify-content: center;
} }
.is-required { .is-required:before {
content: "*";
color: #FC1F3E;
image { image {
width: 20rpx; width: 20rpx;
height: 20rpx; height: 20rpx;
@ -690,7 +874,10 @@
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.is-required { .is-required:before {
content: "*";
color: #FC1F3E;
image { image {
width: 20rpx; width: 20rpx;
height: 20rpx; height: 20rpx;
@ -792,7 +979,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
z-index: 999; z-index: 9;
.view-dom { .view-dom {
flex: 1; flex: 1;
@ -835,4 +1022,4 @@
.checklist-box { .checklist-box {
margin-right: 0 !important; margin-right: 0 !important;
} }
</style> </style>

View File

@ -206,7 +206,9 @@
/** /**
* 去名片所有者主页 * 去名片所有者主页
*/ */
goIndex(item) {}, goIndex(item) {
this.$tab.navigateTo('/pages/mine/member/member-index')
},
/** /**
* 将名片置为合适或不合适 * 将名片置为合适或不合适
*/ */
@ -327,4 +329,4 @@
} }
} }
} }
</style> </style>

View File

@ -55,12 +55,12 @@
</view> </view>
</view> </view>
<view class="card-bottom"> <view class="card-bottom">
<view class="item-field-row"> <view class="item-field-row" v-if="noticeDetail.isSelfPrice=='1'">
<view class="item-lable is-required"> <view class="item-lable is-required">
自报价 自报价
</view> </view>
<view class="item-value"> <view class="item-value">
<input class="uni-input" v-model="dataObj.name" type="number" placeholder="请输入" /> <input class="uni-input" v-model="item.selfPrice" type="number" placeholder="请输入" />
</view> </view>
</view> </view>
<view class="item-field-row"> <view class="item-field-row">
@ -68,7 +68,8 @@
附言 附言
</view> </view>
<view class="item-value"> <view class="item-value">
<input class="uni-input" v-model="dataObj.name" type="text" placeholder="请输入" /> <textarea class="uni-input" placeholder="请输入" v-model="item.remark"></textarea>
</view> </view>
</view> </view>
</view> </view>
@ -99,7 +100,7 @@
<text>{{userAddr.name}}</text> <text>{{userAddr.name}}</text>
<text>{{userAddr.tel}}</text> <text>{{userAddr.tel}}</text>
</view> </view>
<view class="change-addr-dom">切换</view> <view class="change-addr-dom" @click="goSignAddr()">切换</view>
</view> </view>
</view> </view>
<!-- 去报名始终浮动下方 --> <!-- 去报名始终浮动下方 -->
@ -224,6 +225,9 @@
uni.$on('updateCard', function(data) { uni.$on('updateCard', function(data) {
that.updateCard(data) that.updateCard(data)
}) })
uni.$on('updateAddr', function(data) {
that.updateAddr(data)
})
}, },
methods: { methods: {
@ -234,8 +238,11 @@
} }
}) })
}, },
updateAddr(data) {
this.userAddr = data
},
updateCard(data) { updateCard(data) {
console.log(data, 211);
this.cardList = data this.cardList = data
}, },
/** /**
@ -260,7 +267,11 @@
} }
}, },
goSignCard() { goSignCard() {
this.$tab.navigateTo('/pages/mine/card/my-card') this.$tab.navigateTo('/pages/mine/card/my-card?ifChoose=true&noticeId=' +
this.noticeId)
},
goSignAddr() {
this.$tab.navigateTo('/pages/mine/addr/addr-list?ifChoose=true')
}, },
goMemberCard() { goMemberCard() {
this.$tab.navigateTo('/pages/mine/member/member-card') this.$tab.navigateTo('/pages/mine/member/member-card')
@ -320,6 +331,28 @@
return return
} }
} }
//
if (this.noticeDetail.isSelfPrice == '1') {
let flag1 = false
this.cardList.forEach(it => {
if (!it.selfPrice) {
flag1 = true
}
})
if (flag1) {
uni.showToast({
title: '请进行报价',
icon: 'none',
duration: 1000
})
return;
}
}
// //
this.signFormData.noticeId = this.noticeId this.signFormData.noticeId = this.noticeId
this.signFormData.cardList = this.cardList this.signFormData.cardList = this.cardList
@ -845,4 +878,4 @@
} }
} }
} }
</style> </style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

View File

@ -139,6 +139,9 @@ export function tansParams(params) {
* @param {Object} num * @param {Object} num
*/ */
export function formatNumberWithUnits(num) { export function formatNumberWithUnits(num) {
if (!num) {
return '无限制';
}
const units = ['', 'k', 'w', 'kw']; const units = ['', 'k', 'w', 'kw'];
// 获取绝对值以处理负数 // 获取绝对值以处理负数
let absNum = Math.abs(num); let absNum = Math.abs(num);
@ -147,6 +150,7 @@ export function formatNumberWithUnits(num) {
return num; return num;
} }
// 寻找合适的单位 // 寻找合适的单位
let unitIndex = 0; let unitIndex = 0;
if (absNum > 10000000) { if (absNum > 10000000) {
@ -182,11 +186,15 @@ export function calculateTimeDifference(time) {
// 计算完整的整天天数和剩余的小时数 // 计算完整的整天天数和剩余的小时数
const diffDays = Math.floor(diffHours / 24); const diffDays = Math.floor(diffHours / 24);
const remainingHours = diffHours % 24; const remainingHours = diffHours % 24;
if (diffDays > 0) { if (diffDays > 0) {
return parseInt(diffDays) + "天前" return parseInt(diffDays) + "天前"
} else { } else {
return parseInt(remainingHours) + "小时前" if (parseInt(remainingHours) == 0) {
return "刚刚"
} else {
return parseInt(remainingHours) + "小时前"
}
} }
} }
@ -204,4 +212,4 @@ export function getTextByIdentityType(key) {
} else if ("04" == key) { } else if ("04" == key) {
return "电商" return "电商"
} }
} }