|
@@ -5,7 +5,7 @@
|
|
|
<view class="picker">
|
|
|
<view class="label">状态</view>
|
|
|
<view class="fb-type">
|
|
|
- <view class="type-label">{{array[index]}}</view>
|
|
|
+ <view class="type-label">{{this.array[index]}}</view>
|
|
|
<image class="type-icon"
|
|
|
src="http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/pickerArrow-a8b918f05f.png">
|
|
|
</image>
|
|
@@ -14,10 +14,10 @@
|
|
|
</picker>
|
|
|
|
|
|
<picker @change="bindPickerChange2" v-model="index2" :range="deviceList" :range-key="'name'">
|
|
|
- <view class="picker">
|
|
|
+ <view class="picker" style="position: relative;">
|
|
|
<view class="label">设备</view>
|
|
|
<view class="fb-type">
|
|
|
- <view class="type-label">{{deviceList[index2].name}}</view>
|
|
|
+ <view class="type-label">{{this.deviceList[index2].name}}</view>
|
|
|
<image class="type-icon"
|
|
|
src="http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/pickerArrow-a8b918f05f.png">
|
|
|
</image>
|
|
@@ -26,10 +26,10 @@
|
|
|
</picker>
|
|
|
|
|
|
<view class="picker" style="position: relative;">
|
|
|
- <view class="label" v-if="this.$route.query.type">今日订单</view>
|
|
|
+ <view class="label" v-if="isToday">今日订单</view>
|
|
|
<view class="fb-type">
|
|
|
<text>{{range[0]}} - {{range[1]}}</text>
|
|
|
- <button type="primary" @click="onShowDatePicker('range')">选择日期范围</button>
|
|
|
+ <button type="primary" @click="onShowDatePicker('range')" :disabled="isToday" >选择</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
<mx-date-picker :show="showPicker" :type="type" :value="value" :show-tips="true" :begin-text="'开始'"
|
|
@@ -54,7 +54,7 @@
|
|
|
</view>
|
|
|
<view class="h">
|
|
|
<view class="l">订单编号:{{item.id||''}}</view>
|
|
|
- <view class="r">¥{{item.orderAmount}}</view>
|
|
|
+ <view class="r">¥{{item.orderAmount||'0'}}</view>
|
|
|
</view>
|
|
|
<view class="h">
|
|
|
<view class="l">会员名称:{{item.orderMemberName||''}}</view>
|
|
@@ -90,19 +90,11 @@
|
|
|
showPicker: false,
|
|
|
index: 0,
|
|
|
index2: 0,
|
|
|
+ isToday: true,
|
|
|
deviceId: '',
|
|
|
deviceList: [{
|
|
|
id: '',
|
|
|
name: '全部'
|
|
|
- }, {
|
|
|
- id: 1,
|
|
|
- name: "果奶机1"
|
|
|
- }, {
|
|
|
- id: 2,
|
|
|
- name: "果奶机2"
|
|
|
- }, {
|
|
|
- id: 3,
|
|
|
- name: "果奶机3"
|
|
|
}],
|
|
|
orderCount: 2,
|
|
|
orderSum: 0.0,
|
|
@@ -149,7 +141,7 @@
|
|
|
},
|
|
|
bindPickerChange2: function(e) {
|
|
|
this.index2 = e.detail.value
|
|
|
- this.deviceId = this.deviceList[this.index].id
|
|
|
+ this.deviceId = this.deviceList[this.index2].id
|
|
|
},
|
|
|
bindDateChange: function(e) {
|
|
|
this.date = e.detail.value
|
|
@@ -168,7 +160,11 @@
|
|
|
}
|
|
|
this.orderList = []
|
|
|
this.queryParams.current = 1
|
|
|
- this.getOrderList()
|
|
|
+ let pages = getCurrentPages();
|
|
|
+ let page = pages[pages.length - 1].$page.fullPath;
|
|
|
+ let oType = page.split('type=')[1]
|
|
|
+ console.log(oType)
|
|
|
+ this.getOrderList(oType)
|
|
|
},
|
|
|
onCancel(e) {
|
|
|
this.range = []
|
|
@@ -178,7 +174,10 @@
|
|
|
}
|
|
|
this.orderList = []
|
|
|
this.queryParams.current = 1
|
|
|
- this.getOrderList()
|
|
|
+ let pages = getCurrentPages();
|
|
|
+ let page = pages[pages.length - 1].$page.fullPath;
|
|
|
+ let oType = page.split('type=')[1]
|
|
|
+ this.getOrderList(oType)
|
|
|
},
|
|
|
getDeviceList() {
|
|
|
let that = this;
|
|
@@ -186,22 +185,25 @@
|
|
|
if (res.code === 0) {
|
|
|
//that.orderList = that.orderList.concat(res.data.data)
|
|
|
//that.page = res.data.currentPage + 1
|
|
|
- that.totalPages2 = res.total
|
|
|
- that.deviceList = res.data.records
|
|
|
+ that.totalPages2 = res.pages
|
|
|
+ that.deviceList = that.deviceList.concat(res.data.records)
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- getOrderList() {
|
|
|
+ getOrderList(type) {
|
|
|
let that = this;
|
|
|
- let type = this.$route.query.type;
|
|
|
if(type=="1"){
|
|
|
- that.range=[util.getNowDate(0), util.getNowDate(1)];
|
|
|
+ that.range=[util.getNowDate(0), util.getNowDate(1)];
|
|
|
+ that.isToday = true
|
|
|
+ }else{
|
|
|
+ that.isToday = false
|
|
|
}
|
|
|
- if (that.index2 > 0) {
|
|
|
- that.queryParams.model.orderEquId = that.index2;
|
|
|
+ if (that.deviceId) {
|
|
|
+ that.queryParams.model.orderEquId = that.deviceId;
|
|
|
} else {
|
|
|
that.queryParams.model = {}
|
|
|
}
|
|
|
+ console.log(that.range)
|
|
|
if (that.range.length > 0) {
|
|
|
that.queryParams.map.createTime_st = that.range[0];
|
|
|
that.queryParams.map.createTime_ed = that.range[1];
|
|
@@ -216,8 +218,7 @@
|
|
|
return false
|
|
|
}
|
|
|
return true;
|
|
|
- })
|
|
|
- console.log(res.data.records[0])
|
|
|
+ })
|
|
|
that.orderList = that.orderList.concat(res.data.records);
|
|
|
//that.page = res.data.currentPage + 1
|
|
|
that.totalPages = res.data.pages
|
|
@@ -240,15 +241,30 @@
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
*/
|
|
|
onReachBottom: function() {
|
|
|
+ let pages = getCurrentPages();
|
|
|
+ let page = pages[pages.length - 1].$page.fullPath;
|
|
|
+ let type = page.split('type=')[1]
|
|
|
+ type = type? type: ""
|
|
|
if (this.totalPages > this.queryParams.current) {
|
|
|
this.queryParams.current = this.queryParams.current + 1
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
- this.getOrderList()
|
|
|
+ this.getOrderList(type)
|
|
|
},
|
|
|
- onShow: function(options) {
|
|
|
- this.getOrderList();
|
|
|
+ onLoad: function(option) {
|
|
|
+ this.getDeviceList();
|
|
|
+ console.log(this.deviceList)
|
|
|
+ let type = option.type? option.type : ""
|
|
|
+ let equId = option.equId? option.equId : ""
|
|
|
+ if(equId){
|
|
|
+ this.deviceId = equId;
|
|
|
+ this.index2 = this.deviceList.findIndex(function(item){
|
|
|
+ return item.id === equId;
|
|
|
+ });
|
|
|
+ console.log(this.index2);
|
|
|
+ }
|
|
|
+ this.getOrderList(type);
|
|
|
}
|
|
|
}
|
|
|
</script>
|