Quellcode durchsuchen

分页解决详情上传图片

LongYuFei vor 2 Jahren
Ursprung
Commit
0a8cc48b08
2 geänderte Dateien mit 19 neuen und 6 gelöschten Zeilen
  1. 15 2
      pages/index.vue
  2. 4 4
      pages/particulars/index.vue

+ 15 - 2
pages/index.vue

@@ -89,11 +89,14 @@
 			return {
 				// 查询条件
 				condition: {
-					range: []
+					range: [],
+					head: 1,
+					tail: 9
 				},
 				// 数据
 				orderBillsPlansList: [],
-				show: false
+				show: false,
+				
 			}
 		},
 		computed: {
@@ -105,9 +108,19 @@
 			this.getCurrentMonthFirst();
 			this.getOrderBillsPlansList();
 		},
+		onReachBottom() {
+			this.condition.head += 9;
+			this.condition.tail += 9;
+			orderBillsPlansList(this.condition).then(res => {
+				var next_data = res.data;
+				this.orderBillsPlansList = this.orderBillsPlansList.concat(next_data);
+			})
+		},
 		methods: {
 			// 查询主页数据
 			getOrderBillsPlansList() {
+				this.condition.head = 1;
+				this.condition.tail = 9;
 				orderBillsPlansList(this.condition).then(res => {
 					this.orderBillsPlansList = res.data;
 				})

+ 4 - 4
pages/particulars/index.vue

@@ -105,7 +105,7 @@
 
 			<u-collapse-item title="照片" name="img" ref="collapseHeight">
 				<!-- @afterRead="imgUploading" -->
-				<u-upload :fileList="fileList1" @delete="deletePic" name="1" multiple :previewFullImage="true"
+				<u-upload :fileList="fileList1" @afterRead="imgUploading" @delete="deletePic" name="1" multiple :previewFullImage="true"
 					:disabled="this.status317 == 6"></u-upload>
 			</u-collapse-item>
 
@@ -361,9 +361,9 @@
 			},
 			// 新增图片
 			imgUploading(event) {
-				this.$nextTick(() => {
-					this.$refs.xxxxxx111.init()
-				})
+				// this.$nextTick(() => {
+				// 	this.$refs.xxxxxx111.init()
+				// })
 
 				// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
 				let lists = [].concat(event.file)