From 3dbd59baa634c97c969c58164bca2950fb511790 Mon Sep 17 00:00:00 2001 From: wangzimeng <3297159934@qq.com> Date: Mon, 7 Jul 2025 18:30:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=91=E5=8F=91=E5=B8=83=E7=9A=84=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B4=BB=E5=8A=A8=E4=BF=A1=E6=81=AF=E5=92=8C?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=B4=BB=E5=8A=A8=E7=9A=84=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8D=89=E7=A8=BF=E7=AE=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packageA/my/orderList.vue | 259 +++++++++++++++- packageB/editAct.vue | 634 +++++++++++++++++++++++++++++++++++++- pages/center/index.vue | 613 +++++++++++++++++++++++++++++++++++- 3 files changed, 1471 insertions(+), 35 deletions(-) diff --git a/packageA/my/orderList.vue b/packageA/my/orderList.vue index c881c11..d43dcf0 100644 --- a/packageA/my/orderList.vue +++ b/packageA/my/orderList.vue @@ -2,7 +2,7 @@ - item.status === selected)" :activeStyle="{ color: '#303133', fontWeight: 'bold',fontSize: '32rpx'}" :inactiveStyle="{ color: '#606266' @@ -31,7 +31,51 @@ + + + + + + + + + + + + + + {{item.title}} + {{item.content}} + 保存时间: {{item.updatetime_text}} + + + + + 编辑 + + + 删除 + + + + + + + + + + 暂无数据 + + + + {{ dateWeeks(item.start_time) }} - + {{ item.address_detail }} @@ -91,7 +134,7 @@ - + @@ -100,8 +143,7 @@ - 修改 + + + 核销: {{ item.verification_num }} /{{ item.stock }} - - + + @@ -153,8 +198,8 @@ 重发 - 详情 + 详情 - + @@ -241,17 +286,32 @@ - + 暂无发布活动 前往发布 + + + + + + + + + @@ -311,6 +371,7 @@ import { dateWeek } from "../../utils/dateFormat"; + import dayjs from 'dayjs'; export default { data() { return { @@ -344,6 +405,9 @@ size: 13, sortStyle: ["#ff557f", "#3f3f3f"], headers: [{ + status: "15", + name: "草稿箱", + }, { status: "0", name: "活动审核", }, @@ -393,6 +457,8 @@ server_status: '3', cancelsShow: false, //取消的二次弹框显示 deleteId: null, //暂存删除活动的id + draftList: [], //草稿箱列表 + draftShow: false, }; }, onLoad(option) { @@ -709,8 +775,8 @@ }) .catch((error) => {}); }, - - + + // 售后 service(id) { uni.navigateTo({ @@ -793,12 +859,92 @@ this.status = status; if (status == -2) { this.getAfterList(); - }else if(status == -2){ - + } else if (status == 15) { + console.log('draftShow'); + this.draftShow = true + this.hotList = [] + this.getDraftList(status) } else { this.getHotList(status); } }, + //获取草稿箱列表 + getDraftList(status) { + uni.$u.http + .get("/api/school.newactivity.activity_drafts/drafts_list", { + params: { + keywords: this.keywords, + page: this.page, + limit: this.limit, + order: 'normal' + // status: status, + }, + }) + .then((res) => { + if (res.code == 1) { + this.count = res.data.count; + console.log('draft1', res.data.list); + this.draftList = res.data.list.data; + console.log('draft', this.draftList); + for(let i = 0;i= res.data.count) { + this.loadStatus = "nomore"; + } else { + this.loadStatus = "loading"; + } + console.log('draft', this.draftList); + } else { + uni.showToast({ + title: res.msg, + icon: "none", + duration: 2000, + }); + this.loadStatus = "loading"; + } + }) + .catch((error) => { + console.error("请求失败", error); + this.loadStatus = "loading"; + }); + }, + toEditDraft(id) { + console.log('编辑草稿'); + const type = 3 + uni.navigateTo({ + url: '/packageB/editAct?draftId=' + id + '&type=' + type + }) + }, + toDeleteDraft(id) { + console.log('删除草稿'); + console.log('deleteItem', id); + uni.$u.http.post('/api/school.newactivity.activity_drafts/del', { + ids: id, + }).then(res => { + if (res.code == 1) { + this.cancelsShow = false + uni.showToast({ + title: '删除成功', + icon: 'success', + duration: 2000 + }) + this.getDraftList('15') + // this.toShlist('2') + // setTimeout(() => { + // uni.redirectTo({ + // url: "/packageA/my/orderList" + // }) + // }, 1000) + } else { + uni.showToast({ + title: res.msg, + icon: 'none', + duration: 2000 + }) + } + }).catch(error => {}); + }, headerSelected(status) { return this.selected === status; }, @@ -861,6 +1007,10 @@ color: #3D3D3D; } } + + + + } } @@ -1187,6 +1337,81 @@ /* 使用省略号表示被截断的文本 */ } + .invoiceList { + width: 100%; + height: auto; + + .invoiceList-item { + display: grid; + justify-content: space-around; + align-items: center; + background-color: #ffffff; + // width: 100%; + width: 690rpx; + margin-top: 20rpx; + margin-left: 10rpx; + padding: 20rpx 20rpx; + height: 220rpx auto; + + .invoiceList-itemInfo { + // width: 100%; + width: 690rpx; + display: flex; + justify-content: flex-start; + align-items: center; + + .item-img { + width: 170rpx; + height: 170rpx; + margin-left: 40rpx; + + } + + .item-con { + margin-left: 20rpx; + width: 90%; + height: 160rpx; + position: relative; + color: #323232; + display: grid; + + .itenCon-actName { + // position: absolute; + // top: 0; + font-size: 28rpx; + font-weight: 400; + } + + .itenCon-actCon { + // position: absolute; + // top: 50rpx; + // margin-top: 60rpx; + font-size: 28rpx; + font-weight: 400; + } + + .itenCon-actPrice { + // position: absolute; + // bottom: 0; + font-size: 26rpx; + font-weight: 400; + } + } + } + + + + .item-draftBtns { + width: 100%; + display: flex; + justify-content: flex-end; + align-items: center; + margin-top: 20rpx; + } + + } + } + .hot { margin-top: 80rpx; margin-bottom: 70rpx; diff --git a/packageB/editAct.vue b/packageB/editAct.vue index b6ed26c..2970103 100644 --- a/packageB/editAct.vue +++ b/packageB/editAct.vue @@ -197,7 +197,7 @@ @clickOne="protocolClick"> - 存草稿 + 存草稿 确认发布 @@ -394,6 +394,40 @@ @confirm="birthConfirm1" :show="birthShow1" v-model="form.birth1" mode="datetime"> --> + + + + + 取消 + 草稿箱 + + 确定 + + + + + + + + + + {{item.title}} + {{item.content}} + 保存时间: {{item.updatetime_text}} + + + + + + + + @@ -491,6 +525,17 @@ alignItems: 'center', flexColumn: 'column' }, + popupStyletkDraft: { + width: '100%', + padding: '24rpx 0rpx 24rpx 0rpx', + height: '984rpx', + margin: '0 auto', // 水平居中 + display: 'flex', + justifyContent: 'start', + alignItems: 'center', + flexColumn: 'column', + backgroundColor: '#f7f7f7', + }, current: -1, currents: -1, institutionList: [], @@ -520,29 +565,66 @@ original_activity_id: null, type: null, tempDefaultTime: null, + isFormValid: false, //草稿箱的控制 + draftList: [], + draftShow: false, + keywords: '', + loadStatus: "loading", + selectHeadIndex: null, + draftSelectIndex: null, + selectDradtForm: { + cate_ids: '', + // 活动分类名字 + cate_idsName: "", + content: '', + refund_id: '', + refund_idn: '', + price: '', + stock: '', + sign_time: '', + time: '', + images: '', + title: '', + address: '', + latitude: '', + longitude: '', + address_detail: '', //详细位置 + date: dayjs().add(4, 'hour').valueOf(), //活动开始时间 + date1: dayjs().add(8, 'hour').valueOf(), //活动结束时间 + birth: dayjs().add(4, 'hour').valueOf(), //报名开始日期 + birth1: dayjs().add(8, 'hour').valueOf(), //报名结束日期 + }, + draftId:null, }; }, onLoad(options) { - console.log('options', options.id, options.original_activity_id); + console.log('options', options.id, options.original_activity_id,options.draftId); this.id = options.id this.original_activity_id = options.original_activity_id this.type = options.type + this.draftId = options.draftId console.log('this.id', this.id); console.log('this.original_activity_id ', this.original_activity_id); console.log('this.type', this.type); if (this.id || this.original_activity_id) { this.agree = true + + this.getDetail() + } + if(this.draftId) { + this.getDraftDetail() } // if(options.original_activity_id) { // this.original_activity_id = options.original_activity_id // } - this.getDetail() + // this.getDetail() uni.hideShareMenu(); this.getAgreement() this.getBqList(); this.getrefund_list(); this.getitembq(); this.selectItemTuikuan(); + this.getDraftList(); //var c=uni.getSystemInfoSync(); //844-94-70-100 = 580 //763-47-(100-47)-34-50 @@ -552,6 +634,7 @@ onShow() { this.show = false; this.getCardInfo(); + this.getDraftList(); }, filters: { formatTimestamp(value) { @@ -659,6 +742,98 @@ } }).catch(error => {}); }, + //草稿箱 + getDraftDetail() { + console.log('getDraftDetail',this.draftId); + uni.$u.http.get('/api/school.newactivity.activity_drafts/detail', { + params: { + id: this.draftId, + } + }).then(res => { + if (res.code == 1) { + this.form = res.data.detail + this.price = this.form.price + this.priceDo() + this.form.content = this.form.content.replace(/<[^>]+>/g, ''); // 输出: "运动" + this.value_slide = res.data.detail.join_info.percent; + const idBqSet = new Set(this.form.cate_ids); + const bqArray = this.bqList.reduce((acc, obj) => { + if (this.form.cate_ids.includes(obj.id)) { + acc.push(obj); + } + return acc; + }, []); + console.log('bqArray', bqArray); + let arrIdsName = bqArray.map((item) => { + return item.name + }) + this.form.cate_idsName = arrIdsName.join(','); + console.log('cate_idsName', this.form.cate_idsName); + this.list = bqArray + this.form.cate_ids = res.data.detail.cate_ids; + + console.log('cate_ids', this.form.cate_ids); + this.form.refund_idn = this.form.refund_info.title; + // 转换为 fileList 格式 + this.fileList1 = this.form.images.map(url => ({ + url: url, + status: 'success', + message: '' + })); + this.list1 = this.form.images + console.log('fileList1', this.fileList1); + + this.qunQrcode = ({ + url: this.form.image, + status: 'success', + message: '' + }) + this.QunQrcode1 = this.qunQrcode + + // formatDate(dateStr) { + // if (!dateStr) return ''; + // return dateStr.slice(5, 16); + // } + // this.times_b_int = this.form.start_time_text + // this.times_e_int = this.form.end_time_text + // res.data.detail + const time_start = this.form.start_time_text.slice(5, 16) + const time_end = this.form.end_time_text.slice(5, 16) + this.form.time = time_start + ' - ' + time_end + + const signTime_start = this.form.sign_start_time_text.slice(5, 16) + const signTime_end = this.form.sign_end_time_text.slice(5, 16) + this.form.sign_time = signTime_start + ' - ' + signTime_end + + console.log('qunQrcode', this.qunQrcode); + if (!this.original_activity_id) { + this.times_b_int = this.form.start_time_text + this.times_e_int = this.form.end_time_text + this.times_sinb_int = this.form.sign_start_time_text + this.times_sine_int = this.form.sign_end_time_text + } else { + this.times_b_int = '' + this.times_e_int = '' + this.times_sinb_int = '' + this.times_sine_int = '' + this.form.sign_time = '' + this.form.time = '' + } + if (this.type == 2) { + this.form.title = '' + } + + this.mobile = this.detail.user.mobile.slice(0, 3) + 'XXXX' + this.detail.user.mobile.slice( + 7); + } else { + uni.showToast({ + title: res.msg, + icon: 'none', + duration: 2000 + }) + } + }).catch(error => {}); + }, priceDo() { var price = this.price; console.log('priceDo price:', price); @@ -1450,6 +1625,282 @@ const telRegex = /^1[3-9]\d{9}$/; // 假设是中国大陆的手机号码格式 return telRegex.test(tel); }, + + //草稿箱列表 + getDraftList() { + uni.$u.http + .get("/api/school.newactivity.activity_drafts/drafts_list", { + params: { + keywords: this.keywords, + page: this.page, + limit: this.limit, + order: 'normal', + // status: status, + }, + }) + .then((res) => { + if (res.code == 1) { + this.count = res.data.count; + console.log('getDraft', res.data.list); + this.draftList = res.data.list.data; + for(let i = 0;i= res.data.count) { + this.loadStatus = "nomore"; + } else { + this.loadStatus = "loading"; + } + console.log('draftList', this.draftList); + } else { + uni.showToast({ + title: res.msg, + icon: "none", + duration: 2000, + }); + this.loadStatus = "loading"; + } + }) + .catch((error) => { + console.error("请求失败", error); + this.loadStatus = "loading"; + }); + }, + //新增草稿箱 + addDraft() { + console.log('草稿'); + let url = '/api/school.newactivity.activity_drafts/add'; + let params = {}; + let hdtime = '' + let bmtime = '' + this.form.cate_ids = this.list.map(item => item.id).join(','); + if (this.times_b_int && this.times_e_int) { + hdtime = this.times_b_int + ' - ' + this.times_e_int; + } + if (this.times_sinb_int && this.times_sine_int) { + bmtime = this.times_sinb_int + ' - ' + this.times_sine_int; + } + // let hdtime = this.times_b_int + ' - ' + this.times_e_int; + // let bmtime = this.times_sinb_int + ' - ' + this.times_sine_int; + params = { + title: this.form.title, + cate_ids: this.form.cate_ids, + content: this.form.content, + // refund_id: 1, + refund_id: this.form.refund_id, + price: this.form.price == '' ? 0 : this.form.price, + stock: this.form.stock, + sign_time: bmtime || '', + time: hdtime || '', + images: this.list1, + longitude: this.form.longitude, + latitude: this.form.latitude, + address: this.form.address, + address_detail: this.form.address_detail, + image: this.qunQrcode + } + console.log('草稿1'); + uni.$u.http.post(url, params).then(res => { + console.log('草稿2'); + if (res.code == 1) { + //置空 + this.fileList1 = []; + this.agree = false; + this.list1 = ''; + this.list = []; + this.price = ''; + this.priceName = '免费'; + this.qunQrcode = ''; + this.form = { + + cate_ids: '', + // 活动分类名字 + cate_idsName: "", + content: '', + refund_id: '', + refund_idn: '', + price: 1, + stock: '', + sign_time: '', + time: '', + images: '', + title: '', + address: '', + latitude: '', + longitude: '', + address_detail: '', //详细位置 + date: '', //活动开始时间 + date1: '', //活动结束时间 + birth: '', //报名开始日期 + birth1: '', //报名结束日期 + } + + uni.showToast({ + title: '添加成功!', + icon: 'none', + duration: 2000, + }); + setTimeout(function() { + // uni.navigateTo({ + // url: "/packageA/my/orderList" + // }) + }, 1000); + } else { + this.$u.toast(res.msg); + // uni.showToast({ + // title: res.msg, + // icon: 'none', + // duration: 2000 + // }); + } + }).catch(error => { + uni.showToast({ + title: error.msg, + icon: 'none', + duration: 2000 + }); + }); + }, + //关闭草稿 + closeDraftShow() { + this.draftShow = false + }, + //显示草稿 + openDraftShow() { + this.draftShow = true + }, + selectDraft(item, index) { + console.log('index:', index, 'item:', item); + this.draftSelectIndex = index + this.selectDradtForm.title = item.title + this.selectDradtForm.content = item.content + this.selectDradtForm.images = item.images + this.selectDradtForm.address = item.address + this.selectDradtForm.address_detail = item.address_detail + this.selectDradtForm.stock = item.stock + this.selectDradtForm.price = item.price + this.selectDradtForm.time = item.time + this.selectDradtForm.sign_time = item.sign_time + this.selectDradtForm.title = item.title + this.selectDradtForm.cate_ids = item.cate_ids + this.selectDradtForm.refund_id = item.refund_id + console.log('5555'); + // this.closeDraftShow(); + }, + selectSureDraft() { + console.log('366666'); + this.form.title = this.selectDradtForm.title + this.form.content = this.selectDradtForm.content + this.form.images = this.selectDradtForm.images + this.form.address = this.selectDradtForm.address + this.form.address_detail = this.selectDradtForm.address_detail + this.form.stock = this.selectDradtForm.stock + this.form.price = this.selectDradtForm.price + this.form.time = this.selectDradtForm.time + this.form.sign_time = this.selectDradtForm.sign_time + this.form.title = this.selectDradtForm.title + this.form.cate_ids = this.selectDradtForm.cate_ids + this.form.refund_id = this.selectDradtForm.refund_id + console.log('99999'); + this.closeDraftShow(); + }, + editDraft() { + console.log('草稿'); + let url = '/api/school.newactivity.activity_drafts/add'; + let params = {}; + let hdtime = '' + let bmtime = '' + this.form.cate_ids = this.list.map(item => item.id).join(','); + if (this.times_b_int && this.times_e_int) { + hdtime = this.times_b_int + ' - ' + this.times_e_int; + } + if (this.times_sinb_int && this.times_sine_int) { + bmtime = this.times_sinb_int + ' - ' + this.times_sine_int; + } + // let hdtime = this.times_b_int + ' - ' + this.times_e_int; + // let bmtime = this.times_sinb_int + ' - ' + this.times_sine_int; + params = { + title: this.form.title, + cate_ids: this.form.cate_ids, + content: this.form.content, + // refund_id: 1, + refund_id: this.form.refund_id, + price: this.form.price == '' ? 0 : this.form.price, + stock: this.form.stock, + sign_time: bmtime || '', + time: hdtime || '', + images: this.list1, + longitude: this.form.longitude, + latitude: this.form.latitude, + address: this.form.address, + address_detail: this.form.address_detail, + image: this.qunQrcode + } + console.log('草稿1'); + uni.$u.http.post(url, params).then(res => { + console.log('草稿2'); + if (res.code == 1) { + //置空 + this.fileList1 = []; + this.agree = false; + this.list1 = ''; + this.list = []; + this.price = ''; + this.priceName = '免费'; + this.qunQrcode = ''; + this.form = { + + cate_ids: '', + // 活动分类名字 + cate_idsName: "", + content: '', + refund_id: '', + refund_idn: '', + price: 1, + stock: '', + sign_time: '', + time: '', + images: '', + title: '', + address: '', + latitude: '', + longitude: '', + address_detail: '', //详细位置 + date: '', //活动开始时间 + date1: '', //活动结束时间 + birth: '', //报名开始日期 + birth1: '', //报名结束日期 + } + + uni.showToast({ + title: '编辑保存成功!', + icon: 'none', + duration: 2000, + }); + uni.navigateBack() + // setTimeout(function() { + // // uni.navigateTo({ + // // url: "/packageA/my/orderList" + // // }) + // }, 1000); + } else { + this.$u.toast(res.msg); + // uni.showToast({ + // title: res.msg, + // icon: 'none', + // duration: 2000 + // }); + } + }).catch(error => { + uni.showToast({ + title: error.msg, + icon: 'none', + duration: 2000 + }); + }); + }, + + apply() { if (this.cardStatus == -1) { @@ -1604,7 +2055,7 @@ if (/^https?:\/\//i.test(params.images[i])) { params.images[i] = params.images[i].replace(/^https?:\/\/[^/]+/, ''); console.log('params.images[i].url', params.images[i]); - }else { + } else { params.images[i] = params.images[i] } } @@ -2323,7 +2774,180 @@ font-family: PingFang SC, PingFang SC; } } - + + .popup_tkallDraft { + z-index: 100; + background-color: #f7f7f7; + + .popup_tkDraft { + font-size: 36rpx; + margin: 12rpx 0 24rpx 0; + text-align: center; + } + + .popup-content { + height: 900rpx; + overflow-y: auto; + margin-top: 30rpx; + width: 100%; + padding: 0rpx; + background-color: #f7f7f7; + + .invoiceList { + width: 690rpx; + height: auto; + + .invoiceList-item { + display: flex; + justify-content: space-between; + align-items: center; + background-color: #ffffff; + width: 93%; + margin-top: 20rpx; + padding: 20rpx 20rpx; + height: 220rpx; + border-radius: 40rpx 40rpx 40rpx 40rpx; + + // &.active { + // background-color: ##F0FFDF; + // border: 2rpx solid #9CEAA2; + // border-image: linear-gradient(270deg, rgba(251.00000023841858, 246.0000005364418, 109.00000110268593, 1), rgba(156.00000590085983, 234.00000125169754, 162.00000554323196, 1)) 2 2; + // border-radius: 40rpx; + // // clip-path: inset(0px round 16rpx); + // } + + + .item-img { + width: 170rpx; + height: 170rpx; + // margin-left: 40rpx; + + } + + .item-con { + margin-left: 20rpx; + width: 90%; + height: 160rpx; + position: relative; + color: #323232; + + .itenCon-actName { + position: absolute; + top: 0; + font-size: 28rpx; + font-weight: 400; + } + + .itenCon-actCon { + // position: absolute; + // top: 100rpx; + margin-top: 60rpx; + font-size: 28rpx; + font-weight: 400; + } + + .itenCon-actPrice { + position: absolute; + bottom: 0; + font-size: 26rpx; + font-weight: 900; + } + } + + + } + + .invoiceList-itemSelect { + display: flex; + justify-content: space-between; + align-items: center; + background-color: #F0FFDF; + width: 93%; + margin-top: 20rpx; + padding: 20rpx 20rpx; + height: 220rpx; + border-radius: 40rpx 40rpx 40rpx 40rpx; + border: 2rpx solid #9CEAA2; + // border-image: linear-gradient(270deg, rgba(251.00000023841858, 246.0000005364418, 109.00000110268593, 1), rgba(156.00000590085983, 234.00000125169754, 162.00000554323196, 1)) 2 2; + + .item-img { + width: 170rpx; + height: 170rpx; + // margin-left: 40rpx; + + } + + .item-con { + margin-left: 20rpx; + width: 70%; + height: 160rpx; + position: relative; + color: #323232; + display: grid; + + .itenCon-actName { + // position: absolute; + // top: 0; + font-size: 28rpx; + font-weight: 400; + } + + .itenCon-actCon { + // position: absolute; + // top: 100rpx; + // margin-top: 60rpx; + font-size: 28rpx; + font-weight: 400; + } + + .itenCon-actPrice { + // position: absolute; + // bottom: 0; + font-size: 26rpx; + font-weight: 900; + } + } + + + } + } + + + .popup-footer { + width: 100%; + display: flex; + justify-content: center; + align-items: center; + + .headBtn { + width: 90%; + height: 90rpx; + background-color: #323232; + border-radius: 148rpx; + color: #BBFC5B; + font-size: 36rpx; + font-weight: 400; + line-height: 50rpx; + font-family: YouSheBiaoTiHei, YouSheBiaoTiHei; + text-transform: none; + font-style: normal; + display: flex; + justify-content: center; + align-items: center; + text-align: center; + position: fixed; + bottom: 66rpx; + margin-left: 2%; + } + } + + + } + + + } + + .btn_1 { width: 90%; height: 80rpx; diff --git a/pages/center/index.vue b/pages/center/index.vue index c277140..0c517bf 100644 --- a/pages/center/index.vue +++ b/pages/center/index.vue @@ -12,7 +12,7 @@ + v-model="form.title" placeholder-class="bttop" @input="handleUsernameChange" /> (必填20字内) @@ -20,8 +20,8 @@ + placeholder="描述一下活动的亮点、活动内容、推荐的人群、叫大家一起运动吧~" :height="120" placeholder-class="bttop" + @input="handleUsernameChange2"> @@ -56,7 +56,7 @@ + placeholder="请输入详细地址/楼、门牌号" @input="handleUsernameChange2()"> @@ -154,7 +154,8 @@ v-model.number="form.stock" /> --> - + @@ -202,9 +203,18 @@ - 确认发布 - 确认发布 + + 存草稿 + 草稿箱 + + ({{draftList.length}}) + + 确认发布 + 确认发布 + + @@ -394,6 +404,36 @@ --> + + + + + 取消 + 草稿箱 + 确定 + + + + + + + + + + {{item.title}} + {{item.content}} + 保存时间: {{item.updatetime_text}} + + + + + + + @@ -484,7 +524,7 @@ }, popupStyletk: { width: '710rpx', - padding: '24rpx 24rpx 42rpx 24rpx', + padding: '24rpx 20rpx 42rpx 20rpx', height: '984rpx', margin: '0 auto', // 水平居中 display: 'flex', @@ -492,6 +532,17 @@ alignItems: 'center', flexColumn: 'column' }, + popupStyletkDraft: { + width: '100%', + padding: '24rpx 0rpx 24rpx 0rpx', + height: '984rpx', + margin: '0 auto', // 水平居中 + display: 'flex', + justifyContent: 'start', + alignItems: 'center', + flexColumn: 'column', + backgroundColor: '#f7f7f7', + }, current: -1, currents: -1, institutionList: [], @@ -516,6 +567,35 @@ boxHeight: 0, cardShow: false, cardStatus: 0, + isFormValid: false, //草稿箱的控制 + draftList: [], + draftShow: false, + keywords: '', + loadStatus: "loading", + selectHeadIndex: null, + draftSelectIndex: null, + selectDradtForm: { + cate_ids: '', + // 活动分类名字 + cate_idsName: "", + content: '', + refund_id: '', + refund_idn: '', + price: '', + stock: '', + sign_time: '', + time: '', + images: '', + title: '', + address: '', + latitude: '', + longitude: '', + address_detail: '', //详细位置 + date: dayjs().add(4, 'hour').valueOf(), //活动开始时间 + date1: dayjs().add(8, 'hour').valueOf(), //活动结束时间 + birth: dayjs().add(4, 'hour').valueOf(), //报名开始日期 + birth1: dayjs().add(8, 'hour').valueOf(), //报名结束日期 + } }; }, onLoad() { @@ -528,6 +608,7 @@ this.getrefund_list(); this.getitembq(); this.selectItemTuikuan(); + this.getDraftList(); //var c=uni.getSystemInfoSync(); //844-94-70-100 = 580 //763-47-(100-47)-34-50 @@ -537,6 +618,23 @@ onShow() { this.show = false; this.getCardInfo(); + this.getDraftList(); + }, + watch: { + // form: { + // handler(newVal) { + // this.isFormValid = newVal.name.title > 0 && newVal.content > 0; + // }, + // deep: true, + // immediate: true + // } + + // 'form.title'(newVal) { + // this.isFormValid = newVal.length > 0 || this.form.content.length > 0; + // }, + // 'form.content'(newVal) { + // this.isFormValid = this.form.title.length > 0 || newVal.length > 0; + // } }, filters: { formatTimestamp(value) { @@ -549,6 +647,23 @@ } }, methods: { + handleUsernameChange() { + console.log('标题变化:', this.form.title); + this.checkFormValidity(); + }, + handleUsernameChange2() { + console.log('内容变化:', this.form.content); + this.checkFormValidity(); + }, + checkFormValidity() { + this.isFormValid = this.form.title.length > 0 || this.form.content.length > 0 || this.fileList1.length > + 0 || this.form.address.length > 0 || + this.form.address_detail.length > 0 || this.form.time.length > 0 || this.form.sign_time > 0 || this + .form.cate_idsName.length > 0 || + this.form.refund_idn.length > 0 || this.qunQrcode.length > 0 || this.form.stock.length > 0 || this.form + .price.length > 0; + console.log('isFormValid', this.isFormValid); + }, priceDo() { var price = this.price; console.log(price); @@ -573,7 +688,7 @@ this.form.price = this.price; this.priceName = price; this.priceShow = false; - + this.checkFormValidity(); }, selectItemTuikuan() { this.currents = 5; @@ -604,6 +719,7 @@ async uploadQun(item) { const result = await this.uploadFilePromise(item.file.url, 'user'); this.qunQrcode = result; + this.checkFormValidity(); }, //登录及发布123 // tofb() { @@ -685,6 +801,7 @@ }, closebq() { this.showPopbq = false + this.checkFormValidity(); }, openBq() { this.showPopbq = true @@ -870,6 +987,7 @@ } this.form.time = this.times_b + ' - ' + this.times_e this.dateShow = false; + this.checkFormValidity(); // if(this.times_e == '' || this.times_e==null){ // const currentTime = dayjs().format('YYYY-MM-DD HH'); // this.times_e = dateWeekData(currentTime+'00'); @@ -980,6 +1098,7 @@ } this.form.sign_time = this.times_sinb + ' - ' + this.times_sine this.birthShow = false; + this.checkFormValidity(); }, birthCancel() { this.birthShow = false @@ -993,6 +1112,7 @@ }, closetuikuan() { this.tuikuan = false + this.checkFormValidity(); }, open() { this.show = true @@ -1059,6 +1179,7 @@ // that.form.address_detail = res.address that.form.latitude = res.latitude that.form.longitude = res.longitude + this.checkFormValidity(); }, fail: function(rot) { console.log(rot) @@ -1166,6 +1287,7 @@ // this.list1 = this.fileList1[0]?.url || ''; //单张 this.list1 = this.fileList1.map(item => item.url).join(','); } + } }, uploadFilePromise(url, category) { @@ -1241,7 +1363,6 @@ }); }); }, - // 验证电话号码格式的方法 validateTel(tel) { // 这里使用一个简单的正则表达式来验证电话号码格式 @@ -1249,6 +1370,186 @@ return telRegex.test(tel); }, + + //草稿箱列表 + getDraftList() { + uni.$u.http + .get("/api/school.newactivity.activity_drafts/drafts_list", { + params: { + keywords: this.keywords, + page: this.page, + limit: this.limit, + order: 'normal', + // status: status, + }, + }) + .then((res) => { + if (res.code == 1) { + this.count = res.data.count; + console.log('getDraft', res.data.list); + this.draftList = res.data.list.data; + for(let i = 0;i= res.data.count) { + this.loadStatus = "nomore"; + } else { + this.loadStatus = "loading"; + } + console.log('draftList', this.draftList); + } else { + uni.showToast({ + title: res.msg, + icon: "none", + duration: 2000, + }); + this.loadStatus = "loading"; + } + }) + .catch((error) => { + console.error("请求失败", error); + this.loadStatus = "loading"; + }); + }, + //新增草稿箱 + addDraft() { + console.log('草稿'); + let url = '/api/school.newactivity.activity_drafts/add'; + let params = {}; + let hdtime = '' + let bmtime = '' + this.form.cate_ids = this.list.map(item => item.id).join(','); + if (this.times_b_int && this.times_e_int) { + hdtime = this.times_b_int + ' - ' + this.times_e_int; + } + if (this.times_sinb_int && this.times_sine_int) { + bmtime = this.times_sinb_int + ' - ' + this.times_sine_int; + } + // let hdtime = this.times_b_int + ' - ' + this.times_e_int; + // let bmtime = this.times_sinb_int + ' - ' + this.times_sine_int; + params = { + title: this.form.title, + cate_ids: this.form.cate_ids, + content: this.form.content, + // refund_id: 1, + refund_id: this.form.refund_id, + price: this.form.price == '' ? 0 : this.form.price, + stock: this.form.stock, + sign_time: bmtime || '', + time: hdtime || '', + images: this.list1, + longitude: this.form.longitude, + latitude: this.form.latitude, + address: this.form.address, + address_detail: this.form.address_detail, + image: this.qunQrcode + } + console.log('草稿1'); + uni.$u.http.post(url, params).then(res => { + console.log('草稿2'); + if (res.code == 1) { + //置空 + this.fileList1 = []; + this.agree = false; + this.list1 = ''; + this.list = []; + this.price = ''; + this.priceName = '免费'; + this.qunQrcode = ''; + this.form = { + + cate_ids: '', + // 活动分类名字 + cate_idsName: "", + content: '', + refund_id: '', + refund_idn: '', + price: 1, + stock: '', + sign_time: '', + time: '', + images: '', + title: '', + address: '', + latitude: '', + longitude: '', + address_detail: '', //详细位置 + date: '', //活动开始时间 + date1: '', //活动结束时间 + birth: '', //报名开始日期 + birth1: '', //报名结束日期 + } + + uni.showToast({ + title: '添加成功!', + icon: 'none', + duration: 2000, + }); + setTimeout(function() { + // uni.navigateTo({ + // url: "/packageA/my/orderList" + // }) + }, 1000); + } else { + this.$u.toast(res.msg); + // uni.showToast({ + // title: res.msg, + // icon: 'none', + // duration: 2000 + // }); + } + }).catch(error => { + uni.showToast({ + title: error.msg, + icon: 'none', + duration: 2000 + }); + }); + }, + //关闭草稿 + closeDraftShow() { + this.draftShow = false + }, + //显示草稿 + openDraftShow() { + this.draftShow = true + }, + selectDraft(item, index) { + console.log('index:', index, 'item:', item); + this.draftSelectIndex = index + this.selectDradtForm.title = item.title + this.selectDradtForm.content = item.content + this.selectDradtForm.images = item.images + this.selectDradtForm.address = item.address + this.selectDradtForm.address_detail = item.address_detail + this.selectDradtForm.stock = item.stock + this.selectDradtForm.price = item.price + this.selectDradtForm.time = item.time + this.selectDradtForm.sign_time = item.sign_time + this.selectDradtForm.title = item.title + this.selectDradtForm.cate_ids = item.cate_ids + this.selectDradtForm.refund_id = item.refund_id + console.log('5555'); + // this.closeDraftShow(); + }, + selectSureDraft() { + console.log('366666'); + this.form.title = this.selectDradtForm.title + this.form.content = this.selectDradtForm.content + this.form.images = this.selectDradtForm.images + this.form.address = this.selectDradtForm.address + this.form.address_detail = this.selectDradtForm.address_detail + this.form.stock = this.selectDradtForm.stock + this.form.price = this.selectDradtForm.price + this.form.time = this.selectDradtForm.time + this.form.sign_time = this.selectDradtForm.sign_time + this.form.title = this.selectDradtForm.title + this.form.cate_ids = this.selectDradtForm.cate_ids + this.form.refund_id = this.selectDradtForm.refund_id + console.log('99999'); + this.closeDraftShow(); + }, + apply() { if (this.cardStatus == -1) { this.cardShow = true; @@ -1680,7 +1981,8 @@ z-index: 10; span { - width: 642rpx; + // width: 642rpx; + width: 435rpx; height: 80rpx; background: #323232; border-radius: 401rpx 401rpx 401rpx 401rpx; @@ -1692,6 +1994,85 @@ margin: 0 auto; margin-top: 30rpx; } + + .btns { + width: 100%; + display: flex; + justify-content: center; + align-items: center; + margin-top: 30rpx; + + span { + // width: 642rpx; + width: 435rpx; + height: 80rpx; + background: #323232; + border-radius: 401rpx 401rpx 401rpx 401rpx; + font-family: YouSheBiaoTiHei; + font-weight: 400; + font-size: 36rpx; + color: #BBFC5B; + line-height: 32rpx; + margin: 0 auto; + margin-top: 30rpx; + } + + .saveDraft { + width: 235rpx; + height: 70rpx; + position: relative; + top: 10rpx; + border: 2rpx solid #323232; + background-color: #ffffff; + text-align: center; + color: #323232; + font-family: YouSheBiaoTiHei; + font-size: 36rpx; + font-weight: 400; + border-radius: 50rpx; + margin: 0 auto; + display: grid; + align-items: center; + } + + .draftBox { + width: 235rpx; + height: 70rpx; + position: relative; + top: 10rpx; + border: 2rpx solid #323232; + background-color: #ffffff; + text-align: center; + color: #323232; + font-family: YouSheBiaoTiHei; + font-size: 36rpx; + font-weight: 400; + border-radius: 50rpx; + margin: 0 auto; + display: flex; + align-items: center; + justify-content: center; + } + + .submitPublish { + margin-left: 20rpx; + width: 435rpx; + height: 90rpx; + border: 2rpx solid #323232; + background-color: #323232; + color: #BBFC5B; + font-family: YouSheBiaoTiHei; + font-size: 36rpx; + font-weight: 400; + text-align: center; + border-radius: 50rpx; + margin: 0 auto; + display: grid; + align-items: center; + } + + } + } .inputl { @@ -1879,7 +2260,181 @@ } - + + .popup_tkallDraft { + z-index: 100; + background-color: #f7f7f7; + + .popup_tkDraft { + font-size: 36rpx; + margin: 12rpx 0 24rpx 0; + text-align: center; + } + + .popup-content { + height: 900rpx; + overflow-y: auto; + margin-top: 30rpx; + width: 100%; + padding: 0rpx; + background-color: #f7f7f7; + + .invoiceList { + width: 690rpx; + height: auto; + + .invoiceList-item { + display: flex; + justify-content: space-between; + align-items: center; + background-color: #ffffff; + width: 93%; + margin-top: 20rpx; + padding: 20rpx 20rpx; + height: 220rpx; + border-radius: 40rpx 40rpx 40rpx 40rpx; + + // &.active { + // background-color: ##F0FFDF; + // border: 2rpx solid #9CEAA2; + // border-image: linear-gradient(270deg, rgba(251.00000023841858, 246.0000005364418, 109.00000110268593, 1), rgba(156.00000590085983, 234.00000125169754, 162.00000554323196, 1)) 2 2; + // border-radius: 40rpx; + // // clip-path: inset(0px round 16rpx); + // } + + + .item-img { + width: 170rpx; + height: 170rpx; + // margin-left: 40rpx; + + } + + .item-con { + margin-left: 20rpx; + width: 90%; + height: 160rpx; + position: relative; + color: #323232; + + .itenCon-actName { + position: absolute; + top: 0; + font-size: 28rpx; + font-weight: 400; + } + + .itenCon-actCon { + // position: absolute; + // top: 100rpx; + margin-top: 60rpx; + font-size: 28rpx; + font-weight: 400; + } + + .itenCon-actPrice { + position: absolute; + bottom: 0; + font-size: 26rpx; + font-weight: 900; + } + } + + + } + + .invoiceList-itemSelect { + display: flex; + justify-content: space-between; + align-items: center; + background-color: #F0FFDF; + width: 93%; + margin-top: 20rpx; + padding: 20rpx 20rpx; + height: 220rpx; + border-radius: 40rpx 40rpx 40rpx 40rpx; + border: 2rpx solid #9CEAA2; + // border-image: linear-gradient(270deg, rgba(251.00000023841858, 246.0000005364418, 109.00000110268593, 1), rgba(156.00000590085983, 234.00000125169754, 162.00000554323196, 1)) 2 2; + + .item-img { + width: 170rpx; + height: 170rpx; + // margin-left: 40rpx; + + } + + .item-con { + margin-left: 20rpx; + width: 90%; + height: 160rpx; + position: relative; + color: #323232; + display: grid; + + .itenCon-actName { + // position: absolute; + // top: 0; + font-size: 28rpx; + font-weight: 400; + } + + .itenCon-actCon { + // position: absolute; + // top: 100rpx; + // margin-top: 60rpx; + font-size: 28rpx; + font-weight: 400; + } + + .itenCon-actPrice { + // position: absolute; + // bottom: 0; + font-size: 26rpx; + font-weight: 900; + } + } + + + } + } + + + .popup-footer { + width: 100%; + display: flex; + justify-content: center; + align-items: center; + + .headBtn { + width: 90%; + height: 90rpx; + background-color: #323232; + border-radius: 148rpx; + color: #BBFC5B; + font-size: 36rpx; + font-weight: 400; + line-height: 50rpx; + font-family: YouSheBiaoTiHei, YouSheBiaoTiHei; + text-transform: none; + font-style: normal; + display: flex; + justify-content: center; + align-items: center; + text-align: center; + position: fixed; + bottom: 66rpx; + margin-left: 2%; + } + } + + + } + + + } + + + .popup_tkall { // height: 1100rpx; z-index: 100; @@ -1891,10 +2446,42 @@ text-align: center; } + + .popup-content { height: 900rpx; overflow-y: auto; margin-top: 30rpx; + width: 100%; + + .popup-footer { + width: 100%; + display: flex; + justify-content: center; + align-items: center; + + .headBtn { + width: 90%; + height: 90rpx; + background-color: #323232; + border-radius: 148rpx; + color: #BBFC5B; + font-size: 36rpx; + font-weight: 400; + line-height: 50rpx; + font-family: YouSheBiaoTiHei, YouSheBiaoTiHei; + text-transform: none; + font-style: normal; + display: flex; + justify-content: center; + align-items: center; + text-align: center; + position: fixed; + bottom: 66rpx; + margin-left: 2%; + } + } + } .popup-content-item {