Commit b6d9e0ef by 高淑倩

add: 退单列表

parent f6cb1beb
......@@ -45,7 +45,8 @@ wxService.page({
totalPages: 0,
subImgs: [],
trade: '', // 订单状态(C:取消;N:新建,P:已支付;D:已发货;R:已收货)
no_data: true
no_data: true,
currentTradeId: ''
},
/**
......@@ -108,6 +109,7 @@ wxService.page({
// 立即支付
handelToPay(e) {
const { id } = e.currentTarget.dataset
console.log('0000', id)
wx.showLoading({
title: '加载中',
mask: true
......@@ -213,15 +215,61 @@ wxService.page({
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)
// // 退单列表
// if(item.tradeId){
// console.log('item.tradeId', item.tradeId)
// let currentTradeId = item.tradeId
// this.setData({
// currentTradeId
// },()=>{
// this.refundDetail()
// })
// }
// })
this.setData({
no_data: this.data.orderList.length ? true : false
})
})
}
}
})
},
// 退单详情
// refundDetail(){
// console.log('tradeId', this.data.currentTradeId)
// wx.showLoading({
// title: '加载中',
// mask: true
// })
// wxService.get(`/sale/trade/buyer/${this.data.currentTradeId}`).then(res => {
// if (res) {
// const { result, data } = res.data
// if (result == 0) {
// wx.hideLoading()
// console.log('daya', data, [...this.data.orderList, ...data])
// console.log('this.data.orderList', this.data.orderList)
// this.data.orderList.forEach(item =>{
// console.log('item.tradeId == data.id', item.tradeId,data.id)
// if(item.tradeId == data.id){
// console.log('...item, ...data',item, data)
// this.setData({
// orderList: [...item, ...data]
// },()=>{
// console.log('orderList', this.data.orderList)
// })
// }
// })
// }
// }
// })
// },
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
......
......@@ -26,6 +26,8 @@
<text class="number">{{item.id}}</text>
</view>
<!--订单状态(C:取消;N:新建,P:已支付;D:已发货;R:已收货) 关闭 取消 新建 待付款 已支付 待发货 已发货 待收货 已完成 已收货 交易关闭 取消-->
<!-- 订单状态(C:取消;N:新建,A:已审核;R:退货已发R货;D:退货已收货)-->
<text class="order-status" wx-if="{{item.status == 'C'}}">交易关闭</text>
<text class="order-status" wx-if="{{item.status == 'N'}}">待付款</text>
<text class="order-status" wx-if="{{item.status == 'P'}}">待发货</text>
......@@ -72,7 +74,7 @@
</view>
<view class="order-status" wx-if="{{item.status == 'D'}}">
<button class="btn btn-sm btn-default" data-id="{{item.id}}">查看物流</button>
<button class="btn btn-sm btn-default" data-id="{{item.id}}" bindtap="handelConfirmReceipt">确认收货</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'}}" />
<!--<button class="btn btn-sm btn-primary btn-outline ">再来一单</button>-->
......
......@@ -10,7 +10,8 @@ wxService.page({
* 页面的初始数据
*/
data: {
detail: null
detail: null,
id: ''
},
/**
......@@ -29,7 +30,11 @@ wxService.page({
// /trade/buyer/{id} 订单详情
console.log('id', id)
if(id) {
this.setData({
id
},()=>{
this.getOrderDetail(id)
})
}
// this.setData({
// detail: currentDetail[0]
......@@ -62,8 +67,10 @@ wxService.page({
handelCancelOrder() { console.log('取消订单') },
// 申请退款
handelRequestRefund(e) {
console.log('----', e)
const { id } = e.currentTarget.dataset
const { detail } = e.currentTarget.dataset
detail.id = this.data.id
let params = JSON.stringify(detail)
// 退款申请
wxService.router(`/pages/refund/refund`).search({params})
......
......@@ -110,10 +110,10 @@
</view>
<view class="button-wrap" wx-if="{{detail.status == 'D'}}">
<button class="btn btn-primary btn-lg" data-id="{{detail.id}}" data-detail="{{detail}}" bindtap="handelRequestRefund">申请退款</button>
<button class="btn btn-lg btn-gray" data-id="{{detail.id}}" bindtap="handelCancelOrder">确认收货</button>
<button class="btn btn-lg btn-gray" data-id="{{detail.id}}" bindtap="handelConfirmReceipt">确认收货</button>
</view>
<view class="button-wrap" wx-if="{{detail.status == 'R'}}">
<button class="btn btn-lg btn-gray" data-id="{{detail.id}}" data-detail="{{detail}}" bindtap="handelConfirmReceipt">申请退款</button>
<button class="btn btn-lg btn-gray" data-id="{{detail.id}}" data-detail="{{detail}}" bindtap="handelRequestRefund">申请退款</button>
</view>
</view>
......@@ -80,6 +80,7 @@ wxService.page({
}
})
console.log('refundCreateDto', refundCreateDto)
this.handelRequestRefund(refundCreateDto)
......@@ -95,7 +96,15 @@ wxService.page({
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
wx.showToast({
title: '申请退款成功',
icon: 'none'
});
// 订单列表
setTimeout(() => {
// wxService.router(`/pages/order/order`).search({params})
wxService.router(`/pages/order/order`)
}, 2000)
}
}
})
......@@ -258,7 +267,8 @@ wxService.page({
})
this.setData({
cartList: detail.skuVOList,
refundAmount: detail.payAmount
refundAmount: detail.payAmount,
'refundCreateDto.tradeId': detail.id
})
},
......
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