我发布的、修改活动信息和发布活动的页面新增草稿箱

This commit is contained in:
wangzimeng 2025-07-07 18:30:41 +08:00
parent ec699798bf
commit 3dbd59baa6
3 changed files with 1471 additions and 35 deletions

View File

@ -2,7 +2,7 @@
<view class="box">
<view class="con-center flex flex-column justify-center align-items">
<view class="tabs">
<u-tabs :activeStyle="{
<u-tabs :current="headers.findIndex(item => item.status === selected)" :activeStyle="{
color: '#303133',
fontWeight: 'bold',fontSize: '32rpx'}" :inactiveStyle="{
color: '#606266'
@ -31,7 +31,51 @@
</view>
<view style="width: 100%;">
<!-- 草稿箱列表 -->
<!-- <view v-if="draftShow === true"> -->
<view v-if="status == 15" style="margin-top: 110rpx;width: 100%;min-height: 100vh;">
<!-- 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-itemInfo flex">
<view class="item-img">
<image v-if="item.images.length>0"
style="width: 170rpx;height: 170rpx;border-radius: 20rpx;" :src="item.images[0]"
mode=""></image>
<image v-else style="width: 170rpx;height: 170rpx;border-radius: 20rpx;"
src="https://naweigetetest2.hschool.com.cn/miniapp/invoice/draftImgNo.png" mode=""></image>
</view>
<view class="item-con">
<view class="itenCon-actName" style="">{{item.title}}</view>
<view class="itenCon-actCon" style="">{{item.content}}</view>
<view class="itenCon-actPrice" style="">保存时间 {{item.updatetime_text}}</view>
</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>
</view>
</view>
</view>
<!-- <view class="invoiceBtn" @click="handleIssueInvoice()">
<view>申请开票</view>
</view> -->
<view class="bottom_box flex justify-center align-items" style="height: 1240rpx;width: 100%;"
v-if="draftList.length == 0">
<view style="text-align: center;">
<image src="/static/no.png" style="width: 150rpx;height: 150rpx;"></image>
<view>暂无数据</view>
</view>
</view>
</view>
<view :class="['hot', status == 0 || status == -2 ? 'wsh_hot' : '']">
<view class="content flex align-items flex-column">
<view class="flex flex-column w-100 bbb" style="position: relative;"
@ -74,8 +118,7 @@
<span v-if="item.status != 2"
style="margin: 0 20rpx 0 0">{{ dateWeeks(item.start_time) }}
</span>
<span
style="width: 1rpx;height: 22rpx;background: #323232;"></span>
<span style="width: 1rpx;height: 22rpx;background: #323232;"></span>
<span class="white-space" style="margin-left: 20rpx; width: 260rpx">{{
item.address_detail }}</span>
@ -100,8 +143,7 @@
<view
style="display: flex;align-items: center;justify-content: flex-end;gap: 20rpx;width: 96%;margin-bottom: 30rpx;"
v-if="item.auth_status == 0">
<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>
</view>
<!-- <view
@ -133,13 +175,16 @@
</view>
</view>
<!-- <view v-if="item.auth_status != 2 || item.status != 1" style="font-size: 26rpx; width: 24%;"> -->
<view v-if="item.status == 3 || item.status == 4">
</view>
<view v-if="item.status == 4 || item.status == 5"
style="font-size: 26rpx; width: 24%;">
<text>核销</text>
<text style="color: orangered;">{{ item.verification_num }}</text>
<text>/{{ item.stock }}</text>
</view>
<view v-if="item.status == -1 && item.auth_status == 1 || item.status == 3 || item.status == 4">
<view v-if="item.status == -1 && item.auth_status == 1">
</view>
<view
@ -153,8 +198,8 @@
<view class="part flex justify-center align-items"
v-if="item.status == -1 && item.auth_status == 1"
@click.stop="copyNewItem(item.id)"> 重发 </view>
<view class="part flex justify-center align-items" v-if="item.auth_status != 2 "
@click.stop="detail(item.id)"> 详情 </view>
<view class="part flex justify-center align-items"
v-if="item.auth_status != 2 " @click.stop="detail(item.id)"> 详情 </view>
</view>
<!-- <view style="display: flex;align-items: center;justify-content: flex-end;gap: 20rpx;width: 1005;">
<view class="part flex justify-center align-items" v-if="item.auth_status == 0 || item.status == 1"
@ -241,17 +286,32 @@
</view>
</view>
<view class="flex flex-column flex-start align-items" v-if="hotList.length == 0"
style="margin-top: 300rpx;">
<view class="flex flex-column flex-start align-items"
v-if="hotList.length == 0 && selected != 15" style="margin-top: 300rpx;">
<image src="/static/message/activen.png" mode="" style="width: 180rpx;height: 180rpx;">
</image>
<view style="margin-top: 30rpx;font-size: 28rpx;color: #323232;">暂无发布活动</view>
<view class="tofb" @click="tofb">前往发布</view>
</view>
<!-- <view class="flex flex-column flex-start align-items" v-if="hotList.length == 0"
style="margin-top: 300rpx;">
<image src="/static/message/activen.png" mode="" style="width: 180rpx;height: 180rpx;">
</image>
<view style="margin-top: 30rpx;font-size: 28rpx;color: #323232;">暂无发布活动</view>
<view class="tofb" @click="tofb">前往发布</view>
</view> -->
</view>
</view>
</view>
</view>
<!-- 热门活动 -->
@ -311,6 +371,7 @@
import {
dateWeek
} from "../../utils/dateFormat";
import dayjs from 'dayjs';
export default {
data() {
return {
@ -344,6 +405,9 @@
size: 13,
sortStyle: ["#ff557f", "#3f3f3f"],
headers: [{
status: "15",
name: "草稿箱",
}, {
status: "0",
name: "活动审核",
},
@ -393,6 +457,8 @@
server_status: '3',
cancelsShow: false, //
deleteId: null, //id
draftList: [], //稿
draftShow: false,
};
},
onLoad(option) {
@ -793,12 +859,92 @@
this.status = status;
if (status == -2) {
this.getAfterList();
}else if(status == -2){
} else if (status == 15) {
console.log('draftShow');
this.draftShow = true
this.hotList = []
this.getDraftList(status)
} else {
this.getHotList(status);
}
},
//稿
getDraftList(status) {
uni.$u.http
.get("/api/school.newactivity.activity_drafts/drafts_list", {
params: {
keywords: this.keywords,
page: this.page,
limit: this.limit,
order: 'normal'
// status: status,
},
})
.then((res) => {
if (res.code == 1) {
this.count = res.data.count;
console.log('draft1', res.data.list);
this.draftList = res.data.list.data;
console.log('draft', this.draftList);
for(let i = 0;i<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('draft', this.draftList);
} else {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000,
});
this.loadStatus = "loading";
}
})
.catch((error) => {
console.error("请求失败", error);
this.loadStatus = "loading";
});
},
toEditDraft(id) {
console.log('编辑草稿');
const type = 3
uni.navigateTo({
url: '/packageB/editAct?draftId=' + id + '&type=' + type
})
},
toDeleteDraft(id) {
console.log('删除草稿');
console.log('deleteItem', id);
uni.$u.http.post('/api/school.newactivity.activity_drafts/del', {
ids: id,
}).then(res => {
if (res.code == 1) {
this.cancelsShow = false
uni.showToast({
title: '删除成功',
icon: 'success',
duration: 2000
})
this.getDraftList('15')
// this.toShlist('2')
// setTimeout(() => {
// uni.redirectTo({
// url: "/packageA/my/orderList"
// })
// }, 1000)
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
}).catch(error => {});
},
headerSelected(status) {
return this.selected === status;
},
@ -861,6 +1007,10 @@
color: #3D3D3D;
}
}
}
}
@ -1187,6 +1337,81 @@
/* 使用省略号表示被截断的文本 */
}
.invoiceList {
width: 100%;
height: auto;
.invoiceList-item {
display: grid;
justify-content: space-around;
align-items: center;
background-color: #ffffff;
// width: 100%;
width: 690rpx;
margin-top: 20rpx;
margin-left: 10rpx;
padding: 20rpx 20rpx;
height: 220rpx auto;
.invoiceList-itemInfo {
// width: 100%;
width: 690rpx;
display: flex;
justify-content: flex-start;
align-items: center;
.item-img {
width: 170rpx;
height: 170rpx;
margin-left: 40rpx;
}
.item-con {
margin-left: 20rpx;
width: 90%;
height: 160rpx;
position: relative;
color: #323232;
display: grid;
.itenCon-actName {
// position: absolute;
// top: 0;
font-size: 28rpx;
font-weight: 400;
}
.itenCon-actCon {
// position: absolute;
// top: 50rpx;
// margin-top: 60rpx;
font-size: 28rpx;
font-weight: 400;
}
.itenCon-actPrice {
// position: absolute;
// bottom: 0;
font-size: 26rpx;
font-weight: 400;
}
}
}
.item-draftBtns {
width: 100%;
display: flex;
justify-content: flex-end;
align-items: center;
margin-top: 20rpx;
}
}
}
.hot {
margin-top: 80rpx;
margin-bottom: 70rpx;

View File

@ -197,7 +197,7 @@
@clickOne="protocolClick"></cc-protocolBox>
</view>
<view class="btns">
<view class="saveDraft">存草稿</view>
<view class="saveDraft" @click="editDraft()">存草稿</view>
<!-- <view class="draftBox">草稿箱</view> -->
<view class="submitPublish" @click="apply()">确认发布</view>
</view>
@ -394,6 +394,40 @@
@confirm="birthConfirm1" :show="birthShow1" v-model="form.birth1" mode="datetime"></u-datetime-picker> -->
<!-- 草稿箱列表 -->
<u-popup :show="draftShow" :round="22" mode="bottom" @close="closeDraftShow" @open="openDraftShow"
: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;">取消</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">
<view class="invoiceList" v-for="(item,index) in draftList" :key="index">
<view :class="(draftSelectIndex === index ) ? 'invoiceList-itemSelect':'invoiceList-item'"
@click="selectDraft(item,index)">
<view class="item-img" style="margin-right: 40rpx;position: relative;right: 6rpx;">
<image v-if="item.images.length > 0"
style="width: 170rpx;height: 170rpx;border-radius: 20rpx;" :src="item.images[0]"
mode=""></image>
<image v-else style="width: 170rpx;height: 170rpx;border-radius: 20rpx;"
src="https://naweigetetest2.hschool.com.cn/miniapp/invoice/draftImgNo.png"
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-actPrice" style="">保存时间 {{item.updatetime_text}}</view>
</view>
</view>
</view>
</scroll-view>
</view>
</u-popup>
</view>
<!-- <tab-bar :tabBarShow="2"></tab-bar> -->
</view>
@ -491,6 +525,17 @@
alignItems: 'center',
flexColumn: 'column'
},
popupStyletkDraft: {
width: '100%',
padding: '24rpx 0rpx 24rpx 0rpx',
height: '984rpx',
margin: '0 auto', //
display: 'flex',
justifyContent: 'start',
alignItems: 'center',
flexColumn: 'column',
backgroundColor: '#f7f7f7',
},
current: -1,
currents: -1,
institutionList: [],
@ -520,29 +565,66 @@
original_activity_id: null,
type: null,
tempDefaultTime: null,
isFormValid: false, //稿
draftList: [],
draftShow: false,
keywords: '',
loadStatus: "loading",
selectHeadIndex: null,
draftSelectIndex: null,
selectDradtForm: {
cate_ids: '',
//
cate_idsName: "",
content: '',
refund_id: '',
refund_idn: '',
price: '',
stock: '',
sign_time: '',
time: '',
images: '',
title: '',
address: '',
latitude: '',
longitude: '',
address_detail: '', //
date: dayjs().add(4, 'hour').valueOf(), //
date1: dayjs().add(8, 'hour').valueOf(), //
birth: dayjs().add(4, 'hour').valueOf(), //
birth1: dayjs().add(8, 'hour').valueOf(), //
},
draftId:null,
};
},
onLoad(options) {
console.log('options', options.id, options.original_activity_id);
console.log('options', options.id, options.original_activity_id,options.draftId);
this.id = options.id
this.original_activity_id = options.original_activity_id
this.type = options.type
this.draftId = options.draftId
console.log('this.id', this.id);
console.log('this.original_activity_id ', this.original_activity_id);
console.log('this.type', this.type);
if (this.id || this.original_activity_id) {
this.agree = true
this.getDetail()
}
if(this.draftId) {
this.getDraftDetail()
}
// if(options.original_activity_id) {
// this.original_activity_id = options.original_activity_id
// }
this.getDetail()
// this.getDetail()
uni.hideShareMenu();
this.getAgreement()
this.getBqList();
this.getrefund_list();
this.getitembq();
this.selectItemTuikuan();
this.getDraftList();
//var c=uni.getSystemInfoSync();
//844-94-70-100 = 580
//763-47-(100-47)-34-50
@ -552,6 +634,7 @@
onShow() {
this.show = false;
this.getCardInfo();
this.getDraftList();
},
filters: {
formatTimestamp(value) {
@ -659,6 +742,98 @@
}
}).catch(error => {});
},
//稿
getDraftDetail() {
console.log('getDraftDetail',this.draftId);
uni.$u.http.get('/api/school.newactivity.activity_drafts/detail', {
params: {
id: this.draftId,
}
}).then(res => {
if (res.code == 1) {
this.form = res.data.detail
this.price = this.form.price
this.priceDo()
this.form.content = this.form.content.replace(/<[^>]+>/g, ''); // : ""
this.value_slide = res.data.detail.join_info.percent;
const idBqSet = new Set(this.form.cate_ids);
const bqArray = this.bqList.reduce((acc, obj) => {
if (this.form.cate_ids.includes(obj.id)) {
acc.push(obj);
}
return acc;
}, []);
console.log('bqArray', bqArray);
let arrIdsName = bqArray.map((item) => {
return item.name
})
this.form.cate_idsName = arrIdsName.join(',');
console.log('cate_idsName', this.form.cate_idsName);
this.list = bqArray
this.form.cate_ids = res.data.detail.cate_ids;
console.log('cate_ids', this.form.cate_ids);
this.form.refund_idn = this.form.refund_info.title;
// fileList
this.fileList1 = this.form.images.map(url => ({
url: url,
status: 'success',
message: ''
}));
this.list1 = this.form.images
console.log('fileList1', this.fileList1);
this.qunQrcode = ({
url: this.form.image,
status: 'success',
message: ''
})
this.QunQrcode1 = this.qunQrcode
// formatDate(dateStr) {
// if (!dateStr) return '';
// return dateStr.slice(5, 16);
// }
// this.times_b_int = this.form.start_time_text
// this.times_e_int = this.form.end_time_text
// res.data.detail
const time_start = this.form.start_time_text.slice(5, 16)
const time_end = this.form.end_time_text.slice(5, 16)
this.form.time = time_start + ' - ' + time_end
const signTime_start = this.form.sign_start_time_text.slice(5, 16)
const signTime_end = this.form.sign_end_time_text.slice(5, 16)
this.form.sign_time = signTime_start + ' - ' + signTime_end
console.log('qunQrcode', this.qunQrcode);
if (!this.original_activity_id) {
this.times_b_int = this.form.start_time_text
this.times_e_int = this.form.end_time_text
this.times_sinb_int = this.form.sign_start_time_text
this.times_sine_int = this.form.sign_end_time_text
} else {
this.times_b_int = ''
this.times_e_int = ''
this.times_sinb_int = ''
this.times_sine_int = ''
this.form.sign_time = ''
this.form.time = ''
}
if (this.type == 2) {
this.form.title = ''
}
this.mobile = this.detail.user.mobile.slice(0, 3) + 'XXXX' + this.detail.user.mobile.slice(
7);
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
}).catch(error => {});
},
priceDo() {
var price = this.price;
console.log('priceDo price:', price);
@ -1451,6 +1626,282 @@
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');
uni.$u.http.post(url, params).then(res => {
console.log('草稿2');
if (res.code == 1) {
//
this.fileList1 = [];
this.agree = false;
this.list1 = '';
this.list = [];
this.price = '';
this.priceName = '免费';
this.qunQrcode = '';
this.form = {
cate_ids: '',
//
cate_idsName: "",
content: '',
refund_id: '',
refund_idn: '',
price: 1,
stock: '',
sign_time: '',
time: '',
images: '',
title: '',
address: '',
latitude: '',
longitude: '',
address_detail: '', //
date: '', //
date1: '', //
birth: '', //
birth1: '', //
}
uni.showToast({
title: '添加成功!',
icon: 'none',
duration: 2000,
});
setTimeout(function() {
// uni.navigateTo({
// url: "/packageA/my/orderList"
// })
}, 1000);
} else {
this.$u.toast(res.msg);
// uni.showToast({
// title: res.msg,
// icon: 'none',
// duration: 2000
// });
}
}).catch(error => {
uni.showToast({
title: error.msg,
icon: 'none',
duration: 2000
});
});
},
//稿
closeDraftShow() {
this.draftShow = false
},
//稿
openDraftShow() {
this.draftShow = true
},
selectDraft(item, index) {
console.log('index:', index, 'item:', item);
this.draftSelectIndex = index
this.selectDradtForm.title = item.title
this.selectDradtForm.content = item.content
this.selectDradtForm.images = item.images
this.selectDradtForm.address = item.address
this.selectDradtForm.address_detail = item.address_detail
this.selectDradtForm.stock = item.stock
this.selectDradtForm.price = item.price
this.selectDradtForm.time = item.time
this.selectDradtForm.sign_time = item.sign_time
this.selectDradtForm.title = item.title
this.selectDradtForm.cate_ids = item.cate_ids
this.selectDradtForm.refund_id = item.refund_id
console.log('5555');
// this.closeDraftShow();
},
selectSureDraft() {
console.log('366666');
this.form.title = this.selectDradtForm.title
this.form.content = this.selectDradtForm.content
this.form.images = this.selectDradtForm.images
this.form.address = this.selectDradtForm.address
this.form.address_detail = this.selectDradtForm.address_detail
this.form.stock = this.selectDradtForm.stock
this.form.price = this.selectDradtForm.price
this.form.time = this.selectDradtForm.time
this.form.sign_time = this.selectDradtForm.sign_time
this.form.title = this.selectDradtForm.title
this.form.cate_ids = this.selectDradtForm.cate_ids
this.form.refund_id = this.selectDradtForm.refund_id
console.log('99999');
this.closeDraftShow();
},
editDraft() {
console.log('草稿');
let url = '/api/school.newactivity.activity_drafts/add';
let params = {};
let hdtime = ''
let bmtime = ''
this.form.cate_ids = this.list.map(item => item.id).join(',');
if (this.times_b_int && this.times_e_int) {
hdtime = this.times_b_int + ' - ' + this.times_e_int;
}
if (this.times_sinb_int && this.times_sine_int) {
bmtime = this.times_sinb_int + ' - ' + this.times_sine_int;
}
// let hdtime = this.times_b_int + ' - ' + this.times_e_int;
// let bmtime = this.times_sinb_int + ' - ' + this.times_sine_int;
params = {
title: this.form.title,
cate_ids: this.form.cate_ids,
content: this.form.content,
// refund_id: 1,
refund_id: this.form.refund_id,
price: this.form.price == '' ? 0 : this.form.price,
stock: this.form.stock,
sign_time: bmtime || '',
time: hdtime || '',
images: this.list1,
longitude: this.form.longitude,
latitude: this.form.latitude,
address: this.form.address,
address_detail: this.form.address_detail,
image: this.qunQrcode
}
console.log('草稿1');
uni.$u.http.post(url, params).then(res => {
console.log('草稿2');
if (res.code == 1) {
//
this.fileList1 = [];
this.agree = false;
this.list1 = '';
this.list = [];
this.price = '';
this.priceName = '免费';
this.qunQrcode = '';
this.form = {
cate_ids: '',
//
cate_idsName: "",
content: '',
refund_id: '',
refund_idn: '',
price: 1,
stock: '',
sign_time: '',
time: '',
images: '',
title: '',
address: '',
latitude: '',
longitude: '',
address_detail: '', //
date: '', //
date1: '', //
birth: '', //
birth1: '', //
}
uni.showToast({
title: '编辑保存成功!',
icon: 'none',
duration: 2000,
});
uni.navigateBack()
// setTimeout(function() {
// // uni.navigateTo({
// // url: "/packageA/my/orderList"
// // })
// }, 1000);
} else {
this.$u.toast(res.msg);
// uni.showToast({
// title: res.msg,
// icon: 'none',
// duration: 2000
// });
}
}).catch(error => {
uni.showToast({
title: error.msg,
icon: 'none',
duration: 2000
});
});
},
apply() {
if (this.cardStatus == -1) {
this.cardShow = true;
@ -1604,7 +2055,7 @@
if (/^https?:\/\//i.test(params.images[i])) {
params.images[i] = params.images[i].replace(/^https?:\/\/[^/]+/, '');
console.log('params.images[i].url', params.images[i]);
}else {
} else {
params.images[i] = params.images[i]
}
}
@ -2324,6 +2775,179 @@
}
}
.popup_tkallDraft {
z-index: 100;
background-color: #f7f7f7;
.popup_tkDraft {
font-size: 36rpx;
margin: 12rpx 0 24rpx 0;
text-align: center;
}
.popup-content {
height: 900rpx;
overflow-y: auto;
margin-top: 30rpx;
width: 100%;
padding: 0rpx;
background-color: #f7f7f7;
.invoiceList {
width: 690rpx;
height: auto;
.invoiceList-item {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #ffffff;
width: 93%;
margin-top: 20rpx;
padding: 20rpx 20rpx;
height: 220rpx;
border-radius: 40rpx 40rpx 40rpx 40rpx;
// &.active {
// background-color: ##F0FFDF;
// border: 2rpx solid #9CEAA2;
// border-image: linear-gradient(270deg, rgba(251.00000023841858, 246.0000005364418, 109.00000110268593, 1), rgba(156.00000590085983, 234.00000125169754, 162.00000554323196, 1)) 2 2;
// border-radius: 40rpx;
// // clip-path: inset(0px round 16rpx);
// }
.item-img {
width: 170rpx;
height: 170rpx;
// margin-left: 40rpx;
}
.item-con {
margin-left: 20rpx;
width: 90%;
height: 160rpx;
position: relative;
color: #323232;
.itenCon-actName {
position: absolute;
top: 0;
font-size: 28rpx;
font-weight: 400;
}
.itenCon-actCon {
// position: absolute;
// top: 100rpx;
margin-top: 60rpx;
font-size: 28rpx;
font-weight: 400;
}
.itenCon-actPrice {
position: absolute;
bottom: 0;
font-size: 26rpx;
font-weight: 900;
}
}
}
.invoiceList-itemSelect {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #F0FFDF;
width: 93%;
margin-top: 20rpx;
padding: 20rpx 20rpx;
height: 220rpx;
border-radius: 40rpx 40rpx 40rpx 40rpx;
border: 2rpx solid #9CEAA2;
// border-image: linear-gradient(270deg, rgba(251.00000023841858, 246.0000005364418, 109.00000110268593, 1), rgba(156.00000590085983, 234.00000125169754, 162.00000554323196, 1)) 2 2;
.item-img {
width: 170rpx;
height: 170rpx;
// margin-left: 40rpx;
}
.item-con {
margin-left: 20rpx;
width: 70%;
height: 160rpx;
position: relative;
color: #323232;
display: grid;
.itenCon-actName {
// position: absolute;
// top: 0;
font-size: 28rpx;
font-weight: 400;
}
.itenCon-actCon {
// position: absolute;
// top: 100rpx;
// margin-top: 60rpx;
font-size: 28rpx;
font-weight: 400;
}
.itenCon-actPrice {
// position: absolute;
// bottom: 0;
font-size: 26rpx;
font-weight: 900;
}
}
}
}
.popup-footer {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
.headBtn {
width: 90%;
height: 90rpx;
background-color: #323232;
border-radius: 148rpx;
color: #BBFC5B;
font-size: 36rpx;
font-weight: 400;
line-height: 50rpx;
font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
text-transform: none;
font-style: normal;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
position: fixed;
bottom: 66rpx;
margin-left: 2%;
}
}
}
}
.btn_1 {
width: 90%;
height: 80rpx;

View File

@ -12,7 +12,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>
@ -20,8 +20,8 @@
<view class="row flex align-items textarea_fb" style="margin-top: 25rpx;">
<u--textarea :confirmType="null" v-model="form.content" :maxlength="800"
placeholder="描述一下活动的亮点、活动内容、推荐的人群、叫大家一起运动吧~" :height="120"
placeholder-class="bttop"></u--textarea>
placeholder="描述一下活动的亮点、活动内容、推荐的人群、叫大家一起运动吧~" :height="120" placeholder-class="bttop"
@input="handleUsernameChange2"></u--textarea>
</view>
<span class="line-row" style="margin-top: 0;"></span>
@ -56,7 +56,7 @@
<view class="row flex align-items textarea_mph" style="margin-top: 30rpx;">
<u--textarea v-model="form.address_detail" maxlength="400" placeholder-class="bttops"
placeholder="请输入详细地址/楼、门牌号"></u--textarea>
placeholder="请输入详细地址/楼、门牌号" @input="handleUsernameChange2()"></u--textarea>
</view>
<view class="row flex align-items" style="margin: 30rpx 0;">
@ -154,7 +154,8 @@
v-model.number="form.stock" />
</span> -->
<span class="row-right">
<input type="number" placeholder="请填写活动人数" class="input" v-model="form.stock" />
<input type="number" placeholder="请填写活动人数" class="input" v-model="form.stock"
@input="handleUsernameChange2()" />
</span>
</view>
<span class="line-row"></span>
@ -202,11 +203,20 @@
<cc-protocolBox :agree="agree" :name="protocolArr" @click="protocolClick"
@clickOne="protocolClick"></cc-protocolBox>
</view>
<view class="btns">
<view class="saveDraft" v-if="isFormValid" @click="addDraft()">存草稿</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;">
({{draftList.length}})</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"
style="background: #EEEEEE;color: #9C9C9C;">确认发布</span>
</view>
</view>
<!-- 退款政策 -->
<u-popup @touchmove.native.stop.prevent :closeable="false" :show="tuikuan" :round="22" mode="bottom"
@close="closetuikuan" @open="opentuikuan" :custom-style="popupStyletk">
@ -394,6 +404,36 @@
<u-datetime-picker @cancel="birthCancel1" ref="birthRef" title="结束时间" :minDate="minDate1"
@confirm="birthConfirm1" :show="birthShow1" v-model="form.birth1" mode="datetime"></u-datetime-picker> -->
<!-- 草稿箱列表 -->
<u-popup :show="draftShow" :round="22" mode="bottom" @close="closeDraftShow" @open="openDraftShow"
: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;">取消</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">
<view class="invoiceList" v-for="(item,index) in draftList" :key="index">
<view :class="(draftSelectIndex === index ) ? 'invoiceList-itemSelect':'invoiceList-item'" @click="selectDraft(item,index)">
<view class="item-img" style="margin-right: 40rpx;position: relative;right: 6rpx;">
<image v-if="item.images.length > 0" style="width: 170rpx;height: 170rpx;border-radius: 20rpx;"
:src="item.images[0]" mode=""></image>
<image v-else style="width: 170rpx;height: 170rpx;border-radius: 20rpx;"
src="https://naweigetetest2.hschool.com.cn/miniapp/invoice/draftImgNo.png" 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-actPrice" style="">保存时间 {{item.updatetime_text}}</view>
</view>
</view>
</view>
</scroll-view>
</view>
</u-popup>
</view>
<tab-bar :tabBarShow="2"></tab-bar>
@ -484,7 +524,7 @@
},
popupStyletk: {
width: '710rpx',
padding: '24rpx 24rpx 42rpx 24rpx',
padding: '24rpx 20rpx 42rpx 20rpx',
height: '984rpx',
margin: '0 auto', //
display: 'flex',
@ -492,6 +532,17 @@
alignItems: 'center',
flexColumn: 'column'
},
popupStyletkDraft: {
width: '100%',
padding: '24rpx 0rpx 24rpx 0rpx',
height: '984rpx',
margin: '0 auto', //
display: 'flex',
justifyContent: 'start',
alignItems: 'center',
flexColumn: 'column',
backgroundColor: '#f7f7f7',
},
current: -1,
currents: -1,
institutionList: [],
@ -516,6 +567,35 @@
boxHeight: 0,
cardShow: false,
cardStatus: 0,
isFormValid: false, //稿
draftList: [],
draftShow: false,
keywords: '',
loadStatus: "loading",
selectHeadIndex: null,
draftSelectIndex: null,
selectDradtForm: {
cate_ids: '',
//
cate_idsName: "",
content: '',
refund_id: '',
refund_idn: '',
price: '',
stock: '',
sign_time: '',
time: '',
images: '',
title: '',
address: '',
latitude: '',
longitude: '',
address_detail: '', //
date: dayjs().add(4, 'hour').valueOf(), //
date1: dayjs().add(8, 'hour').valueOf(), //
birth: dayjs().add(4, 'hour').valueOf(), //
birth1: dayjs().add(8, 'hour').valueOf(), //
}
};
},
onLoad() {
@ -528,6 +608,7 @@
this.getrefund_list();
this.getitembq();
this.selectItemTuikuan();
this.getDraftList();
//var c=uni.getSystemInfoSync();
//844-94-70-100 = 580
//763-47-(100-47)-34-50
@ -537,6 +618,23 @@
onShow() {
this.show = false;
this.getCardInfo();
this.getDraftList();
},
watch: {
// form: {
// handler(newVal) {
// this.isFormValid = newVal.name.title > 0 && newVal.content > 0;
// },
// deep: true,
// immediate: true
// }
// 'form.title'(newVal) {
// this.isFormValid = newVal.length > 0 || this.form.content.length > 0;
// },
// 'form.content'(newVal) {
// this.isFormValid = this.form.title.length > 0 || newVal.length > 0;
// }
},
filters: {
formatTimestamp(value) {
@ -549,6 +647,23 @@
}
},
methods: {
handleUsernameChange() {
console.log('标题变化:', this.form.title);
this.checkFormValidity();
},
handleUsernameChange2() {
console.log('内容变化:', this.form.content);
this.checkFormValidity();
},
checkFormValidity() {
this.isFormValid = this.form.title.length > 0 || this.form.content.length > 0 || this.fileList1.length >
0 || this.form.address.length > 0 ||
this.form.address_detail.length > 0 || this.form.time.length > 0 || this.form.sign_time > 0 || this
.form.cate_idsName.length > 0 ||
this.form.refund_idn.length > 0 || this.qunQrcode.length > 0 || this.form.stock.length > 0 || this.form
.price.length > 0;
console.log('isFormValid', this.isFormValid);
},
priceDo() {
var price = this.price;
console.log(price);
@ -573,7 +688,7 @@
this.form.price = this.price;
this.priceName = price;
this.priceShow = false;
this.checkFormValidity();
},
selectItemTuikuan() {
this.currents = 5;
@ -604,6 +719,7 @@
async uploadQun(item) {
const result = await this.uploadFilePromise(item.file.url, 'user');
this.qunQrcode = result;
this.checkFormValidity();
},
//123
// tofb() {
@ -685,6 +801,7 @@
},
closebq() {
this.showPopbq = false
this.checkFormValidity();
},
openBq() {
this.showPopbq = true
@ -870,6 +987,7 @@
}
this.form.time = this.times_b + ' - ' + this.times_e
this.dateShow = false;
this.checkFormValidity();
// if(this.times_e == '' || this.times_e==null){
// const currentTime = dayjs().format('YYYY-MM-DD HH');
// this.times_e = dateWeekData(currentTime+'00');
@ -980,6 +1098,7 @@
}
this.form.sign_time = this.times_sinb + ' - ' + this.times_sine
this.birthShow = false;
this.checkFormValidity();
},
birthCancel() {
this.birthShow = false
@ -993,6 +1112,7 @@
},
closetuikuan() {
this.tuikuan = false
this.checkFormValidity();
},
open() {
this.show = true
@ -1059,6 +1179,7 @@
// that.form.address_detail = res.address
that.form.latitude = res.latitude
that.form.longitude = res.longitude
this.checkFormValidity();
},
fail: function(rot) {
console.log(rot)
@ -1166,6 +1287,7 @@
// this.list1 = this.fileList1[0]?.url || ''; //
this.list1 = this.fileList1.map(item => item.url).join(',');
}
}
},
uploadFilePromise(url, category) {
@ -1241,7 +1363,6 @@
});
});
},
//
validateTel(tel) {
// 使
@ -1249,6 +1370,186 @@
return telRegex.test(tel);
},
//稿
getDraftList() {
uni.$u.http
.get("/api/school.newactivity.activity_drafts/drafts_list", {
params: {
keywords: this.keywords,
page: this.page,
limit: this.limit,
order: 'normal',
// status: status,
},
})
.then((res) => {
if (res.code == 1) {
this.count = res.data.count;
console.log('getDraft', res.data.list);
this.draftList = res.data.list.data;
for(let i = 0;i<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');
uni.$u.http.post(url, params).then(res => {
console.log('草稿2');
if (res.code == 1) {
//
this.fileList1 = [];
this.agree = false;
this.list1 = '';
this.list = [];
this.price = '';
this.priceName = '免费';
this.qunQrcode = '';
this.form = {
cate_ids: '',
//
cate_idsName: "",
content: '',
refund_id: '',
refund_idn: '',
price: 1,
stock: '',
sign_time: '',
time: '',
images: '',
title: '',
address: '',
latitude: '',
longitude: '',
address_detail: '', //
date: '', //
date1: '', //
birth: '', //
birth1: '', //
}
uni.showToast({
title: '添加成功!',
icon: 'none',
duration: 2000,
});
setTimeout(function() {
// uni.navigateTo({
// url: "/packageA/my/orderList"
// })
}, 1000);
} else {
this.$u.toast(res.msg);
// uni.showToast({
// title: res.msg,
// icon: 'none',
// duration: 2000
// });
}
}).catch(error => {
uni.showToast({
title: error.msg,
icon: 'none',
duration: 2000
});
});
},
//稿
closeDraftShow() {
this.draftShow = false
},
//稿
openDraftShow() {
this.draftShow = true
},
selectDraft(item, index) {
console.log('index:', index, 'item:', item);
this.draftSelectIndex = index
this.selectDradtForm.title = item.title
this.selectDradtForm.content = item.content
this.selectDradtForm.images = item.images
this.selectDradtForm.address = item.address
this.selectDradtForm.address_detail = item.address_detail
this.selectDradtForm.stock = item.stock
this.selectDradtForm.price = item.price
this.selectDradtForm.time = item.time
this.selectDradtForm.sign_time = item.sign_time
this.selectDradtForm.title = item.title
this.selectDradtForm.cate_ids = item.cate_ids
this.selectDradtForm.refund_id = item.refund_id
console.log('5555');
// this.closeDraftShow();
},
selectSureDraft() {
console.log('366666');
this.form.title = this.selectDradtForm.title
this.form.content = this.selectDradtForm.content
this.form.images = this.selectDradtForm.images
this.form.address = this.selectDradtForm.address
this.form.address_detail = this.selectDradtForm.address_detail
this.form.stock = this.selectDradtForm.stock
this.form.price = this.selectDradtForm.price
this.form.time = this.selectDradtForm.time
this.form.sign_time = this.selectDradtForm.sign_time
this.form.title = this.selectDradtForm.title
this.form.cate_ids = this.selectDradtForm.cate_ids
this.form.refund_id = this.selectDradtForm.refund_id
console.log('99999');
this.closeDraftShow();
},
apply() {
if (this.cardStatus == -1) {
this.cardShow = true;
@ -1680,7 +1981,8 @@
z-index: 10;
span {
width: 642rpx;
// width: 642rpx;
width: 435rpx;
height: 80rpx;
background: #323232;
border-radius: 401rpx 401rpx 401rpx 401rpx;
@ -1692,6 +1994,85 @@
margin: 0 auto;
margin-top: 30rpx;
}
.btns {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
margin-top: 30rpx;
span {
// width: 642rpx;
width: 435rpx;
height: 80rpx;
background: #323232;
border-radius: 401rpx 401rpx 401rpx 401rpx;
font-family: YouSheBiaoTiHei;
font-weight: 400;
font-size: 36rpx;
color: #BBFC5B;
line-height: 32rpx;
margin: 0 auto;
margin-top: 30rpx;
}
.saveDraft {
width: 235rpx;
height: 70rpx;
position: relative;
top: 10rpx;
border: 2rpx solid #323232;
background-color: #ffffff;
text-align: center;
color: #323232;
font-family: YouSheBiaoTiHei;
font-size: 36rpx;
font-weight: 400;
border-radius: 50rpx;
margin: 0 auto;
display: grid;
align-items: center;
}
.draftBox {
width: 235rpx;
height: 70rpx;
position: relative;
top: 10rpx;
border: 2rpx solid #323232;
background-color: #ffffff;
text-align: center;
color: #323232;
font-family: YouSheBiaoTiHei;
font-size: 36rpx;
font-weight: 400;
border-radius: 50rpx;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: center;
}
.submitPublish {
margin-left: 20rpx;
width: 435rpx;
height: 90rpx;
border: 2rpx solid #323232;
background-color: #323232;
color: #BBFC5B;
font-family: YouSheBiaoTiHei;
font-size: 36rpx;
font-weight: 400;
text-align: center;
border-radius: 50rpx;
margin: 0 auto;
display: grid;
align-items: center;
}
}
}
.inputl {
@ -1880,6 +2261,180 @@
}
.popup_tkallDraft {
z-index: 100;
background-color: #f7f7f7;
.popup_tkDraft {
font-size: 36rpx;
margin: 12rpx 0 24rpx 0;
text-align: center;
}
.popup-content {
height: 900rpx;
overflow-y: auto;
margin-top: 30rpx;
width: 100%;
padding: 0rpx;
background-color: #f7f7f7;
.invoiceList {
width: 690rpx;
height: auto;
.invoiceList-item {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #ffffff;
width: 93%;
margin-top: 20rpx;
padding: 20rpx 20rpx;
height: 220rpx;
border-radius: 40rpx 40rpx 40rpx 40rpx;
// &.active {
// background-color: ##F0FFDF;
// border: 2rpx solid #9CEAA2;
// border-image: linear-gradient(270deg, rgba(251.00000023841858, 246.0000005364418, 109.00000110268593, 1), rgba(156.00000590085983, 234.00000125169754, 162.00000554323196, 1)) 2 2;
// border-radius: 40rpx;
// // clip-path: inset(0px round 16rpx);
// }
.item-img {
width: 170rpx;
height: 170rpx;
// margin-left: 40rpx;
}
.item-con {
margin-left: 20rpx;
width: 90%;
height: 160rpx;
position: relative;
color: #323232;
.itenCon-actName {
position: absolute;
top: 0;
font-size: 28rpx;
font-weight: 400;
}
.itenCon-actCon {
// position: absolute;
// top: 100rpx;
margin-top: 60rpx;
font-size: 28rpx;
font-weight: 400;
}
.itenCon-actPrice {
position: absolute;
bottom: 0;
font-size: 26rpx;
font-weight: 900;
}
}
}
.invoiceList-itemSelect {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #F0FFDF;
width: 93%;
margin-top: 20rpx;
padding: 20rpx 20rpx;
height: 220rpx;
border-radius: 40rpx 40rpx 40rpx 40rpx;
border: 2rpx solid #9CEAA2;
// border-image: linear-gradient(270deg, rgba(251.00000023841858, 246.0000005364418, 109.00000110268593, 1), rgba(156.00000590085983, 234.00000125169754, 162.00000554323196, 1)) 2 2;
.item-img {
width: 170rpx;
height: 170rpx;
// margin-left: 40rpx;
}
.item-con {
margin-left: 20rpx;
width: 90%;
height: 160rpx;
position: relative;
color: #323232;
display: grid;
.itenCon-actName {
// position: absolute;
// top: 0;
font-size: 28rpx;
font-weight: 400;
}
.itenCon-actCon {
// position: absolute;
// top: 100rpx;
// margin-top: 60rpx;
font-size: 28rpx;
font-weight: 400;
}
.itenCon-actPrice {
// position: absolute;
// bottom: 0;
font-size: 26rpx;
font-weight: 900;
}
}
}
}
.popup-footer {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
.headBtn {
width: 90%;
height: 90rpx;
background-color: #323232;
border-radius: 148rpx;
color: #BBFC5B;
font-size: 36rpx;
font-weight: 400;
line-height: 50rpx;
font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
text-transform: none;
font-style: normal;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
position: fixed;
bottom: 66rpx;
margin-left: 2%;
}
}
}
}
.popup_tkall {
// height: 1100rpx;
z-index: 100;
@ -1891,10 +2446,42 @@
text-align: center;
}
.popup-content {
height: 900rpx;
overflow-y: auto;
margin-top: 30rpx;
width: 100%;
.popup-footer {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
.headBtn {
width: 90%;
height: 90rpx;
background-color: #323232;
border-radius: 148rpx;
color: #BBFC5B;
font-size: 36rpx;
font-weight: 400;
line-height: 50rpx;
font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
text-transform: none;
font-style: normal;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
position: fixed;
bottom: 66rpx;
margin-left: 2%;
}
}
}
.popup-content-item {