set cache
handleShow (card) {
if (!this.form.activityEndTime) {
this.$message.error("");
return ;
} else if (this.selectTicket.length < 10){
this.$refs.dialog.show(null, this.form.activityEndTime);
} else {
this.$message.error("10");
}
localStorage.setItem("activitySaved",JSON.stringify(this.form));
let test = JSON.parse(localStorage.activitySaved);
console.log(test);
},
enter the read cache through a specific page
beforeRouteEnter (from, to, next) {
next(vm => {
if (to.path.includes("/MarketingManage/Coupon/AddCoupon")) {
if (localStorage.getItem("activitySaved")){
vm.form = JSON.parse(localStorage.activitySaved);
console.log(2,vm.form.activityStartTime);
}
}
});
},
after reading
return {
startPickerOptions: {
disabledDate (currentDate) {
console.log(2,_this.form.activityStartTime);
return _this.$moment().startOf("days").valueOf() > currentDate.getTime()
|| (_this.form.activityEndTime && currentDate.getTime() > _this.form.activityEndTime.getTime());
}
},
endPickerOptions: {
disabledDate (currentDate) {
return (_this.$moment().startOf("days").valueOf() + 86400000) > currentDate.getTime()
|| currentDate.getTime() <= _this.form.activityStartTime.getTime() - 86400000;
}
},
startTime: minutes >= 30 ? _this.$moment().add(1, "hours").format("HH:00") : _this.$moment().format("HH:30"),
endTime: "00:00",
commitStatus: true
};
},