瀏覽代碼

小程序运营端页面处理

oyq28 2 年之前
父節點
當前提交
13bf02d5c9

+ 41 - 11
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/door/door.vue

@@ -15,7 +15,7 @@
 		<view class="picker">
 			<view class="fb-type">
 			   <text>{{range[0]}} - {{range[1]}}</text>
-			   <button type="primary" @click="onShowDatePicker('range')">选择日期范围</button>
+			   <button type="primary" @click="onShowDatePicker('range')">选择</button>
 			</view>			
 		</view>
 		<mx-date-picker :show="showPicker" :type="type" :value="value" :show-tips="true" :begin-text="'开始'"           
@@ -30,7 +30,8 @@
 				<text class="lcolumn">{{item.time}}</text>
 				<text class="rcolumn">{{item.action}}</text>
 			</view>
-			<view class="fb-btn" @tap="fetch">点击加载更多</view>
+			<!--<view class="fb-btn" @tap="fetch">点击加载更多</view>-->
+			<uni-load-more status="more"></uni-load-more>
 		</view>
 	</view>
 </template>
@@ -56,7 +57,9 @@
 					time: '2022-01-08 08:08',
 					action: '关门'
 				}],
+				queryParams: util.initQueryParams(),
 				range: [],
+				totalPages: 1,
 				value: '',
 				type: '',
 				showPicker: false,				
@@ -72,6 +75,14 @@
 		methods: {
 			bindPickerChange: function(e) {
 				this.index = e.detail.value
+				this.queryParams.model.action=this.index;
+				let pages = getCurrentPages();
+				let page = pages[pages.length - 1].$page.fullPath;
+				let equId = page.split('equId=')[1]
+				equId = equId? equId: ""
+				this.records = []
+				this.queryParams.current = 1
+				this.fetch(equId)
 			},
 			bindDateChange: function(e) {
 				this.date = e.detail.value
@@ -86,23 +97,42 @@
 				console.log(JSON.stringify(e))
 				this.showPicker = false;
 				if (e) {
-					this[this.type] = e.value;
+					this[this.type] = e.value;					
 				}
-				this.fetch()
+				let pages = getCurrentPages();
+				let page = pages[pages.length - 1].$page.fullPath;
+				let equId = page.split('equId=')[1]
+				equId = equId? equId: ""
+				this.fetch(equId)
 			},
-			fetch: function(e) {
+			fetch: function(equId) {
 				let that = this;
-				
-				util.request(api.DoorList, {
-					page: that.page,
-					size: that.size
-				}, 'GET').then(function(res) {
-					if (res.errno === 0) {
+				that.queryParams.model.equId = equId
+				util.request(api.DoorList, that.queryParams, 'POST', 'application/json').then(function(res) {
+					if (res.code === 0) {
 						//that.orderList = that.orderList.concat(res.data.data)
 						//that.page = res.data.currentPage + 1
 						//that.totalPages = res.data.totalPages
+						that.records = that.records.concat(res.data.records)
+						that.totalPages = res.data.pages
 					}
 				});
+			},
+			onReachBottom: function() {
+				let pages = getCurrentPages();
+				let page = pages[pages.length - 1].$page.fullPath;
+				let equId = page.split('equId=')[1]
+				equId = equId? equId: ""
+				if (this.totalPages > this.queryParams.current) {
+					this.queryParams.current = this.queryParams.current + 1
+				} else {
+					return false;
+				}
+				this.fetch(equId)
+			},
+			onLoad: function(option) {
+				let equId = option.equId? option.equId : ""
+				this.fetch(equId);
 			}
 		},
 	}

+ 1 - 1
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/material/cup.vue

@@ -396,7 +396,7 @@
 				that.queryParams.model.barrelType = "1"
 				util.request(api.RecordList, that.queryParams, 'Post', 'application/json').then(function(res) {
 					if (res.code === 0) {
-						that.records = res.data.records
+						that.records = that.records.concat(res.data.records)
 						that.totalPages = res.data.pages
 					}
 				});

+ 4 - 4
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/material/material.vue

@@ -52,8 +52,8 @@
 				</uni-tr>
 			</uni-table>
 
-			<uni-table border stripe emptyText="暂无更多数据" v-show="false">
-				<!-- 表头行 -->
+			<!--<uni-table border stripe emptyText="暂无更多数据" v-show="false">
+				
 				<uni-tr>
 					<uni-th align="center"></uni-th>
 					<uni-th align="center">原料</uni-th>
@@ -66,7 +66,7 @@
 					<uni-td align="center">{{item.specs}}</uni-td>
 					<uni-td align="center">{{item.date}}</uni-td>
 				</uni-tr>
-			</uni-table>
+			</uni-table> -->
 
 			<uni-load-more status="more"></uni-load-more>
 		</uni-section>
@@ -421,7 +421,7 @@
 				that.queryParams.model.equId = equId
 				util.request(api.RecordList, that.queryParams, 'Post', 'application/json').then(function(res) {
 					if (res.code === 0) {
-						that.records = res.data.records
+						that.records = that.records.concat(res.data.records)
 						that.totalPages = res.data.pages
 					}
 				});

+ 7 - 0
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/ucenter/order/order.vue

@@ -142,6 +142,13 @@
 			bindPickerChange2: function(e) {
 				this.index2 = e.detail.value
 				this.deviceId = this.deviceList[this.index2].id
+				this.orderList = []
+				this.queryParams.current = 1
+				this.queryParams.model.equId = this.deviceId
+				let pages = getCurrentPages();
+				let page = pages[pages.length - 1].$page.fullPath;
+				let oType = page.split('type=')[1]				
+				this.getOrderList(oType)
 			},
 			bindDateChange: function(e) {
 				this.date = e.detail.value

+ 1 - 1
imcs-bt-fe/imcs-bt-fe/uni-mall/utils/api.js

@@ -66,7 +66,7 @@ module.exports = {
 	OrderCancel: 'order/cancelOrder', //取消订单
 	OrderConfirm: 'order/confirmOrder', //确认收货
 	
-	DoorList: 'door/door',
+	DoorList: 'doorRecordList',
 	MaterialList: 'barrelList',
 	MaterialDetail: 'material/detail',
 	MaterialUpdate: 'material/update',