0
点赞
收藏
分享

微信扫一扫

uniapp 前端控制公告弹窗 控制在限定的时间内显示

大漠雪关山月 2022-02-24 阅读 100
	let firstDay = new Date();
		firstDay.setFullYear(2022, 0, 28);
		let lastDaty = new Date();
		lastDaty.setFullYear(2022, 1, 10);
		let today = new Date();
		console.log(lastDaty, 'lastDaty');
		console.log(firstDay, 'firstDay');
		console.log(today, 'today');
		if (firstDay < today && today < lastDaty) {
			//是否大于2022.1.28小于2022.2.10号
			this.dateShow = true;
		} else {
			this.dateShow = false;
		}
		this.noticeShow = uni.getStorageSync('dateShow') ? false : true;
<block v-if="dateShow">
			<u-modal v-model="noticeShow" :content="content" title=" " :show-cancel-button="false" @confirm="toNotice"></u-modal>
		</block>
举报

相关推荐

0 条评论