Merge branch 'master' into zyj

pull/6/head
zhangyouji 11 months ago
commit f43be96193
  1. 112
      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>
@ -188,31 +186,31 @@
refundMap: new Map([ refundMap: new Map([
[ [
['FUYOU'], { ['FUYOU'], {
interface: serve.fuyouRefund, serveTarget: serve.fuyouRefund,
type: 'post' type: 'post'
} }
], ],
[ [
['ZHIZHU', 'NEWHOPE', 'MUYUAN', 'G7CLUSTER-CAHNGJIU'], { ['ZHIZHU', 'NEWHOPE', 'MUYUAN', 'G7CLUSTER-CAHNGJIU'], {
interface: serve.orderRefund, serveTarget: serve.orderRefund,
type: 'post' type: 'post'
} }
], ],
[ [
['SHUNFENG'], { ['SHUNFENG'], {
interface: serve.sfRefund, serveTarget: serve.sfRefund,
type: 'post' type: 'post'
} }
], ],
[ [
['ANNENG'], { ['ANNENG'], {
interface: serve.refund, serveTarget: serve.refund,
type: 'get' type: 'get'
} }
], ],
[ [
['YIGUANYOU', 'ANTU'], { ['YIGUANYOU', 'ANTU'], {
interface: serve.unifiedRefund, serveTarget: serve.unifiedRefund,
type: 'post' type: 'post'
} }
], ],
@ -226,26 +224,67 @@
this.id = JSON.parse(e.jsData).id this.id = JSON.parse(e.jsData).id
this.getList(this.id) this.getList(this.id)
} }
console.log('refundMap', this.refundMap) // console.log('refundMap', this.refundMap)
}, },
methods: { methods: {
refundff() { refundNew() {
let {createSource} = this.details let {
if(!createSource) { createSource,
id
} = this.details
if (!createSource) {
uni.showToast({ uni.showToast({
title:"createSource 为空", title: "未查询到该订单创建来源",
icon:"none" icon: "none"
}) })
return return
} }
let keys = this.refundMap.keys() let keys = this.refundMap.keys()
console.log(keys) let result = null
// console.log(this.details) for (let key of keys) {
// console.log('refundff') if (key.includes(createSource)) {
result = this.refundMap.get(key)
break
}
}
if (result) {
let {
type,
serveTarget
} = result
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() { 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)
@ -265,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