|
@ -8,7 +8,7 @@ Page({ |
|
|
// tab切换
|
|
|
// tab切换
|
|
|
currentTab: 0, |
|
|
currentTab: 0, |
|
|
isStatus: 'payment', //1待付款,2待发货,3待收货 4、5已完成
|
|
|
isStatus: 'payment', //1待付款,2待发货,3待收货 4、5已完成
|
|
|
page: 0, |
|
|
page: 1, |
|
|
refundpage: 0, |
|
|
refundpage: 0, |
|
|
ordert0: [], |
|
|
ordert0: [], |
|
|
ordert1: [], |
|
|
ordert1: [], |
|
@ -143,6 +143,8 @@ Page({ |
|
|
storeId: 239, |
|
|
storeId: 239, |
|
|
storeType: 1, |
|
|
storeType: 1, |
|
|
queryOrderType: that.data.isStatus, |
|
|
queryOrderType: that.data.isStatus, |
|
|
|
|
|
page: 1, |
|
|
|
|
|
pagesize: 100, |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
if (res.code == 200) { |
|
|
if (res.code == 200) { |
|
|
var data = res.data; |
|
|
var data = res.data; |
|
@ -193,67 +195,87 @@ Page({ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
// wx.request({
|
|
|
}, |
|
|
// url: app.d.ceshiUrl + '&action=order&m=index',
|
|
|
/** |
|
|
// method: 'post',
|
|
|
* 页面上拉触底事件的处理函数 |
|
|
// data: {
|
|
|
*/ |
|
|
// openid: app.globalData.userInfo.openid,
|
|
|
onReachBottom: function () { |
|
|
// order_type: that.data.isStatus,
|
|
|
// this.getMore();
|
|
|
// otype: that.data.otype,
|
|
|
}, |
|
|
// },
|
|
|
// 点击加载更多
|
|
|
// header: {
|
|
|
getMore: function (e) { |
|
|
// 'Content-Type': 'application/x-www-form-urlencoded'
|
|
|
var that = this; |
|
|
// },
|
|
|
var page = that.data.page+1; |
|
|
// success: function (res) {
|
|
|
WXAPI.orderList({ |
|
|
// var status = res.data.status;
|
|
|
accessId: app.globalData.accessId, |
|
|
// var order = res.data.order;
|
|
|
storeId: 239, |
|
|
// switch (that.data.currentTab) {
|
|
|
storeType: 1, |
|
|
// case 0:
|
|
|
queryOrderType: that.data.isStatus, |
|
|
// that.setData({
|
|
|
page: page, |
|
|
// ordert0: order,
|
|
|
}).then(res => { |
|
|
// });
|
|
|
if (res.code == 200) { |
|
|
// break;
|
|
|
var data = res.data; |
|
|
// case 5:
|
|
|
//成功返回设置数据
|
|
|
// that.setData({
|
|
|
if (data == '') { |
|
|
// ordert0: order,
|
|
|
that.setData({ |
|
|
// });
|
|
|
loading: false, |
|
|
// break;
|
|
|
}); |
|
|
// case 6:
|
|
|
return; |
|
|
// that.setData({
|
|
|
} else { |
|
|
// ordert0: order,
|
|
|
switch (that.data.currentTab) { |
|
|
// });
|
|
|
case 0: |
|
|
// break;
|
|
|
var orderList = that.data.ordert0; |
|
|
// case 1:
|
|
|
orderList.push(...data.order) |
|
|
// that.setData({
|
|
|
that.setData({ |
|
|
// ordert1: order,
|
|
|
ordert0: orderList, |
|
|
// });
|
|
|
}); |
|
|
// break;
|
|
|
break; |
|
|
// case 2:
|
|
|
case 5: |
|
|
// that.setData({
|
|
|
var orderList = that.data.ordert0; |
|
|
// ordert2: order,
|
|
|
orderList.push(...data.order) |
|
|
// });
|
|
|
that.setData({ |
|
|
// break;
|
|
|
ordert0: orderList, |
|
|
// case 3:
|
|
|
}); |
|
|
// that.setData({
|
|
|
break; |
|
|
// ordert3: order,
|
|
|
case 6: |
|
|
// });
|
|
|
var orderList = that.data.ordert0; |
|
|
// break;
|
|
|
orderList.push(...data.order) |
|
|
// case 4:
|
|
|
that.setData({ |
|
|
// that.setData({
|
|
|
ordert0: orderList, |
|
|
// ordert4: order,
|
|
|
}); |
|
|
// });
|
|
|
break; |
|
|
// break;
|
|
|
case 1: |
|
|
// }
|
|
|
var orderList = that.data.ordert1; |
|
|
// //console.log(that.data.ordert0)
|
|
|
orderList.push(...data.order) |
|
|
// },
|
|
|
that.setData({ |
|
|
// fail: function () {
|
|
|
ordert1: orderList, |
|
|
// // fail
|
|
|
}); |
|
|
// wx.showToast({
|
|
|
break; |
|
|
// title: '网络异常!',
|
|
|
case 2: |
|
|
// duration: 2000
|
|
|
var orderList = that.data.ordert2; |
|
|
// });
|
|
|
orderList.push(...data.order) |
|
|
// }
|
|
|
that.setData({ |
|
|
// });
|
|
|
ordert2: orderList, |
|
|
|
|
|
}); |
|
|
|
|
|
break; |
|
|
|
|
|
case 3: |
|
|
|
|
|
var orderList = that.data.ordert3; |
|
|
|
|
|
orderList.push(...data.order) |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
ordert3: orderList, |
|
|
|
|
|
}); |
|
|
|
|
|
break; |
|
|
|
|
|
case 4: |
|
|
|
|
|
var orderList = that.data.ordert4; |
|
|
|
|
|
orderList.push(...data.order) |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
ordert4: orderList, |
|
|
|
|
|
}); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
}, |
|
|
}, |
|
|
// 确认收货
|
|
|
// 确认收货
|
|
|
recOrder: function (e) { |
|
|
recOrder: function (e) { |
|
@ -464,7 +486,7 @@ Page({ |
|
|
var orderId = res.data.sNo; // 订单号
|
|
|
var orderId = res.data.sNo; // 订单号
|
|
|
var oid = res.data.id; // 订单id
|
|
|
var oid = res.data.id; // 订单id
|
|
|
//发送信息到客户
|
|
|
//发送信息到客户
|
|
|
that.notice(oid, order_sn, price, user_id, form_id, f_pname); |
|
|
// that.notice(oid, order_sn, price, user_id, form_id, f_pname);
|
|
|
wx.showModal({ |
|
|
wx.showModal({ |
|
|
content: "支付成功!", |
|
|
content: "支付成功!", |
|
|
showCancel: false, |
|
|
showCancel: false, |
|
@ -500,26 +522,26 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
//发送数据到客户微信上
|
|
|
//发送数据到客户微信上
|
|
|
notice: function (order_id, order_sn, price, user_id, form_id, f_pname) { |
|
|
// notice: function (order_id, order_sn, price, user_id, form_id, f_pname) {
|
|
|
wx.request({ |
|
|
// wx.request({
|
|
|
url: app.d.ceshiUrl + '&action=getcode&m=Send_Prompt', |
|
|
// url: app.d.ceshiUrl + '&action=getcode&m=Send_Prompt',
|
|
|
method: 'post', |
|
|
// method: 'post',
|
|
|
data: { |
|
|
// data: {
|
|
|
page: 'pages/order/detail?orderId=' + order_id, |
|
|
// page: 'pages/order/detail?orderId=' + order_id,
|
|
|
order_sn: order_sn, |
|
|
// order_sn: order_sn,
|
|
|
price: price, |
|
|
// price: price,
|
|
|
user_id: user_id, |
|
|
// user_id: user_id,
|
|
|
form_id: form_id, |
|
|
// form_id: form_id,
|
|
|
f_pname: f_pname |
|
|
// f_pname: f_pname
|
|
|
}, |
|
|
// },
|
|
|
header: { |
|
|
// header: {
|
|
|
'Content-Type': 'application/x-www-form-urlencoded' |
|
|
// 'Content-Type': 'application/x-www-form-urlencoded'
|
|
|
}, |
|
|
// },
|
|
|
success: function (res) { |
|
|
// success: function (res) {
|
|
|
console.log(res) |
|
|
// console.log(res)
|
|
|
} |
|
|
// }
|
|
|
}) |
|
|
// })
|
|
|
}, |
|
|
// },
|
|
|
escOrder: function (e) { |
|
|
escOrder: function (e) { |
|
|
var that = this, |
|
|
var that = this, |
|
|
id = e.target.dataset.orderId; |
|
|
id = e.target.dataset.orderId; |
|
|