index.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. import request from '../utils/request.js';
  2. import requestWhite from '../utils/requestWhite.js';
  3. import Qs from 'qs';
  4. export function scanCode(res) {
  5. // res="jp_team51_charge_id:A_11111"
  6. var str1 = res.slice(0,19);
  7. var str2 = res.slice(20,21);
  8. var id = res.slice(22);
  9. if(str1 == 'jp_team51_charge_id') {
  10. if(str2 == 'A') {
  11. uni.navigateTo({
  12. url: '/pages/searchPile/stationAndPile/stationDetails?id=' + id
  13. })
  14. }
  15. } else {
  16. uni.showToast({
  17. title: '请扫描充电装上的二维码'
  18. })
  19. }
  20. }
  21. export function activityInfoList(data) {
  22. return requestWhite({
  23. method: 'post',
  24. data: data,
  25. url: '/mobile/activityInfo/activityInfoList'
  26. })
  27. }
  28. export function test(data) {
  29. return request({
  30. method: 'post',
  31. data: data,
  32. url: '/test/post'
  33. })
  34. }
  35. export function chargingData(data) {
  36. return request({
  37. method: 'post',
  38. data: data,
  39. url: '/mobile/charging/chargingData'
  40. })
  41. }
  42. export function marketingData(data) {
  43. return request({
  44. method: 'post',
  45. data: data,
  46. url: '/mobile/charging/marketingData'
  47. })
  48. }
  49. export function findChargeData(data) {
  50. return request({
  51. method: 'get',
  52. data: data,
  53. url: '/mobile/regUser/findChargeData'
  54. })
  55. }
  56. export function personalCenter(data) {
  57. return request({
  58. method: 'post',
  59. data: data,
  60. url: '/mobile/regUser/personalCenter'
  61. })
  62. }
  63. export function logout(data) {
  64. return request({
  65. method: 'get',
  66. data: data,
  67. url: '/mobile/regUser/logout'
  68. })
  69. }
  70. export function stopCharging(data) {
  71. return request({
  72. method: 'post',
  73. data: data,
  74. url: '/mobile/command/stopCharging'
  75. })
  76. }
  77. export function startCharging(data) {
  78. return request({
  79. method: 'post',
  80. data: data,
  81. url: '/mobile/command/startCharging'
  82. })
  83. }
  84. export function accountRecordData(data) {
  85. return request({
  86. method: 'post',
  87. data: data,
  88. url: '/mobile/accountRecord/accountRecordData'
  89. })
  90. }
  91. export function accountDetail(id) {
  92. return request({
  93. method: 'get',
  94. url: '/mobile/accountRecord/accountDetail?id='+id
  95. })
  96. }
  97. export function chargingRecordData(data) {
  98. return request({
  99. method: 'post',
  100. data: data,
  101. url: '/mobile/chargingRecord/chargingRecordData'
  102. })
  103. }
  104. export function chargingDetail(id) {
  105. return request({
  106. method: 'get',
  107. url: '/mobile/chargingRecord/chargingDetail?id='+id
  108. })
  109. }
  110. export function passengerMessageNoReadNum(data) {
  111. return request({
  112. url: '/mobile/passengerApi/passengerMessageNoReadNum',
  113. data:data,
  114. method: 'post',
  115. })
  116. }
  117. export function chargingDeviceData(data) {
  118. return request({
  119. method: 'post',
  120. data: data,
  121. url: '/mobile/charging/chargingDeviceData'
  122. })
  123. }