http.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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("/user/login",params).then(result=>{
  17. resolve(result)
  18. }).catch(err=>{
  19. reject(err)
  20. });
  21. })
  22. }
  23. //个人中心首页
  24. export function ucenterData(){
  25. return request.post("/inquire/myData")
  26. }
  27. //个人中心联系客服
  28. export function getService(){
  29. return request.post("/inquire/contact/service")
  30. }
  31. //个人中心换电记录
  32. export function exchangeRecord(params){
  33. return request.post("/inquire/exchangeRecord",params)
  34. }
  35. //个人中心获取天数
  36. export function getDays(){
  37. return request.post("/user/days")
  38. }
  39. //换电记录详情
  40. export function exchangeRecordShow(id){
  41. return request.post(`/inquire/exchangeDetail/${id}`)
  42. }
  43. //个人中心我的车辆
  44. export function exchangeHistoryCar(){
  45. return request.post("/inquire/exchangeHistorical")
  46. }
  47. //个人中心获取所有车辆列表
  48. export function userCarList(){
  49. return request.post("/inquire/vehInfo")
  50. }
  51. //个人中心我的车辆详情
  52. export function exchangeCarDetail(plate){
  53. return request.post(`/inquire/vehDetail?plate=${plate}`)
  54. }
  55. //用stationCode获取换电编号
  56. export function getStationExchange(params){
  57. return request.post("/swap/getStationExchange",params)
  58. }
  59. //首页车辆信息
  60. export function homeCar(params){
  61. return request.post("/inquire/homeCar",params)
  62. }
  63. //首页换电站信息
  64. export function homeStation(params){
  65. return request.post("/inquire/homeStation",params)
  66. }
  67. //换电流程累计换电次数
  68. export function getExchangeTimes(params){
  69. return request.post("/exchange/record/getExchangeNum",params)
  70. }
  71. //登录用户协议
  72. export function getAgreement(){
  73. return request.post("/user/agreement",1)
  74. }