api.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. import {
  2. http
  3. } from './service.js'
  4. //文件上传
  5. const uploadFile = (p) => http.upload('blade-resource/oss/endpoint/put-file', {
  6. name: 'file',
  7. filePath: p
  8. })
  9. const notice = {
  10. detail: p => http.get('blade-desk/notice/detail', {
  11. params: p
  12. }),
  13. }
  14. const platform = {
  15. setting: p => http.get('blade-system/param/detail', {
  16. params: p
  17. }),
  18. getPlatformParams: p => http.get('/app/platformsetting/getPlatformValueByList', {
  19. params: p
  20. }),
  21. getPlatformValue: p => http.get('/app/platformsetting/getPlatformValue', {
  22. params: p
  23. }),
  24. }
  25. const activity = {
  26. getPromoteNum: p => http.get('app/active/help', {
  27. params: p
  28. }),
  29. getWorksList: p => http.get('/app/active/product/sortList', {
  30. params: p
  31. }),
  32. sortListQuery: p => http.get('/app/active/product/sortListQuery', {
  33. params: p
  34. }),
  35. indexList: p => http.get('app/active/product/list', {
  36. params: p
  37. }),
  38. searchWork: p => http.get('/app/active/product/search', {
  39. params: {
  40. keyword: p
  41. }
  42. }),
  43. getWorksDetail: id => http.get('/sing_active/activeproductrecord/detail', {
  44. params: {
  45. id
  46. }
  47. }),
  48. list: p => http.get('/sing_active/activeproductrecord/list', {
  49. params: p
  50. }),
  51. getGiftList: p => http.get('/sing_goods/helpgoods/list', {
  52. params: p
  53. }),
  54. getMyTotalHeat: p => http.get('/sing_active/activeproductrecord/getMyTotalHeat', {
  55. params: p
  56. }),
  57. }
  58. //微信api
  59. const wxApp = {
  60. getOpenId: p => http.get('/wx-app/getOpenId', {
  61. params: p
  62. }),
  63. getOpenData: p => http.post('/wx-app/getOpenData', p),
  64. getGenerateScheme: p => http.get('/wx-app/getGenerateScheme', {
  65. params: p
  66. }),
  67. }
  68. //字典
  69. const dict = {
  70. list: p => http.get('/blade-system/dict-biz/dictionary', {
  71. params: p
  72. }),
  73. parentList: p => http.get('/blade-system/dict-biz/parent-list', {
  74. params: p
  75. }),
  76. dictionaryTree: p => http.get('/blade-system/dict-biz/dictionary-tree', {
  77. params: p
  78. }),
  79. }
  80. const loginUser = {
  81. list: p => http.get('ldt_user/loginuser/list', {
  82. params: p
  83. }),
  84. submit: p => http.post('sing_user/loginuser/submit', p),
  85. login: p => http.post('/user/login/login', p),
  86. detail: p => http.get('sing_user/loginuser/detail', {
  87. params: p
  88. }),
  89. userHeatValueAndPufaPoint: p => http.get('/user/login/userHeatValueAndPufaPoint', {
  90. params: p
  91. }),
  92. }
  93. const CMCC = {
  94. isCMCC: p => http.get('/user/login/isCMCC', {
  95. params: p
  96. }),
  97. queryCmccPoint: p => http.post('app/cmcc/queryCmccPoint' + p),
  98. }
  99. const points = {
  100. list: p => http.get('sing_point/pointrecord/list', {
  101. params: p
  102. }),
  103. }
  104. //我的助力
  105. const help = {
  106. list: p => http.get('sing_active/activehelprecord/list', {
  107. params: p
  108. }),
  109. }
  110. //热力明细
  111. const heatrecord = {
  112. list: p => http.get('sing_heat_value/heatrecord/list', {
  113. params: p
  114. }),
  115. }
  116. /**
  117. * 积分商城
  118. */
  119. const pointgoods = {
  120. list: p => http.get('sing_goods/pointgoods/list', {
  121. params: p
  122. }),
  123. exchange: p => http.post('app/point/exchange', p, {
  124. header: {
  125. 'Content-Type': 'application/x-www-form-urlencoded'
  126. }
  127. }),
  128. }
  129. /**
  130. * 兑换记录
  131. */
  132. const goodsorder = {
  133. list: p => http.get('sing_goods/goodsorder/list', {
  134. params: p
  135. }),
  136. detail: p => http.get('sing_goods/goodsorder/detail', {
  137. params: p
  138. }),
  139. submit: p => http.post('sing_goods/goodsorder/submit', p),
  140. }
  141. /**
  142. * 道具
  143. */
  144. const order = {
  145. sendCmccSms: p => http.post('/app/help/goods/sendCmccSms', p, {
  146. header: {
  147. 'Content-Type': 'application/x-www-form-urlencoded'
  148. }
  149. }),
  150. create: p => http.post('/app/help/goods/createPropsOrder', p, {
  151. header: {
  152. 'Content-Type': 'application/x-www-form-urlencoded'
  153. }
  154. }),
  155. exchange: p => http.post('/app/help/goods/exchangeProps', p, {
  156. header: {
  157. 'Content-Type': 'application/x-www-form-urlencoded'
  158. }
  159. }),
  160. }
  161. /**
  162. * 用户地址
  163. */
  164. const address = {
  165. list: p => http.get("sing_user/useraddress/list", {
  166. params: p
  167. }),
  168. detail: p => http.get("sing_user/useraddress/detail", {
  169. params: p
  170. }),
  171. submit: p => http.post('sing_user/useraddress/submitAddress', p),
  172. //获取地址信息
  173. getLocation: p => http.get("sing_user/useraddress/getLocation", {
  174. params: p
  175. }),
  176. }
  177. /**
  178. * 字典地址
  179. */
  180. const area = {
  181. province: p => http.get('blade-system/region/lazy-tree?parentCode=00', {
  182. params: p
  183. }),
  184. list: p => http.get('blade-system/region/lazy-tree', {
  185. params: p
  186. }),
  187. }
  188. const census = {
  189. online: p => http.get('app/index/census/online', {
  190. params: p
  191. }),
  192. offline: p => http.get('app/index/census/offline', {
  193. params: p
  194. }),
  195. }
  196. //活动列表
  197. const activerecord={
  198. list: p => http.get('sing_active/activerecord/list', {
  199. params: p
  200. }),
  201. }
  202. export const api = {
  203. uploadFile,
  204. dict,
  205. wxApp,
  206. loginUser,
  207. activity,
  208. platform,
  209. points,
  210. help,
  211. heatrecord,
  212. CMCC,
  213. pointgoods,
  214. goodsorder,
  215. order,
  216. address,
  217. notice,
  218. area,
  219. census,
  220. activerecord
  221. }