会议通知时间选择

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

View File

@@ -29,7 +29,8 @@
</div> </div>
<div class="card"> <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>
<div class="card item-wrap" @click="select"> <div class="card item-wrap" @click="select">
@@ -71,9 +72,10 @@
<div @click="add(1)">发布会议</div> <div @click="add(1)">发布会议</div>
</div> </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"/> <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> </div>
</template> </template>
@@ -111,6 +113,7 @@
files: [], files: [],
}, },
userSelect: false, userSelect: false,
value: Number(new Date())
} }
}, },
onLoad(opt) { onLoad(opt) {
@@ -118,7 +121,6 @@
this.form.id = opt.id this.form.id = opt.id
this.getDetail() this.getDetail()
} }
this.$dict.load("meetingNoticeBefore", "meetingNoticeAfter");
this.$nextTick(() => { this.$nextTick(() => {
let date = new Date(); let date = new Date();
this.form.startTime.time = date.getHours()?.toString()?.padStart(2, "0") + ":" + date.getMinutes()?.toString()?.padStart(2, "0") this.form.startTime.time = date.getHours()?.toString()?.padStart(2, "0") + ":" + date.getMinutes()?.toString()?.padStart(2, "0")
@@ -186,19 +188,29 @@
}) })
}, },
confirm(e) { 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) { if (this.index == 0) {
this.form.startTime = {...e} this.form.startTime = {year,month,day,timestamp:e.vaule}
this.form.startTime.time = e.hour + ":" + (e.minute.length > 1 ? e.minute : ("0" + e.minute)) this.form.startTime.time = hours + ":" + minutes
this.form.startTime.weekday = '一二三四五六'.charAt(new Date(e.timestamp * 1000).getDay()) this.form.startTime.weekday = '一二三四五六'.charAt(weekday)
} else { } else {
if (this.form.startTime.timestamp >= e.timestamp) { if (this.form.startTime.timestamp >= e.value) {
return this.$u.toast("结束时间不能小于开始时间"); return this.$u.toast("结束时间不能小于开始时间");
} }
this.form.endTime = {...e} this.form.endTime = {year,month,day,timestamp:e.vaule}
this.form.endTime.time = e.hour + ":" + (e.minute.length > 1 ? e.minute : ("0" + e.minute)) this.form.endTime.time = hours + ":" + minutes
this.form.endTime.weekday = '一二三四五六'.charAt(new Date(e.timestamp * 1000).getDay()) this.form.endTime.weekday = '一二三四五六'.charAt(weekday)
} }
this.show = false;
}, },
add(status) { add(status) {

View File

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

View File

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

View File

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