You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

useOrderSkip.ts 10KB

hace 2 años
hace 2 años
hace 1 año
hace 11 meses
hace 2 años
hace 1 año
hace 1 año
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 2 años
hace 1 año
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 11 meses
hace 11 meses
hace 2 años
hace 2 años
hace 11 meses
hace 11 meses
hace 11 meses
hace 11 meses
hace 11 meses
hace 11 meses
hace 2 años
hace 2 años
hace 11 meses
hace 11 meses
hace 11 meses
hace 2 años
hace 2 años
hace 2 años
hace 1 año
hace 1 año
hace 2 años
hace 1 año
hace 1 año
hace 2 años
hace 1 año
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 11 meses
hace 2 años
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. // 订单跳转统一工具类
  2. import { msg, navTo } from "@/utils/utils";
  3. import { OrderStatus } from "@/datas/enum";
  4. import { OrderTypes } from "@/datas/enum";
  5. import { getItem, setItem } from "@/utils/storage";
  6. import { request } from "@/utils/network/request.js";
  7. import { gotoAgainUseOrderApi, finishUseOrderApi } from "@/utils/network/api.js";
  8. import { stringToJson } from "@/utils/network/encryption.js";
  9. import { jump } from "@/datas/9901Jump.js";
  10. export default function useOrderSkip() {
  11. const gotoOrderDetailsPay = (orderInfo) => {
  12. // #ifdef MP-WEIXIN
  13. navTo(`/subpackage/orders/order_payment?orderId=${orderInfo.orderId}&isValueCard=${orderInfo.isValueCard}`);
  14. // #endif
  15. // #ifdef MP-ALIPAY
  16. navTo(`/subpackage/orders/order_payment?orderId=${orderInfo.orderId}&isValueCard=${orderInfo.isValueCard}`);
  17. // #endif
  18. }
  19. //根据订单类型 跳转到不同的订单详情页面
  20. const gotoOrderDetails = (orderInfo, isWeiXin) => {
  21. console.log('输出内容=====', orderInfo)
  22. navTo(`/subpackage/orders/order-details-new?id=${orderInfo.id}&appraise=${orderInfo.appraise}&isWeiXin=${isWeiXin}`);
  23. }
  24. //跳转到修改地址页面
  25. const gotoEditAddress = (orderInfo : any) => {
  26. const item = {
  27. id: orderInfo.orderInfoExt.id ? orderInfo.orderInfoExt.id : '',
  28. consignee: orderInfo.orderInfoExt.consignee ? orderInfo.orderInfoExt.consignee : '',
  29. consigneeTel: orderInfo.orderInfoExt.consigneeTel ? orderInfo.orderInfoExt.consigneeTel : '',
  30. region: orderInfo.orderInfoExt.region ? orderInfo.orderInfoExt.region : '',
  31. address: orderInfo.orderInfoExt.address ? orderInfo.orderInfoExt.address : '',
  32. postalCode: orderInfo.orderInfoExt.postalCode ? orderInfo.orderInfoExt.postalCode : '',
  33. fromOrder: true, //是否来自订单
  34. }
  35. navTo(`/subpackage/personal-center/setting/addressManager?fromOrder=true`);
  36. }
  37. //取消订单
  38. const gotoCancelOrder = (orderInfo : any) => {
  39. const item = {
  40. id: orderInfo.id,
  41. orderId: orderInfo.orderId,
  42. vehiclePlate: orderInfo.vehiclePlate,
  43. orderStep: orderInfo.orderStep
  44. }
  45. navTo(`/subpackage/orders/cancel-order?data=${JSON.stringify(item)}`);
  46. }
  47. //继续申请、修改资料
  48. const gotoEditUserOrUnitInfo = (orderInfo : any) => {
  49. console.log("********555555555555**********", orderInfo.orderStep, OrderStatus["已支付/待签约"]);
  50. let url = '';
  51. if (orderInfo.orderStep == OrderStatus.完成填写基本信息 || orderInfo.orderStep == OrderStatus.待支付3) {
  52. if (orderInfo.agencyId == "52010106004") {
  53. const params = encodeURIComponent(JSON.stringify(orderInfo))
  54. jump("10", params)
  55. } else {
  56. url = orderInfo.userType === 'PERSONAL_USER' ? '/subpackage/orders/opening-account-people' : '/subpackage/orders/opening-account-unit';
  57. }
  58. } else if (orderInfo.orderStep === OrderStatus["完成个人/单位信息上传"]) {
  59. url = '/subpackage/orders/car-release';
  60. } else if (orderInfo.orderStep === OrderStatus.完成车辆信息上传 && orderInfo.isValueCard != 1) {
  61. url = `/subpackage/orders/release-products`;
  62. } else if (orderInfo.orderStep === OrderStatus.待加购权益) {
  63. navTo(`/subpackage/orders/interestsList?orderId=${orderInfo.orderId}&&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}`);
  64. } else if (orderInfo.orderStep === OrderStatus["完成车辆信息上传/待支付"]) {
  65. if (orderInfo.agencyId == "52010106004") {
  66. const params = encodeURIComponent(JSON.stringify(orderInfo))
  67. jump("11", params)
  68. } else {
  69. url = '/subpackage/orders/order-payment';
  70. }
  71. } else if (orderInfo.orderStep === OrderStatus["审核不通过"]) { //修改资料
  72. url = '/subpackage/orders/changeInformation';
  73. } else if (orderInfo.orderStep === OrderStatus["已支付/待签约"]) { //修改资料
  74. if (orderInfo.agencyId == "52010106004") {
  75. const params = encodeURIComponent(JSON.stringify(orderInfo))
  76. jump("12", params)
  77. } else {
  78. url = '/subpackage/orders/release-products';
  79. }
  80. }
  81. console.log("url", url)
  82. 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'}&vehicleId=${orderInfo.vehicleId}`);
  83. }
  84. //确认收货
  85. const gotoConfirmReceipt = (orderInfo : any) => {
  86. const item = {
  87. id: orderInfo.id,
  88. orderId: orderInfo.orderId,
  89. vehiclePlate: orderInfo.vehiclePlate,
  90. orderStep: orderInfo.orderStep,
  91. cardId: orderInfo.cardId,
  92. obuId: orderInfo.obuId,
  93. }
  94. navTo(`/subpackage/orders/order-confirm-receipt?id=${orderInfo.id}`)
  95. }
  96. //去支付-选择产品
  97. const gotoPay = (orderInfo : any) => {
  98. const data = {
  99. orderId: orderInfo.orderId,
  100. amount: orderInfo.amount,
  101. productId: orderInfo.productId,
  102. }
  103. navTo(`/subpackage/orders/payment?data=${JSON.stringify(data)}`);
  104. }
  105. //申请退货
  106. const gotoReturnOrder = (orderInfo : any) => {
  107. if (orderInfo.agencyId == "52010106004") {
  108. const params = encodeURIComponent(JSON.stringify(orderInfo))
  109. jump("8", params)
  110. } else {
  111. const data = {
  112. id: orderInfo.id,
  113. orderId: orderInfo.orderId,
  114. vehiclePlate: orderInfo.vehiclePlate,
  115. orderStep: orderInfo.orderStep,
  116. }
  117. navTo(`/subpackage/orders/apply-return-goods?data=${JSON.stringify(data)}`);
  118. }
  119. }
  120. //申请换货
  121. const gotoExchangeOrder = (orderInfo : any) => {
  122. if (orderInfo.agencyId == "52010106004") {
  123. const params = encodeURIComponent(JSON.stringify(orderInfo))
  124. jump("7", params)
  125. } else {
  126. navTo(`/subpackage/orders/apply-ex-goods-step1?orderId=${orderInfo.orderId}&id=${orderInfo.id}`);
  127. }
  128. }
  129. //申请补货
  130. const gotoReplenishmentOrder = (orderInfo : any) => {
  131. if (orderInfo.agencyId == "52010106004") {
  132. const params = encodeURIComponent(JSON.stringify(orderInfo))
  133. jump("9", params)
  134. }
  135. }
  136. //去激活订单
  137. const gotoActiveOrder = (orderInfo : any) => {
  138. if (orderInfo.agencyId == "52010106004") {
  139. const params = encodeURIComponent(JSON.stringify(orderInfo))
  140. jump("3", params)
  141. } else {
  142. navTo(`/subpackage/after-sale/activation/operation-tips?id=${orderInfo.id}&orderId=${orderInfo.orderId}&cardStatus=${orderInfo.cardStatus}&obuStatus=${orderInfo.obuStatus}&transfer=${orderInfo.transfer}`);
  143. }
  144. }
  145. //新办订单-去评价
  146. const gotoEvaluateOrder = (orderInfo : any) => {
  147. navTo(`/subpackage/orders/order-evaluate?id=${orderInfo.id}`);
  148. }
  149. //新办订单-去评价 发行产品,业务满意度评价
  150. const gotoEvaluateProduct = (orderInfo : any) => {
  151. navTo(`/subpackage/orders/order-evaluate-product?id=${orderInfo.id}&orderId=${orderInfo.orderId}`);
  152. }
  153. //新办订单-去评价 业务办理满意度,业务员满意度
  154. const gotoEvaluateSalesman = (orderInfo : any) => {
  155. navTo(`/subpackage/orders/order-evaluate-salesman?id=${orderInfo.id}&orderId=${orderInfo.orderId}`);
  156. }
  157. //查看物流
  158. const gotoCheckLogistics = (orderInfo : any) => {
  159. navTo(`/subpackage/orders/order-detail-logistics?orderInfo=${JSON.stringify(orderInfo)}`);
  160. }
  161. //换卡、换签、同时换卡换签订单支付确认页面
  162. const gotoCardSignPay = (orderInfo : any) => {
  163. navTo(`/subpackage/orders/order-card-sign-payment?id=${orderInfo.id}`);
  164. }
  165. //重新申请ETC注销
  166. const gotoLogoffETC = (orderInfo : any) => {
  167. navTo(`/subpackage/after-sale/ETC-log-off/log-off-confirm?orderId=${orderInfo.orderId}`);
  168. }
  169. //车辆信息变更-信息重写
  170. const gotoEditCarWriteInfo = (orderInfo : any) => {
  171. navTo(`/pages/bluetooth/bluetooth?routeType=3`);
  172. }
  173. //车辆信息变更-重新申请
  174. const gotoEditCarApplyAgain = (orderInfo : any) => {
  175. //跳转到车辆信息变更界面
  176. navTo(`/subpackage/personal-center/setting/car-information/car-change`);
  177. }
  178. //去签约
  179. const gotoOrderSign = (orderInfo : any) => {
  180. //跳转到车辆信息变更界面
  181. // #ifdef MP-ALIPAY
  182. navTo(`/subpackage/orders/release-products?orderId=${orderInfo.orderId}`);
  183. // #endif
  184. // #ifdef MP-WEIXIN
  185. navTo(`/subpackage/orders/release-products?orderId=${orderInfo.orderId}&&id=${orderInfo.id}&&clientFee=${orderInfo.amount}`);
  186. // #endif
  187. }
  188. //再次使用订单
  189. const gotoAgainUseOrder = (orderInfo : any) => {
  190. uni.showModal({
  191. title: '温馨提示',
  192. content: '确定再次使用订单',
  193. success: function (res) {
  194. if (res.confirm) {
  195. const options = {
  196. type: 2,
  197. data: {
  198. orderId: orderInfo.orderId,
  199. orderSource: "WECHAT",
  200. openId: getItem('openId'),
  201. },
  202. method: "POST",
  203. showLoading: true,
  204. };
  205. request(gotoAgainUseOrderApi, options).then((res) => {
  206. const data = stringToJson(res.bizContent);
  207. // 刷新本页面
  208. console.log("再次使用订单", data)
  209. uni.reLaunch({
  210. url: `/pages/order/order?index=${0}`
  211. })
  212. });
  213. } else if (res.cancel) {
  214. console.log('用户点击取消');
  215. }
  216. }
  217. });
  218. }
  219. // 结束订单
  220. const closeOrder = (orderInfo : any) => {
  221. uni.showModal({
  222. title: '温馨提示',
  223. content: '订单结束后,30天内可申请再次使用',
  224. success: function (res) {
  225. if (res.confirm) {
  226. const options = {
  227. type: 2,
  228. data: {
  229. orderId: orderInfo.orderId,
  230. orderSource: "WECHAT",
  231. openId: getItem('openId'),
  232. },
  233. method: "POST",
  234. showLoading: true,
  235. };
  236. request(finishUseOrderApi, options).then((res) => {
  237. const data = stringToJson(res.bizContent);
  238. // 刷新本页面
  239. console.log("结束订单", orderInfo)
  240. uni.reLaunch({
  241. url: `/pages/order/order?index=${0}`
  242. })
  243. });
  244. } else if (res.cancel) {
  245. console.log('用户点击取消');
  246. }
  247. }
  248. });
  249. }
  250. //异地-邮寄地址填写
  251. const gotoAddressOrder=(orderInfo:any)=>{
  252. if (orderInfo.agencyId == "52010106004") {
  253. const params = encodeURIComponent(JSON.stringify(orderInfo))
  254. jump("13", params)
  255. }
  256. }
  257. return {
  258. gotoEditAddress, gotoCancelOrder, gotoEditUserOrUnitInfo,
  259. gotoConfirmReceipt, gotoCheckLogistics, gotoEvaluateOrder, gotoEvaluateProduct, gotoEvaluateSalesman,
  260. gotoActiveOrder, gotoReturnOrder, gotoExchangeOrder, gotoPay,
  261. gotoOrderDetails, gotoLogoffETC, gotoEditCarWriteInfo,
  262. gotoEditCarApplyAgain, gotoCardSignPay, gotoAgainUseOrder, gotoOrderDetailsPay, gotoOrderSign, closeOrder,
  263. gotoReplenishmentOrder,
  264. gotoAddressOrder
  265. }
  266. }