|
@@ -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);
|
|
|
}
|
|
|
},
|
|
|
}
|