// 订单跳转统一工具类 import {msg, navTo} from "@/utils/utils"; import { OrderStatus } from "@/datas/enum"; import {OrderTypes} from "@/datas/enum"; export default function useOrderSkip(){ //根据订单类型 跳转到不同的订单详情页面 const gotoOrderDetails = (orderInfo) =>{ if(orderInfo.orderType === 'ISSUE'){ navTo(`/orders/order-details-new?id=${orderInfo.id}&appraise=${orderInfo.appraise}`); }else if(orderInfo.orderType == OrderTypes.同时换卡换签 || orderInfo.orderType == 'REPLACEMENT_CARD' || orderInfo.orderType == 'REPLACEMENT_SIGNATURE'){ navTo(`/orders/order-details-card-sign?id=${orderInfo.id}&orType=${orderInfo.orderType}`); }else if(orderInfo.orderType === 'SUPPLEMENT_OBU'){ navTo(`/orders/order-details-obu?id=${orderInfo.id}`); }else if(orderInfo.orderType === 'OFFICAL_SUPPLEMENT_OBU'){ navTo(`/orders/order-details-obu?id=${orderInfo.id}`); } else if(orderInfo.orderType === OrderTypes.ETC注销){ navTo(`/orders/order-details-logoff-etc?id=${orderInfo.id}`); }else if(orderInfo.orderType === OrderTypes.车辆信息变更){ navTo(`/orders/order-details-edit-car?id=${orderInfo.id}`); }else if(orderInfo.orderType === OrderTypes.解除车牌占用){ navTo(`/orders/order-details-cancel-numberplate?id=${orderInfo.id}`); }else if(orderInfo.orderType === 'EXCHANGE_CARD_TYPE'){ navTo(`/orders/order-details-recharge?id=${orderInfo.id}`); } } //跳转到修改地址页面 const gotoEditAddress = (orderInfo:any) => { const item = { id:orderInfo.orderInfoExt.id ?? '', consignee:orderInfo.orderInfoExt.consignee ?? '', consigneeTel:orderInfo.orderInfoExt.consigneeTel ?? '', region:orderInfo.orderInfoExt.region ?? '', address:orderInfo.orderInfoExt.address ?? '', postalCode:orderInfo.orderInfoExt.postalCode ?? '', fromOrder:true, //是否来自订单 } navTo(`/personal-center/setting/addressManager?fromOrder=true`); } //取消订单 const gotoCancelOrder = (orderInfo:any) =>{ const item = { id:orderInfo.id, orderId:orderInfo.orderId, vehiclePlate:orderInfo.vehiclePlate, orderStep:orderInfo.orderStep } navTo(`/orders/cancel-order?data=${JSON.stringify(item)}`); } //继续申请、修改资料 const gotoEditUserOrUnitInfo = (orderInfo:any) =>{ console.log("******************",orderInfo.orderStep); console.log("********555555555555**********",orderInfo); let url = ''; if(orderInfo.orderStep == OrderStatus.完成填写基本信息){ url = orderInfo.userType === 'PERSONAL_USER' ? '/applyCard/opening-account-people' : '/applyCard/opening-account-unit'; }else if(orderInfo.orderStep === OrderStatus["完成个人/单位信息上传"]){ url = '/applyCard/car-release'; }else if(orderInfo.orderStep === OrderStatus.完成车辆信息上传){ url = `/applyCard/release-products`; }else{ url = `/applyCard/essential-information`; } navTo(`${url}?orderId=${orderInfo.orderId}&clientFee=${orderInfo.amount}&id=${orderInfo.productId}&vehiclePlateColor=${orderInfo.vehiclePlateColor}&fromOrder=true&type=${orderInfo.type}&userType=${orderInfo.userType === 'PERSONAL_USER' ? '1' : '2'}`); } //确认收货 const gotoConfirmReceipt = (orderInfo:any) =>{ const item = { id:orderInfo.id, orderId:orderInfo.orderId, vehiclePlate:orderInfo.vehiclePlate, orderStep:orderInfo.orderStep, cardId:orderInfo.cardId, obuId:orderInfo.obuId, } navTo(`/orders/order-confirm-receipt?id=${orderInfo.id}`) } //去支付-选择产品 const gotoPay = (orderInfo:any) => { const data = { orderId: orderInfo.orderId, amount: orderInfo.amount, productId: orderInfo.productId, } navTo(`/orders/payment?data=${JSON.stringify(data)}`); //navTo(`/applyCard/product-detail?orderId=${state.orderId}&&clientFee=${val.clientFee}&&id=${val.id}`) // navTo(`/applyCard/choice-product?orderId=${orderInfo.orderId}`); } //申请退货 const gotoReturnOrder = (orderInfo:any) =>{ const data = { id:orderInfo.id, orderId:orderInfo.orderId, vehiclePlate:orderInfo.vehiclePlate, orderStep:orderInfo.orderStep, } navTo(`/orders/apply-return-goods?data=${JSON.stringify(data)}`); } //去换货 const gotoExchangeOrder = (orderInfo:any) =>{ navTo(`/orders/apply-ex-goods-step1?orderId=${orderInfo.orderId}&id=${orderInfo.id}`); } //去激活订单 const gotoActiveOrder = (orderInfo:any) =>{ navTo(`/after-sale/activation/operation-tips?id=${orderInfo.id}&orderId=${orderInfo.orderId}&cardStatus=${orderInfo.cardStatus}&obuStatus=${orderInfo.obuStatus}`); } //新办订单-去评价 const gotoEvaluateOrder = (orderInfo:any) =>{ navTo(`/orders/order-evaluate?id=${orderInfo.id}`); } //查看物流 const gotoCheckLogistics = (orderInfo:any) =>{ navTo(`/orders/order-detail-logistics?id=${orderInfo.id}`); } //换卡、换签、同时换卡换签订单支付确认页面 const gotoCardSignPay = (orderInfo:any) =>{ navTo(`/orders/order-card-sign-payment?id=${orderInfo.id}`); } //重新申请ETC注销 const gotoLogoffETC = (orderInfo:any) =>{ navTo(`/after-sale/ETC-log-off/log-off-confirm?orderId=${orderInfo.orderId}`); } //车辆信息变更-信息重写 const gotoEditCarWriteInfo = (orderInfo:any) =>{ // navTo(`/pages/bluetooth/bluetooth?id=${orderInfo.id}&orderId=${orderInfo.orderId}`); navTo(`/pages/bluetooth/bluetooth?routeType=3`); } //车辆信息变更-重新申请 const gotoEditCarApplyAgain = (orderInfo:any) =>{ //跳转到车辆信息变更界面 navTo(`/person-al-center/setting/car-information/car-change`); } return{ gotoEditAddress,gotoCancelOrder,gotoEditUserOrUnitInfo, gotoConfirmReceipt,gotoCheckLogistics,gotoEvaluateOrder, gotoActiveOrder,gotoReturnOrder,gotoExchangeOrder,gotoPay, gotoOrderDetails,gotoLogoffETC,gotoEditCarWriteInfo, gotoEditCarApplyAgain,gotoCardSignPay } }