diff --git a/pages/businessCard/printCard.vue b/pages/businessCard/printCard.vue index e6bb5ec..3daac61 100644 --- a/pages/businessCard/printCard.vue +++ b/pages/businessCard/printCard.vue @@ -64,6 +64,8 @@ export default { this.plName = option.plName this.price = option.price this.cardNum = option.cardNum + this.deadline = this.dateAdd(1) + console.log(this.deadline) this.getCouponStaticQR() }, onShow() { @@ -79,6 +81,20 @@ export default { }, computed: {}, methods: { + + timeAdd0(str) { + if (str < 10) { + str = '0' + str; + } + return str + }, + dateAdd(days) { + var startDate = new Date(); + startDate = +startDate + days * 1000 * 60 * 60 * 24; + startDate = new Date(startDate); + var nextStartDate = startDate.getFullYear() + "-" + this.timeAdd0((startDate.getMonth() + 1)) + "-" + this.timeAdd0(startDate.getDate()) + " " + this.timeAdd0(startDate.getHours()) + ":" + this.timeAdd0(startDate.getMinutes()) + ":" + this.timeAdd0(startDate.getSeconds()) + return nextStartDate; + }, changeValue(value) { this.numberValue = value },