Browse Source

修改求购发布提示方式,修改求购获取信息剩余时间字段及计算方式

yangc 8 years ago
parent
commit
9f580ad640

+ 3 - 3
components/applyPurchase/ApplyInfo.vue

@@ -24,7 +24,7 @@
           <span>{{purchaseMan.userName}}</span>
           <span>{{purchaseMan.code}}</span>
           <span>{{purchaseMan.brand}}</span>
-          <span class="date-content"><span>剩余&nbsp;</span><span v-text="getDay(purchaseMan.deadline)"></span>&nbsp;天&nbsp;<span v-text="getHours(purchaseMan.deadline)"></span>&nbsp;小时</span>
+          <span class="date-content"><span>剩余&nbsp;</span><span v-text="getDay(purchaseMan.remainingTime)"></span>&nbsp;天&nbsp;<span v-text="getHours(purchaseMan.remainingTime)"></span>&nbsp;小时</span>
           <span class="number-content"><img src="/images/applyPurchase/hot-fire.png" alt="" v-if="purchaseMan.offerAmount > 10"><span :style="purchaseMan.offerAmount > 10 ? 'color: #ff9a00': ''">{{purchaseMan.offerAmount || 0}}</span>&nbsp;条</span>
           <span class="btn-content">
             <a>联系买家</a>
@@ -120,10 +120,10 @@
     },
     methods: {
       getDay: function (timeStamp) {
-        return Math.floor((timeStamp - new Date().getTime()) / (1000 * 60 * 60 * 24))
+        return Math.floor(timeStamp / (1000 * 60 * 60 * 24))
       },
       getHours: function (timeStamp) {
-        return Math.floor(((timeStamp - new Date().getTime()) / (1000 * 60 * 60)) % 24)
+        return Math.floor((timeStamp / (1000 * 60 * 60)) % 24)
       },
       listenPage: function (page) {
         this.nowPage = page

+ 2 - 2
components/applyPurchase/PublishApply.vue

@@ -171,8 +171,8 @@
         if (this.checkAll()) {
           this.$http.post('/seek/saveOneSeekPurchase', this.applyObj)
             .then(response => {
-//              this.$message.success('发布成功')
-              this.showRemindBox = true
+              this.$message.success('发布成功')
+//              this.showRemindBox = true
               this.emptyForm()
               this.$store.dispatch('applyPurchase/loadPurchaseManList', {page: 1, count: 10})
             }, error => {