|
|
@@ -21,6 +21,7 @@ Page({
|
|
|
current: 1,
|
|
|
pages: 0,
|
|
|
sts: 9,//9是自定义的全部
|
|
|
+ type:'all'
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -33,7 +34,7 @@ Page({
|
|
|
sts: options.sts
|
|
|
});
|
|
|
}
|
|
|
- this.loadOrderData(this.data.sts, 1);
|
|
|
+ this.loadOrderData(this.data.sts,this.data.type, 1);
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -44,7 +45,7 @@ Page({
|
|
|
/**
|
|
|
* 加载订单数据
|
|
|
*/
|
|
|
- loadOrderData: function (sts, current) {
|
|
|
+ loadOrderData: function (sts,dvyType, current) {
|
|
|
var ths = this;
|
|
|
wx.showLoading();
|
|
|
let data = {
|
|
|
@@ -55,6 +56,9 @@ Page({
|
|
|
data.status = sts
|
|
|
|
|
|
}
|
|
|
+ if(dvyType != 'all'){
|
|
|
+ data.dvyType = dvyType
|
|
|
+ }
|
|
|
//加载订单列表
|
|
|
var params = {
|
|
|
url: "/p/myOrder/myOrder",
|
|
|
@@ -92,6 +96,15 @@ Page({
|
|
|
http.request(params);
|
|
|
},
|
|
|
|
|
|
+ handleType(e){
|
|
|
+ var type = e.currentTarget.dataset.type;
|
|
|
+ this.setData({
|
|
|
+ type
|
|
|
+ })
|
|
|
+ this.loadOrderData(this.data.sts,type, 1);
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
/**
|
|
|
* 状态点击事件
|
|
|
*/
|
|
|
@@ -100,7 +113,7 @@ Page({
|
|
|
this.setData({
|
|
|
sts: sts
|
|
|
});
|
|
|
- this.loadOrderData(sts, 1);
|
|
|
+ this.loadOrderData(sts,this.data.type, 1);
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -137,7 +150,7 @@ Page({
|
|
|
*/
|
|
|
onReachBottom: function () {
|
|
|
if (this.data.current < this.data.pages) {
|
|
|
- this.loadOrderData(this.data.sts, this.data.current + 1);
|
|
|
+ this.loadOrderData(this.data.sts,this.data.type, this.data.current + 1);
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -193,7 +206,7 @@ Page({
|
|
|
data: {},
|
|
|
callBack: function (res) {
|
|
|
//console.log(res);
|
|
|
- ths.loadOrderData(ths.data.sts, 1);
|
|
|
+ ths.loadOrderData(ths.data.sts,ths.data.type, 1);
|
|
|
wx.hideLoading();
|
|
|
}
|
|
|
};
|
|
|
@@ -301,7 +314,7 @@ Page({
|
|
|
data: {},
|
|
|
callBack: function (res) {
|
|
|
//console.log(res);
|
|
|
- ths.loadOrderData(ths.data.sts, 1);
|
|
|
+ ths.loadOrderData(ths.data.sts,ths.data.type, 1);
|
|
|
wx.hideLoading();
|
|
|
}
|
|
|
};
|
|
|
@@ -328,7 +341,7 @@ Page({
|
|
|
method: "DELETE",
|
|
|
data: {},
|
|
|
callBack: function (res) {
|
|
|
- ths.loadOrderData(ths.data.sts, 1);
|
|
|
+ ths.loadOrderData(ths.data.sts,ths.data.type, 1);
|
|
|
wx.hideLoading();
|
|
|
}
|
|
|
}
|