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