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