提交 795a92cc 编写于 作者: 2 222000134

修改小队发布活动的时间限制

上级 85787898
......@@ -22,26 +22,8 @@
<view class="input-wrapper">
<view class="form-input2-wrapper">
<view class="form-input2">
<picker mode="date" start="1970-01-01" end="2100-12-31" @change="handleDateChange1">
<view class="picker">{{ start_date }}</view>
</picker>
</view>
<view class="form-input2">
<picker mode="time" start="00:00" end="23:59" @change="handleTimeChange1">
<view class="picker">{{ start_time }}</view>
</picker>
</view>
</view>
<view class="form-input2-wrapper">
<view class="form-input2">
<picker mode="date" start="1970-01-01" end="2100-12-31" @change="handleDateChange2">
<view class="picker">{{ end_date }}</view>
</picker>
</view>
<view class="form-input2">
<picker mode="time" start="00:00" end="23:59" @change="handleTimeChange2">
<view class="picker">{{ end_time }}</view>
</picker>
<uni-datetime-picker v-model="datetimerange" type="datetimerange" start="2020-05-29 20:10:10"
end="2999-05-29 20:10:10" rangeSeparator="至" />
</view>
</view>
</view>
......@@ -63,22 +45,61 @@
</template>
<script>
import DateSelector from '@/components/dengrq-datetime-picker/dateSelector/index.vue';
export default {
components: {
DateSelector
},
data() {
return {
single: '2021-04-3',
datetimesingle: '2021-04-3',
range: ['2021-03-8', '2021-4-20'],
datetimerange: ['2023-05-29 20:10:10', '2023-06-10 10:10:10'],
userId: '',
name: '',
content: '',
object: '',
place: '',
contact: '',
start_date: '2023-05-10',
end_date: '2023-05-10',
start_time: '18:00',
end_time: '18:00',
start_date: '',
end_date: '',
}
},
watch: {
datetimesingle(newval) {
console.log('单选:', this.datetimesingle);
},
range(newval) {
console.log('范围选:', this.range);
},
datetimerange(newval) {
console.log('范围选:', this.datetimerange);
}
},
mounted() {
setTimeout(() => {
this.datetimesingle = '2021-5-1'
this.single = '2021-5-1'
}, 1000)
},
methods: {
change(e) {
this.single = e
console.log('-change事件:', e);
},
onDateSelectorChange({
startDate,
endDate
}) {
console.log('onDateSelectorChange', startDate, endDate);
},
onDateSelectorSubmit({
startDate,
endDate
}) {
console.log('onDateSelectorSubmit', startDate, endDate);
},
goBack() {
uni.navigateBack({
url: '/pages/team/main'
......@@ -88,6 +109,11 @@
this.userId = getApp().globalData.userId
},
async submit() {
this.start_date = this.datetimerange[0]
this.end_date = this.datetimerange[1]
console.log(this.userId, 'this.userId')
console.log(this.start_date)
console.log(this.end_date)
if (this.name == '' || this.content == '' || this.start_date == '' || this.end_date == '' || this
.place == '' || this.object == '' || this.contact == '') {
uni.showToast({
......@@ -96,38 +122,36 @@
});
return;
}
this.start_date = this.start_date + ' ' + this.start_time
this.end_date = this.end_date + ' ' + this.end_time
console.log(this.userId, 'this.userId')
uniCloud.callFunction({
name: 'fe-team-createActivity',
data: {
title: this.name,
content: this.content,
startDate: this.start_date,
endDate: this.end_date,
userId: this.userId,
place: this.place,
participants: this.object,
contact: this.contact,
}
})
.then(res => {
console.log(res)
if (res.result.code == 200) {
uni.showToast({
title: '提交成功',
icon: 'success'
});
this.goBack()
} else {
uni.showToast({
title: '提交失败',
icon: 'error'
});
}
// uniCloud.callFunction({
// name: 'fe-team-createActivity',
// data: {
// title: this.name,
// content: this.content,
// startDate: this.start_date,
// endDate: this.end_date,
// userId: this.userId,
// place: this.place,
// participants: this.object,
// contact: this.contact,
// }
// })
// .then(res => {
// console.log(res)
// if (res.result.code == 200) {
// uni.showToast({
// title: '提交成功',
// icon: 'success'
// });
// this.goBack()
// } else {
// uni.showToast({
// title: '提交失败',
// icon: 'error'
// });
// }
})
// })
},
handleDateChange1(event) {
this.start_date = event.detail.value
......@@ -256,14 +280,15 @@
.form-input2 {
border-radius: 5px;
margin-top: 5px;
margin-left: 10px;
width: 30%;
margin-left: 2px;
margin-right: 15px;
width: 100%;
height: 35px;
border: none;
outline: none;
font-size: 14px;
color: #333;
background-color: #edeef0;
/* background-color: #edeef0; */
padding: 0 10px;
}
</style>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册