Commit 1e06c01ae1da0be044a6df8a6f679ff086637167

Authored by 刘淇
1 parent e1beceff

二维码有效期必须大于当前时间

pages/businessCard/printCard.vue
... ... @@ -136,8 +136,25 @@ export default {
136 136 },
137 137 changeTime: function () {
138 138 console.log(this.single)
139   - this.deadline = this.single
140   - this.getCouponStaticQR()
  139 + console.log(new Date(this.single).getTime())
  140 + console.log(new Date().getTime())
  141 + if(new Date(this.single).getTime()<new Date().getTime()){
  142 + uni.showToast({
  143 + title: '二维码有效期时间必须大于当前时间',
  144 + icon: 'none',
  145 + duration: 2000
  146 + })
  147 + }else{
  148 + uni.showToast({
  149 + title: '2',
  150 +
  151 + duration: 2000
  152 + })
  153 +
  154 + this.deadline = this.single
  155 + this.getCouponStaticQR()
  156 + }
  157 +
141 158 },
142 159 // 小程序保存图片
143 160 savePosterPath(url) {
... ...
pages/businessCard/provideCard.vue
... ... @@ -70,9 +70,10 @@ export default {
70 70 }, 60000)
71 71 },
72 72 onUnload() {
73   - if(this.timer) {
74   - clearTimeout(this.timer);
75   - this.timer = null;
  73 + let me = this
  74 + if(me.timer) {
  75 + clearTimeout(me.timer);
  76 + me.timer = null;
76 77 }
77 78 },
78 79 onShow() {
... ...