Commit b467bab684c67baa8d31318347e88f1ca6557fc8

Authored by 刘淇
1 parent b63f86d6

卡券发放默认时间为一天有效

pages/businessCard/printCard.vue
@@ -64,6 +64,8 @@ export default { @@ -64,6 +64,8 @@ export default {
64 this.plName = option.plName 64 this.plName = option.plName
65 this.price = option.price 65 this.price = option.price
66 this.cardNum = option.cardNum 66 this.cardNum = option.cardNum
  67 + this.deadline = this.dateAdd(1)
  68 + console.log(this.deadline)
67 this.getCouponStaticQR() 69 this.getCouponStaticQR()
68 }, 70 },
69 onShow() { 71 onShow() {
@@ -79,6 +81,20 @@ export default { @@ -79,6 +81,20 @@ export default {
79 }, 81 },
80 computed: {}, 82 computed: {},
81 methods: { 83 methods: {
  84 +
  85 + timeAdd0(str) {
  86 + if (str < 10) {
  87 + str = '0' + str;
  88 + }
  89 + return str
  90 + },
  91 + dateAdd(days) {
  92 + var startDate = new Date();
  93 + startDate = +startDate + days * 1000 * 60 * 60 * 24;
  94 + startDate = new Date(startDate);
  95 + 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())
  96 + return nextStartDate;
  97 + },
82 changeValue(value) { 98 changeValue(value) {
83 this.numberValue = value 99 this.numberValue = value
84 }, 100 },