Quellcode durchsuchen

修改时间回显

wangchao vor 3 Jahren
Ursprung
Commit
787fe27627
1 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen
  1. 4 2
      pages/sale/newsinfo.vue

+ 4 - 2
pages/sale/newsinfo.vue

@@ -181,7 +181,7 @@
 								data[i].title = data[i].title.substring(0,25) + "..."
 							}
 							let _date = new Date(data[i].gmtUpdate)
-							data[i].gmtUpdate = this.$u.timeFormat(this.timestamp, 'mm-dd hh:MM');
+							data[i].gmtUpdate = this.$u.timeFormat(_date.getTime(), 'mm-dd hh:MM');
 						}
 						that.newsInfo = data
 						uni.hideLoading()
@@ -229,13 +229,15 @@
 						that.loadStatus = 'nomore'
 						if(that.pages>1){that.pages-=1}
 						uni.hideLoading()
-					}).then(res => {
+					}).then(res => {debugger
 						let data = res.data
 						if(data.length > 0){
 							for(var k =0;k<data.length;k++){
 								if(data[k].title.length > 20){
 									data[k].title = data[k].title.substring(0,20) + "..."
 								}
+								let _date = new Date(data[k].gmtUpdate)
+								data[k].gmtUpdate = this.$u.timeFormat(_date.getTime(), 'mm-dd hh:MM');
 							}
 							that.newsInfo = that.newsInfo.concat(data)
 							that.isLoadMore=false