|
|
|
@ -28,6 +28,8 @@ |
|
|
|
<view v-if="supplierOrder.status == supplierOrderStatusEnum.WAIT_CLIENT_PAY" class="button-item" @click="confirmWxPay(supplierOrder.mallSupplierId)"> |
|
|
|
去付款 |
|
|
|
</view> |
|
|
|
<!-- 微信服务商支付待付款 --> |
|
|
|
<view v-if="supplierOrder.status == supplierOrderStatusEnum.WX_PAY_SUPPLIER" class="button-item" @click="makeWxpay()">去付款</view> |
|
|
|
<!-- 待收货展示 --> |
|
|
|
<view v-else-if="supplierOrder.status == supplierOrderStatusEnum.WAIT_RECEIVE" class="button-item" @click="confirmReceive(supplierOrder)"> |
|
|
|
确认收货 |
|
|
|
@ -158,9 +160,17 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { go2, back, uploadImage } from '@/utils/hook.js' |
|
|
|
import { getClientOrderInfo, clientUploadVoucher, clientDeleteVoucher, clientConfirmOrder, getReciptCode } from '@/apis/orderApi.js' |
|
|
|
import { getClientOrderInfo, clientUploadVoucher, clientDeleteVoucher, clientConfirmOrder, getReciptCode, makeSupplierPay } from '@/apis/orderApi.js' |
|
|
|
import { transformFileToImg, getFeisuanUrl } from '@/apis/commonApi.js' |
|
|
|
import { orderStatusEnum, supplierOrderStatusMap, supplierOrderStatusEnum, paymentMethodMap, paymentMethodEnum, invoiceStatusMap } from '@/enums/index.js' |
|
|
|
import { |
|
|
|
orderStatusEnum, |
|
|
|
supplierOrderStatusMap, |
|
|
|
supplierOrderStatusEnum, |
|
|
|
paymentMethodMap, |
|
|
|
paymentMethodEnum, |
|
|
|
invoiceStatusMap, |
|
|
|
WX_APPID |
|
|
|
} from '@/enums/index.js' |
|
|
|
const statusImg = { |
|
|
|
[orderStatusEnum.WAIT_SUPPLIER_CONFIRM]: '待供应商确认', |
|
|
|
[orderStatusEnum.ORDERED]: '已下单', |
|
|
|
@ -187,6 +197,7 @@ const showUploadStatus = [ |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
orderId: null, |
|
|
|
orderInfo: { |
|
|
|
deliveryAddress: {}, |
|
|
|
supplierOrder: [] |
|
|
|
@ -202,7 +213,7 @@ export default { |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
if (option.orderId) { |
|
|
|
this.init(option.orderId) |
|
|
|
this.orderId = option.orderId |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
title: '订单信息错误', |
|
|
|
@ -215,6 +226,16 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
onPullDownRefresh() { |
|
|
|
console.log('下拉刷新') |
|
|
|
this.init(this.orderId) |
|
|
|
uni.stopPullDownRefresh() |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
if (this.orderId) { |
|
|
|
this.init(this.orderId) |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
go2, |
|
|
|
back, |
|
|
|
@ -222,6 +243,7 @@ export default { |
|
|
|
getClientOrderInfo({ |
|
|
|
customerOrderId: orderId |
|
|
|
}).then((res) => { |
|
|
|
console.log('订单详情', res) |
|
|
|
if (res) { |
|
|
|
this.orderInfo = res |
|
|
|
} |
|
|
|
@ -368,6 +390,40 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
makeWxpay() { |
|
|
|
makeSupplierPay({ customerOrderId: this.orderInfo.orderId, wxAppid: WX_APPID, apiType: 'app' }).then((info) => { |
|
|
|
if (info) { |
|
|
|
console.log('info', info) |
|
|
|
uni.requestPayment({ |
|
|
|
provider: 'wxpay', |
|
|
|
orderInfo: { |
|
|
|
appid: info.appId, |
|
|
|
partnerid: info.partnerid, |
|
|
|
prepayid: info.prepayId, |
|
|
|
package: 'Sign=WXPay', |
|
|
|
noncestr: info.nonceStr, |
|
|
|
timestamp: info.timeStamp, |
|
|
|
sign: info.paySign |
|
|
|
}, |
|
|
|
success: () => { |
|
|
|
uni.showToast({ |
|
|
|
title: '支付成功', |
|
|
|
icon: 'none', |
|
|
|
duration: 1500 |
|
|
|
}) |
|
|
|
}, |
|
|
|
fail: (err) => { |
|
|
|
console.log('err', err) |
|
|
|
uni.showToast({ |
|
|
|
title: '支付失败', |
|
|
|
icon: 'none', |
|
|
|
duration: 1500 |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
clip(content) { |
|
|
|
uni.setClipboardData({ |
|
|
|
data: content, |
|
|
|
|