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.

typeData.js 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. import {
  2. request
  3. } from "../js/network/request";
  4. import {
  5. storageKey
  6. } from "./storageKey.js";
  7. //1.订单状态 2.车牌颜色 3.车型
  8. export function getLicensePlateColor(type, callBack) {
  9. let name = ''
  10. if (type === 2) {
  11. name = 'getLicensePlateColor'
  12. } else if (type === 3) {
  13. name = 'getLicensePlateType'
  14. }
  15. // let data = uni.getStorageSync(name)
  16. let data = []
  17. if (data && data.length > 0) {
  18. console.log('输出内容', data)
  19. callBack(data)
  20. } else {
  21. request('IF01001202212130849', {
  22. data: {
  23. 'codeType': type
  24. },
  25. showLoading: true
  26. }).then((res) => {
  27. console.log('输出内容', res.rd.rd)
  28. callBack(res.rd.rd)
  29. uni.setStorageSync(name, res.rd.rd)
  30. }).catch((error) => {
  31. console.log('错误提示', error)
  32. })
  33. }
  34. }
  35. //查询职业编号
  36. export function getOccupationNumber(callBack) {
  37. let getOccupationNumber = 'getOccupationNumber'
  38. let data = uni.getStorageSync(getOccupationNumber)
  39. if (data && data.length > 0) {
  40. console.log('输出内容', data)
  41. callBack(data)
  42. } else {
  43. let signChannel = uni.getStorageSync(storageKey.signChannel);
  44. console.log('输出内容signChannel', signChannel);
  45. var param = {};
  46. if(signChannel.channelCode == "10002") {
  47. // channelCode 版本 1-通用版 2-民生银行版
  48. param.version = 2;
  49. } else {
  50. param.version = 1;
  51. }
  52. request('IF01001202209190896', {
  53. data: param,
  54. showLoading: true
  55. }).then((res) => {
  56. console.log('输出内容', res.rd.data)
  57. callBack(res.rd.data)
  58. uni.setStorageSync(getOccupationNumber, res.rd.data)
  59. }).catch((error) => {
  60. console.log('错误提示', error)
  61. })
  62. }
  63. }
  64. /**
  65. * 车牌数字转车牌中文
  66. */
  67. export function getPlateColorText(num, successFun) {
  68. var vehicleColorStr;
  69. switch (num) {
  70. case 0:
  71. vehicleColorStr = "蓝色";
  72. successFun(vehicleColorStr);
  73. break;
  74. case 1:
  75. vehicleColorStr = "黄色";
  76. successFun(vehicleColorStr);
  77. break;
  78. case 2:
  79. vehicleColorStr = "黑色";
  80. successFun(vehicleColorStr);
  81. break;
  82. case 3:
  83. vehicleColorStr = "白色";
  84. successFun(vehicleColorStr);
  85. break;
  86. case 4:
  87. vehicleColorStr = "渐变绿色";
  88. successFun(vehicleColorStr);
  89. break;
  90. case 5:
  91. vehicleColorStr = "黄绿双拼色";
  92. successFun(vehicleColorStr);
  93. break;
  94. case 6:
  95. vehicleColorStr = "蓝白渐变色";
  96. successFun(vehicleColorStr);
  97. break;
  98. case 7:
  99. vehicleColorStr = "临时牌照";
  100. successFun(vehicleColorStr);
  101. break;
  102. case 9:
  103. vehicleColorStr = "未确定";
  104. successFun(vehicleColorStr);
  105. break;
  106. case 11:
  107. vehicleColorStr = "绿色";
  108. successFun(vehicleColorStr);
  109. break;
  110. case 12:
  111. vehicleColorStr = "红色";
  112. successFun(vehicleColorStr);
  113. break;
  114. default:
  115. vehicleColorStr = "未知";
  116. successFun(vehicleColorStr);
  117. break;
  118. }
  119. }