待审核列表的修改页面
1、 tabbars的发布活动在选择草稿箱中的内容发布 我发布页面的草稿箱列表
This commit is contained in:
parent
8104c5df2f
commit
a251c2fcc1
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="long-data-picker">
|
<view class="long-data-picker">
|
||||||
<picker-view :value="valueDate" indicator-class="select-line" :immediate-change="true"
|
<picker-view indicator-class="select-line" :immediate-change="true" :indicator-style="itemHeight"
|
||||||
:indicator-style="itemHeight" @change="bindDateChange">
|
@change="bindDateChange">
|
||||||
|
|
||||||
<picker-view-column>
|
<picker-view-column>
|
||||||
<view class="long-datetime-item" v-for="(item,index) in dates" :key="index">{{item}}</view>
|
<view class="long-datetime-item" v-for="(item,index) in dates" :key="index">{{item}}</view>
|
||||||
@ -48,11 +48,12 @@
|
|||||||
hours: [],
|
hours: [],
|
||||||
minutes: [],
|
minutes: [],
|
||||||
formatdates: [],
|
formatdates: [],
|
||||||
currentTimePlus8Hours: null, // 新增属性
|
currentTime: new Date(),
|
||||||
valueDate: [0, 0, 0]
|
currentTimePlus8Hours: null // 新增属性
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
//自动计算当前时间
|
//自动计算当前时间
|
||||||
currentdateindex(nv) {
|
currentdateindex(nv) {
|
||||||
@ -85,301 +86,140 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// 获取当前时间
|
this.initDate();
|
||||||
this.currentTime = new Date();
|
|
||||||
// 计算当前时间加8小时
|
|
||||||
this.currentTimePlus8Hours = new Date(this.currentTime);
|
|
||||||
this.currentTimePlus8Hours.setHours(this.currentTime.getHours());
|
|
||||||
|
|
||||||
// 使用传入的默认时间或当前时间加8小时作为基准
|
|
||||||
const baseTime = this.defaultTime || this.currentTimePlus8Hours;
|
|
||||||
this.initDate(baseTime);
|
|
||||||
// // 计算当前时间加8小时
|
|
||||||
// const now = new Date();
|
|
||||||
// now.setHours(now.getHours() + 8);
|
|
||||||
// this.currentTimePlus8Hours = now;
|
|
||||||
// this.initDate();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//初始化时间
|
//初始化时间
|
||||||
initDate(baseTime) {
|
initDate() {
|
||||||
// 设置日期数组
|
let currentdate = moment().format("MMM Do");
|
||||||
this.dates = [];
|
// console.log('');
|
||||||
this.formatdates = [];
|
//设置日期数组
|
||||||
|
this.dates = []
|
||||||
|
//格式化日期数组
|
||||||
|
this.formatdates = []
|
||||||
|
|
||||||
|
|
||||||
// 生成日期选项(从今天开始)
|
|
||||||
for (let i = 0; i <= this.chooseNum; i++) {
|
for (let i = 0; i <= this.chooseNum; i++) {
|
||||||
const date = moment(baseTime).add(i, 'days');
|
const date = moment().add(i, 'days');
|
||||||
this.formatdates.push(date.format("YYYY-MM-DD"));
|
this.formatdates.push(moment().add(i, 'days').format("YYYY-MM-DD"))
|
||||||
this.dates.push(date.format("MMMDo dddd"));
|
this.dates.push(moment().add(i, 'days').format("MMMDo dddd"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置时间选项
|
let h = parseInt(moment().format("HH"))
|
||||||
this.updateTimeColumns(baseTime);
|
this.hours = []
|
||||||
|
for (let i = h; i < 24; i++) {
|
||||||
|
let str = i;
|
||||||
|
if (i < 10) {
|
||||||
|
str = '0' + str;
|
||||||
|
} else {
|
||||||
|
str = '' + str;
|
||||||
|
}
|
||||||
|
this.hours.push(str);
|
||||||
|
}
|
||||||
|
this.minutes = []
|
||||||
|
let m = parseInt(moment().format("mm"))
|
||||||
|
console.log('m', m);
|
||||||
|
for (let i = m; i < 60; i++) {
|
||||||
|
let str = i;
|
||||||
|
if (i < 10) {
|
||||||
|
str = '0' + str;
|
||||||
|
} else {
|
||||||
|
str = '' + str;
|
||||||
|
}
|
||||||
|
this.minutes.push(str);
|
||||||
|
}
|
||||||
|
|
||||||
// 使用$nextTick确保DOM更新后再设置默认值
|
console.log('');
|
||||||
setTimeout(() => {
|
|
||||||
this.setDefaultValueDate();
|
|
||||||
}, 300)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 设置默认选中当前时间+8小时的选项
|
|
||||||
setDefaultValueDate() {
|
|
||||||
const now = new Date();
|
|
||||||
// 计算当前时间+8小时的小时值
|
|
||||||
let targetHourStr = now.getHours() + 8;
|
|
||||||
if (targetHourStr >= 24) {
|
|
||||||
targetHourStr -= 24;
|
|
||||||
}
|
|
||||||
console.log(this.hours);
|
|
||||||
console.log(targetHourStr);
|
|
||||||
|
|
||||||
let targetDayStr = now.getDay();
|
//滚动切换时间
|
||||||
console.log('targetDayStr',targetDayStr);
|
bindDateChange(e) { //有效日期的滚动日期时间方法
|
||||||
if (targetHourStr >= 24) {
|
console.log('滚动切换时间',e.detail.value);
|
||||||
// targetHourStr -= 24;
|
let valueArr = e.detail.value
|
||||||
this.valueDate = [0, 0, 0];
|
this.hours = []
|
||||||
}
|
this.minutes = []
|
||||||
|
|
||||||
// 在hours数组中查找对应的索引
|
|
||||||
const hourIndex = this.hours.findIndex(hour => hour == targetHourStr);
|
|
||||||
console.log(hourIndex);
|
|
||||||
// 设置valueDate,日期和分钟保持默认索引0,只设置小时索引
|
|
||||||
if (hourIndex !== -1) {
|
|
||||||
this.valueDate = [0, hourIndex, 0];
|
|
||||||
} else {
|
|
||||||
// 如果找不到对应小时(比如当前时间+8小时超过了今天的可选范围),保持默认
|
|
||||||
this.valueDate = [0, 0, 0];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
updateTimeColumns(selectedDate) {
|
|
||||||
const isToday = moment(selectedDate).isSame(this.currentTime, 'day');
|
|
||||||
const now = new Date();
|
|
||||||
|
|
||||||
// 如果是今天,小时从当前小时开始
|
|
||||||
if (isToday) {
|
|
||||||
// let currentHour = now.getHours() + 8;
|
|
||||||
let currentHour = now.getHours();
|
|
||||||
let currentMinute = now.getMinutes();
|
|
||||||
|
|
||||||
// 生成小时选项(从当前小时到23)
|
|
||||||
this.hours = [];
|
|
||||||
|
|
||||||
for (let i = currentHour; i < 24; i++) {
|
|
||||||
this.hours.push(i.toString().padStart(2, '0'));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 生成分钟选项(如果是当前小时,分钟从当前分钟开始;否则从0开始)
|
|
||||||
this.minutes = [];
|
|
||||||
for (let i = currentMinute; i < 60; i++) {
|
|
||||||
this.minutes.push(i.toString().padStart(2, '0'));
|
|
||||||
}
|
|
||||||
// let startMinute = (i === currentHour) ? currentMinute : 0;
|
|
||||||
// for (let i = 0; i < 60; i++) {
|
|
||||||
// this.minutes.push(i.toString().padStart(2, '0'));
|
|
||||||
// }
|
|
||||||
} else {
|
|
||||||
// 如果不是今天,小时和分钟都从0开始
|
|
||||||
this.hours = [];
|
|
||||||
|
|
||||||
|
if (valueArr[0] != 0) {
|
||||||
|
console.log('不是今天');
|
||||||
for (let i = 0; i < 24; i++) {
|
for (let i = 0; i < 24; i++) {
|
||||||
this.hours.push(i.toString().padStart(2, '0'));
|
let str = i;
|
||||||
|
if (i < 10) {
|
||||||
|
str = '0' + str;
|
||||||
|
} else {
|
||||||
|
str = '' + str;
|
||||||
|
}
|
||||||
|
this.hours.push(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.minutes = [];
|
|
||||||
for (let i = 0; i < 60; i++) {
|
for (let i = 0; i < 60; i++) {
|
||||||
this.minutes.push(i.toString().padStart(2, '0'));
|
let str = i;
|
||||||
|
if (i < 10) {
|
||||||
|
str = '0' + str;
|
||||||
|
} else {
|
||||||
|
str = '' + str;
|
||||||
|
}
|
||||||
|
this.minutes.push(str);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//是今天
|
||||||
|
console.log('今天',);
|
||||||
|
let h = parseInt(moment().format("HH"))
|
||||||
|
console.log('今天1h',h);
|
||||||
|
this.hours = []
|
||||||
|
for (let i = h; i < 24; i++) {
|
||||||
|
let str = i;
|
||||||
|
if (i < 10) {
|
||||||
|
str = '0' + str;
|
||||||
|
} else {
|
||||||
|
str = '' + str;
|
||||||
|
}
|
||||||
|
this.hours.push(str);
|
||||||
|
}
|
||||||
|
this.minutes = []
|
||||||
|
const current = new Date()
|
||||||
|
const currentHour = moment(current).hours();
|
||||||
|
let m = parseInt(moment().format("mm"))
|
||||||
|
console.log('今天1m',m,currentHour,h);
|
||||||
|
if(valueArr[1] == 0 ){
|
||||||
|
|
||||||
|
for (let i = m; i < 60; i++) {
|
||||||
|
let str = i;
|
||||||
|
if (i < 10) {
|
||||||
|
str = '0' + str;
|
||||||
|
} else {
|
||||||
|
str = '' + str;
|
||||||
|
}
|
||||||
|
this.minutes.push(str);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
for (let i = 0; i < 60; i++) {
|
||||||
|
let str = i;
|
||||||
|
if (i < 10) {
|
||||||
|
str = '0' + str;
|
||||||
|
} else {
|
||||||
|
str = '' + str;
|
||||||
|
}
|
||||||
|
this.minutes.push(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
bindDateChange(e) {
|
}
|
||||||
let valueArr = e.detail.value;
|
|
||||||
const selectedDate = this.formatdates[valueArr[0]];
|
|
||||||
const isToday = moment(selectedDate).isSame(this.currentTime, 'day');
|
|
||||||
|
|
||||||
// 更新时间列
|
|
||||||
this.updateTimeColumns(selectedDate);
|
|
||||||
|
|
||||||
// 获取选择的时间
|
|
||||||
let dateStr = this.formatdates[valueArr[0]];
|
let dateStr = this.formatdates[valueArr[0]];
|
||||||
let hourStr = this.hours[valueArr[1]];
|
let hourStr = this.hours[valueArr[1]];
|
||||||
let minuteStr = this.minutes[valueArr[2]];
|
let minuteStr = this.minutes[valueArr[2]];
|
||||||
|
console.log(dateStr + ' ' + hourStr + ':' + minuteStr)
|
||||||
// 验证时间是否在当前时间之后
|
|
||||||
const selectedTime = new Date(`${dateStr} ${hourStr}:${minuteStr}`);
|
|
||||||
if (selectedTime < this.currentTime) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '不能选择过去的时间',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 验证时间是否在当前时间8小时之内
|
|
||||||
if (selectedTime < this.currentTimePlus8Hours) {
|
|
||||||
// 允许选择,不做任何处理
|
|
||||||
}
|
|
||||||
|
|
||||||
// 触发事件
|
|
||||||
this.$emit("select", {
|
this.$emit("select", {
|
||||||
time: moment(`${dateStr} ${hourStr}:${minuteStr}`).format("YYYY-MM-DD HH:mm")
|
time: moment(dateStr + ' ' + hourStr + ':' + minuteStr).format("YYYY-MM-DD HH:mm")
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// initDate() {
|
|
||||||
// const baseTime = this.defaultTime || new Date();
|
|
||||||
// // 使用 currentTimePlus8Hours 作为基准时间
|
|
||||||
// const currentdate = moment(this.currentTimePlus8Hours).format("MMM Do");
|
|
||||||
|
|
||||||
// // 设置日期数组
|
|
||||||
// this.dates = [];
|
|
||||||
// this.formatdates = [];
|
|
||||||
|
|
||||||
// for (let i = 0; i <= this.chooseNum; i++) {
|
|
||||||
// this.formatdates.push(moment(baseTime).add(i, 'days').format("YYYY-MM-DD"));
|
|
||||||
// this.dates.push(moment(baseTime).add(i, 'days').format("MMMDo dddd"));
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // 设置小时数组(从当前时间加8小时的小时开始)
|
|
||||||
// let h = parseInt(moment(this.currentTimePlus8Hours).format("HH"));
|
|
||||||
// this.hours = [];
|
|
||||||
// for (let i = h; i < 24; i++) {
|
|
||||||
// let str = i;
|
|
||||||
// if (i < 10) {
|
|
||||||
// str = '0' + str;
|
|
||||||
// } else {
|
|
||||||
// str = '' + str;
|
|
||||||
// }
|
|
||||||
// this.hours.push(str);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // 设置分钟数组(从0开始)
|
|
||||||
// this.minutes = [];
|
|
||||||
// let m = parseInt(moment(this.currentTimePlus8Hours).format("mm"));
|
|
||||||
// for (let i = 0; i < 60; i++) {
|
|
||||||
// let str = i;
|
|
||||||
// if (i < 10) {
|
|
||||||
// str = '0' + str;
|
|
||||||
// } else {
|
|
||||||
// str = '' + str;
|
|
||||||
// }
|
|
||||||
// this.minutes.push(str);
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
|
|
||||||
|
|
||||||
// // initDate() {
|
|
||||||
// // let currentdate = moment().format("MMM Do");
|
|
||||||
// // //设置日期数组
|
|
||||||
// // this.dates = []
|
|
||||||
// // //格式化日期数组
|
|
||||||
// // this.formatdates = []
|
|
||||||
|
|
||||||
|
|
||||||
// // for (let i = 0; i <= this.chooseNum; i++) {
|
|
||||||
// // this.formatdates.push(moment().add(i, 'days').format("YYYY-MM-DD"))
|
|
||||||
// // this.dates.push(moment().add(i, 'days').format("MMMDo dddd"))
|
|
||||||
// // }
|
|
||||||
|
|
||||||
// // let h = parseInt(moment().format("HH"))
|
|
||||||
// // this.hours = []
|
|
||||||
// // for (let i = h; i < 24; i++) {
|
|
||||||
// // let str = i;
|
|
||||||
// // if (i < 10) {
|
|
||||||
// // str = '0' + str;
|
|
||||||
// // } else {
|
|
||||||
// // str = '' + str;
|
|
||||||
// // }
|
|
||||||
// // this.hours.push(str);
|
|
||||||
// // }
|
|
||||||
// // this.minutes = []
|
|
||||||
// // let m = parseInt(moment().format("mm"))
|
|
||||||
// // console.log(m);
|
|
||||||
// // for (let i = 0; i < 60; i++) {
|
|
||||||
// // let str = i;
|
|
||||||
// // if (i < 10) {
|
|
||||||
// // str = '0' + str;
|
|
||||||
// // } else {
|
|
||||||
// // str = '' + str;
|
|
||||||
// // }
|
|
||||||
// // this.minutes.push(str);
|
|
||||||
// // }
|
|
||||||
|
|
||||||
// // },
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// //滚动切换时间
|
|
||||||
// bindDateChange(e) { //有效日期的滚动日期时间方法
|
|
||||||
// let valueArr = e.detail.value;
|
|
||||||
// this.hours = [];
|
|
||||||
// this.minutes = [];
|
|
||||||
|
|
||||||
// if (valueArr[0] != 0) {
|
|
||||||
// // 如果不是今天,小时从0开始
|
|
||||||
// for (let i = 0; i < 24; i++) {
|
|
||||||
// let str = i;
|
|
||||||
// if (i < 10) {
|
|
||||||
// str = '0' + str;
|
|
||||||
// } else {
|
|
||||||
// str = '' + str;
|
|
||||||
// }
|
|
||||||
// this.hours.push(str);
|
|
||||||
// }
|
|
||||||
// // 分钟从0开始
|
|
||||||
// for (let i = 0; i < 60; i++) {
|
|
||||||
// let str = i;
|
|
||||||
// if (i < 10) {
|
|
||||||
// str = '0' + str;
|
|
||||||
// } else {
|
|
||||||
// str = '' + str;
|
|
||||||
// }
|
|
||||||
// this.minutes.push(str);
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// // 如果是今天,小时从当前时间加8小时的小时开始
|
|
||||||
// let h = parseInt(moment(this.currentTimePlus8Hours).format("HH"));
|
|
||||||
// this.hours = [];
|
|
||||||
// for (let i = h; i < 24; i++) {
|
|
||||||
// let str = i;
|
|
||||||
// if (i < 10) {
|
|
||||||
// str = '0' + str;
|
|
||||||
// } else {
|
|
||||||
// str = '' + str;
|
|
||||||
// }
|
|
||||||
// this.hours.push(str);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // 分钟从0开始
|
|
||||||
// this.minutes = [];
|
|
||||||
// let m = parseInt(moment(this.currentTimePlus8Hours).format("mm"));
|
|
||||||
// for (let i = 0; i < 60; i++) {
|
|
||||||
// let str = i;
|
|
||||||
// if (i < 10) {
|
|
||||||
// str = '0' + str;
|
|
||||||
// } else {
|
|
||||||
// str = '' + str;
|
|
||||||
// }
|
|
||||||
// this.minutes.push(str);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// let dateStr = this.formatdates[valueArr[0]];
|
|
||||||
// let hourStr = this.hours[valueArr[1]];
|
|
||||||
// let minuteStr = this.minutes[valueArr[2]];
|
|
||||||
// console.log(dateStr + ' ' + hourStr + ':' + minuteStr);
|
|
||||||
// this.$emit("select", {
|
|
||||||
// time: moment(dateStr + ' ' + hourStr + ':' + minuteStr).format("YYYY-MM-DD HH:mm")
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
// },
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -35,10 +35,10 @@
|
|||||||
<view style="width: 100%;">
|
<view style="width: 100%;">
|
||||||
<!-- 草稿箱列表 -->
|
<!-- 草稿箱列表 -->
|
||||||
<!-- <view v-if="draftShow === true"> -->
|
<!-- <view v-if="draftShow === true"> -->
|
||||||
<view v-if="status == 15" style="margin-top: 110rpx;width: 100%;min-height: 100vh;height:auto;">
|
<view v-if="status == 15" style="margin-top: 110rpx;width: 100%;min-height: 100vh;height:auto;margin-bottom: 20rpx;">
|
||||||
<!-- v-for="(item,index) in draftList" :key="index" @click="checkInvoice(item.invoiceCheck,index)"-->
|
<!-- v-for="(item,index) in draftList" :key="index" @click="checkInvoice(item.invoiceCheck,index)"-->
|
||||||
<view class="invoiceList" v-for="(item,index) in draftList" :key="index">
|
<view class="invoiceList" >
|
||||||
<view class="invoiceList-item">
|
<view class="invoiceList-item" v-for="(item,index) in draftList" :key="index">
|
||||||
<view class="invoiceList-itemInfo flex">
|
<view class="invoiceList-itemInfo flex">
|
||||||
<view class="item-img">
|
<view class="item-img">
|
||||||
<image v-if="item.images.length>0"
|
<image v-if="item.images.length>0"
|
||||||
@ -58,13 +58,12 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item-draftBtns">
|
<view class="item-draftBtns">
|
||||||
<view class="part flex justify-center align-items" style="margin-right: 20rpx;"
|
<view class="part1 flex justify-center align-items" style="margin-right: 20rpx;" @click.stop="toDeleteDraft(item.id)">
|
||||||
@click.stop="toEditDraft(item.id)">
|
|
||||||
编辑
|
|
||||||
</view>
|
|
||||||
<view class="part flex justify-center align-items" @click.stop="toDeleteDraft(item.id)">
|
|
||||||
删除
|
删除
|
||||||
</view>
|
</view>
|
||||||
|
<view class="part flex justify-center align-items" @click.stop="toEditDraft(item.id)">
|
||||||
|
编辑
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -81,7 +80,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view :class="['hot', status == 0 || status == -2 ? 'wsh_hot' : '']">
|
<view :class="['hot', status == 0 || status == -2 ? 'wsh_hot' : '']" v-if="status != 15">
|
||||||
<view class="content flex align-items flex-column">
|
<view class="content flex align-items flex-column">
|
||||||
<view class="flex flex-column w-100 bbb" style="position: relative;"
|
<view class="flex flex-column w-100 bbb" style="position: relative;"
|
||||||
v-for="(item, index) in hotList" :key="index">
|
v-for="(item, index) in hotList" :key="index">
|
||||||
@ -199,7 +198,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="part flex justify-center align-items" v-if="item.auth_status == 0"
|
<view class="part flex justify-center align-items" v-if="item.auth_status == 0"
|
||||||
@click.stop="editItem(item.id)"> 修改 </view>
|
@click.stop="editItem(item.id)"> 修改 </view>
|
||||||
<view class="part1 flex justify-center align-items" v-if="item.status == 1"
|
<view class="part1 flex justify-center align-items" v-if="item.auth_status == 1 && item.status == 1"
|
||||||
@click.stop="editItem(item.id)"> 修改 </view>
|
@click.stop="editItem(item.id)"> 修改 </view>
|
||||||
<view class="part1 flex justify-center align-items"
|
<view class="part1 flex justify-center align-items"
|
||||||
v-if="item.status == -1 && item.auth_status == 1"
|
v-if="item.status == -1 && item.auth_status == 1"
|
||||||
@ -511,6 +510,7 @@
|
|||||||
}, 2000)
|
}, 2000)
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
|
console.log('onReachBottom',this.status);
|
||||||
// if (this.list.length < this.count) {
|
// if (this.list.length < this.count) {
|
||||||
// this.page++;
|
// this.page++;
|
||||||
// this.getList(this.selected);
|
// this.getList(this.selected);
|
||||||
@ -518,6 +518,9 @@
|
|||||||
if (this.status == -2) {
|
if (this.status == -2) {
|
||||||
this.page++;
|
this.page++;
|
||||||
this.getAfterList();
|
this.getAfterList();
|
||||||
|
}else if(this.status == 15) {
|
||||||
|
this.page++;
|
||||||
|
this.getDraftList();
|
||||||
} else {
|
} else {
|
||||||
this.page++;
|
this.page++;
|
||||||
this.getHotList(this.selected);
|
this.getHotList(this.selected);
|
||||||
@ -532,24 +535,22 @@
|
|||||||
},
|
},
|
||||||
//待审核+未开始的跳转修改活动
|
//待审核+未开始的跳转修改活动
|
||||||
editItem(id) {
|
editItem(id) {
|
||||||
|
const type = 0;
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/packageB/editAct?id=" + id,
|
url: "/packageB/editAct?id=" + id + '&type=' + type,
|
||||||
});
|
});
|
||||||
// uni.switchTab({
|
// uni.switchTab({
|
||||||
// url:"/pages/center/index?id=" + id,
|
// url:"/pages/center/index?id=" + id,
|
||||||
// })//跳转tabbar页面的
|
// })//跳转tabbar页面的
|
||||||
},
|
},
|
||||||
//待审核+未开始的跳转修改活动
|
//未通过的跳转重发活动
|
||||||
copyItem(id) {
|
copyItem(id) {
|
||||||
const type = 1
|
const type = 1
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/packageB/editAct?original_activity_id=" + id + '&type=' + type,
|
url: "/packageB/editAct?original_activity_id=" + id + '&type=' + type,
|
||||||
});
|
});
|
||||||
// uni.switchTab({
|
|
||||||
// url:"/pages/center/index?id=" + id,
|
|
||||||
// })//跳转tabbar页面的
|
|
||||||
},
|
},
|
||||||
//重发活动
|
//已取消重发活动
|
||||||
copyNewItem(id) {
|
copyNewItem(id) {
|
||||||
const type = 2
|
const type = 2
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@ -897,7 +898,10 @@
|
|||||||
if (res.code == 1) {
|
if (res.code == 1) {
|
||||||
this.count = res.data.count;
|
this.count = res.data.count;
|
||||||
console.log('draft1', res.data.list);
|
console.log('draft1', res.data.list);
|
||||||
this.draftList = res.data.list.data;
|
const list = res.data.list.data || [];
|
||||||
|
this.draftList.push(...list);
|
||||||
|
|
||||||
|
// this.draftList = [...this.draftList,...res.data.list.data];
|
||||||
console.log('draft', this.draftList);
|
console.log('draft', this.draftList);
|
||||||
for (let i = 0; i < this.draftList.length; i++) {
|
for (let i = 0; i < this.draftList.length; i++) {
|
||||||
this.draftList[i].createTime = dayjs.unix(this.draftList[i].createtime).format(
|
this.draftList[i].createTime = dayjs.unix(this.draftList[i].createtime).format(
|
||||||
@ -962,14 +966,15 @@
|
|||||||
headerSelected(status) {
|
headerSelected(status) {
|
||||||
return this.selected === status;
|
return this.selected === status;
|
||||||
},
|
},
|
||||||
|
//待审核和未通过的状态判断和传参
|
||||||
toShlist(val) {
|
toShlist(val) {
|
||||||
|
|
||||||
this.page = 1;
|
this.page = 1;
|
||||||
this.hotList = [];
|
this.hotList = [];
|
||||||
this.auth_status = val
|
this.auth_status = val
|
||||||
console.log('toShlist', val, this.auth_status, this.status);
|
console.log('toShlist', val, this.auth_status, this.status);
|
||||||
this.getHotList(this.status);
|
this.getHotList(this.status);
|
||||||
},
|
},
|
||||||
|
//待售后的状态判断和获取列表
|
||||||
toAfter(val) {
|
toAfter(val) {
|
||||||
this.page = 1;
|
this.page = 1;
|
||||||
this.hotList = [];
|
this.hotList = [];
|
||||||
@ -984,6 +989,7 @@
|
|||||||
.box {
|
.box {
|
||||||
.con-center {
|
.con-center {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
// height: 100vh;
|
||||||
// margin-top: 25rpx;
|
// margin-top: 25rpx;
|
||||||
// overflow: hidden;
|
// overflow: hidden;
|
||||||
background: #f7f7f7;
|
background: #f7f7f7;
|
||||||
@ -1354,36 +1360,39 @@
|
|||||||
.invoiceList {
|
.invoiceList {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
display: grid;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
.invoiceList-item {
|
.invoiceList-item {
|
||||||
display: grid;
|
display: grid;
|
||||||
justify-content: space-around;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
// width: 100%;
|
// width: 100%;
|
||||||
width: 690rpx;
|
width: 670rpx;
|
||||||
margin-top: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
margin-left: 10rpx;
|
// margin-left: 10rpx;
|
||||||
padding: 20rpx 20rpx;
|
padding: 20rpx 30rpx;
|
||||||
height: 220rpx auto;
|
height: 220rpx auto;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
|
||||||
.invoiceList-itemInfo {
|
.invoiceList-itemInfo {
|
||||||
// width: 100%;
|
// width: 100%;
|
||||||
width: 690rpx;
|
width: 670rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
// justify-content: flex-start;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.item-img {
|
.item-img {
|
||||||
width: 170rpx;
|
width: 170rpx;
|
||||||
height: 170rpx;
|
height: 170rpx;
|
||||||
margin-left: 40rpx;
|
// margin-left: 40rpx;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-con {
|
.item-con {
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
width: 90%;
|
width: 100%;
|
||||||
height: 160rpx;
|
height: 160rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
color: #323232;
|
color: #323232;
|
||||||
@ -1423,7 +1432,8 @@
|
|||||||
|
|
||||||
|
|
||||||
.item-draftBtns {
|
.item-draftBtns {
|
||||||
width: 100%;
|
// width: 100%;
|
||||||
|
width: 670rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<view class="row flex align-items" style="margin-top: 25rpx;">
|
<view class="row flex align-items" style="margin-top: 25rpx;">
|
||||||
<span>
|
<span>
|
||||||
<input type="text" maxlength="20" placeholder="填写清晰的活动标题" class="inputl"
|
<input type="text" maxlength="20" placeholder="填写清晰的活动标题" class="inputl"
|
||||||
v-model="form.title" placeholder-class="bttop" />
|
v-model="form.title" placeholder-class="bttop" @input="handleUsernameChange"/>
|
||||||
</span>
|
</span>
|
||||||
<span style="font-size: 24rpx;color: #9C9C9C;">(必填20字内)</span>
|
<span style="font-size: 24rpx;color: #9C9C9C;">(必填20字内)</span>
|
||||||
</view>
|
</view>
|
||||||
@ -22,7 +22,7 @@
|
|||||||
<view class="row flex align-items textarea_fb" style="margin-top: 25rpx;">
|
<view class="row flex align-items textarea_fb" style="margin-top: 25rpx;">
|
||||||
<u--textarea :confirmType="null" v-model="form.content" :maxlength="800" type="text"
|
<u--textarea :confirmType="null" v-model="form.content" :maxlength="800" type="text"
|
||||||
placeholder="描述一下活动的亮点、活动内容、推荐的人群、叫大家一起运动吧~" :height="120"
|
placeholder="描述一下活动的亮点、活动内容、推荐的人群、叫大家一起运动吧~" :height="120"
|
||||||
placeholder-class="bttop"></u--textarea>
|
placeholder-class="bttop" @input="handleUsernameChange2"></u--textarea>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<span class="line-row" style="margin-top: 0;"></span>
|
<span class="line-row" style="margin-top: 0;"></span>
|
||||||
@ -198,8 +198,13 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="btns">
|
<view class="btns">
|
||||||
<view class="saveDraft" v-if="isFormValid" @click="addDraft()">存草稿</view>
|
<view class="saveDraft" v-if="isFormValid" @click="addDraft()">存草稿</view>
|
||||||
<view class="draftBox" v-if="!isFormValid">草稿箱</view>
|
<view class="draftBox" v-if="!isFormValid" @click="openDraftShow">草稿箱
|
||||||
<view class="submitPublish" @click="apply()">确认发布</view>
|
<view
|
||||||
|
style="color: #ff4810;font-family: PingFang SC, PingFang SC;font-weight: 400;font-size: 28rpx;">
|
||||||
|
({{draftCount}})</view>
|
||||||
|
</view>
|
||||||
|
<view class="submitPublish" @click="apply()" v-if="type != 0">确认发布</view>
|
||||||
|
<view class="submitPublish" @click="apply()" v-else>保存</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <span class="flex align-items justify-center" @click="apply()" v-if="agreeAdd == true">确认发布</span>
|
<!-- <span class="flex align-items justify-center" @click="apply()" v-if="agreeAdd == true">确认发布</span>
|
||||||
<span class="flex align-items justify-center" v-if="agreeAdd == false"
|
<span class="flex align-items justify-center" v-if="agreeAdd == false"
|
||||||
@ -337,7 +342,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view style="height: 1px;background-color: #EEEEEE;width: 100%;"></view>
|
<view style="height: 1px;background-color: #EEEEEE;width: 100%;"></view>
|
||||||
<view style="height: 700rpx;">
|
<view style="height: 700rpx;">
|
||||||
<long-date v-if="dateShow" chooseNum="90" @select="datefirm($event, hdIndex)"></long-date>
|
<long-date v-if="dateShow" :default-time="defaultTime" chooseNum="90" @select="datefirm($event, hdIndex)"></long-date>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
|
||||||
@ -354,7 +359,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view style="height: 1px;background-color: #EEEEEE;width: 100%;"></view>
|
<view style="height: 1px;background-color: #EEEEEE;width: 100%;"></view>
|
||||||
<view style="height: 700rpx;">
|
<view style="height: 700rpx;">
|
||||||
<long-date v-if="birthShow" chooseNum="90" @select="birthConfirm($event, bmIndex)"></long-date>
|
<long-date v-if="birthShow" :default-time="defaultTime" chooseNum="90" @select="birthConfirm($event, bmIndex)"></long-date>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
<u-popup :show="priceShow" :round="20" :closeable="false" mode="bottom" @close="priceShow = false;">
|
<u-popup :show="priceShow" :round="20" :closeable="false" mode="bottom" @close="priceShow = false;">
|
||||||
@ -404,7 +409,7 @@
|
|||||||
<view style="font-weight: 400;font-size: 28rpx;margin-left: 220rpx;" @click="selectSureDraft()">
|
<view style="font-weight: 400;font-size: 28rpx;margin-left: 220rpx;" @click="selectSureDraft()">
|
||||||
确定</view>
|
确定</view>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view scroll-y="true" class="popup-content">
|
<scroll-view scroll-y="true" class="popup-content" @scrolltolower="handleDraftMore()">
|
||||||
<view class="invoiceList" v-for="(item,index) in draftList" :key="index">
|
<view class="invoiceList" v-for="(item,index) in draftList" :key="index">
|
||||||
<view :class="(draftSelectIndex === index ) ? 'invoiceList-itemSelect':'invoiceList-item'"
|
<view :class="(draftSelectIndex === index ) ? 'invoiceList-itemSelect':'invoiceList-item'"
|
||||||
@click="selectDraft(item,index)">
|
@click="selectDraft(item,index)">
|
||||||
@ -417,8 +422,8 @@
|
|||||||
mode=""></image>
|
mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="item-con" style="">
|
<view class="item-con" style="">
|
||||||
<view class="itenCon-actName" style="">{{item.title}}</view>
|
<view class="itenCon-actName" style="">{{item.title !='' ? item.title:'描述待补充' }}</view>
|
||||||
<view class="itenCon-actCon" style="">{{item.content}}</view>
|
<view class="itenCon-actCon" style="">{{item.content != '' ? item.content:'快来添加活动内容吧'}}</view>
|
||||||
<view class="itenCon-actPrice" style="">保存时间: {{item.updatetime_text}}</view>
|
<view class="itenCon-actPrice" style="">保存时间: {{item.updatetime_text}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -437,8 +442,7 @@
|
|||||||
justifyContent: 'start',
|
justifyContent: 'start',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
flexColumn: 'column'
|
flexColumn: 'column'
|
||||||
}"
|
}" @close="baoDraftClose" @open="baoDraftOpen" :safeAreaInsetBottom="false" :closeable="false">
|
||||||
@close="baoDraftClose" @open="baoDraftOpen" :safeAreaInsetBottom="false" :closeable="false">
|
|
||||||
<view style="text-align: center;margin-top: 30rpx;">
|
<view style="text-align: center;margin-top: 30rpx;">
|
||||||
<image src="/static/fabu/renzheng.png" style="width: 140rpx;height: 140rpx;"></image>
|
<image src="/static/fabu/renzheng.png" style="width: 140rpx;height: 140rpx;"></image>
|
||||||
</view>
|
</view>
|
||||||
@ -622,12 +626,16 @@
|
|||||||
birth: dayjs().add(4, 'hour').valueOf(), //报名开始日期
|
birth: dayjs().add(4, 'hour').valueOf(), //报名开始日期
|
||||||
birth1: dayjs().add(8, 'hour').valueOf(), //报名结束日期
|
birth1: dayjs().add(8, 'hour').valueOf(), //报名结束日期
|
||||||
},
|
},
|
||||||
draftId:null,
|
draftId: null,
|
||||||
baoDraftShow:false,
|
baoDraftShow: false,
|
||||||
|
draftCount: 0,
|
||||||
|
defaultTime:null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
console.log('options', options.id, options.original_activity_id,options.draftId);
|
//type:0是修改,1是未通过重发,2是已取消重发
|
||||||
|
console.log('type', this.type);
|
||||||
|
console.log('options', options.id, options.original_activity_id, options.draftId);
|
||||||
this.id = options.id
|
this.id = options.id
|
||||||
this.original_activity_id = options.original_activity_id
|
this.original_activity_id = options.original_activity_id
|
||||||
this.type = options.type
|
this.type = options.type
|
||||||
@ -635,27 +643,27 @@
|
|||||||
console.log('this.id', this.id);
|
console.log('this.id', this.id);
|
||||||
console.log('this.original_activity_id ', this.original_activity_id);
|
console.log('this.original_activity_id ', this.original_activity_id);
|
||||||
console.log('this.type', this.type);
|
console.log('this.type', this.type);
|
||||||
if (this.id) {
|
if (this.type == 0) {
|
||||||
|
//修改
|
||||||
this.agree = true
|
this.agree = true
|
||||||
this.isFormValid = true
|
this.isFormValid = false
|
||||||
this.getDetail()
|
this.getDetail()
|
||||||
}
|
} else {
|
||||||
if(this.original_activity_id){
|
//重发
|
||||||
this.agree = true
|
this.agree = true
|
||||||
this.isFormValid = false
|
this.isFormValid = false
|
||||||
this.getDetail()
|
this.getDetail()
|
||||||
}
|
}
|
||||||
// if(options.original_activity_id) {
|
// if(this.original_activity_id){
|
||||||
// this.original_activity_id = options.original_activity_id
|
|
||||||
// }
|
// }
|
||||||
// this.getDetail()
|
|
||||||
uni.hideShareMenu();
|
uni.hideShareMenu();
|
||||||
this.getAgreement()
|
this.getAgreement()
|
||||||
this.getBqList();
|
this.getBqList();
|
||||||
this.getrefund_list();
|
this.getrefund_list();
|
||||||
this.getitembq();
|
this.getitembq();
|
||||||
this.selectItemTuikuan();
|
this.selectItemTuikuan();
|
||||||
this.getDraftList();
|
// this.getDraftList();
|
||||||
//var c=uni.getSystemInfoSync();
|
//var c=uni.getSystemInfoSync();
|
||||||
//844-94-70-100 = 580
|
//844-94-70-100 = 580
|
||||||
//763-47-(100-47)-34-50
|
//763-47-(100-47)-34-50
|
||||||
@ -679,6 +687,23 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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);
|
||||||
|
},
|
||||||
// 获取详情
|
// 获取详情
|
||||||
getDetail() {
|
getDetail() {
|
||||||
// uni.switchTab({
|
// uni.switchTab({
|
||||||
@ -691,8 +716,7 @@
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code == 1) {
|
if (res.code == 1) {
|
||||||
this.form = res.data.detail
|
this.form = res.data.detail
|
||||||
this.price = this.form.price
|
|
||||||
this.priceDo()
|
|
||||||
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;
|
||||||
const idBqSet = new Set(this.form.cate_ids);
|
const idBqSet = new Set(this.form.cate_ids);
|
||||||
@ -712,6 +736,9 @@
|
|||||||
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);
|
||||||
|
this.price = this.form.price
|
||||||
|
this.priceDo()
|
||||||
|
|
||||||
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 => ({
|
||||||
@ -775,7 +802,7 @@
|
|||||||
},
|
},
|
||||||
//草稿箱
|
//草稿箱
|
||||||
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,
|
||||||
@ -783,8 +810,9 @@
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code == 1) {
|
if (res.code == 1) {
|
||||||
this.form = res.data.detail
|
this.form = res.data.detail
|
||||||
this.price = this.form.price
|
this.price = res.data.detail.price
|
||||||
this.priceDo()
|
this.priceDo()
|
||||||
|
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;
|
||||||
const idBqSet = new Set(this.form.cate_ids);
|
const idBqSet = new Set(this.form.cate_ids);
|
||||||
@ -871,8 +899,10 @@
|
|||||||
if (price == '' || price == null || price == undefined || price == 0) {
|
if (price == '' || price == null || price == undefined || price == 0) {
|
||||||
this.priceName = '免费';
|
this.priceName = '免费';
|
||||||
this.priceShow = false;
|
this.priceShow = false;
|
||||||
|
console.log('this.priceName000',this.priceName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
console.log('this.priceName111',this.priceName);
|
||||||
//判断金额不能小于1
|
//判断金额不能小于1
|
||||||
if (price < 1) {
|
if (price < 1) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@ -889,7 +919,7 @@
|
|||||||
this.form.price = this.price;
|
this.form.price = this.price;
|
||||||
this.priceName = price;
|
this.priceName = price;
|
||||||
this.priceShow = false;
|
this.priceShow = false;
|
||||||
|
console.log('this.priceName22',this.priceName);
|
||||||
},
|
},
|
||||||
selectItemTuikuan() {
|
selectItemTuikuan() {
|
||||||
this.currents = 5;
|
this.currents = 5;
|
||||||
@ -1127,10 +1157,25 @@
|
|||||||
this.hdIndex = 1;
|
this.hdIndex = 1;
|
||||||
// this.tempDefaultTime = new Date(new Date().getTime() + 8 * 60 * 60 * 1000);
|
// this.tempDefaultTime = new Date(new Date().getTime() + 8 * 60 * 60 * 1000);
|
||||||
this.dateShow = true;
|
this.dateShow = true;
|
||||||
|
console.log('活动时间');
|
||||||
|
// 计算当前时间加8小时
|
||||||
|
const defaultTime = new Date();
|
||||||
|
// defaultTime.setHours(defaultTime.getHours() + 8);
|
||||||
|
console.log('活动时间defaultTime', defaultTime);
|
||||||
|
this.defaultTime = defaultTime;
|
||||||
|
// this.defaultTime = new Date(this.form.start_time)
|
||||||
},
|
},
|
||||||
birthShowHidden() {
|
birthShowHidden() {
|
||||||
this.bmIndex = 1;
|
this.bmIndex = 1;
|
||||||
this.birthShow = true;
|
this.birthShow = true;
|
||||||
|
console.log('报名时间');
|
||||||
|
// 计算当前时间加8小时
|
||||||
|
const defaultTime = new Date();
|
||||||
|
//defaultTime.setHours(defaultTime.getHours() + 8);
|
||||||
|
console.log('报名时间defaultTime', defaultTime);
|
||||||
|
this.defaultTime = defaultTime;
|
||||||
|
// this.defaultTime = new Date(this.form.sign_start_time)
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 活动开始时间
|
// 活动开始时间
|
||||||
@ -1178,6 +1223,7 @@
|
|||||||
}
|
}
|
||||||
//报名结束时间 < 活动开始时间
|
//报名结束时间 < 活动开始时间
|
||||||
// 如果date1 < date2,返回true
|
// 如果date1 < date2,返回true
|
||||||
|
console.log('this.times_b, this.times_sine_int',this.times_b, this.times_sine_int);
|
||||||
if (this.isDateTimeBefore(this.times_b, this.times_sine_int) && this.times_sine_int != '') {
|
if (this.isDateTimeBefore(this.times_b, this.times_sine_int) && this.times_sine_int != '') {
|
||||||
uni.$u.toast('活动开始时间不能小于报名结束时间');
|
uni.$u.toast('活动开始时间不能小于报名结束时间');
|
||||||
return;
|
return;
|
||||||
@ -1671,11 +1717,12 @@
|
|||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.code == 1) {
|
if (res.code == 1) {
|
||||||
this.count = res.data.count;
|
this.draftCount = res.data.count;
|
||||||
console.log('getDraft', res.data.list);
|
console.log('getDraft', res.data.list);
|
||||||
this.draftList = res.data.list.data;
|
this.draftList = res.data.list.data;
|
||||||
for(let i = 0;i<this.draftList.length;i++) {
|
for (let i = 0; i < this.draftList.length; i++) {
|
||||||
this.draftList[i].createTime = dayjs.unix(this.draftList[i].createtime).format('YYYY-MM-DD HH:mm')
|
this.draftList[i].createTime = dayjs.unix(this.draftList[i].createtime).format(
|
||||||
|
'YYYY-MM-DD HH:mm')
|
||||||
}
|
}
|
||||||
if (this.draftList.length >= res.data.count) {
|
if (this.draftList.length >= res.data.count) {
|
||||||
this.loadStatus = "nomore";
|
this.loadStatus = "nomore";
|
||||||
@ -1697,6 +1744,16 @@
|
|||||||
this.loadStatus = "loading";
|
this.loadStatus = "loading";
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
//草稿箱加载更多
|
||||||
|
handleDraftMore() {
|
||||||
|
console.log('加载22',this.draftCount, this.draftList.length);
|
||||||
|
if(this.draftCount>this.draftList.length) {
|
||||||
|
console.log('加载');
|
||||||
|
this.page++;
|
||||||
|
this.getDraftList();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
//新增草稿箱
|
//新增草稿箱
|
||||||
addDraft() {
|
addDraft() {
|
||||||
console.log('草稿');
|
console.log('草稿');
|
||||||
@ -1738,6 +1795,9 @@
|
|||||||
console.log('params', params.image);
|
console.log('params', params.image);
|
||||||
|
|
||||||
console.log('草稿1');
|
console.log('草稿1');
|
||||||
|
|
||||||
|
if (Array.isArray(params.images)) {
|
||||||
|
console.log('这是一个数组', params.images);
|
||||||
for (let i = 0; i < params.images.length; i++) {
|
for (let i = 0; i < params.images.length; i++) {
|
||||||
if (/^https?:\/\//i.test(params.images[i])) {
|
if (/^https?:\/\//i.test(params.images[i])) {
|
||||||
params.images[i] = params.images[i].replace(/^https?:\/\/[^/]+/, '');
|
params.images[i] = params.images[i].replace(/^https?:\/\/[^/]+/, '');
|
||||||
@ -1748,10 +1808,31 @@
|
|||||||
}
|
}
|
||||||
console.log('params.images排查数组的url的路径', params.images);
|
console.log('params.images排查数组的url的路径', params.images);
|
||||||
params.images = params.images.join(',');
|
params.images = params.images.join(',');
|
||||||
|
} else if (typeof params.images === 'string') {
|
||||||
|
console.log('这是一个字符串', params.images);
|
||||||
|
const imags = params.images
|
||||||
|
params.images = imags.split(',')
|
||||||
|
for (let i = 0; i < params.images.length; i++) {
|
||||||
|
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 {
|
||||||
|
params.images[i] = params.images[i]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log('params.images排查数组的url的路径', params.images);
|
||||||
|
params.images = params.images.join(',');
|
||||||
|
console.log('这是一个字符串2', params.images);
|
||||||
|
} else if (typeof params.images === 'object' && this.myField !== null) {
|
||||||
|
console.log('这是一个对象', params.images);
|
||||||
|
}
|
||||||
|
|
||||||
uni.$u.http.post(url, params).then(res => {
|
uni.$u.http.post(url, params).then(res => {
|
||||||
console.log('草稿2');
|
console.log('草稿2');
|
||||||
if (res.code == 1) {
|
if (res.code == 1) {
|
||||||
|
this.isFormValid = false
|
||||||
this.baoDraftShow = true
|
this.baoDraftShow = true
|
||||||
|
this.getDraftList();
|
||||||
//置空
|
//置空
|
||||||
// this.fileList1 = [];
|
// this.fileList1 = [];
|
||||||
// this.agree = false;
|
// this.agree = false;
|
||||||
@ -1822,38 +1903,107 @@
|
|||||||
},
|
},
|
||||||
selectDraft(item, index) {
|
selectDraft(item, index) {
|
||||||
console.log('index:', index, 'item:', item);
|
console.log('index:', index, 'item:', item);
|
||||||
|
this.draftId = item.id
|
||||||
this.draftSelectIndex = index
|
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() {
|
selectSureDraft() {
|
||||||
console.log('366666');
|
console.log('selectSureDraft', this.draftId);
|
||||||
this.form.title = this.selectDradtForm.title
|
uni.$u.http.get('/api/school.newactivity.activity_drafts/detail', {
|
||||||
this.form.content = this.selectDradtForm.content
|
params: {
|
||||||
this.form.images = this.selectDradtForm.images
|
id: this.draftId,
|
||||||
this.form.address = this.selectDradtForm.address
|
}
|
||||||
this.form.address_detail = this.selectDradtForm.address_detail
|
}).then(res => {
|
||||||
this.form.stock = this.selectDradtForm.stock
|
if (res.code == 1) {
|
||||||
this.form.price = this.selectDradtForm.price
|
this.draftType = 1
|
||||||
this.form.time = this.selectDradtForm.time
|
this.form = res.data.detail
|
||||||
this.form.sign_time = this.selectDradtForm.sign_time
|
this.price = res.data.detail.price
|
||||||
this.form.title = this.selectDradtForm.title
|
this.priceDo()
|
||||||
this.form.cate_ids = this.selectDradtForm.cate_ids
|
console.log('selectSureDraft', this.form.cate_ids);
|
||||||
this.form.refund_id = this.selectDradtForm.refund_id
|
|
||||||
console.log('99999');
|
console.log('cate_ids', this.form.cate_ids);
|
||||||
this.closeDraftShow();
|
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;
|
||||||
|
console.log('refund_idn', this.form.refund_idn);
|
||||||
|
// 转换为 fileList 格式
|
||||||
|
if (this.form.images != '') {
|
||||||
|
this.fileList1 = this.form.images.map(url => ({
|
||||||
|
url: url,
|
||||||
|
status: 'success',
|
||||||
|
message: ''
|
||||||
|
}));
|
||||||
|
this.list1 = this.form.images
|
||||||
|
console.log('fileList1', this.fileList1);
|
||||||
|
}
|
||||||
|
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.start_time_text != '' && this.form.end_time_text != '') {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.form.sign_start_time_text != '' && this.form.sign_end_time_text != '') {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
this.price = this.form.price
|
||||||
|
this.priceDo()
|
||||||
|
|
||||||
|
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 => {});
|
||||||
|
this.closeDraftShow();s
|
||||||
},
|
},
|
||||||
editDraft() {
|
editDraft() {
|
||||||
console.log('草稿');
|
console.log('草稿');
|
||||||
@ -1901,6 +2051,14 @@
|
|||||||
this.price = '';
|
this.price = '';
|
||||||
this.priceName = '免费';
|
this.priceName = '免费';
|
||||||
this.qunQrcode = '';
|
this.qunQrcode = '';
|
||||||
|
this.times_b = '';
|
||||||
|
this.times_sinb = '';
|
||||||
|
this.times_b_int = '';
|
||||||
|
this.times_sinb_int = '';
|
||||||
|
this.times_e = '';
|
||||||
|
this.times_e_int = '';
|
||||||
|
this.times_sine = '';
|
||||||
|
this.times_sine_int ='';
|
||||||
this.form = {
|
this.form = {
|
||||||
|
|
||||||
cate_ids: '',
|
cate_ids: '',
|
||||||
@ -1964,6 +2122,8 @@
|
|||||||
let url = '/api/school.new_activity/add';
|
let url = '/api/school.new_activity/add';
|
||||||
let urlEdit = '/api/school.new_activity/edit'
|
let urlEdit = '/api/school.new_activity/edit'
|
||||||
let params = {};
|
let params = {};
|
||||||
|
console.log('平台分类',this.form.cate_ids,this.list);
|
||||||
|
this.form.cate_ids = this.list.map(item => item.id).join(',');
|
||||||
if (!this.id) {
|
if (!this.id) {
|
||||||
this.form.cate_ids = this.list.map(item => item.id).join(',');
|
this.form.cate_ids = this.list.map(item => item.id).join(',');
|
||||||
}
|
}
|
||||||
@ -2142,6 +2302,14 @@
|
|||||||
this.price = '';
|
this.price = '';
|
||||||
this.priceName = '免费';
|
this.priceName = '免费';
|
||||||
this.qunQrcode = '';
|
this.qunQrcode = '';
|
||||||
|
this.times_b = '';
|
||||||
|
this.times_sinb = '';
|
||||||
|
this.times_b_int = '';
|
||||||
|
this.times_sinb_int = '';
|
||||||
|
this.times_e = '';
|
||||||
|
this.times_e_int = '';
|
||||||
|
this.times_sine = '';
|
||||||
|
this.times_sine_int ='';
|
||||||
this.form = {
|
this.form = {
|
||||||
|
|
||||||
cate_ids: '',
|
cate_ids: '',
|
||||||
@ -2872,23 +3040,15 @@
|
|||||||
|
|
||||||
.invoiceList-item {
|
.invoiceList-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
width: 93%;
|
width: 91%;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
padding: 20rpx 20rpx;
|
padding: 20rpx 30rpx;
|
||||||
height: 220rpx;
|
height: 220rpx;
|
||||||
border-radius: 40rpx 40rpx 40rpx 40rpx;
|
border-radius: 40rpx 40rpx 40rpx 40rpx;
|
||||||
|
border: 2rpx solid #ffffff;
|
||||||
// &.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 {
|
.item-img {
|
||||||
width: 170rpx;
|
width: 170rpx;
|
||||||
@ -2903,33 +3063,29 @@
|
|||||||
height: 160rpx;
|
height: 160rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
color: #323232;
|
color: #323232;
|
||||||
|
display: grid;
|
||||||
|
|
||||||
.itenCon-actName {
|
.itenCon-actName {
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.itenCon-actCon {
|
.itenCon-actCon {
|
||||||
// position: absolute;
|
|
||||||
// top: 100rpx;
|
|
||||||
width: 400rpx;
|
width: 400rpx;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
/* 禁止换行 */
|
/* 禁止换行 */
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
/* 隐藏超出部分 */
|
/* 隐藏超出部分 */
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
margin-top: 60rpx;
|
// margin-top: 60rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
|
|
||||||
.itenCon-actPrice {
|
.itenCon-actPrice {
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: 900;
|
font-weight: 400;
|
||||||
|
color: #9c9c9c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2938,12 +3094,12 @@
|
|||||||
|
|
||||||
.invoiceList-itemSelect {
|
.invoiceList-itemSelect {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: #F0FFDF;
|
background-color: #F0FFDF;
|
||||||
width: 93%;
|
width: 91%;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
padding: 20rpx 20rpx;
|
padding: 20rpx 30rpx;
|
||||||
height: 220rpx;
|
height: 220rpx;
|
||||||
border-radius: 40rpx 40rpx 40rpx 40rpx;
|
border-radius: 40rpx 40rpx 40rpx 40rpx;
|
||||||
border: 2rpx solid #9CEAA2;
|
border: 2rpx solid #9CEAA2;
|
||||||
@ -2958,7 +3114,7 @@
|
|||||||
|
|
||||||
.item-con {
|
.item-con {
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
width: 70%;
|
width: 90%;
|
||||||
height: 160rpx;
|
height: 160rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
color: #323232;
|
color: #323232;
|
||||||
@ -2986,10 +3142,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.itenCon-actPrice {
|
.itenCon-actPrice {
|
||||||
// position: absolute;
|
color: #9c9c9c;
|
||||||
// bottom: 0;
|
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: 900;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1683,6 +1683,14 @@
|
|||||||
this.price = '';
|
this.price = '';
|
||||||
this.priceName = '免费';
|
this.priceName = '免费';
|
||||||
this.qunQrcode = '';
|
this.qunQrcode = '';
|
||||||
|
this.times_b = '';
|
||||||
|
this.times_sinb = '';
|
||||||
|
this.times_b_int = '';
|
||||||
|
this.times_sinb_int = '';
|
||||||
|
this.times_e = '';
|
||||||
|
this.times_e_int = '';
|
||||||
|
this.times_sine = '';
|
||||||
|
this.times_sine_int ='';
|
||||||
this.form = {
|
this.form = {
|
||||||
|
|
||||||
cate_ids: '',
|
cate_ids: '',
|
||||||
@ -1904,6 +1912,14 @@
|
|||||||
this.price = '';
|
this.price = '';
|
||||||
this.priceName = '免费';
|
this.priceName = '免费';
|
||||||
this.qunQrcode = '';
|
this.qunQrcode = '';
|
||||||
|
this.times_b = '';
|
||||||
|
this.times_sinb = '';
|
||||||
|
this.times_b_int = '';
|
||||||
|
this.times_sinb_int = '';
|
||||||
|
this.times_e = '';
|
||||||
|
this.times_e_int = '';
|
||||||
|
this.times_sine = '';
|
||||||
|
this.times_sine_int ='';
|
||||||
this.form = {
|
this.form = {
|
||||||
|
|
||||||
cate_ids: '',
|
cate_ids: '',
|
||||||
|
@ -208,7 +208,7 @@
|
|||||||
<view class="draftBox" v-if="!isFormValid" @click="openDraftShow">草稿箱
|
<view class="draftBox" v-if="!isFormValid" @click="openDraftShow">草稿箱
|
||||||
<view
|
<view
|
||||||
style="color: #ff4810;font-family: PingFang SC, PingFang SC;font-weight: 400;font-size: 28rpx;">
|
style="color: #ff4810;font-family: PingFang SC, PingFang SC;font-weight: 400;font-size: 28rpx;">
|
||||||
({{draftList.length}})</view>
|
({{draftCount}})</view>
|
||||||
</view>
|
</view>
|
||||||
<span class="flex align-items justify-center" @click="apply()" v-if="agreeAdd == true">确认发布</span>
|
<span class="flex align-items justify-center" @click="apply()" v-if="agreeAdd == true">确认发布</span>
|
||||||
<span class="flex align-items justify-center" v-if="agreeAdd == false"
|
<span class="flex align-items justify-center" v-if="agreeAdd == false"
|
||||||
@ -348,7 +348,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view style="height: 1px;background-color: #EEEEEE;width: 100%;"></view>
|
<view style="height: 1px;background-color: #EEEEEE;width: 100%;"></view>
|
||||||
<view style="height: 700rpx;">
|
<view style="height: 700rpx;">
|
||||||
<long-date v-if="dateShow" chooseNum="90"
|
<long-date v-if="dateShow" :default-time="defaultTime" chooseNum="90"
|
||||||
@select="datefirm($event, hdIndex)"></long-date>
|
@select="datefirm($event, hdIndex)"></long-date>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
@ -366,7 +366,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view style="height: 1px;background-color: #EEEEEE;width: 100%;"></view>
|
<view style="height: 1px;background-color: #EEEEEE;width: 100%;"></view>
|
||||||
<view style="height: 700rpx;">
|
<view style="height: 700rpx;">
|
||||||
<long-date v-if="birthShow" chooseNum="90"
|
<long-date v-if="birthShow" :default-time="defaultTime" chooseNum="90"
|
||||||
@select="birthConfirm($event, bmIndex)"></long-date>
|
@select="birthConfirm($event, bmIndex)"></long-date>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
@ -412,12 +412,13 @@
|
|||||||
:custom-style="popupStyletkDraft">
|
:custom-style="popupStyletkDraft">
|
||||||
<view class="popup_tkallDraft">
|
<view class="popup_tkallDraft">
|
||||||
<view class="popup_tkDraft" style="display: flex;justify-content: center;">
|
<view class="popup_tkDraft" style="display: flex;justify-content: center;">
|
||||||
<view style="font-weight: 400;font-size: 28rpx;margin-right: 220rpx;" @click="closeDraftShow()">取消</view>
|
<view style="font-weight: 400;font-size: 28rpx;margin-right: 220rpx;" @click="closeDraftShow()">
|
||||||
|
取消</view>
|
||||||
<view style="font-weight: 800;">草稿箱</view>
|
<view style="font-weight: 800;">草稿箱</view>
|
||||||
<view style="font-weight: 400;font-size: 28rpx;margin-left: 220rpx;" @click="selectSureDraft()">
|
<view style="font-weight: 400;font-size: 28rpx;margin-left: 220rpx;" @click="selectSureDraft()">
|
||||||
确定</view>
|
确定</view>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view scroll-y="true" class="popup-content">
|
<scroll-view scroll-y="true" class="popup-content" @scrolltolower="handleDraftMore()">
|
||||||
<view class="invoiceList" v-for="(item,index) in draftList" :key="index">
|
<view class="invoiceList" v-for="(item,index) in draftList" :key="index">
|
||||||
<view :class="(draftSelectIndex === index ) ? 'invoiceList-itemSelect':'invoiceList-item'"
|
<view :class="(draftSelectIndex === index ) ? 'invoiceList-itemSelect':'invoiceList-item'"
|
||||||
@click="selectDraft(item,index)">
|
@click="selectDraft(item,index)">
|
||||||
@ -460,8 +461,7 @@
|
|||||||
justifyContent: 'start',
|
justifyContent: 'start',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
flexColumn: 'column'
|
flexColumn: 'column'
|
||||||
}"
|
}" @close="baoDraftClose" @open="baoDraftOpen" :safeAreaInsetBottom="false" :closeable="false">
|
||||||
@close="baoDraftClose" @open="baoDraftOpen" :safeAreaInsetBottom="false" :closeable="false">
|
|
||||||
<view style="text-align: center;margin-top: 30rpx;">
|
<view style="text-align: center;margin-top: 30rpx;">
|
||||||
<image src="/static/fabu/renzheng.png" style="width: 140rpx;height: 140rpx;"></image>
|
<image src="/static/fabu/renzheng.png" style="width: 140rpx;height: 140rpx;"></image>
|
||||||
</view>
|
</view>
|
||||||
@ -642,6 +642,9 @@
|
|||||||
defaultTime: null,
|
defaultTime: null,
|
||||||
draftType: 0,
|
draftType: 0,
|
||||||
baoDraftShow: false,
|
baoDraftShow: false,
|
||||||
|
draftCount: 0,
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
@ -654,7 +657,7 @@
|
|||||||
this.getrefund_list();
|
this.getrefund_list();
|
||||||
this.getitembq();
|
this.getitembq();
|
||||||
this.selectItemTuikuan();
|
this.selectItemTuikuan();
|
||||||
this.getDraftList('15');
|
// this.getDraftList('15');
|
||||||
//var c=uni.getSystemInfoSync();
|
//var c=uni.getSystemInfoSync();
|
||||||
//844-94-70-100 = 580
|
//844-94-70-100 = 580
|
||||||
//763-47-(100-47)-34-50
|
//763-47-(100-47)-34-50
|
||||||
@ -684,6 +687,21 @@
|
|||||||
this.isFormValid = this.form.title.length > 0 || newVal.length > 0;
|
this.isFormValid = this.form.title.length > 0 || newVal.length > 0;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
console.log('onReachBottom');
|
||||||
|
// this.page++;
|
||||||
|
// this.getDraftList();
|
||||||
|
// if (this.status == -2) {
|
||||||
|
// this.page++;
|
||||||
|
// this.getAfterList();
|
||||||
|
// }else if(this.status == 15) {
|
||||||
|
// this.page++;
|
||||||
|
// this.getDraftList();
|
||||||
|
// } else {
|
||||||
|
// this.page++;
|
||||||
|
// this.getHotList(this.selected);
|
||||||
|
// }
|
||||||
|
},
|
||||||
filters: {
|
filters: {
|
||||||
formatTimestamp(value) {
|
formatTimestamp(value) {
|
||||||
if (!value) return '';
|
if (!value) return '';
|
||||||
@ -936,9 +954,9 @@
|
|||||||
this.dateShow = true;
|
this.dateShow = true;
|
||||||
// 计算当前时间加8小时
|
// 计算当前时间加8小时
|
||||||
const defaultTime = new Date();
|
const defaultTime = new Date();
|
||||||
//defaultTime.setHours(defaultTime.getHours() + 8);
|
// defaultTime.setHours(defaultTime.getHours() + 8);
|
||||||
console.log('活动时间defaultTime',defaultTime);
|
console.log('活动时间defaultTime', defaultTime);
|
||||||
this.defaultTime = defaultTime;
|
// this.defaultTime = defaultTime;
|
||||||
},
|
},
|
||||||
birthShowHidden() {
|
birthShowHidden() {
|
||||||
console.log('报名时间');
|
console.log('报名时间');
|
||||||
@ -947,7 +965,7 @@
|
|||||||
// 计算当前时间加8小时
|
// 计算当前时间加8小时
|
||||||
const defaultTime = new Date();
|
const defaultTime = new Date();
|
||||||
//defaultTime.setHours(defaultTime.getHours() + 8);
|
//defaultTime.setHours(defaultTime.getHours() + 8);
|
||||||
console.log('报名时间defaultTime',defaultTime);
|
console.log('报名时间defaultTime', defaultTime);
|
||||||
this.defaultTime = defaultTime;
|
this.defaultTime = defaultTime;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -978,7 +996,7 @@
|
|||||||
const currentTime = dayjs().format('YYYY-MM-DD HH');
|
const currentTime = dayjs().format('YYYY-MM-DD HH');
|
||||||
// const currentTime = this.getCurrentTimePlus8Hours();
|
// const currentTime = this.getCurrentTimePlus8Hours();
|
||||||
var b = currentTime + ':00';
|
var b = currentTime + ':00';
|
||||||
console.log('b', b);
|
console.log('b', b, this.times_b);
|
||||||
if (this.times_b == '' || this.times_b == null) {
|
if (this.times_b == '' || this.times_b == null) {
|
||||||
console.log('判断是否this.times_b小于当前时间 用的是年月日而不是时间戳');
|
console.log('判断是否this.times_b小于当前时间 用的是年月日而不是时间戳');
|
||||||
//判断是否this.times_b小于当前时间 用的是年月日而不是时间戳
|
//判断是否this.times_b小于当前时间 用的是年月日而不是时间戳
|
||||||
@ -1241,24 +1259,19 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
//轮播图处的相关内容
|
||||||
// 回调参数为包含columnIndex、value、values
|
// 回调参数为包含columnIndex、value、values
|
||||||
confirm(e) {
|
confirm(e) {
|
||||||
console.log('confirm', e.value)
|
console.log('回调参数confirm', e.value)
|
||||||
this.form.cut = e.value[0]
|
this.form.cut = e.value[0]
|
||||||
this.fileList1 = [],
|
this.fileList1 = [],
|
||||||
this.list1 = '',
|
this.list1 = '',
|
||||||
this.name = ''
|
this.name = ''
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
oversize(e) {
|
oversize(e) {
|
||||||
this.$u.toast("请传1MB以内大小的图片!");
|
this.$u.toast("请传1MB以内大小的图片!");
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 删除图片
|
// 删除图片
|
||||||
deletePic(event) {
|
deletePic(event) {
|
||||||
const {
|
const {
|
||||||
@ -1266,6 +1279,8 @@
|
|||||||
index
|
index
|
||||||
} = event;
|
} = event;
|
||||||
|
|
||||||
|
console.log('轮播图删除照片', event, this[`fileList${name}`], this.fileList1);
|
||||||
|
|
||||||
if (index >= 0 && index < this[`fileList${name}`].length) {
|
if (index >= 0 && index < this[`fileList${name}`].length) {
|
||||||
this[`fileList${name}`].splice(index, 1);
|
this[`fileList${name}`].splice(index, 1);
|
||||||
|
|
||||||
@ -1275,9 +1290,10 @@
|
|||||||
// this.list1 = this.fileList1.length > 0 ? this.fileList1[0].url : '';
|
// this.list1 = this.fileList1.length > 0 ? this.fileList1[0].url : '';
|
||||||
|
|
||||||
this.list1 = this.fileList1.map(item => item.url).join(',');
|
this.list1 = this.fileList1.map(item => item.url).join(',');
|
||||||
console.log('Updated list1:', this.list1);
|
console.log('单张-Updated list1:', this.list1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('非单张-Updated list1:', this.list1);
|
||||||
|
|
||||||
// 确保对应的 list 字段是一个数组
|
// 确保对应的 list 字段是一个数组
|
||||||
let list = this[`list${name}`];
|
let list = this[`list${name}`];
|
||||||
@ -1287,12 +1303,14 @@
|
|||||||
list.splice(index, 1);
|
list.splice(index, 1);
|
||||||
console.log(`Updated list${name}:`, list);
|
console.log(`Updated list${name}:`, list);
|
||||||
}
|
}
|
||||||
|
console.log('list', list);
|
||||||
} else {
|
} else {
|
||||||
console.error('Invalid index');
|
console.error('Invalid index');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 新增图片
|
// 新增图片
|
||||||
async afterRead(event) {
|
async afterRead(event) {
|
||||||
|
console.log('新增-afterRead的轮播图');
|
||||||
let lists = [].concat(event.file);
|
let lists = [].concat(event.file);
|
||||||
let fileListLen = this[`fileList${event.name}`].length;
|
let fileListLen = this[`fileList${event.name}`].length;
|
||||||
let categoryMap = [{
|
let categoryMap = [{
|
||||||
@ -1344,6 +1362,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
uploadFilePromise(url, category) {
|
uploadFilePromise(url, category) {
|
||||||
|
console.log('上传-uploadFilePromise');
|
||||||
console.log('category', category)
|
console.log('category', category)
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let a = uni.uploadFile({
|
let a = uni.uploadFile({
|
||||||
@ -1379,6 +1398,8 @@
|
|||||||
reject(err);
|
reject(err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log('');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 查询状态
|
// 查询状态
|
||||||
@ -1423,293 +1444,12 @@
|
|||||||
return telRegex.test(tel);
|
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 < this.draftList.length; i++) {
|
|
||||||
this.draftList[i].createTime = dayjs.unix(this.draftList[i].createtime).format(
|
|
||||||
'YYYY-MM-DD HH:mm')
|
|
||||||
}
|
|
||||||
if (this.draftList.length >= 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');
|
|
||||||
// if (this.isFormValid) {
|
|
||||||
|
|
||||||
// }
|
|
||||||
if(typeof params.image === 'object' && params.image == null ){
|
|
||||||
console.log('typeof', params.image);
|
|
||||||
params.image =''
|
|
||||||
}
|
|
||||||
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: 0,
|
|
||||||
stock: '',
|
|
||||||
sign_time: '',
|
|
||||||
time: '',
|
|
||||||
images: '',
|
|
||||||
title: '',
|
|
||||||
address: '',
|
|
||||||
latitude: '',
|
|
||||||
longitude: '',
|
|
||||||
address_detail: '', //详细位置
|
|
||||||
date: '', //活动开始时间
|
|
||||||
date1: '', //活动结束时间
|
|
||||||
birth: '', //报名开始日期
|
|
||||||
birth1: '', //报名结束日期
|
|
||||||
}
|
|
||||||
this.baoDraftShow = true
|
|
||||||
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '存草稿成功!',
|
|
||||||
// icon: 'none',
|
|
||||||
// duration: 2000,
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
this.isFormValid = false
|
|
||||||
this.getDraftList();
|
|
||||||
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
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//保存草稿成功弹框
|
|
||||||
baoDraftOpen() {
|
|
||||||
this.baoDraftShow = true
|
|
||||||
},
|
|
||||||
//关闭草稿
|
|
||||||
closeDraftShow() {
|
|
||||||
this.draftShow = false
|
|
||||||
},
|
|
||||||
//显示草稿
|
|
||||||
openDraftShow() {
|
|
||||||
this.draftShow = true
|
|
||||||
},
|
|
||||||
selectDraft(item, index) {
|
|
||||||
console.log('index:', index, 'item:', item);
|
|
||||||
this.draftId = item.id
|
|
||||||
this.draftSelectIndex = index
|
|
||||||
|
|
||||||
},
|
|
||||||
selectSureDraft() {
|
|
||||||
console.log('selectSureDraft', this.draftId);
|
|
||||||
uni.$u.http.get('/api/school.newactivity.activity_drafts/detail', {
|
|
||||||
params: {
|
|
||||||
id: this.draftId,
|
|
||||||
}
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code == 1) {
|
|
||||||
this.draftType = 1
|
|
||||||
this.form = res.data.detail
|
|
||||||
console.log('selectSureDraft', this.form.cate_ids);
|
|
||||||
|
|
||||||
console.log('cate_ids', this.form.cate_ids);
|
|
||||||
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;
|
|
||||||
console.log('refund_idn', this.form.refund_idn);
|
|
||||||
// 转换为 fileList 格式
|
|
||||||
if (this.form.images != '') {
|
|
||||||
this.fileList1 = this.form.images.map(url => ({
|
|
||||||
url: url,
|
|
||||||
status: 'success',
|
|
||||||
message: ''
|
|
||||||
}));
|
|
||||||
this.list1 = this.form.images
|
|
||||||
console.log('fileList1', this.fileList1);
|
|
||||||
}
|
|
||||||
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.start_time_text != '' && this.form.end_time_text != '') {
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.form.sign_start_time_text != '' && this.form.sign_end_time_text != '') {
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
this.price = this.form.price
|
|
||||||
this.priceDo()
|
|
||||||
|
|
||||||
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 => {});
|
|
||||||
// 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.form);
|
|
||||||
// this.price = this.form.price
|
|
||||||
// // this.form.refund_idn = this.form.refund_info.title;
|
|
||||||
// this.priceDo()
|
|
||||||
this.closeDraftShow();
|
|
||||||
},
|
|
||||||
|
|
||||||
apply() {
|
apply() {
|
||||||
if (this.cardStatus == -1) {
|
if (this.cardStatus == -1) {
|
||||||
this.cardShow = true;
|
this.cardShow = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
console.log('apply agreeShow:', this.agreeShow);
|
||||||
let url = '/api/school.new_activity/add';
|
let url = '/api/school.new_activity/add';
|
||||||
let params = {};
|
let params = {};
|
||||||
this.form.cate_ids = this.list.map(item => item.id).join(',');
|
this.form.cate_ids = this.list.map(item => item.id).join(',');
|
||||||
@ -1850,8 +1590,10 @@
|
|||||||
params.image = params.image.replace(/^https?:\/\/[^/]+/, '');
|
params.image = params.image.replace(/^https?:\/\/[^/]+/, '');
|
||||||
console.log('params', params.image);
|
console.log('params', params.image);
|
||||||
|
|
||||||
console.log('草稿1');
|
console.log('草稿1', this.draftType, params.images);
|
||||||
if(this.draftType == 1) {
|
// if (this.draftType == 1) {
|
||||||
|
if (Array.isArray(params.images)) {
|
||||||
|
console.log('这是一个数组', params.images);
|
||||||
for (let i = 0; i < params.images.length; i++) {
|
for (let i = 0; i < params.images.length; i++) {
|
||||||
if (/^https?:\/\//i.test(params.images[i])) {
|
if (/^https?:\/\//i.test(params.images[i])) {
|
||||||
params.images[i] = params.images[i].replace(/^https?:\/\/[^/]+/, '');
|
params.images[i] = params.images[i].replace(/^https?:\/\/[^/]+/, '');
|
||||||
@ -1862,7 +1604,26 @@
|
|||||||
}
|
}
|
||||||
console.log('params.images排查数组的url的路径', params.images);
|
console.log('params.images排查数组的url的路径', params.images);
|
||||||
params.images = params.images.join(',');
|
params.images = params.images.join(',');
|
||||||
|
} else if (typeof params.images === 'string') {
|
||||||
|
console.log('这是一个字符串', params.images);
|
||||||
|
const imags = params.images
|
||||||
|
params.images = imags.split(',')
|
||||||
|
for (let i = 0; i < params.images.length; i++) {
|
||||||
|
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 {
|
||||||
|
params.images[i] = params.images[i]
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
console.log('params.images排查数组的url的路径', params.images);
|
||||||
|
params.images = params.images.join(',');
|
||||||
|
console.log('这是一个字符串2', params.images);
|
||||||
|
} else if (typeof params.images === 'object' && this.myField !== null) {
|
||||||
|
console.log('这是一个对象', params.images);
|
||||||
|
}
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
uni.$u.http.post(url, params).then(res => {
|
uni.$u.http.post(url, params).then(res => {
|
||||||
if (res.code == 1) {
|
if (res.code == 1) {
|
||||||
@ -1874,6 +1635,19 @@
|
|||||||
this.price = '';
|
this.price = '';
|
||||||
this.priceName = '免费';
|
this.priceName = '免费';
|
||||||
this.qunQrcode = '';
|
this.qunQrcode = '';
|
||||||
|
this.draftSelectIndex = '';
|
||||||
|
this.current = '';
|
||||||
|
this.currents = -1;
|
||||||
|
// this.agreeShow = false
|
||||||
|
this.agreeAdd = false;
|
||||||
|
this.times_b = '';
|
||||||
|
this.times_sinb = '';
|
||||||
|
this.times_b_int = '';
|
||||||
|
this.times_sinb_int = '';
|
||||||
|
this.times_e = '';
|
||||||
|
this.times_e_int = '';
|
||||||
|
this.times_sine = '';
|
||||||
|
this.times_sine_int ='';
|
||||||
this.form = {
|
this.form = {
|
||||||
|
|
||||||
cate_ids: '',
|
cate_ids: '',
|
||||||
@ -1898,6 +1672,8 @@
|
|||||||
birth1: '', //报名结束日期
|
birth1: '', //报名结束日期
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('置空的form', );
|
||||||
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '发布成功!',
|
title: '发布成功!',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
@ -1924,7 +1700,329 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
//草稿箱列表
|
||||||
|
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.draftCount = res.data.count;
|
||||||
|
console.log('getDraft', res.data.list);
|
||||||
|
const list = res.data.list.data || [];
|
||||||
|
this.draftList.push(...list);
|
||||||
|
// this.draftList = res.data.list.data;
|
||||||
|
for (let i = 0; i < this.draftList.length; i++) {
|
||||||
|
this.draftList[i].createTime = dayjs.unix(this.draftList[i].createtime).format(
|
||||||
|
'YYYY-MM-DD HH:mm')
|
||||||
}
|
}
|
||||||
|
if (this.draftList.length >= 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";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//草稿箱加载更多
|
||||||
|
handleDraftMore() {
|
||||||
|
console.log('加载22', this.draftCount, this.draftList.length);
|
||||||
|
if (this.draftCount > this.draftList.length) {
|
||||||
|
console.log('加载');
|
||||||
|
this.page++;
|
||||||
|
this.getDraftList();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
//新增草稿箱
|
||||||
|
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');
|
||||||
|
if (Array.isArray(params.images)) {
|
||||||
|
console.log('这是一个数组', params.images);
|
||||||
|
for (let i = 0; i < params.images.length; i++) {
|
||||||
|
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 {
|
||||||
|
params.images[i] = params.images[i]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log('params.images排查数组的url的路径', params.images);
|
||||||
|
params.images = params.images.join(',');
|
||||||
|
} else if (typeof params.images === 'string') {
|
||||||
|
console.log('这是一个字符串', params.images);
|
||||||
|
const imags = params.images
|
||||||
|
params.images = imags.split(',')
|
||||||
|
for (let i = 0; i < params.images.length; i++) {
|
||||||
|
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 {
|
||||||
|
params.images[i] = params.images[i]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log('params.images排查数组的url的路径', params.images);
|
||||||
|
params.images = params.images.join(',');
|
||||||
|
console.log('这是一个字符串2', params.images);
|
||||||
|
} else if (typeof params.images === 'object' && this.myField !== null) {
|
||||||
|
console.log('这是一个对象', params.images);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof params.image === 'object' && params.image == null) {
|
||||||
|
console.log('typeof', params.image);
|
||||||
|
params.image = params.image.url;
|
||||||
|
}
|
||||||
|
// 转换为相对路径
|
||||||
|
params.image = params.image.replace(/^https?:\/\/[^/]+/, '');
|
||||||
|
console.log('params', params.image);
|
||||||
|
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.draftSelectIndex = '';
|
||||||
|
this.current = '';
|
||||||
|
this.currents = -1;
|
||||||
|
// this.agreeShow = false
|
||||||
|
this.agreeAdd = false
|
||||||
|
this.times_b = '';
|
||||||
|
this.times_sinb = '';
|
||||||
|
this.times_b_int = '';
|
||||||
|
this.times_sinb_int = '';
|
||||||
|
this.times_e = '';
|
||||||
|
this.times_e_int = '';
|
||||||
|
this.times_sine = '';
|
||||||
|
this.times_sine_int ='';
|
||||||
|
this.form = {
|
||||||
|
cate_ids: '',
|
||||||
|
// 活动分类名字
|
||||||
|
cate_idsName: "",
|
||||||
|
content: '',
|
||||||
|
refund_id: '',
|
||||||
|
refund_idn: '',
|
||||||
|
price: 0,
|
||||||
|
stock: '',
|
||||||
|
sign_time: '',
|
||||||
|
time: '',
|
||||||
|
images: '',
|
||||||
|
title: '',
|
||||||
|
address: '',
|
||||||
|
latitude: '',
|
||||||
|
longitude: '',
|
||||||
|
address_detail: '', //详细位置
|
||||||
|
date: '', //活动开始时间
|
||||||
|
date1: '', //活动结束时间
|
||||||
|
birth: '', //报名开始日期
|
||||||
|
birth1: '', //报名结束日期
|
||||||
|
}
|
||||||
|
console.log('新增draft:', this.form.cate_idsName);
|
||||||
|
this.baoDraftShow = true
|
||||||
|
|
||||||
|
// uni.showToast({
|
||||||
|
// title: '存草稿成功!',
|
||||||
|
// icon: 'none',
|
||||||
|
// duration: 2000,
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
this.isFormValid = false
|
||||||
|
this.getDraftList();
|
||||||
|
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
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//保存草稿成功弹框
|
||||||
|
baoDraftOpen() {
|
||||||
|
this.baoDraftShow = true
|
||||||
|
},
|
||||||
|
//关闭草稿
|
||||||
|
closeDraftShow() {
|
||||||
|
this.draftShow = false
|
||||||
|
},
|
||||||
|
//显示草稿
|
||||||
|
openDraftShow() {
|
||||||
|
this.draftShow = true
|
||||||
|
},
|
||||||
|
selectDraft(item, index) {
|
||||||
|
console.log('index:', index, 'item:', item);
|
||||||
|
this.draftId = item.id
|
||||||
|
this.draftSelectIndex = index
|
||||||
|
},
|
||||||
|
selectSureDraft() {
|
||||||
|
console.log('selectSureDraft', this.draftId);
|
||||||
|
uni.$u.http.get('/api/school.newactivity.activity_drafts/detail', {
|
||||||
|
params: {
|
||||||
|
id: this.draftId,
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
this.draftType = 1
|
||||||
|
this.form = res.data.detail
|
||||||
|
console.log('selectSureDraft', this.form.cate_ids);
|
||||||
|
|
||||||
|
console.log('cate_ids', this.form.cate_ids);
|
||||||
|
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;
|
||||||
|
console.log('refund_idn', this.form.refund_idn);
|
||||||
|
// 转换为 fileList 格式
|
||||||
|
if (this.form.images != '') {
|
||||||
|
this.fileList1 = this.form.images.map(url => ({
|
||||||
|
url: url,
|
||||||
|
status: 'success',
|
||||||
|
message: ''
|
||||||
|
}));
|
||||||
|
this.list1 = this.form.images
|
||||||
|
console.log('fileList1', this.fileList1);
|
||||||
|
}
|
||||||
|
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.start_time_text != '' && this.form.end_time_text != '') {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.form.sign_start_time_text != '' && this.form.sign_end_time_text != '') {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
this.price = this.form.price
|
||||||
|
this.priceDo()
|
||||||
|
|
||||||
|
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 => {});
|
||||||
|
this.closeDraftShow();
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -2510,10 +2608,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.itenCon-actPrice {
|
.itenCon-actPrice {
|
||||||
// position: absolute;
|
|
||||||
// bottom: 0;
|
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
color: #9c9c9c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2570,8 +2667,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.itenCon-actPrice {
|
.itenCon-actPrice {
|
||||||
// position: absolute;
|
color: #9c9c9c;
|
||||||
// bottom: 0;
|
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user