瀏覽代碼

购物车修改

wcni 5 年之前
父節點
當前提交
7e68e48e33
共有 1 個文件被更改,包括 15 次插入7 次删除
  1. 15 7
      pages/index/cart.vue

+ 15 - 7
pages/index/cart.vue

@@ -115,7 +115,7 @@
 				isdelete: true,
 				isAll: false,
 				checkboxList:[],
-				list:[]
+				list:[],
 			}
 		},
 		// 隐藏分享菜单
@@ -187,6 +187,8 @@
 					success: () => {
 						this.nums = 0;
 					    this.listip = "删除" + '(' + this.nums + ')';
+						this.list = [];
+						this.checkboxList = [];
 						this.getshoplist();
 					}
 				})
@@ -198,10 +200,10 @@
 			
 			// 滚到底部
 			lower(e) {
-				this.page = this.page + 1;
-				if(this.ispull) {
-					this.getshoplist();
-				}
+				// this.page = this.page + 1;
+				// if(this.ispull) {
+				// 	this.getshoplist();
+				// }
 			},
 			
 			// 滚动时触发
@@ -228,7 +230,11 @@
 							 item.desarray = arr[0];
 							 item.descire = item.goods_name.replace(arr[0], '');
 						 })
-						this.list = data.cart_list;
+						if(data.cart_list.length < 10) {
+							this.ispull = false;
+							
+						}
+						this.list = this.list.concat(data.cart_list);
 						this.store = data.store;
 						//console.log(data.cart_list[0].goods_name.split(' '));
 					}
@@ -257,10 +263,12 @@
 				  price.push(array[item])
 			  })
 			  this.pricelist = price;
-			  let num = 0
+			  let num = 0;
+			  console.log(this.pricelist);
 			  this.pricelist.forEach(item => {
 				  num += item.goods_num;
 			  })
+			  console.log(num);
 			  this.nums = num;
 			  this.lengthnumber = this.pricelist.length;
 			   this.listip = this.isdelete ? "结算" + '(' + this.nums + ')' :'删除'+ '(' + this.nums + ')';