Commit 1e06c01ae1da0be044a6df8a6f679ff086637167
1 parent
e1beceff
二维码有效期必须大于当前时间
Showing
2 changed files
with
23 additions
and
5 deletions
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