会议通知时间选择

This commit is contained in:
wanglei
2021-11-19 11:12:47 +08:00
parent 69e3eda6e5
commit e4d0f6aa98
5 changed files with 53 additions and 43 deletions

View File

@@ -112,20 +112,17 @@
})
},
handleClick(index) {
let url
if (index == 0 || index == 2) {
this.comp = "meetingList";
this.params = index;
this.isList = false;
if (index == 0 || index == 2) {
this.comp = "meetingList";
} else if (index == 1) {
url = "/pages/meetingNotice/components/belongToMe"
this.comp = "belongToMe";
}
uni.navigateTo({url})
},
add() {
uni.navigateTo({
url: "/pages/meetingNotice/components/addMeeting"
})
this.isList = false;
this.comp = "addMeeting";
}
},
@@ -142,6 +139,7 @@
},
onShow() {
this.$dict.load("meetingNoticeBefore", "meetingNoticeAfter");
this.getData()
}
}

View File

@@ -29,7 +29,8 @@
</div>
<div class="card">
<AiUploader :multiple="true" type="file" :limit="9" placeholder="上传附件" @list="fileList" :def="form.files"></AiUploader>
<AiUploader :multiple="true" type="file" :limit="9" placeholder="上传附件" @list="fileList"
:def="form.files"></AiUploader>
</div>
<div class="card item-wrap" @click="select">
@@ -71,9 +72,10 @@
<div @click="add(1)">发布会议</div>
</div>
</div>
<u-picker mode="time" v-model="show" :params="params" @confirm="confirm"></u-picker>
<u-datetime-picker mode="datetime" :show="show" :value="value" @confirm="confirm"></u-datetime-picker>
<AiBack ref="aiBack" v-if="!userSelect"/>
<AiSelectEnterprise :visible.sync="userSelect" :value="form.attendees" v-if="userSelect" @change="change"></AiSelectEnterprise>
<AiSelectEnterprise :visible.sync="userSelect" :value="form.attendees" v-if="userSelect"
@change="change"></AiSelectEnterprise>
</div>
</template>
@@ -111,6 +113,7 @@
files: [],
},
userSelect: false,
value: Number(new Date())
}
},
onLoad(opt) {
@@ -118,7 +121,6 @@
this.form.id = opt.id
this.getDetail()
}
this.$dict.load("meetingNoticeBefore", "meetingNoticeAfter");
this.$nextTick(() => {
let date = new Date();
this.form.startTime.time = date.getHours()?.toString()?.padStart(2, "0") + ":" + date.getMinutes()?.toString()?.padStart(2, "0")
@@ -186,19 +188,29 @@
})
},
confirm(e) {
if (new Date().getTime() / 1000 > e.timestamp) return this.$u.toast("选择时间不能小于当前时间")
const date = new Date(e.value);
const year = date.getFullYear();
const month = date.getMonth() + 1;
const day = date.getDate();
const hours = date.getHours();
const minutes = date.getMinutes();
const seconds = date.getSeconds();
const weekday = date.getDay();
if (new Date().getTime() / 1000 > e.value) return this.$u.toast("选择时间不能小于当前时间")
if (this.index == 0) {
this.form.startTime = {...e}
this.form.startTime.time = e.hour + ":" + (e.minute.length > 1 ? e.minute : ("0" + e.minute))
this.form.startTime.weekday = '一二三四五六'.charAt(new Date(e.timestamp * 1000).getDay())
this.form.startTime = {year,month,day,timestamp:e.vaule}
this.form.startTime.time = hours + ":" + minutes
this.form.startTime.weekday = '一二三四五六'.charAt(weekday)
} else {
if (this.form.startTime.timestamp >= e.timestamp) {
if (this.form.startTime.timestamp >= e.value) {
return this.$u.toast("结束时间不能小于开始时间");
}
this.form.endTime = {...e}
this.form.endTime.time = e.hour + ":" + (e.minute.length > 1 ? e.minute : ("0" + e.minute))
this.form.endTime.weekday = '一二三四五六'.charAt(new Date(e.timestamp * 1000).getDay())
this.form.endTime = {year,month,day,timestamp:e.vaule}
this.form.endTime.time = hours + ":" + minutes
this.form.endTime.weekday = '一二三四五六'.charAt(weekday)
}
this.show = false;
},
add(status) {

View File

@@ -1,7 +1,7 @@
<template>
<div class="belong-to-me">
<ai-top-fixed>
<u-tabs :list="tabs" :is-scroll="false" :current="index" bar-width="88" :height="96" @change="change"></u-tabs>
<u-tabs :list="tabs" :is-scroll="false" :current="index" bar-width="88" :height="96" @click="change"></u-tabs>
</ai-top-fixed>
<div class="body">
<template v-if="list.length">
@@ -54,9 +54,6 @@
status: "加载更多",
}
},
onLoad() {
this.getList()
},
computed: {
tabs() {
return [
@@ -100,12 +97,16 @@
})
},
change(e) {
this.index = e
this.index = e.index
this.current = 1
this.getList()
},
},
created() {
this.getList()
},
onReachBottom() {
this.current = this.current + 1;
this.getList()

View File

@@ -44,8 +44,7 @@
components: {AiBack, AiEmpty},
props: {
params: {
type: String,
default: ""
type: [String,Number,Object],
}
},
data() {

View File

@@ -44,7 +44,7 @@
<img :src="$cdn + 'common/xzn.png'" v-else alt="">
</div>
<div class="person" v-if="item.type==0">
<u-avatar :src="item.avatar || ($cdn + 'common/xztx.png')" mode="square" :size="74"></u-avatar>
<u-avatar :src="item.avatar || ($cdn + 'common/xztx.png')" mode="square" :size="37"></u-avatar>
</div>
<u-row justify="between" style="width: 100%;">
@@ -58,7 +58,7 @@
<span class="ellipsis">{{item[tag]}}</span>
</template>
<template v-else>
<u-avatar :src="item.avatar || ($cdn + 'common/xztx.png')" mode="square" :size="74"
<u-avatar :src="item.avatar || ($cdn + 'common/xztx.png')" mode="square" :size="37"
style="margin: 0 17px;"></u-avatar>
<span class="ellipsis">{{item["name"]}}</span>
</template>