待审核列表的修改页面

1、	tabbars的发布活动在选择草稿箱中的内容发布
我发布页面的草稿箱列表
This commit is contained in:
wangzimeng 2025-07-09 18:31:02 +08:00
parent 8104c5df2f
commit a251c2fcc1
5 changed files with 910 additions and 793 deletions

View File

@ -1,8 +1,8 @@
<template>
<view>
<view class="long-data-picker">
<picker-view :value="valueDate" indicator-class="select-line" :immediate-change="true"
:indicator-style="itemHeight" @change="bindDateChange">
<picker-view indicator-class="select-line" :immediate-change="true" :indicator-style="itemHeight"
@change="bindDateChange">
<picker-view-column>
<view class="long-datetime-item" v-for="(item,index) in dates" :key="index">{{item}}</view>
@ -48,11 +48,12 @@
hours: [],
minutes: [],
formatdates: [],
currentTimePlus8Hours: null, //
valueDate: [0, 0, 0]
currentTime: new Date(),
currentTimePlus8Hours: null //
};
},
computed: {
//
currentdateindex(nv) {
@ -85,301 +86,140 @@
},
mounted() {
//
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();
this.initDate();
},
methods: {
//
initDate(baseTime) {
//
this.dates = [];
this.formatdates = [];
initDate() {
let currentdate = moment().format("MMM Do");
// console.log('');
//
this.dates = []
//
this.formatdates = []
//
for (let i = 0; i <= this.chooseNum; i++) {
const date = moment(baseTime).add(i, 'days');
this.formatdates.push(date.format("YYYY-MM-DD"));
this.dates.push(date.format("MMMDo dddd"));
const date = moment().add(i, 'days');
this.formatdates.push(moment().add(i, 'days').format("YYYY-MM-DD"))
this.dates.push(moment().add(i, 'days').format("MMMDo dddd"))
}
//
this.updateTimeColumns(baseTime);
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', m);
for (let i = m; i < 60; i++) {
let str = i;
if (i < 10) {
str = '0' + str;
} else {
str = '' + str;
}
this.minutes.push(str);
}
// 使$nextTickDOM
setTimeout(() => {
this.setDefaultValueDate();
}, 300)
console.log('');
},
// +8
setDefaultValueDate() {
const now = new Date();
// +8
let targetHourStr = now.getHours() + 8;
if (targetHourStr >= 24) {
targetHourStr -= 24;
}
console.log(this.hours);
console.log(targetHourStr);
//
bindDateChange(e) { //
console.log('滚动切换时间',e.detail.value);
let valueArr = e.detail.value
this.hours = []
this.minutes = []
let targetDayStr = now.getDay();
console.log('targetDayStr',targetDayStr);
if (targetHourStr >= 24) {
// targetHourStr -= 24;
this.valueDate = [0, 0, 0];
}
// hours
const hourIndex = this.hours.findIndex(hour => hour == targetHourStr);
console.log(hourIndex);
// valueDate0
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++) {
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++) {
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 hourStr = this.hours[valueArr[1]];
let minuteStr = this.minutes[valueArr[2]];
//
const selectedTime = new Date(`${dateStr} ${hourStr}:${minuteStr}`);
if (selectedTime < this.currentTime) {
uni.showToast({
title: '不能选择过去的时间',
icon: 'none'
});
return;
}
// 8
if (selectedTime < this.currentTimePlus8Hours) {
//
}
//
console.log(dateStr + ' ' + hourStr + ':' + minuteStr)
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>

View File

@ -35,10 +35,10 @@
<view style="width: 100%;">
<!-- 草稿箱列表 -->
<!-- <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)"-->
<view class="invoiceList" v-for="(item,index) in draftList" :key="index">
<view class="invoiceList-item">
<view class="invoiceList" >
<view class="invoiceList-item" v-for="(item,index) in draftList" :key="index">
<view class="invoiceList-itemInfo flex">
<view class="item-img">
<image v-if="item.images.length>0"
@ -58,13 +58,12 @@
</view>
</view>
<view class="item-draftBtns">
<view class="part flex justify-center align-items" style="margin-right: 20rpx;"
@click.stop="toEditDraft(item.id)">
编辑
</view>
<view class="part flex justify-center align-items" @click.stop="toDeleteDraft(item.id)">
<view class="part1 flex justify-center align-items" style="margin-right: 20rpx;" @click.stop="toDeleteDraft(item.id)">
删除
</view>
<view class="part flex justify-center align-items" @click.stop="toEditDraft(item.id)">
编辑
</view>
</view>
</view>
@ -81,7 +80,7 @@
</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="flex flex-column w-100 bbb" style="position: relative;"
v-for="(item, index) in hotList" :key="index">
@ -199,7 +198,7 @@
</view>
<view class="part flex justify-center align-items" v-if="item.auth_status == 0"
@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>
<view class="part1 flex justify-center align-items"
v-if="item.status == -1 && item.auth_status == 1"
@ -511,6 +510,7 @@
}, 2000)
},
onReachBottom() {
console.log('onReachBottom',this.status);
// if (this.list.length < this.count) {
// this.page++;
// this.getList(this.selected);
@ -518,6 +518,9 @@
if (this.status == -2) {
this.page++;
this.getAfterList();
}else if(this.status == 15) {
this.page++;
this.getDraftList();
} else {
this.page++;
this.getHotList(this.selected);
@ -532,24 +535,22 @@
},
//+
editItem(id) {
const type = 0;
uni.navigateTo({
url: "/packageB/editAct?id=" + id,
url: "/packageB/editAct?id=" + id + '&type=' + type,
});
// uni.switchTab({
// url:"/pages/center/index?id=" + id,
// })//tabbar
},
//+
//
copyItem(id) {
const type = 1
uni.navigateTo({
url: "/packageB/editAct?original_activity_id=" + id + '&type=' + type,
});
// uni.switchTab({
// url:"/pages/center/index?id=" + id,
// })//tabbar
},
//
//
copyNewItem(id) {
const type = 2
uni.navigateTo({
@ -897,7 +898,10 @@
if (res.code == 1) {
this.count = res.data.count;
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);
for (let i = 0; i < this.draftList.length; i++) {
this.draftList[i].createTime = dayjs.unix(this.draftList[i].createtime).format(
@ -962,14 +966,15 @@
headerSelected(status) {
return this.selected === status;
},
//
toShlist(val) {
this.page = 1;
this.hotList = [];
this.auth_status = val
console.log('toShlist', val, this.auth_status, this.status);
this.getHotList(this.status);
},
//
toAfter(val) {
this.page = 1;
this.hotList = [];
@ -984,6 +989,7 @@
.box {
.con-center {
width: 100%;
// height: 100vh;
// margin-top: 25rpx;
// overflow: hidden;
background: #f7f7f7;
@ -1354,36 +1360,39 @@
.invoiceList {
width: 100%;
height: auto;
display: grid;
justify-content: center;
.invoiceList-item {
display: grid;
justify-content: space-around;
justify-content: space-between;
align-items: center;
background-color: #ffffff;
// width: 100%;
width: 690rpx;
margin-top: 20rpx;
margin-left: 10rpx;
padding: 20rpx 20rpx;
width: 670rpx;
margin-bottom: 20rpx;
// margin-left: 10rpx;
padding: 20rpx 30rpx;
height: 220rpx auto;
border-radius: 30rpx;
.invoiceList-itemInfo {
// width: 100%;
width: 690rpx;
width: 670rpx;
display: flex;
justify-content: flex-start;
// justify-content: flex-start;
align-items: center;
.item-img {
width: 170rpx;
height: 170rpx;
margin-left: 40rpx;
// margin-left: 40rpx;
}
.item-con {
margin-left: 20rpx;
width: 90%;
width: 100%;
height: 160rpx;
position: relative;
color: #323232;
@ -1423,7 +1432,8 @@
.item-draftBtns {
width: 100%;
// width: 100%;
width: 670rpx;
display: flex;
justify-content: flex-end;
align-items: center;

View File

@ -13,7 +13,7 @@
<view class="row flex align-items" style="margin-top: 25rpx;">
<span>
<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 style="font-size: 24rpx;color: #9C9C9C;">(必填20字内)</span>
</view>
@ -22,7 +22,7 @@
<view class="row flex align-items textarea_fb" style="margin-top: 25rpx;">
<u--textarea :confirmType="null" v-model="form.content" :maxlength="800" type="text"
placeholder="描述一下活动的亮点、活动内容、推荐的人群、叫大家一起运动吧~" :height="120"
placeholder-class="bttop"></u--textarea>
placeholder-class="bttop" @input="handleUsernameChange2"></u--textarea>
</view>
<span class="line-row" style="margin-top: 0;"></span>
@ -80,7 +80,7 @@
</view>
<view class="first flex flex-column align-items justify-start" style="margin-top: 20rpx;">
<view class="row flex align-items" style="margin-top: 25rpx;">
<view class="row flex align-items" style="margin-top: 25rpx;">
<span class="label flex align-items ">
<span style="color: #3D3D3D;">*</span>
报名时间
@ -198,8 +198,13 @@
</view>
<view class="btns">
<view class="saveDraft" v-if="isFormValid" @click="addDraft()">存草稿</view>
<view class="draftBox" v-if="!isFormValid">草稿箱</view>
<view class="submitPublish" @click="apply()">确认发布</view>
<view class="draftBox" v-if="!isFormValid" @click="openDraftShow">草稿箱
<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>
<!-- <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"
@ -337,7 +342,7 @@
</view>
<view style="height: 1px;background-color: #EEEEEE;width: 100%;"></view>
<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>
</u-popup>
@ -354,7 +359,7 @@
</view>
<view style="height: 1px;background-color: #EEEEEE;width: 100%;"></view>
<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>
</u-popup>
<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>
</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="(draftSelectIndex === index ) ? 'invoiceList-itemSelect':'invoiceList-item'"
@click="selectDraft(item,index)">
@ -417,8 +422,8 @@
mode=""></image>
</view>
<view class="item-con" style="">
<view class="itenCon-actName" style="">{{item.title}}</view>
<view class="itenCon-actCon" style="">{{item.content}}</view>
<view class="itenCon-actName" style="">{{item.title !='' ? item.title:'描述待补充' }}</view>
<view class="itenCon-actCon" style="">{{item.content != '' ? item.content:'快来添加活动内容吧'}}</view>
<view class="itenCon-actPrice" style="">保存时间 {{item.updatetime_text}}</view>
</view>
</view>
@ -427,7 +432,7 @@
</view>
</u-popup>
<!-- 保存草稿箱弹框 -->
<u-popup :show="baoDraftShow" mode="center" :round="10" :zIndex="99999" :custom-style="{
width: '600rpx',
@ -437,8 +442,7 @@
justifyContent: 'start',
alignItems: 'center',
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;">
<image src="/static/fabu/renzheng.png" style="width: 140rpx;height: 140rpx;"></image>
</view>
@ -452,10 +456,10 @@
<view class="btn_2" @click="baoDraftShow = false">知道了</view>
</view>
</u-popup>
</view>
<!-- <tab-bar :tabBarShow="2"></tab-bar> -->
</view>
@ -622,40 +626,44 @@
birth: dayjs().add(4, 'hour').valueOf(), //
birth1: dayjs().add(8, 'hour').valueOf(), //
},
draftId:null,
baoDraftShow:false,
draftId: null,
baoDraftShow: false,
draftCount: 0,
defaultTime:null,
};
},
onLoad(options) {
console.log('options', options.id, options.original_activity_id,options.draftId);
//type012
console.log('type', this.type);
console.log('options', options.id, options.original_activity_id, options.draftId);
this.id = options.id
this.original_activity_id = options.original_activity_id
this.type = options.type
console.log('this.id', this.id);
console.log('this.original_activity_id ', this.original_activity_id);
console.log('this.type', this.type);
if (this.id) {
if (this.type == 0) {
//
this.agree = true
this.isFormValid = true
this.isFormValid = false
this.getDetail()
}
if(this.original_activity_id){
} else {
//
this.agree = true
this.isFormValid = false
this.getDetail()
}
// if(options.original_activity_id) {
// this.original_activity_id = options.original_activity_id
// if(this.original_activity_id){
// }
// this.getDetail()
uni.hideShareMenu();
this.getAgreement()
this.getBqList();
this.getrefund_list();
this.getitembq();
this.selectItemTuikuan();
this.getDraftList();
// this.getDraftList();
//var c=uni.getSystemInfoSync();
//844-94-70-100 = 580
//763-47-(100-47)-34-50
@ -679,6 +687,23 @@
}
},
methods: {
handleUsernameChange() {
console.log('标题变化:', this.form.title);
this.checkFormValidity();
},
handleUsernameChange2() {
console.log('内容变化:', this.form.content);
this.checkFormValidity();
},
checkFormValidity() {
this.isFormValid = this.form.title.length > 0 || this.form.content.length > 0 || this.fileList1.length >
0 || this.form.address.length > 0 ||
this.form.address_detail.length > 0 || this.form.time.length > 0 || this.form.sign_time > 0 || this
.form.cate_idsName.length > 0 ||
this.form.refund_idn.length > 0 || this.qunQrcode.length > 0 || this.form.stock.length > 0 || this.form
.price.length > 0;
console.log('isFormValid', this.isFormValid);
},
//
getDetail() {
// uni.switchTab({
@ -691,8 +716,7 @@
}).then(res => {
if (res.code == 1) {
this.form = res.data.detail
this.price = this.form.price
this.priceDo()
this.form.content = this.form.content.replace(/<[^>]+>/g, ''); // : ""
this.value_slide = res.data.detail.join_info.percent;
const idBqSet = new Set(this.form.cate_ids);
@ -712,6 +736,9 @@
this.form.cate_ids = res.data.detail.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;
// fileList
this.fileList1 = this.form.images.map(url => ({
@ -775,7 +802,7 @@
},
//稿
getDraftDetail() {
console.log('getDraftDetail',this.draftId);
console.log('getDraftDetail', this.draftId);
uni.$u.http.get('/api/school.newactivity.activity_drafts/detail', {
params: {
id: this.draftId,
@ -783,8 +810,9 @@
}).then(res => {
if (res.code == 1) {
this.form = res.data.detail
this.price = this.form.price
this.price = res.data.detail.price
this.priceDo()
console.log('this.priceName',this.priceName,this.price);
this.form.content = this.form.content.replace(/<[^>]+>/g, ''); // : ""
this.value_slide = res.data.detail.join_info.percent;
const idBqSet = new Set(this.form.cate_ids);
@ -802,7 +830,7 @@
console.log('cate_idsName', this.form.cate_idsName);
this.list = bqArray
this.form.cate_ids = res.data.detail.cate_ids;
console.log('cate_ids', this.form.cate_ids);
this.form.refund_idn = this.form.refund_info.title;
// fileList
@ -813,14 +841,14 @@
}));
this.list1 = this.form.images
console.log('fileList1', this.fileList1);
this.qunQrcode = ({
url: this.form.image,
status: 'success',
message: ''
})
this.QunQrcode1 = this.qunQrcode
// formatDate(dateStr) {
// if (!dateStr) return '';
// return dateStr.slice(5, 16);
@ -831,11 +859,11 @@
const time_start = this.form.start_time_text.slice(5, 16)
const time_end = this.form.end_time_text.slice(5, 16)
this.form.time = time_start + ' - ' + time_end
const signTime_start = this.form.sign_start_time_text.slice(5, 16)
const signTime_end = this.form.sign_end_time_text.slice(5, 16)
this.form.sign_time = signTime_start + ' - ' + signTime_end
console.log('qunQrcode', this.qunQrcode);
if (!this.original_activity_id) {
this.times_b_int = this.form.start_time_text
@ -853,7 +881,7 @@
if (this.type == 2) {
this.form.title = ''
}
this.mobile = this.detail.user.mobile.slice(0, 3) + 'XXXX' + this.detail.user.mobile.slice(
7);
} else {
@ -871,8 +899,10 @@
if (price == '' || price == null || price == undefined || price == 0) {
this.priceName = '免费';
this.priceShow = false;
console.log('this.priceName000',this.priceName);
return;
}
console.log('this.priceName111',this.priceName);
//1
if (price < 1) {
uni.showToast({
@ -889,7 +919,7 @@
this.form.price = this.price;
this.priceName = price;
this.priceShow = false;
console.log('this.priceName22',this.priceName);
},
selectItemTuikuan() {
this.currents = 5;
@ -1127,10 +1157,25 @@
this.hdIndex = 1;
// this.tempDefaultTime = new Date(new Date().getTime() + 8 * 60 * 60 * 1000);
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() {
this.bmIndex = 1;
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 < date2true
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 != '') {
uni.$u.toast('活动开始时间不能小于报名结束时间');
return;
@ -1656,7 +1702,7 @@
const telRegex = /^1[3-9]\d{9}$/; //
return telRegex.test(tel);
},
//稿
getDraftList() {
uni.$u.http
@ -1671,11 +1717,12 @@
})
.then((res) => {
if (res.code == 1) {
this.count = res.data.count;
this.draftCount = 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')
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";
@ -1697,6 +1744,16 @@
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('草稿');
@ -1736,56 +1793,80 @@
//
params.image = params.image.replace(/^https?:\/\/[^/]+/, '');
console.log('params', params.image);
console.log('草稿1');
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]
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);
}
console.log('params.images排查数组的url的路径', params.images);
params.images = params.images.join(',');
uni.$u.http.post(url, params).then(res => {
console.log('草稿2');
if (res.code == 1) {
this.isFormValid = false
this.baoDraftShow = true
this.getDraftList();
//
// this.fileList1 = [];
// this.agree = false;
// this.list1 = '';
// this.list = [];
// this.price = '';
// this.priceName = '';
// this.qunQrcode = '';
// this.form = {
// cate_ids: '',
// //
// cate_idsName: "",
// content: '',
// refund_id: '',
// refund_idn: '',
// price: 1,
// stock: '',
// sign_time: '',
// time: '',
// images: '',
// title: '',
// address: '',
// latitude: '',
// longitude: '',
// address_detail: '', //
// date: '', //
// date1: '', //
// birth: '', //
// birth1: '', //
// }
// this.fileList1 = [];
// this.agree = false;
// this.list1 = '';
// this.list = [];
// this.price = '';
// this.priceName = '';
// this.qunQrcode = '';
// this.form = {
// cate_ids: '',
// //
// cate_idsName: "",
// content: '',
// refund_id: '',
// refund_idn: '',
// price: 1,
// stock: '',
// sign_time: '',
// time: '',
// images: '',
// title: '',
// address: '',
// latitude: '',
// longitude: '',
// address_detail: '', //
// date: '', //
// date1: '', //
// birth: '', //
// birth1: '', //
// }
// uni.showToast({
// title: '稿',
// icon: 'none',
@ -1822,38 +1903,107 @@
},
selectDraft(item, index) {
console.log('index:', index, 'item:', item);
this.draftId = item.id
this.draftSelectIndex = index
this.selectDradtForm.title = item.title
this.selectDradtForm.content = item.content
this.selectDradtForm.images = item.images
this.selectDradtForm.address = item.address
this.selectDradtForm.address_detail = item.address_detail
this.selectDradtForm.stock = item.stock
this.selectDradtForm.price = item.price
this.selectDradtForm.time = item.time
this.selectDradtForm.sign_time = item.sign_time
this.selectDradtForm.title = item.title
this.selectDradtForm.cate_ids = item.cate_ids
this.selectDradtForm.refund_id = item.refund_id
console.log('5555');
// this.closeDraftShow();
},
selectSureDraft() {
console.log('366666');
this.form.title = this.selectDradtForm.title
this.form.content = this.selectDradtForm.content
this.form.images = this.selectDradtForm.images
this.form.address = this.selectDradtForm.address
this.form.address_detail = this.selectDradtForm.address_detail
this.form.stock = this.selectDradtForm.stock
this.form.price = this.selectDradtForm.price
this.form.time = this.selectDradtForm.time
this.form.sign_time = this.selectDradtForm.sign_time
this.form.title = this.selectDradtForm.title
this.form.cate_ids = this.selectDradtForm.cate_ids
this.form.refund_id = this.selectDradtForm.refund_id
console.log('99999');
this.closeDraftShow();
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
this.price = res.data.detail.price
this.priceDo()
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();s
},
editDraft() {
console.log('草稿');
@ -1901,8 +2051,16 @@
this.price = '';
this.priceName = '免费';
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 = {
cate_ids: '',
//
cate_idsName: "",
@ -1924,7 +2082,7 @@
birth: '', //
birth1: '', //
}
uni.showToast({
title: '编辑草稿保存成功!',
icon: 'none',
@ -1953,8 +2111,8 @@
});
});
},
apply() {
if (this.cardStatus == -1) {
@ -1964,6 +2122,8 @@
let url = '/api/school.new_activity/add';
let urlEdit = '/api/school.new_activity/edit'
let params = {};
console.log('平台分类',this.form.cate_ids,this.list);
this.form.cate_ids = this.list.map(item => item.id).join(',');
if (!this.id) {
this.form.cate_ids = this.list.map(item => item.id).join(',');
}
@ -2142,6 +2302,14 @@
this.price = '';
this.priceName = '免费';
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 = {
cate_ids: '',
@ -2553,7 +2721,7 @@
display: grid;
align-items: center;
}
.draftBox {
width: 235rpx;
height: 70rpx;
@ -2847,17 +3015,17 @@
font-family: PingFang SC, PingFang SC;
}
}
.popup_tkallDraft {
z-index: 100;
background-color: #f7f7f7;
.popup_tkDraft {
font-size: 36rpx;
margin: 12rpx 0 24rpx 0;
text-align: center;
}
.popup-content {
height: 900rpx;
overflow-y: auto;
@ -2865,112 +3033,100 @@
width: 100%;
padding: 0rpx;
background-color: #f7f7f7;
.invoiceList {
width: 690rpx;
height: auto;
.invoiceList-item {
display: flex;
justify-content: space-between;
justify-content: center;
align-items: center;
background-color: #ffffff;
width: 93%;
width: 91%;
margin-top: 20rpx;
padding: 20rpx 20rpx;
padding: 20rpx 30rpx;
height: 220rpx;
border-radius: 40rpx 40rpx 40rpx 40rpx;
// &.active {
// background-color: ##F0FFDF;
// border: 2rpx solid #9CEAA2;
// border-image: linear-gradient(270deg, rgba(251.00000023841858, 246.0000005364418, 109.00000110268593, 1), rgba(156.00000590085983, 234.00000125169754, 162.00000554323196, 1)) 2 2;
// border-radius: 40rpx;
// // clip-path: inset(0px round 16rpx);
// }
border: 2rpx solid #ffffff;
.item-img {
width: 170rpx;
height: 170rpx;
// margin-left: 40rpx;
}
.item-con {
margin-left: 20rpx;
width: 90%;
height: 160rpx;
position: relative;
color: #323232;
display: grid;
.itenCon-actName {
position: absolute;
top: 0;
font-size: 28rpx;
font-weight: 600;
}
.itenCon-actCon {
// position: absolute;
// top: 100rpx;
width: 400rpx;
white-space: nowrap;
/* 禁止换行 */
overflow: hidden;
/* 隐藏超出部分 */
text-overflow: ellipsis;
margin-top: 60rpx;
// margin-top: 60rpx;
font-size: 28rpx;
font-weight: 400;
}
.itenCon-actPrice {
position: absolute;
bottom: 0;
font-size: 26rpx;
font-weight: 900;
font-weight: 400;
color: #9c9c9c;
}
}
}
.invoiceList-itemSelect {
display: flex;
justify-content: space-between;
justify-content: center;
align-items: center;
background-color: #F0FFDF;
width: 93%;
width: 91%;
margin-top: 20rpx;
padding: 20rpx 20rpx;
padding: 20rpx 30rpx;
height: 220rpx;
border-radius: 40rpx 40rpx 40rpx 40rpx;
border: 2rpx solid #9CEAA2;
// border-image: linear-gradient(270deg, rgba(251.00000023841858, 246.0000005364418, 109.00000110268593, 1), rgba(156.00000590085983, 234.00000125169754, 162.00000554323196, 1)) 2 2;
.item-img {
width: 170rpx;
height: 170rpx;
// margin-left: 40rpx;
}
.item-con {
margin-left: 20rpx;
width: 70%;
width: 90%;
height: 160rpx;
position: relative;
color: #323232;
display: grid;
.itenCon-actName {
// position: absolute;
// top: 0;
font-size: 28rpx;
font-weight: 600;
}
.itenCon-actCon {
// position: absolute;
// top: 100rpx;
@ -2984,26 +3140,25 @@
font-size: 28rpx;
font-weight: 400;
}
.itenCon-actPrice {
// position: absolute;
// bottom: 0;
color: #9c9c9c;
font-size: 26rpx;
font-weight: 900;
font-weight: 400;
}
}
}
}
.popup-footer {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
.headBtn {
width: 90%;
height: 90rpx;
@ -3025,14 +3180,14 @@
margin-left: 2%;
}
}
}
}
.btn_1 {
width: 90%;
height: 80rpx;

View File

@ -1683,6 +1683,14 @@
this.price = '';
this.priceName = '免费';
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 = {
cate_ids: '',
@ -1904,6 +1912,14 @@
this.price = '';
this.priceName = '免费';
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 = {
cate_ids: '',

View File

@ -208,7 +208,7 @@
<view class="draftBox" v-if="!isFormValid" @click="openDraftShow">草稿箱
<view
style="color: #ff4810;font-family: PingFang SC, PingFang SC;font-weight: 400;font-size: 28rpx;">
({{draftList.length}})</view>
({{draftCount}})</view>
</view>
<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"
@ -348,7 +348,7 @@
</view>
<view style="height: 1px;background-color: #EEEEEE;width: 100%;"></view>
<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>
</view>
</u-popup>
@ -366,7 +366,7 @@
</view>
<view style="height: 1px;background-color: #EEEEEE;width: 100%;"></view>
<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>
</view>
</u-popup>
@ -412,12 +412,13 @@
:custom-style="popupStyletkDraft">
<view class="popup_tkallDraft">
<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: 400;font-size: 28rpx;margin-left: 220rpx;" @click="selectSureDraft()">
确定</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="(draftSelectIndex === index ) ? 'invoiceList-itemSelect':'invoiceList-item'"
@click="selectDraft(item,index)">
@ -450,7 +451,7 @@
</view>
</u-popup>
<!-- 保存草稿箱弹框 -->
<u-popup :show="baoDraftShow" mode="center" :round="10" :zIndex="99999" :custom-style="{
width: '600rpx',
@ -460,8 +461,7 @@
justifyContent: 'start',
alignItems: 'center',
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;">
<image src="/static/fabu/renzheng.png" style="width: 140rpx;height: 140rpx;"></image>
</view>
@ -475,8 +475,8 @@
<view class="btn_2" @click="baoDraftShow = false">知道了</view>
</view>
</u-popup>
</view>
<tab-bar :tabBarShow="2"></tab-bar>
</view>
@ -642,6 +642,9 @@
defaultTime: null,
draftType: 0,
baoDraftShow: false,
draftCount: 0,
page: 1,
limit: 10,
};
},
onLoad() {
@ -654,7 +657,7 @@
this.getrefund_list();
this.getitembq();
this.selectItemTuikuan();
this.getDraftList('15');
// this.getDraftList('15');
//var c=uni.getSystemInfoSync();
//844-94-70-100 = 580
//763-47-(100-47)-34-50
@ -684,6 +687,21 @@
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: {
formatTimestamp(value) {
if (!value) return '';
@ -936,9 +954,9 @@
this.dateShow = true;
// 8
const defaultTime = new Date();
//defaultTime.setHours(defaultTime.getHours() + 8);
console.log('活动时间defaultTime',defaultTime);
this.defaultTime = defaultTime;
// defaultTime.setHours(defaultTime.getHours() + 8);
console.log('活动时间defaultTime', defaultTime);
// this.defaultTime = defaultTime;
},
birthShowHidden() {
console.log('报名时间');
@ -947,7 +965,7 @@
// 8
const defaultTime = new Date();
//defaultTime.setHours(defaultTime.getHours() + 8);
console.log('报名时间defaultTime',defaultTime);
console.log('报名时间defaultTime', defaultTime);
this.defaultTime = defaultTime;
},
@ -978,7 +996,7 @@
const currentTime = dayjs().format('YYYY-MM-DD HH');
// const currentTime = this.getCurrentTimePlus8Hours();
var b = currentTime + ':00';
console.log('b', b);
console.log('b', b, this.times_b);
if (this.times_b == '' || this.times_b == null) {
console.log('判断是否this.times_b小于当前时间 用的是年月日而不是时间戳');
//this.times_b
@ -1241,24 +1259,19 @@
},
//
// columnIndexvaluevalues
confirm(e) {
console.log('confirm', e.value)
console.log('回调参数confirm', e.value)
this.form.cut = e.value[0]
this.fileList1 = [],
this.list1 = '',
this.name = ''
},
oversize(e) {
this.$u.toast("请传1MB以内大小的图片");
return false;
},
//
deletePic(event) {
const {
@ -1266,6 +1279,8 @@
index
} = event;
console.log('轮播图删除照片', event, this[`fileList${name}`], this.fileList1);
if (index >= 0 && index < this[`fileList${name}`].length) {
this[`fileList${name}`].splice(index, 1);
@ -1275,9 +1290,10 @@
// this.list1 = this.fileList1.length > 0 ? this.fileList1[0].url : '';
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
let list = this[`list${name}`];
@ -1287,12 +1303,14 @@
list.splice(index, 1);
console.log(`Updated list${name}:`, list);
}
console.log('list', list);
} else {
console.error('Invalid index');
}
},
//
async afterRead(event) {
console.log('新增-afterRead的轮播图');
let lists = [].concat(event.file);
let fileListLen = this[`fileList${event.name}`].length;
let categoryMap = [{
@ -1344,6 +1362,7 @@
}
},
uploadFilePromise(url, category) {
console.log('上传-uploadFilePromise');
console.log('category', category)
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
@ -1379,6 +1398,8 @@
reject(err);
}
});
console.log('');
});
},
//
@ -1423,293 +1444,12 @@
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() {
if (this.cardStatus == -1) {
this.cardShow = true;
return;
}
console.log('apply agreeShow', this.agreeShow);
let url = '/api/school.new_activity/add';
let params = {};
this.form.cate_ids = this.list.map(item => item.id).join(',');
@ -1850,8 +1590,10 @@
params.image = params.image.replace(/^https?:\/\/[^/]+/, '');
console.log('params', params.image);
console.log('草稿1');
if(this.draftType == 1) {
console.log('草稿1', this.draftType, params.images);
// if (this.draftType == 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?:\/\/[^/]+/, '');
@ -1862,8 +1604,27 @@
}
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);
}
// }
uni.$u.http.post(url, params).then(res => {
if (res.code == 1) {
//
@ -1874,6 +1635,19 @@
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: '',
@ -1898,6 +1672,8 @@
birth1: '', //
}
console.log('置空的form', );
uni.showToast({
title: '发布成功!',
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>
@ -2510,10 +2608,9 @@
}
.itenCon-actPrice {
// position: absolute;
// bottom: 0;
font-size: 26rpx;
font-weight: 400;
color: #9c9c9c;
}
}
@ -2570,8 +2667,7 @@
}
.itenCon-actPrice {
// position: absolute;
// bottom: 0;
color: #9c9c9c;
font-size: 26rpx;
font-weight: 400;
}