http.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. import request from './request'
  2. import storage from './storage'
  3. //获取code
  4. export function wxgetCode(params) {
  5. return new Promise((resolve, reject) => {
  6. request.post("/user/session",params).then(result=>{
  7. resolve(result)
  8. }).catch(err=>{
  9. reject(err)
  10. });
  11. })
  12. }
  13. //登录
  14. export function wxLogin(params) {
  15. return new Promise((resolve, reject) => {
  16. request.post("/mini/login",params).then(result=>{
  17. resolve(result)
  18. }).catch(err=>{
  19. reject(err)
  20. });
  21. })
  22. }
  23. //用户信息
  24. export function getInfoData(){
  25. return request.get("/getInfo")
  26. }
  27. //首页-运维工单
  28. export function getOpsOrderOverview(stationCode){
  29. return request.get("/mini/order/home/opsOrderOverview?stationCode=" + stationCode)
  30. }
  31. //首页-换电站供应商
  32. export function getStationOverview(){
  33. return request.get("/mini/station/home/stationOverview")
  34. }
  35. //下拉框-获取权限内全部站点
  36. export function getHasStationCodeAndName(){
  37. return request.get("/mini/station/hasStationCodeAndName")
  38. }
  39. //获取供货商列表
  40. export function getSupplierList(params){
  41. return request.post("/mini/supplier/list",params)
  42. }
  43. //获取站点权限内用户下拉框
  44. export function getUserListByStationCode(stationCode){
  45. return request.get("/system/user/getUserListByStationCode?stationCode=" + stationCode)
  46. }
  47. //工单上报
  48. export function addOrder(params){
  49. return request.post("/mini/order/add",params)
  50. }
  51. //个人中心首页
  52. export function ucenterData(){
  53. return request.post("/inquire/myData")
  54. }
  55. //个人中心联系客服
  56. export function getService(){
  57. return request.post("/inquire/contact/service")
  58. }
  59. //个人中心换电记录
  60. export function exchangeRecord(params){
  61. return request.post("/inquire/exchangeRecord",params)
  62. }
  63. //个人中心获取天数
  64. export function getDays(){
  65. return request.post("/user/days")
  66. }
  67. //换电记录详情
  68. export function exchangeRecordShow(id){
  69. return request.post(`/inquire/exchangeDetail/${id}`)
  70. }
  71. //个人中心我的车辆
  72. export function exchangeHistoryCar(data){
  73. return request.post("/inquire/exchangeHistorical",data)
  74. }
  75. //个人中心获取所有车辆列表
  76. export function userCarList(data){
  77. return request.post("/inquire/vehInfo",data)
  78. }
  79. //个人中心我的车辆详情
  80. export function exchangeCarDetail(plate){
  81. return request.post(`/inquire/vehDetail?plate=${plate}`)
  82. }
  83. //用stationCode获取换电编号
  84. export function getStationExchange(params){
  85. return request.post("/swap/getStationExchange",params)
  86. }
  87. //首页车辆信息
  88. export function homeCar(params){
  89. return request.post("/inquire/homeCar",params)
  90. }
  91. //首页换电站信息
  92. export function homeStation(params){
  93. return request.post("/inquire/homeStation",params)
  94. }
  95. //换电流程累计换电次数
  96. export function getExchangeTimes(params){
  97. return request.post("/exchange/record/getExchangeNum",params)
  98. }
  99. //登录用户协议
  100. export function getAgreement(){
  101. return request.post("/user/agreement",1)
  102. }
  103. //充电方式费率
  104. export function chargeMethod(){
  105. return request.get("/inquire/chargeMethod")
  106. }
  107. //充电扫码验证
  108. export function verifyCharge(params){
  109. return request.post("/charge/verify",params)
  110. }
  111. //个人中心充电记录
  112. export function chargeRecord(params){
  113. return request.post("/inquire/chargeRecord",params)
  114. }
  115. //获取指南
  116. export function getexchangeGuide(stationCode){
  117. return request.post(`/inquire/exchangeGuide?stationCode=${stationCode}`,)
  118. }