pull/6/head^2
xiaozhiyong 8 months ago
parent d6ba26cf31
commit 66d928e7d2
  1. 80
      orderList/orderDetails/orderDetails.vue

@ -113,10 +113,8 @@
</view> </view>
<view style="margin-bottom:33rpx;" class="smallText">{{details.createTime}}</view> <view style="margin-bottom:33rpx;" class="smallText">{{details.createTime}}</view>
<!-- <view @tap="refund" v-if="!customerList.includes(details.createSource)" <view @tap="refund" v-if="!customerList.includes(details.createSource)"
:style="{background:details.orderStatus==1?'':'#bbbbbb'}" :style="{background:details.orderStatus==1?'':'#bbbbbb'}"
class="refund felx justifyContent alignItems">退款</view> -->
<view @tap="refundff" :style="{background:details.orderStatus==1?'':'#bbbbbb'}"
class="refund felx justifyContent alignItems">退款</view> class="refund felx justifyContent alignItems">退款</view>
</view> </view>
</view> </view>
@ -229,17 +227,15 @@
// console.log('refundMap', this.refundMap) // console.log('refundMap', this.refundMap)
}, },
methods: { methods: {
refundff() { refundNew() {
let { let {
createSource, createSource,
id id
} = this.details } = this.details
// console.log('this.details', this.details) if (!createSource) {
createSource = 'FUYOU'
if(!createSource) {
uni.showToast({ uni.showToast({
title:"createSource 为空", title: "未查询到该订单创建来源",
icon:"none" icon: "none"
}) })
return return
} }
@ -248,7 +244,6 @@
for (let key of keys) { for (let key of keys) {
if (key.includes(createSource)) { if (key.includes(createSource)) {
result = this.refundMap.get(key) result = this.refundMap.get(key)
// console.log('result', result)
break break
} }
} }
@ -257,15 +252,39 @@
type, type,
serveTarget serveTarget
} = result } = result
let params = type === 'post' ? {} : id let params = type === 'post' ? {
id,
orderId: id
} : id
serveTarget(params).then(res => { serveTarget(params).then(res => {
if (res.code === 20000) {
uni.showToast({
title: '退款成功',
duration: 2000
});
setTimeout(() => {
that.getList(id)
}, 1000)
}
})
} else {
orderList.refund({
id
}).then(res => {
if (res.code == 20000) {
uni.showToast({
title: '退款成功',
duration: 2000
});
setTimeout(() => {
that.getList(id)
}, 1000)
}
}) })
} }
}, },
codeFn() { codeFn() {
if (this.details.orderWfStatus == 0) { if (this.details.orderWfStatus == 0) {
orderList.getOrderQrCodeOms(this.details.orderSerialNumber).then(res => { orderList.getOrderQrCodeOms(this.details.orderSerialNumber).then(res => {
if (res.code == 20000) { if (res.code == 20000) {
console.log(res) console.log(res)
@ -285,28 +304,29 @@
}, },
refund() { refund() {
if (this.details.orderStatus !== 1) return; if (this.details.orderStatus !== 1) return;
let that = this // let that = this
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '是否确认退款', content: '是否确认退款',
success: function(res) { success: (res) => {
if (res.confirm) { if (res.confirm) {
orderList.refund({ this.refundNew()
id: that.id // orderList.refund({
}).then(res => { // id: that.id
if (res.code == 20000) { // }).then(res => {
uni.showToast({ // if (res.code == 20000) {
title: '退款成功', // uni.showToast({
duration: 2000 // title: '退',
}); // duration: 2000
setTimeout(() => { // });
that.getList(that.id) // setTimeout(() => {
}, 1000) // that.getList(that.id)
} // }, 1000)
}) // }
console.log('用户点击确定'); // })
// console.log('');
} else if (res.cancel) { } else if (res.cancel) {
console.log('用户点击取消'); // console.log('');
} }
} }
}); });

Loading…
Cancel
Save