Commit 1a7ffa5d by 高淑倩

订单列表查看物流

parent 6080b63d
......@@ -61,23 +61,23 @@ wxService.page({
*/
onShow: function () {
console.log('currentIndex', this.data.currentIndex)
const {currentIndex} = this.data
if(currentIndex == 5){
this.getRefundList(this.data.pageNo, this.data.pageSize)
} else {
this.setData({
pageNo: 1,
pageSize: 5
},()=>{
const params = { trade: this.data.trade }
this.initOrderList(this.data.pageNo, this.data.pageSize, params)
// this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.trade)
})
}
const { currentIndex } = this.data
if (currentIndex == 5) {
this.getRefundList(this.data.pageNo, this.data.pageSize)
} else {
this.setData({
pageNo: 1,
pageSize: 5
}, () => {
const params = { trade: this.data.trade }
this.initOrderList(this.data.pageNo, this.data.pageSize, params)
// this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.trade)
})
}
},
// 确认收货
handelConfirmReceipt(e) {
......@@ -163,20 +163,27 @@ if(currentIndex == 5){
}
})
},
// 查看物流
checkLogistics(e) {
const { detail } = e.currentTarget.dataset
let params = JSON.stringify(detail)
// 退款申请
wxService.router(`/pages/logistics/logistics`).search({ params })
},
// 查看详情
handelCheckRfDetail(e){
handelCheckRfDetail(e) {
const { id } = e.currentTarget.dataset
wxService.router(`/pages/orderDetail/orderDetail?id=${id}`)
},
// 退货寄回
handelCheckRfSend(e){
handelCheckRfSend(e) {
const { id } = e.currentTarget.dataset
console.log('handelCheckRfSend', id )
console.log('handelCheckRfSend', id)
},
// 取消退款
handelCancelRefund(e){
handelCancelRefund(e) {
const { id } = e.currentTarget.dataset
console.log('取消退款', id )
console.log('取消退款', id)
this.handelRevokeRefund(id)
},
handelRevokeRefund(id) {
......@@ -184,8 +191,8 @@ if(currentIndex == 5){
title: '加载中',
mask: true
})
const params = {id}
wxService.post(`/sale/refund/buyer/cancel`,params).then(res => {
const params = { id }
wxService.post(`/sale/refund/buyer/cancel`, params).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
......@@ -196,7 +203,7 @@ if(currentIndex == 5){
});
setTimeout(() => {
wxService.router('/pages/order/order')
},200)
}, 200)
}
}
})
......@@ -228,11 +235,11 @@ if(currentIndex == 5){
this.getRefundList(this.data.pageNo, this.data.pageSize)
} else {
this.setData({
trade:status
},()=>{
trade: status
}, () => {
this.initOrderList(this.data.pageNo, this.data.pageSize, status)
})
}
})
},
......@@ -276,7 +283,7 @@ if(currentIndex == 5){
this.setData({
orderList: this.data.pageNo == 1 ? [...data] : [...this.data.orderList, ...data],
noMoreFlag: data.length < pageSize ? true : false
},()=>{
}, () => {
// this.data.orderList.forEach(item =>{
// console.log('item', item)
// // 退单列表
......@@ -293,7 +300,7 @@ if(currentIndex == 5){
this.setData({
no_data: this.data.orderList.length ? true : false
})
})
}
}
......@@ -325,11 +332,11 @@ if(currentIndex == 5){
// })
// }
// })
// }
// }
// })
// },
/**
......
......@@ -140,14 +140,22 @@
<button class="btn btn-sm btn-primary btn-outline" data-id="{{item.id}}" bindtap="handelToPay">立即支付</button>
</view>
<view class="order-status" wx-if="{{item.status == 'P'}}">
<navigator url="/pages/logistics/logistics?code={{item.logistic.supplierCode}}&logisticsNo={{item.logistic.code}}&id={{item.id}}" hover-class="none">
<button class="btn btn-sm btn-default" data-id="{{item.id}}">查看物流</button>
</navigator>
<button
class="btn btn-sm btn-default"
data-id="{{item.id}}"
data-detail="{{item}}"
bindtap="checkLogistics"
>查看物流
</button>
</view>
<view class="order-status" wx-if="{{item.status == 'D'}}">
<navigator url="/pages/logistics/logistics?code={{item.logistic.supplierCode}}&logisticsNo={{item.logistic.code}}&id={{item.id}}" hover-class="none">
<button class="btn btn-sm btn-default" data-id="{{item.id}}">查看物流</button>
</navigator>
<button
class="btn btn-sm btn-default"
data-id="{{item.id}}"
data-detail="{{item}}"
bindtap="checkLogistics"
>查看物流
</button>
<button class="btn btn-sm btn-primary btn-outline" data-id="{{item.id}}" bindtap="handelConfirmReceipt">确认收货</button>
</view>
<view class="order-status" wx-if="{{item.status == 'R'}}" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment