|
|
@@ -30,13 +30,19 @@ Page({
|
|
|
// 获取订单列表
|
|
|
getOrderLists(status){
|
|
|
API.getOrderLists({pageNum:this.data.pageNum,pageSize:10,status}).then(res=>{
|
|
|
+
|
|
|
+
|
|
|
res.orderDTOS.forEach(item=>{
|
|
|
let stats = {PAYED:"已支付",CANCELLED:"已取消",DELIVERED:"已发货",RECEIVED:"已收货",FINISHED:"完成",ORDERED:"已下单"};
|
|
|
item.statusName = stats[item.orderStatus]
|
|
|
})
|
|
|
this.setData({
|
|
|
- orderList:res.orderDTOS
|
|
|
+ orderList:this.data.pageNum === 1?res.orderDTOS:[...this.data.orderList,...res.orderDTOS]
|
|
|
})
|
|
|
+
|
|
|
+ // this.setData({
|
|
|
+ // orderList:res.orderDTOS
|
|
|
+ // })
|
|
|
})
|
|
|
},
|
|
|
// 订单详情
|
|
|
@@ -46,6 +52,29 @@ Page({
|
|
|
url: '/pages/order/orderDetail/orderDetail?orderId='+orderId,
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ showExprMsg(e) {
|
|
|
+ let odDTOs = e.currentTarget.dataset.item.orderDetailDTOS;
|
|
|
+ let exprNo = "";
|
|
|
+ odDTOs.forEach(dto=>{
|
|
|
+ dto.orderDetailExprs.forEach(exprDto=>{
|
|
|
+ exprNo=exprNo + exprDto.expressNo;
|
|
|
+ })
|
|
|
+ })
|
|
|
+ wx.showModal({
|
|
|
+ title: "快递单号",
|
|
|
+ content: exprNo,
|
|
|
+ showCancel: false, // 隐藏取消按钮
|
|
|
+ confirmText: "OK", // 自定义确认按钮文字为"OK"
|
|
|
+ success(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ console.log("用户点击了OK");
|
|
|
+ // 执行OK后的操作
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
@@ -92,7 +121,10 @@ Page({
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
*/
|
|
|
onReachBottom() {
|
|
|
-
|
|
|
+ this.setData({
|
|
|
+ pageNum:this.data.pageNum+1
|
|
|
+ });
|
|
|
+ this.getOrderLists(this.data.tab[this.data.selectTab].status);
|
|
|
},
|
|
|
|
|
|
/**
|