x 5 vuotta sitten
vanhempi
commit
4aa250b33e
1 muutettua tiedostoa jossa 5 lisäystä ja 16 poistoa
  1. 5 16
      src/views/user/UserVip.vue

+ 5 - 16
src/views/user/UserVip.vue

@@ -18,7 +18,7 @@
           </div>
           <div class="spacer"></div>
           <div class="date">
-            {{ formatTime(userInfo.vip_time) }}
+            {{ new Date(userInfo.vip_time * 1000).Format("yyyy-MM-dd") }}
           </div>
           <!-- <div class="nav acea-row" v-if="vipInfo.grade == grade">
               <div
@@ -245,25 +245,14 @@ export default {
     drawClick: function() {
       var that = this;
       drawVIP().then(res => {
-        if (res.status == 200) {
-          that.$dialog.message("领取成功!");
-          that.update();
-        } else {
-          that.$dialog.message(res.msg);
-        }
+        that.$dialog.message("领取成功!");
+        that.update();
+      }).catch(err => {
+          that.$dialog.error(err.msg);
       });
     },
     upgradeClick: function() {
       this.$router.push({ path: "/detail/" + this.productId });
-    },
-    formatTime: function(UnixTime) {
-      var date = new Date(UnixTime * 1000);
-      var y = date.getFullYear();
-      var m = date.getMonth() + 1;
-      m = m < 10 ? "0" + m : m;
-      var d = date.getDate();
-      d = d < 10 ? "0" + d : d;
-      return y + "-" + m + "-" + d;
     }
   }
 };