编辑活动草稿箱完善

This commit is contained in:
wangzimeng 2025-07-12 08:47:40 +08:00
parent 76a5c7b4c7
commit 25ce5aef43

View File

@ -772,115 +772,115 @@
}).catch(error => {}); }).catch(error => {});
}, },
//稿 //稿
getDraftDetail() { // getDraftDetail() {
console.log('getDraftDetail', this.draftId); // console.log('getDraftDetail', this.draftId);
uni.$u.http.get('/api/school.newactivity.activity_drafts/detail', { // uni.$u.http.get('/api/school.newactivity.activity_drafts/detail', {
params: { // params: {
id: this.draftId, // id: this.draftId,
} // }
}).then(res => { // }).then(res => {
if (res.code == 1) { // if (res.code == 1) {
this.form = res.data.detail // this.form = res.data.detail
this.form.cate_idsName = this.form.classes_cate.join(','); // this.form.cate_idsName = this.form.classes_cate.join(',');
// this.form.cate_ids = res.data.detail.cate_ids; // // this.form.cate_ids = res.data.detail.cate_ids;
console.log('cate_ids', this.form.cate_ids); // console.log('cate_ids', this.form.cate_ids);
const idBqSet = new Set(this.form.cate_ids); // const idBqSet = new Set(this.form.cate_ids);
const bqArray = this.bqList.reduce((acc, obj) => { // const bqArray = this.bqList.reduce((acc, obj) => {
if (this.form.cate_ids.includes(obj.id)) { // if (this.form.cate_ids.includes(obj.id)) {
acc.push(obj); // acc.push(obj);
} // }
return acc; // return acc;
}, []); // }, []);
console.log('bqArray', bqArray); // console.log('bqArray', bqArray);
console.log('cate_idsName', this.form.cate_idsName); // console.log('cate_idsName', this.form.cate_idsName);
this.list = bqArray // this.list = bqArray
console.log('getDraftDetail——list', this.list); // console.log('getDraftDetaillist', this.list);
console.log('this.priceName',this.priceName,this.price); // console.log('this.priceName',this.priceName,this.price);
this.form.content = this.form.content.replace(/<[^>]+>/g, ''); // : "" // this.form.content = this.form.content.replace(/<[^>]+>/g, ''); // : ""
this.value_slide = res.data.detail.join_info.percent; // this.value_slide = res.data.detail.join_info.percent;
this.form.refund_idn = this.form.refund_info.title; // this.form.refund_idn = this.form.refund_info.title;
// fileList // // fileList
this.fileList1 = this.form.images.map(url => ({ // this.fileList1 = this.form.images.map(url => ({
url: url, // url: url,
status: 'success', // status: 'success',
message: '' // message: ''
})); // }));
this.list1 = this.form.images // this.list1 = this.form.images
console.log('fileList1', this.fileList1); // console.log('fileList1', this.fileList1);
if(this.form.image == '' || this.form.image == null){ // if(this.form.image == '' || this.form.image == null){
this.qunQrcode = '' // this.qunQrcode = ''
this.QunQrcode1 = this.qunQrcode // this.QunQrcode1 = this.qunQrcode
console.log('草稿详情',this.QunQrcode1,this.QunQrcode); // console.log('稿',this.QunQrcode1,this.QunQrcode);
}else { // }else {
this.qunQrcode = ({
url: this.form.image || res.data.detail,
status: 'success',
message: ''
})
this.QunQrcode1 = this.qunQrcode
console.log('草稿详情2',this.QunQrcode1,this.QunQrcode);
}
// this.qunQrcode = ({ // this.qunQrcode = ({
// url: this.form.image || res.data.detail, // url: this.form.image || res.data.detail,
// status: 'success', // status: 'success',
// message: '' // message: ''
// }) // })
// this.QunQrcode1 = this.qunQrcode // this.QunQrcode1 = this.qunQrcode
// console.log('稿',this.QunQrcode1,this.QunQrcode); // console.log('稿2',this.QunQrcode1,this.QunQrcode);
// console.log('qunQrcode', this.qunQrcode);
// formatDate(dateStr) {
// if (!dateStr) return '';
// return dateStr.slice(5, 16);
// } // }
// // this.qunQrcode = ({
// // url: this.form.image || res.data.detail,
// // status: 'success',
// // message: ''
// // })
// // this.QunQrcode1 = this.qunQrcode
// // console.log('稿',this.QunQrcode1,this.QunQrcode);
// // console.log('qunQrcode', 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
// this.currents = this.form.refund_id;
// 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('this.form.sign_time',this.form.sign_time);
// if (!this.original_activity_id) {
// this.times_b_int = this.form.start_time_text // this.times_b_int = this.form.start_time_text
// this.times_e_int = this.form.end_time_text // this.times_e_int = this.form.end_time_text
// res.data.detail // this.times_sinb_int = this.form.sign_start_time_text
this.currents = this.form.refund_id; // this.times_sine_int = this.form.sign_end_time_text
const time_start = this.form.start_time_text.slice(5, 16) // } else {
const time_end = this.form.end_time_text.slice(5, 16) // this.times_b_int = ''
this.form.time = time_start + ' - ' + time_end // 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 = ''
// }
const signTime_start = this.form.sign_start_time_text.slice(5, 16) // this.price = res.data.detail.price
const signTime_end = this.form.sign_end_time_text.slice(5, 16) // this.priceDo()
this.form.sign_time = signTime_start + ' - ' + signTime_end // this.mobile = this.detail.user.mobile.slice(0, 3) + 'XXXX' + this.detail.user.mobile.slice(
console.log('this.form.sign_time',this.form.sign_time); // 7);
// } else {
// uni.showToast({
if (!this.original_activity_id) { // title: res.msg,
this.times_b_int = this.form.start_time_text // icon: 'none',
this.times_e_int = this.form.end_time_text // duration: 2000
this.times_sinb_int = this.form.sign_start_time_text // })
this.times_sine_int = this.form.sign_end_time_text // }
} else { // }).catch(error => {});
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.price = res.data.detail.price
this.priceDo()
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() { priceDo() {
var price = this.price; var price = this.price;
console.log('priceDo price:', price); console.log('priceDo price:', price);
@ -1955,14 +1955,28 @@
this.list1 = this.form.images this.list1 = this.form.images
console.log('fileList1', this.fileList1); console.log('fileList1', this.fileList1);
} }
if (this.form.image) { // if (this.form.image) {
// this.qunQrcode = ({
// url: this.form.image,
// status: 'success',
// message: ''
// })
// this.QunQrcode1 = this.qunQrcode
// console.log('qunQrcode222', this.qunQrcode);
// }
if(this.form.image == '' || this.form.image == null){
this.qunQrcode = ''
this.QunQrcode1 = this.qunQrcode
console.log('草稿详情',this.QunQrcode1,this.QunQrcode);
}else {
this.qunQrcode = ({ this.qunQrcode = ({
url: this.form.image, url: this.form.image || res.data.detail,
status: 'success', status: 'success',
message: '' message: ''
}) })
this.QunQrcode1 = this.qunQrcode this.QunQrcode1 = this.qunQrcode
console.log('qunQrcode222', this.qunQrcode); console.log('草稿详情2',this.QunQrcode1,this.QunQrcode);
} }
if (this.form.start_time_text != '' && this.form.end_time_text != '') { if (this.form.start_time_text != '' && this.form.end_time_text != '') {