api.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. import {http} from './service.js'
  2. //文件上传
  3. const uploadFile =(p)=> http.upload('blade-resource/oss/endpoint/put-file', {name:'file',filePath:p})
  4. const notice={
  5. detail:p => http.get('blade-desk/notice/detail', {params:p}),
  6. }
  7. const platform = {
  8. setting: p => http.get('blade-system/param/detail', {params:p}),
  9. getPlatformParams: p => http.get('/app/platformsetting/getPlatformValueByList', {params:p}),
  10. }
  11. const activity = {
  12. getPromoteNum: p => http.get('app/active/help', {params:p}),
  13. getWorksList: p => http.get('/app/active/product/sortList', {params:p}),
  14. sortListQuery: p => http.get('/app/active/product/sortListQuery', {params:p}),
  15. indexList: p => http.get('app/active/product/list', {params:p}),
  16. searchWork: p => http.get('/app/active/product/search', {params:{keyword: p}}),
  17. getWorksDetail: id => http.get('/sing_active/activeproductrecord/detail', {params:{id}}),
  18. list: p => http.get('/sing_active/activeproductrecord/list', {params:p}),
  19. getGiftList: p => http.get('/sing_goods/helpgoods/list', {params:p}),
  20. getMyTotalHeat:p => http.get('/sing_active/activeproductrecord/getMyTotalHeat', {params:p}),
  21. }
  22. //微信api
  23. const wxApp={
  24. getOpenId:p => http.get('/wx-app/getOpenId', {params:p}),
  25. getOpenData:p => http.post('/wx-app/getOpenData',p),
  26. getGenerateScheme: p => http.get('/wx-app/getGenerateScheme', {
  27. params: p
  28. }),
  29. }
  30. //字典
  31. const dict={
  32. list:p => http.get('/blade-system/dict-biz/dictionary', {params:p}),
  33. parentList:p => http.get('/blade-system/dict-biz/parent-list', {params:p}),
  34. dictionaryTree:p => http.get('/blade-system/dict-biz/dictionary-tree', {params:p}),
  35. }
  36. const loginUser={
  37. list:p => http.get('ldt_user/loginuser/list', {params:p}),
  38. submit:p => http.post('sing_user/loginuser/submit', p),
  39. login:p => http.post('/user/login/login', p),
  40. detail:p => http.get('sing_user/loginuser/detail', {params:p}),
  41. userHeatValueAndPufaPoint:p => http.get('/user/login/userHeatValueAndPufaPoint', {params:p}),
  42. }
  43. const CMCC={
  44. isCMCC:p => http.get('/user/login/isCMCC', {params:p}),
  45. queryCmccPoint:p => http.post('app/cmcc/queryCmccPoint'+p),
  46. }
  47. const points={
  48. list:p => http.get('sing_point/pointrecord/list', {params:p}),
  49. }
  50. //我的助力
  51. const help={
  52. list:p => http.get('sing_active/activehelprecord/list', {params:p}),
  53. }
  54. //热力明细
  55. const heatrecord={
  56. list:p => http.get('sing_heat_value/heatrecord/list', {params:p}),
  57. }
  58. /**
  59. * 积分商城
  60. */
  61. const pointgoods={
  62. list:p => http.get('sing_goods/pointgoods/list', {params:p}),
  63. exchange:p => http.post('app/point/exchange',p,{header:{'Content-Type':'application/x-www-form-urlencoded'}}),
  64. }
  65. /**
  66. * 兑换记录
  67. */
  68. const goodsorder={
  69. list:p => http.get('sing_goods/goodsorder/list', {params:p}),
  70. detail:p => http.get('sing_goods/goodsorder/detail', {params:p}),
  71. submit:p => http.post('sing_goods/goodsorder/submit', p),
  72. }
  73. /**
  74. * 道具
  75. */
  76. const order={
  77. sendCmccSms:p => http.post('/app/help/goods/sendCmccSms',p,{header:{'Content-Type':'application/x-www-form-urlencoded'}}),
  78. create:p => http.post('/app/help/goods/createPropsOrder',p,{header:{'Content-Type':'application/x-www-form-urlencoded'}}),
  79. exchange:p => http.post('/app/help/goods/exchangeProps',p,{header:{'Content-Type':'application/x-www-form-urlencoded'}}),
  80. }
  81. /**
  82. * 用户地址
  83. */
  84. const address = {
  85. list: p => http.get("sing_user/useraddress/list", {
  86. params: p
  87. }),
  88. detail: p => http.get("sing_user/useraddress/detail", {
  89. params: p
  90. }),
  91. submit: p => http.post('sing_user/useraddress/submitAddress', p),
  92. //获取地址信息
  93. getLocation: p => http.get("sing_user/useraddress/getLocation", {
  94. params: p
  95. }),
  96. }
  97. /**
  98. * 字典地址
  99. */
  100. const area={
  101. province: p => http.get('blade-system/region/lazy-tree?parentCode=00', {params: p}),
  102. list:p => http.get('blade-system/region/lazy-tree', {params: p}),
  103. }
  104. export const api={
  105. uploadFile,
  106. dict,
  107. wxApp,
  108. loginUser,
  109. activity,
  110. platform,
  111. points,
  112. help,
  113. heatrecord,
  114. CMCC,
  115. pointgoods,
  116. goodsorder,
  117. order,
  118. address,
  119. notice,
  120. area
  121. }