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

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

Loading…
Cancel
Save