发布通告功能

This commit is contained in:
13405411873 2025-04-14 14:24:40 +08:00
parent 9ddbff0b71
commit b05f96fddd
9 changed files with 584 additions and 226 deletions

View File

@ -54,3 +54,21 @@ export function closeNotice(params) {
params: params
})
}
// 我报名查询通告列表
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
})
}

View File

@ -1,19 +1,18 @@
<template>
<view>
<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">
<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 class="notice-main-box">
<notice-item :dataObj="itemObj"></notice-item>
<notice-item :dataObj="item"></notice-item>
</view>
<!-- 操作按钮 -->
<view class="opt-button-box">
<view class="opt-item">追加留言</view>
<view class="opt-item">查看详情</view>
<view class="opt-item" @click="goDetail(item)">查看详情</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>
@ -168,4 +175,4 @@
}
}
}
</style>
</style>

View File

@ -30,15 +30,22 @@
hasRights
} from '@/utils/common.js'
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 {
components: {
myNoticeItem
},
data() {
return {
menus: ['全部', '已报名', '待审核', '待发布', '已完成', '未合作'],
menus: ['全部', '审核中', '已通过', '未合作'],
menuIndex: 0,
dataList: ['', ''],
dataList: [],
queryParams: {
pageNum: 1,
pageSize: 10,
@ -48,7 +55,63 @@
isTriggered: false
}
},
mounted() {
this.initData("dl_platform", "platformList")
this.initData("dl_blogger_type", "bloggerTypeList")
this.selectDataList()
},
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
@ -56,6 +119,10 @@
*/
itemClick(index, item) {
this.menuIndex = index
this.queryParams.reportStatus = item
this.queryParams.pageNum = 1
this.total = 0
this.selectDataList()
},
/**
* 上滑加载数据
@ -68,6 +135,7 @@
}
//+1,
this.queryParams.pageNum++
this.selectDataList()
},
/**
* 下拉刷新数据
@ -76,6 +144,8 @@
this.isTriggered = true
this.queryParams.pageNum = 1
this.total = 0
this.selectDataList()
},
}
}
@ -143,4 +213,4 @@
}
}
}
</style>
</style>

View File

@ -19,7 +19,7 @@
</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 class="dl-content">类型{{item.bloggerTypesText||'无限制'}}</view>
</view>
<view class="text-item" style="padding-top: 10rpx;">
<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)">
<uni-icons type="compose" color="#565656" size="16"></uni-icons><text></text>
</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>
</view>
</view>
@ -68,7 +68,7 @@
isTriggered: false,
dataList: [],
//
ifChoose: true,
ifChoose: false,
}
},
@ -141,7 +141,10 @@
* 选择地址
* @param {Object} id
*/
chooseItem(id) {},
chooseItem(item) {
uni.$emit('updateAddr', item)
uni.navigateBack()
},
/**复制*/
toCopy(id) {
this.$tab.navigateTo(`/pages/mine/addr/addr-detail?id=` + id + `&isCopy=1`)
@ -299,4 +302,4 @@
}
}
</style>
</style>

View File

@ -75,13 +75,14 @@
{{formatNumberWithUnits(noticeDetail.fansDown)||'0'}}-{{formatNumberWithUnits(noticeDetail.fansUp)||''}}
</view>
</view>
<view class="dl-item">
<view class="dl-item" v-if='noticeDetail.province'>
<view class="dl-label">
地区要求
</view>
<view class="dl-value">{{noticeDetail.city||''}} </view>
<view class="dl-value">{{noticeDetail.province+(noticeDetail.city?('-'+noticeDetail.city):'')}}
</view>
</view>
<view class="dl-item">
<view class="dl-item" v-if='noticeDetail.bloggerTypes'>
<view class="dl-label">
博主类型
</view>
@ -107,28 +108,26 @@
<!-- 联系方式 -->
<view class="info-box notice-detail">
<view class="detail-title">联系方式</view>
<view class="field-box">
<view class="field-box" v-if="passSign">
<view class="dl-item">
<view class="dl-label">
联系人
微信群码图片
</view>
<view class="dl-value">报名后可查看 </view>
</view>
<view class="dl-item">
<view class="dl-label">
微信号
<view class="dl-value">
<image v-if="noticeDetail.groupImage" @click="preview([noticeDetail.groupImage])"
:src="imageUrl+noticeDetail.groupImage" mode="widthFix"></image>
<text v-else>未上传请等待通告主联系</text>
</view>
<view class="dl-value">报名后可查看 </view>
</view>
</view>
<view class="field-box" v-else>
<view class="dl-item">
<view class="dl-label">
微信二维码
</view>
<view class="dl-value">报名后可查看 </view>
</view>
<view class="dl-item">
<view class="dl-label">
加入通告二维码
微信群码图片
</view>
<view class="dl-value">报名后可查看 </view>
</view>
@ -136,19 +135,24 @@
</view>
<!-- 报名列表 -->
<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"
:style="{height:(imageArray.length*(imageWidth+10)+20)+'rpx'}">
<view class="image-row" v-for="(row,rowIndex) in imageArray">
<image v-for="(item,i) in row"
:style="{ top:(imageWidth+10)*rowIndex+'rpx',left:imageWidth*i+'rpx'}"
src="@/static/images/profile.jpg" mode="aspectFit">
</image>
<span v-for=" (item,i) in row">
<image v-if="item" :style="{ top:(imageWidth+10)*rowIndex+'rpx',left:imageWidth*i+'rpx'}"
:src="item" mode="aspectFit">
</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 class="dl-bottom-box" v-show="showBottom">
<view class="dl-bottom-box" v-show="showBottom&&type=='common'">
<!-- 报名 -->
<view class="report-box">
<view @click="goHome()">
@ -158,7 +162,8 @@
<image src="@/static/detail/share.png" mode="aspectFit"></image>
</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>
<!-- 通告发布人能操作的 -->
@ -236,6 +241,8 @@
imageArray: [
],
//
allImgNum: 0,
//rpx--
imageWidth: 70,
//
@ -243,7 +250,8 @@
//
isLove: false,
//
isSign: false,
passSign: false,
isSign: true,
//
userDetail: {
avatar: '',
@ -282,10 +290,11 @@
shareImage: '/static/bg.jpg', //
qrSize: 100, //
qrUrl: 'https://ext.dcloud.net.cn/plugin?id=5747', //
type: 'common'
}
},
onReady() {
this.calculateImagesPerRow();
//
this.checkUserType()
this.showBottom = true
@ -295,10 +304,16 @@
if (params.viewMy) {
this.viewMy = true
}
if (params.type) {
this.type = params.type
}
this.noticeId = params.id
if (null != getJSONData(constant.userInfo)) {
this.userInfo = getJSONData(constant.userInfo)
}
},
onShow() {
this.getDetail()
this.viewNotice()
},
@ -398,12 +413,14 @@
if (res.code == 200) {
this.noticeDetail = res.data.noticeDetail
this.userDetail = res.data.userDetail
this.imageArray = res.data.signUserAvatarList
this.isLove = res.data.isLove
this.passSign = res.data.passSign
this.isSign = res.data.isSign
if (this.noticeDetail.images) {
this.noticeDetail.imageArray = this.noticeDetail.images.split(",")
}
this.allImgNum = res.data.signUserAvatarList.length
this.calculateImagesPerRow(res.data.signUserAvatarList)
}
}).catch((e) => {
this.isTriggered = false
@ -521,7 +538,12 @@
/**
* 计算头像显示区域高度
*/
calculateImagesPerRow() {
calculateImagesPerRow(imgs) {
let tempImg = []
imgs.forEach(it => {
tempImg.push(this.imageUrl + it)
})
console.log(tempImg);
const systemInfo = uni.getSystemInfoSync();
//1rpx px
let rpxUnit = (systemInfo.screenWidth / 750)
@ -532,10 +554,7 @@
//
let imagesPerRow = Math.floor(screenWidth / imageWidthPx);
//
let thisArray = []
for (var i = 0; i < 50; i++) {
thisArray.push('/static/images/profile.jpg')
}
let thisArray = tempImg
for (let i = 0; i < thisArray.length; i += imagesPerRow) {
this.imageArray.push(thisArray.slice(i, i + imagesPerRow));
}
@ -803,14 +822,27 @@
.dl-item {
display: flex;
justify-content: center;
align-items: flex-start;
justify-content: start;
align-items: center;
margin-bottom: 10rpx;
.dl-label {}
.dl-label {
width: 300rpx;
display: flex;
justify-content: start;
align-items: center;
}
.dl-value {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
image {
width: 200rpx;
height: 80rpx;
}
}
}
}
@ -912,4 +944,4 @@
}
}
}
</style>
</style>

View File

@ -19,8 +19,11 @@
<view class="data-list-box">
<view class="form-warn">
<image src="@/static/detail/warn.png" mode="aspectFit"></image>
<text>注意请勿发布直发代发等虚假通告</text>
<text>注意请勿发布直发代发等虚假通告
为了您的信息安全平台不建议填写您的银行卡号身份证号密码等隐私信息</text>
</view>
<view class="form-content">
<view class="item-field">
<view class="item-lable is-required">
@ -40,36 +43,6 @@
:imgCode="dataObj.platformCode"></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.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-lable is-required">
截止时间
@ -79,6 +52,67 @@
@maskClick="maskClick" />
</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-lable is-required">
品牌
@ -87,53 +121,39 @@
<input class="uni-input" v-model="dataObj.brand" type="text" placeholder="请输入" />
</view>
</view>
<view class="item-field">
<view class="item-lable is-required">
名额
粉丝下限
</view>
<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 class="item-field">
<view class="item-lable is-required">
粉丝
<view class="item-lable ">
粉丝上限
</view>
<view class="item-value">
<uni-data-select v-model="dataObj.fansLimit" :localdata="limitRange"
@change="change($event,'fans')" :clear="false"></uni-data-select>
<view class="dl-drawer-item" v-if="dataObj.fansLimit">
<input class="uni-input" v-model="dataObj.fansDown" type="digit" placeholder="最低" />
<view></view>
<input class="uni-input" v-model="dataObj.fansUp" type="digit" placeholder="最高" />
</view>
<view class="dl-drawer-item" v-if="dataObj.fansLimit">
<uni-data-checkbox @change="chooseBoxFun($event,'isEligible')" multiple
:localdata="isEligibleList" />
</view>
<input class="uni-input" v-model="dataObj.fansUp" type="digit" placeholder="最高(不填代表无上限)" />
</view>
</view>
<view class="item-field">
<view class="item-lable ">
地区要求
</view>
<view class="item-value">
<uni-data-picker placeholder="请选择" popup-title="请选择收件地址" :localdata="dataTree"
v-model="dataObj.city" @change="onchange" @nodeclick="onnodeclick"
@popupopened="onpopupopened" @popupclosed="onpopupclosed">
</uni-data-picker>
</view>
</view>
<view class="item-field">
<view class="item-lable is-required">
通告明细
</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">
<view class="item-lable">
博主类型 <text class="little-text">(可多选)</text>
</view>
<view class="item-value">
@ -148,65 +168,19 @@
</view>
</view>
</view>
</view>
<view class="form-content">
<view class="item-field">
<view class="item-lable is-required">
联系方式
<view class="item-lable ">
产品图
</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-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-lable is-required">
<view class="item-lable ">
微信群码<text class="little-text">(选填)</text>
</view>
<view class="item-value">
@ -215,20 +189,45 @@
@delete="deleteFile($event,'groupImageList')" limit="1"></uni-file-picker>
</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 class="line-row-bottom">
<uni-data-checkbox @change="chooseBoxFun($event,'isRead')" multiple :localdata="readBookList" />
<text @click="handleUserAgrement(globalConfig.appInfo.agreements[1])"
class="text-red">{{globalConfig.appInfo.agreements[1].title}}</text>
<!-- 自定义表单 -->
<view class="form-content">
<view class="item-field-row" style="padding-top: 0;">
<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 class="dl-bottom-box">
<!-- 预览 -->
<view class="view-dom">
<view class="view-dom" @click="preview()">
预览
</view>
<view class="public-dom">
<view class="public-dom" @click="publish()">
发布
</view>
</view>
@ -255,12 +254,20 @@
uniListByParentCode
} from '@/api/system/config.js'
import config from '@/config';
import {
treeCity
} from '@/api/business/base.js'
import {
saveNotice
} from '@/api/business/notice';
export default {
components: {
navigationBarVue,
},
data() {
return {
//
dataTree: [],
//
showNum: 4,
globalConfig: getApp().globalData.config,
@ -276,33 +283,25 @@
//
groupImageList: [],
//
customFieldList: [{
labelTitle: "姓名",
value: "",
sort: 1
}, {
labelTitle: "身份证号",
value: "",
sort: 2
}],
customFieldList: [],
dataObj: {
isRead: false,
isRead: 0,
title: "",
brand: "",
platformCode: "",
feeLimit: false,
platformCode: "xiaohongshu",
feeLimit: 0,
feeDown: null,
feeUp: null,
giftLimit: false,
haveGift: null,
giftDetail: "",
giftPrice: null,
endDate: null,
needNum: null,
fansLimit: false,
fansLimit: 0,
fansDown: null,
fansUp: null,
// (0|1)
isEligible: 0,
isEligible: null,
//
bloggerTypes: "",
//便
@ -310,7 +309,7 @@
tel: "",
wechat: "",
// (0|1)
isShowTel: 0,
isShowTel: null,
},
isEligibleList: [{
text: '报名需符合粉丝要求',
@ -326,21 +325,21 @@
}],
//
ifHasRange: [{
value: false,
text: ""
value: 0,
text: ""
},
{
value: true,
text: ""
value: 1,
text: ""
}
],
//
limitRange: [{
value: false,
value: 0,
text: "不限制"
},
{
value: true,
value: 1,
text: "限制"
}
],
@ -350,8 +349,201 @@
onLoad() {
this.initData("dl_platform", 'platFormRange')
this.initData("dl_blogger_type", "bloggerTypeList")
this.initAddress()
},
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) {
this.$tab.navigateTo(`/pages/common/richview/index?title=${site.title}&code=${site.code}`)
@ -475,18 +667,7 @@
this.$refs.inputDialog.close()
},
dialogInputConfirmCus(val) {
let thisObj = {
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
}
let thisObj = val
this.customFieldList.push(thisObj)
//
this.$refs.inputDialogCus.close()
@ -620,7 +801,10 @@
justify-content: center;
}
.is-required {
.is-required:before {
content: "*";
color: #FC1F3E;
image {
width: 20rpx;
height: 20rpx;
@ -690,7 +874,10 @@
margin-bottom: 20rpx;
}
.is-required {
.is-required:before {
content: "*";
color: #FC1F3E;
image {
width: 20rpx;
height: 20rpx;
@ -792,7 +979,7 @@
display: flex;
align-items: center;
justify-content: center;
z-index: 999;
z-index: 9;
.view-dom {
flex: 1;
@ -835,4 +1022,4 @@
.checklist-box {
margin-right: 0 !important;
}
</style>
</style>

View File

@ -55,12 +55,12 @@
</view>
</view>
<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>
<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 class="item-field-row">
@ -68,7 +68,8 @@
附言
</view>
<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>
@ -99,7 +100,7 @@
<text>{{userAddr.name}}</text>
<text>{{userAddr.tel}}</text>
</view>
<view class="change-addr-dom">切换</view>
<view class="change-addr-dom" @click="goSignAddr()">切换</view>
</view>
</view>
<!-- 去报名始终浮动下方 -->
@ -224,6 +225,9 @@
uni.$on('updateCard', function(data) {
that.updateCard(data)
})
uni.$on('updateAddr', function(data) {
that.updateAddr(data)
})
},
methods: {
@ -234,8 +238,11 @@
}
})
},
updateAddr(data) {
this.userAddr = data
},
updateCard(data) {
console.log(data, 211);
this.cardList = data
},
/**
@ -260,7 +267,11 @@
}
},
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() {
this.$tab.navigateTo('/pages/mine/member/member-card')
@ -320,6 +331,28 @@
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.cardList = this.cardList
@ -845,4 +878,4 @@
}
}
}
</style>
</style>

View File

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