This commit is contained in:
jiangnan 2023-08-03 11:05:06 +08:00
parent 946deb8bbf
commit fe9fd1c789
3 changed files with 1093 additions and 644 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,441 @@
<template>
<view class="box">
<view class="form_line">
<view class="form_left">
标题
</view>
<view class="form_right">
<u--input placeholder="请输入名称" v-model="title" clearable border="none" inputAlign="right" style="color: #251B1D;">
</u--input>
</view>
</view>
<view class="form_line">
<view class="form_left">
节目
</view>
<view class="form_right" @click="showType = true">
<u--input placeholder="请选择" clearable border="none" inputAlign="right" style="color: #251B1D;"
suffixIcon="arrow-right" readonly v-model="programs" disabledColor="#ffffff">
</u--input>
</view>
</view>
<u-popup :show="showType" @close="close" closeOnClickOverlay :round="5" customStyle="padding: 16px;">
<u-radio-group @change="selectForm1" v-model="programs" :borderBottom="true" placement="column"
iconPlacement="right">
<u-radio :customStyle="{ marginBottom: '16px' }" v-for="(item, index) in program" :key="index" :label="item.name"
labelSize="28rpx" labelColor="#231F1C" :name="item.id" activeColor="#99241B ">
</u-radio>
<u-button class="custom-style" style="background-color:#99241B ; color: #FFFFFF; margin-top: 32rpx;"
type="default" @click="showType = false">确认</u-button>
</u-radio-group>
</u-popup>
<view class="form_line">
<view class="form_left">
团队
</view>
<view class="form_right" @click="showTypes = true">
<u--input placeholder="请选择" clearable border="none" inputAlign="right" style="color: #251B1D;"
suffixIcon="arrow-right" readonly v-model="teams" disabledColor="#ffffff">
</u--input>
</view>
</view>
<u-popup :show="showTypes" @close="close" closeOnClickOverlay :round="5" customStyle="padding: 16px;">
<u-radio-group @change="selectForm1" v-model="teams" :borderBottom="true" placement="column" iconPlacement="right">
<u-radio :customStyle="{ marginBottom: '16px' }" v-for="(item, index) in team" :key="index" :label="item.name"
labelSize="28rpx" labelColor="#231F1C" :name="item.id" activeColor="#99241B ">
</u-radio>
<u-button class="custom-style" style="background-color:#99241B ; color: #FFFFFF; margin-top: 32rpx;"
type="default" @click="showTypes = false">确认</u-button>
</u-radio-group>
</u-popup>
<view class="form_line">
<view class="form_left">
开始时间
</view>
<view class="form_right">
<uni-datetime-picker type="datetime" v-model="wTime" :border="false" :clearIcon="false" />
<!-- <u--input placeholder="请选择" clearable border="none" inputAlign="right" style="color: #251B1D;"
suffixIcon="calendar" readonly v-model="wTime" disabledColor="#ffffff">
</u--input> -->
</view>
</view>
<view class="form_line">
<view class="form_left">
截止时间
</view>
<view class="form_right">
<uni-datetime-picker type="datetime" v-model="eTime" :border="false" :clearIcon="false" />
<!-- <u--input placeholder="请选择" clearable border="none" inputAlign="right" style="color: #251B1D;"
suffixIcon="calendar" readonly v-model="eTime" disabledColor="#ffffff">
</u--input> -->
</view>
</view>
<view class="operation" @click="next">
发布
</view>
</view>
</template>
<script>
import http from '../../request/interface.js'
export default {
data () {
return {
title: '',
typeId: '',
showType: false,
type: '',
radiolist1: [],
text1: '',
text2: '',
showTime: false,
timeTab: 0,
eTime: '',
wTime: '',
timeValue: Number(new Date()),
showUser: false,
userType: '',
userTypeValue: 'wyrc,zyz',
radiovalue2: [],
radiolist2: [],
morePer: true,
perNumber: 1,
fileList3: [],
ok: true,
team: [],
teams: '',
program: [],
programs: '',
showTypes: false
}
},
onShow () {
},
async onLoad () {
await this.getCurrentTime()
await this.teamandprogram()
},
methods: {
getCurrentTime () {
//
let yy = new Date().getFullYear();
let mm = new Date().getMonth() + 1;
let dd = new Date().getDate();
let gettime = yy + '-' + mm + '-' + dd;
this.eTime = gettime
this.wTime = gettime
},
//
// getTypeList () {
// this.http.request('/hallType/list', {}, "GET").then(res => {
// if (res.code == 200) {
// this.radiolist1 = res.data.records
// }
// }).catch(e => {
// uni.showToast({
// title: e.data.message,
// icon: "none",
// });
// })
// },
//
// getUserList () {
// this.http.request('/hall/yhlx', {}, "GET").then(res => {
// if (res.code == 200) {
// this.radiolist2 = res.data
// }
// }).catch(e => {
// uni.showToast({
// title: e.data.message,
// icon: "none",
// });
// })
// },
close () {
this.showType = false
this.showTime = false
this.showUser = false
},
selectForm1 (form) {
let _this = this
this.radiolist1.forEach(function (item) {
if (item.name == form) {
_this.typeId = item.code
}
})
},
chooseTime (val) {
this.showTime = true
this.timeTab = val
},
sureTime (e) {
if (this.timeTab == 0) {
this.eTime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM')
} else {
this.wTime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM')
}
this.showTime = false
},
// selectForm2 () {
// let _this = this
// let code = []
// this.radiolist2.forEach(function (item) {
// _this.radiovalue2.forEach(function (ele) {
// if (item.label == ele) {
// code.push(item.value)
// }
// })
// })
// this.userTypeValue = code.join(',')
// this.userType = this.radiovalue2.join(',')
// this.showUser = false
// },
changeTrue (e) {
console.log('change', e);
},
valChange (e) {
console.log('当前值为: ' + e.value)
},
//
deletePic (event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
//
// async afterRead (event) {
// // mutiple true , file
// let lists = [].concat(event.file)
// let fileListLen = this[`fileList${event.name}`].length
// lists.map((item) => {
// this[`fileList${event.name}`].push({
// ...item,
// status: 'uploading',
// message: ''
// })
// })
// for (let i = 0; i < lists.length; i++) {
// const result = await this.uploadFilePromise(lists[i].url)
// let item = this[`fileList${event.name}`][fileListLen]
// this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
// status: 'success',
// message: '',
// url: result
// }))
// fileListLen++
// }
// },
// uploadFilePromise (url) {
// let token = uni.getStorageSync('token');
// return new Promise((resolve, reject) => {
// let a = uni.uploadFile({
// url: http.config.baseUrl + '/file/upload',
// filePath: url,
// name: 'file',
// formData: {
// user: 'test'
// },
// header: {
// "X-Token": token
// },
// success: (res) => {
// if (JSON.parse(res.data).code == 200) {
// setTimeout(() => {
// resolve(JSON.parse(res.data).data.path)
// }, 1000)
// } else {
// uni.showToast({
// title: JSON.parse(res.data).message,
// icon: "none",
// });
// this.fileList3.pop()
// }
// }
// });
// })
// },
next () {
this.ok = true
if (this.title == '') {
uni.showToast({
title: '请输入名称',
icon: "none",
});
this.ok = false
return
}
if (this.teams == '') {
uni.showToast({
title: '请选择团队',
icon: "none",
});
this.ok = false
return
}
if (this.programs == '') {
uni.showToast({
title: '请选择团队',
icon: "none",
});
this.ok = false
return
}
if (this.eTime == '') {
uni.showToast({
title: '请选择截止日期',
icon: "none",
});
this.ok = false
return
}
if (this.wTime == '') {
uni.showToast({
title: '请选择开始日期',
icon: "none",
});
this.ok = false
return
}
if (this.eTime.length < 12) {
uni.showToast({
title: '请选择截止时间',
icon: "none",
});
this.ok = false
return
}
if (this.wTime.length < 12) {
uni.showToast({
title: '请选择活动时间',
icon: "none",
});
this.ok = false
return
}
if (this.ok) {
this.http.request('/artCountryside/add', {
title: this.title,
showId: this.programs,
teams: this.teams,
endTime: this.eTime,
startTime: this.wTime,
}, "POST").then(res => {
if (res.code == 200) {
uni.navigateBack()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
}
},
teamandprogram () {
this.http.request('/artTeam/list', {}, 'GET').then(res => {
if (res.code === 200) {
this.team = []
this.program = []
res.data.records.forEach((item, index) => {
if (item.type == 'team') {
this.team.push(item)
} else {
this.program.push(item)
}
});
} else {
uni.showToast({
title: res.data.message,
icon: "error",
});
}
}).catch(err => {
})
}
}
}
</script>
<style></style>
<style lang="scss" scoped>
.box {
width: 100%;
height: 100%;
overflow-y: auto;
position: relative;
}
/deep/ .uni-icons {
display: none;
}
/deep/ .uni-date-x {
text-align: right;
padding: 0;
}
.form_line {
width: 686rpx;
padding: 0 32rpx;
display: flex;
align-items: center;
font-size: 32rpx;
justify-content: space-between;
height: 104rpx;
border-bottom: 1rpx solid #dadbde;
.form_right {
width: 450rpx;
}
}
.form_box {
width: 686rpx;
padding: 0 32rpx;
display: flex;
align-items: center;
font-size: 32rpx;
justify-content: space-between;
height: 104rpx;
}
.text_box {
width: 686rpx;
padding: 0 32rpx;
}
.gap {
color: #AFADB0;
background: #F5F5F5;
opacity: 1;
padding: 10rpx 32rpx;
font-size: 32rpx;
}
::v-deep .u-upload__wrap {
padding: 32rpx;
}
.upload {
padding: 32rpx;
}
.operation {
width: 654rpx;
height: 96rpx;
margin: 32rpx 48rpx 48rpx;
text-align: center;
line-height: 96rpx;
background-color: #99241B;
color: #fff;
font-size: 36rpx;
font-weight: 600;
position: absolute;
bottom: 0rpx;
}
</style>

View File

@ -24,7 +24,7 @@
<view class="teamBox-left">
<view class="teamMinbox-top">
<view class="title">{{ item.name }}</view>
<view class="street">丹东街道</view>
<view class="street">{{ item.villageName }}</view>
</view>
<view class="teamMinbox-bottom">
{{ item.introduce }}
@ -46,7 +46,7 @@
<view class="teamBox-left">
<view class="teamMinbox-top">
<view class="title">{{ item.name }}</view>
<view class="street">丹东街道</view>
<view class="street">{{ item.villageName }}</view>
</view>
<view class="teamMinbox-bottom">
{{ item.introduce }}
@ -124,7 +124,7 @@ export default {
},
toAddOrder () {
uni.navigateTo({
url: `/pagesB/orderHall/addOrder`
url: `/pagesD/wyxx/addindex`
})
},
teamandprogram () {
@ -247,7 +247,7 @@ export default {
color: #a02521;
margin-left: 18rpx;
padding: 2rpx 20rpx;
max-width: 120rpx;
max-width: 130rpx;
overflow: hidden;
/* 超出一行文字自动隐藏 */
text-overflow: ellipsis;