From 6409b72811ea4f4548a1fb46fc3848649664baf6 Mon Sep 17 00:00:00 2001 From: lfs3 Date: Sat, 27 Jul 2019 02:02:27 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/view/month-card.vue | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/view/month-card.vue b/src/view/month-card.vue index 6442b6b..2fd8e39 100644 --- a/src/view/month-card.vue +++ b/src/view/month-card.vue @@ -137,7 +137,21 @@ export default { }); }); }, - + getTime(time) { + let date = new Date(time); + let year = date.getFullYear(); + let month = this.checkTime(date.getMonth() + 1); + let day = this.checkTime(date.getDate()); + let str = + year + "-" + month + "-" + day; + return str; + }, + checkTime(i) { + if (i < 10) { + i = "0" + i; + } + return i; + }, // 立即使用优惠券 handleUseCoupon() { window.location.href = @@ -197,13 +211,14 @@ export default { } }, mounted() { - let uuniqueId = Qs.parse(location.search.substring(1)).uniqueId + // let uuniqueId = Qs.parse(location.search.substring(1)).uniqueId var url = location.href.split('?')[0] - if(this.uniqueId !== undefined && this.uniqueId !== null && this.uniqueId !== ""){ + if(this.uniqueId === undefined || this.uniqueId === null || this.uniqueId === ""){ this.uniqueId = '' } // 初始化 this.handleInit(); + console.log('uniqueId:'+this.uniqueId) return new Promise((resolve, reject) => { var params = { salesmanUniqueIdentity: this.uniqueId,