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

阅读 100

2022-02-24

	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)

0 0 举报