ccjgmwz 3 lat temu
rodzic
commit
91cc1c3b3d
1 zmienionych plików z 6 dodań i 44 usunięć
  1. 6 44
      pages/sale/newsinfo.vue

+ 6 - 44
pages/sale/newsinfo.vue

@@ -125,7 +125,7 @@
 				}, 1000);
 			},
 			computed: {
-				...mapState(['hasLogin', 'userInfo'])
+				...mapState(['hasLogin', 'userInfo']),
 			},
 			methods: {
 				
@@ -209,55 +209,15 @@
 					})
 				},
 				getIndexSaleData() {
-					// const that = this
-					// var pages = that.pages
-					// var limit = that.limit
-					// uni.showLoading({
-					// 	title: '正在加载'
-					// })
-					// that.$api.request('integral', 'getIndexSaleData', {
-					// 	page: pages,
-					// 	limit: limit
-					// }, failres => {
-					// 	that.$api.msg(failres.errmsg)
-					// 	that.isLoadMore = false
-					// 	that.loadStatus = 'nomore'
-					// 	if (that.pages > 1) {
-					// 		that.pages -= 1
-					// 	}
-					// 	uni.hideLoading()
-					// }).then(res => {
-					// 	let data = res.data
-					// 	//销售信息
-					// 	if (data.saleInfo.length > 0 ) {
-					// 		that.saleInfo = that.saleInfo.concat(data.saleInfo)
-					// 		that.isLoadMore = false
-					// 	} else {
-					// 		if (that.pages > 1) {
-					// 			that.pages -= 1
-					// 		}
-					// 		that.isLoadMore = true
-					// 		that.loadStatus = 'nomore'
-					// 	}
-					// 	if(data.saleInfo.length < that.limit){
-					// 		if (that.pages > 1) {
-					// 			that.pages -= 1
-					// 		}
-					// 		that.isLoadMore = true
-					// 		that.loadStatus = 'nomore'
-					// 	}
-					// 	uni.hideLoading()
-					// })
 					const that = this
 					var pages=that.pages
 					var limit=that.limit
 								   
 					uni.showLoading({
-						title: '正在加载',
-						mask:true
+						title: '正在加载'
 					})
 					that.$api.request('news', 'getNewsInfo', {
-						category:this.category,
+						category:2,
 						page: pages,
 						limit:limit
 					},failres => {
@@ -270,7 +230,9 @@
 						let data = res.data
 						if(data.length > 0){
 							for(var k =0;k<data.length;k++){
-								data[k].gmtUpdate=formatDate(Date.parse(data[k].gmtUpdate))
+								if(data[k].title.length > 20){
+									data[k].title = data[k].title.substring(0,20) + "..."
+								}
 							}
 							that.newsInfo = that.newsInfo.concat(data)
 							that.isLoadMore=false