🐞 fix(订单详情):修复api错误

This commit is contained in:
Haiyi 2022-12-07 13:51:51 +08:00
parent c0b7bd4e42
commit 25f6423ae0

View File

@ -16,17 +16,17 @@ import BottomBtns from '@/components/BottomBtns'
import { debounce } from '@/common/util'
import {
GetPayCode,
mpsaleOrder,
mpsaleOrderaddress,
mpsaleOrdercancel,
mpsaleOrderput,
mpsaleOrderreceive,
mpsaleOrdershipmentMode,
mpshoppingCartproductColorlist,
orderPaymentorderPaymentMethodInfo,
orderPaymentorderPaymentSubmission,
orderPaymentpreCollectOrderorderPaymentMethodInfo,
orderPaymentpreCollectOrderorderPaymentSubmission,
MpSaleOrder,
MpSaleOrderAddress,
MpSaleOrderCancel,
MpSaleOrderPut,
MpSaleOrderReceive,
MpSaleOrderShipmentMode,
MpShoppingCartProductColorList,
OrderPaymentOrderPaymentMethodInfo,
OrderPaymentOrderPaymentSubmission,
OrderPaymentPreCollectOrderOrderPaymentMethodInfo,
OrderPaymentPreCollectOrderOrderPaymentSubmission,
} from '@/api/order'
import { alert, goLink } from '@/common/common'
import { formatDateTime, formatPriceDiv, formatWeightDiv } from '@/common/format'
@ -132,7 +132,7 @@ const OrderDetails = () => {
// 收货方法,1:自提2物流
const [receivingStatus, setReceivingStatus] = useState(null)
// 切换自提或者物流
const { fetchData: selectFetch } = mpsaleOrdershipmentMode()
const { fetchData: selectFetch } = MpSaleOrderShipmentMode()
const onReceivingStatus = debounce(async(e, value) => {
if (infoObj.status === 8 || infoObj.status === 9 || infoObj.status === 4 || infoObj.status === 5 || infoObj.status === 3 || infoObj.status === 11) {
alert.error('不允许更改')
@ -175,7 +175,7 @@ const OrderDetails = () => {
}
}, 300)
const { fetchData: infoFetch } = mpsaleOrder()
const { fetchData: infoFetch } = MpSaleOrder()
const [infoObj, setInfoObj] = useState<any>({})
// 获取订单详情
const getDetail = async() => {
@ -244,7 +244,7 @@ const OrderDetails = () => {
// 备注操作
const [showDesc, setShowDesc] = useState(false)
const { fetchData: remarkFetch } = mpsaleOrderput()
const { fetchData: remarkFetch } = MpSaleOrderPut()
const getRemark = async() => {
const res = await remarkFetch({ remark: infoObj.remark, id: Number(router.params.id) })
if (res.msg === 'success') {
@ -266,7 +266,7 @@ const OrderDetails = () => {
getDetail()
}, [])
const { fetchData: cancelFetch } = mpsaleOrdercancel()
const { fetchData: cancelFetch } = MpSaleOrderCancel()
// 取消订单
const cancle = async(e, item) => {
e.stopPropagation()
@ -299,7 +299,7 @@ const OrderDetails = () => {
})
}
// 再次购买
const { fetchData: buyFetch } = mpshoppingCartproductColorlist()
const { fetchData: buyFetch } = MpShoppingCartProductColorList()
const nextBuy = async(e, item) => {
e.stopPropagation()
Taro.showLoading({
@ -337,8 +337,8 @@ const OrderDetails = () => {
}
}
// 去支付逻辑
const { fetchData: infoOneFetch } = orderPaymentorderPaymentMethodInfo()
const { fetchData: infoTwoFetch } = orderPaymentpreCollectOrderorderPaymentMethodInfo()
const { fetchData: infoOneFetch } = OrderPaymentOrderPaymentMethodInfo()
const { fetchData: infoTwoFetch } = OrderPaymentPreCollectOrderOrderPaymentMethodInfo()
const [payList, setPayList] = useState<any[]>([
{
id: 2,
@ -549,8 +549,8 @@ const OrderDetails = () => {
}
// 确认交易
const { fetchData: payOneFetch } = orderPaymentorderPaymentSubmission()
const { fetchData: payTwoFetch } = orderPaymentpreCollectOrderorderPaymentSubmission()
const { fetchData: payOneFetch } = OrderPaymentOrderPaymentSubmission()
const { fetchData: payTwoFetch } = OrderPaymentPreCollectOrderOrderPaymentSubmission()
const handsurePay = (obj) => {
let arr: any = []
// if (obj.status !== 10) {
@ -643,7 +643,7 @@ const OrderDetails = () => {
}
// 确认收货
const { fetchData: receveFetch } = mpsaleOrderreceive()
const { fetchData: receveFetch } = MpSaleOrderReceive()
const handSureGoods = async() => {
Taro.showModal({
content: '确认收货吗?',