api.js 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. import {
  2. http
  3. } from './service.js'
  4. const uploadFileUrl = '/blade-resource/oss/endpoint/put-file'
  5. //文件上传
  6. const uploadFile = (p) => http.upload(uploadFileUrl, {
  7. name: 'file',
  8. filePath: p
  9. })
  10. //手机验证码
  11. const sms={
  12. send:p => http.post('/sms/sendSms'+p)
  13. }
  14. const notice = {
  15. detail: p => http.get('sing_active/activenotice/detail', {
  16. params: p
  17. }),
  18. list: p => http.get('sing_active/activenotice/list', {
  19. params: p
  20. }),
  21. //从缓存中获取
  22. getDetail: p => http.get('app/active/notice/getNotice', {
  23. params: p
  24. }),
  25. }
  26. const platform = {
  27. setting: p => http.get('blade-system/param/detail', {
  28. params: p
  29. }),
  30. getPlatformParams: p => http.get('/app/platformsetting/getPlatformValueByList', {
  31. params: p
  32. }),
  33. getPlatformValue: p => http.get('/app/platformsetting/getPlatformValue', {
  34. params: p
  35. }),
  36. }
  37. const activity = {
  38. getPromoteNum: p => http.get('app/active/help', {
  39. params: p
  40. }),
  41. getWorksList: p => http.get('/app/active/product/sortList', {
  42. params: p
  43. }),
  44. sortListQuery: p => http.get('/app/active/product/sortListQuery', {
  45. params: p
  46. }),
  47. indexList: p => http.get('app/active/product/list', {
  48. params: p
  49. }),
  50. searchWork: p => http.get('/app/active/product/search', {
  51. params: p
  52. }),
  53. getWorksDetail: id => http.get('/sing_active/activeproductrecord/detail', {
  54. params: {
  55. id
  56. }
  57. }),
  58. list: p => http.get('/sing_active/activeproductrecord/list', {
  59. params: p
  60. }),
  61. // getGiftList: p => http.get('/sing_goods/helpgoods/list', {
  62. // params: p
  63. // }),
  64. getGiftList: p => http.get('app/help/goods/getHelpGoodsList', {
  65. params: p
  66. }),
  67. getMyTotalHeat: p => http.get('/sing_active/activeproductrecord/getMyTotalHeat', {
  68. params: p
  69. }),
  70. submitForm: p => http.post('/sing_active/activeproductrecord/submit', p),
  71. mediaSave: p => http.post('/sing_active/activeproductrecord/save', {
  72. params: p
  73. }),
  74. remove: p => http.post('sing_active/activeproductrecord/remove', p ,{
  75. header: {
  76. 'Content-Type': 'application/x-www-form-urlencoded'
  77. }
  78. }),
  79. //获取学习列表
  80. getStudyList: p => http.get('sing_active/activestudy/list', p),
  81. //获取学习详情
  82. getStudyDetail: p => http.get('sing_active/activestudy/detail', {
  83. params: p
  84. }),
  85. }
  86. //微信api
  87. const wxApp = {
  88. getOpenId: p => http.get('/wx-app/getOpenId', {
  89. params: p
  90. }),
  91. getOpenData: p => http.post('/wx-app/getOpenData', p),
  92. getGenerateScheme: p => http.get('/wx-app/getGenerateScheme', {
  93. params: p
  94. }),
  95. getWxShareData: p => http.get('/wxOfficial/getShareData', {
  96. params: p
  97. }),
  98. getH5WxAuth: p => http.get('/user/login/getH5WeixinAuthorizeUrl', {
  99. params: p
  100. }),
  101. getH5WxUserInfo: p => http.get('/user/login/getWeiXinH5UserInfo', {
  102. params: p
  103. }),
  104. }
  105. //字典
  106. const dict = {
  107. list: p => http.get('/blade-system/dict-biz/dictionary', {
  108. params: p
  109. }),
  110. parentList: p => http.get('/blade-system/dict-biz/parent-list', {
  111. params: p
  112. }),
  113. dictionaryTree: p => http.get('/blade-system/dict-biz/dictionary-tree', {
  114. params: p
  115. }),
  116. }
  117. const loginUser = {
  118. list: p => http.get('ldt_user/loginuser/list', {
  119. params: p
  120. }),
  121. submit: p => http.post('sing_user/loginuser/submit', p),
  122. updateInfo: p => http.post('sing_user/loginuser/updateInfo', p),
  123. login: p => http.post('/user/login/login', p),
  124. h5Login: p => http.post('/user/login/h5Login', p, {
  125. header: {
  126. 'Content-Type': 'application/x-www-form-urlencoded'
  127. }
  128. }),
  129. updatePhone: p => http.post('/user/login/updatePhone', p, {
  130. header: {
  131. 'Content-Type': 'application/x-www-form-urlencoded'
  132. }
  133. }),
  134. savePhone: p => http.post('/user/login/savePhone', p, {
  135. header: {
  136. 'Content-Type': 'application/x-www-form-urlencoded'
  137. }
  138. }),
  139. detail: p => http.get('sing_user/loginuser/detail', {
  140. params: p
  141. }),
  142. userHeatValueAndPufaPoint: p => http.get('/user/login/userHeatValueAndPufaPoint', {
  143. params: p
  144. }),
  145. }
  146. const CMCC = {
  147. isCMCC: p => http.get('/user/login/isCMCC', {
  148. params: p
  149. }),
  150. h5IsCMCC: p => http.get('/user/login/h5IsCMCC', {
  151. params: p
  152. }),
  153. queryCmccPoint: p => http.post('app/cmcc/queryCmccPoint' + p),
  154. }
  155. const points = {
  156. list: p => http.get('sing_point/pointrecord/list', {
  157. params: p
  158. }),
  159. }
  160. //我的助力
  161. const help = {
  162. list: p => http.get('sing_active/activehelprecord/list', {
  163. params: p
  164. }),
  165. }
  166. //热力明细
  167. const heatrecord = {
  168. list: p => http.get('sing_heat_value/heatrecord/list', {
  169. params: p
  170. }),
  171. }
  172. /**
  173. * 积分商城
  174. */
  175. const pointgoods = {
  176. list: p => http.get('sing_goods/pointgoods/list', {
  177. params: p
  178. }),
  179. detail: p => http.get('sing_goods/pointgoods/detail', {
  180. params: p
  181. }),
  182. queryList: p => http.get('sing_goods/pointgoods/queryList', {
  183. params: p
  184. }),
  185. queryLogistics: p => http.post('app/point/queryLogistics', p, {
  186. header: {
  187. 'Content-Type': 'application/x-www-form-urlencoded'
  188. }
  189. }),
  190. exchange: p => http.post('app/point/exchange', p, {
  191. header: {
  192. 'Content-Type': 'application/x-www-form-urlencoded'
  193. }
  194. }),
  195. }
  196. /**
  197. * 兑换记录
  198. */
  199. const goodsorder = {
  200. list: p => http.get('sing_goods/goodsorder/list', {
  201. params: p
  202. }),
  203. detail: p => http.get('sing_goods/goodsorder/detail', {
  204. params: p
  205. }),
  206. submit: p => http.post('sing_goods/goodsorder/submit', p),
  207. }
  208. /**
  209. * 道具
  210. */
  211. const order = {
  212. sendCmccSms: p => http.post('/app/help/goods/sendCmccSms', p, {
  213. header: {
  214. 'Content-Type': 'application/x-www-form-urlencoded'
  215. }
  216. }),
  217. create: p => http.post('/app/help/goods/createPropsOrder', p, {
  218. header: {
  219. 'Content-Type': 'application/x-www-form-urlencoded'
  220. }
  221. }),
  222. exchange: p => http.post('/app/help/goods/exchangeProps', p, {
  223. header: {
  224. 'Content-Type': 'application/x-www-form-urlencoded'
  225. }
  226. }),
  227. cashExchange: p => http.post('/app/help/goods/createCashPropsOrder', p, {
  228. header: {
  229. 'Content-Type': 'application/x-www-form-urlencoded'
  230. }
  231. }),
  232. orderDetail: p => http.get('/sing_yeepay/yeepayorder/detail', {
  233. params: p
  234. }),
  235. verificationCode: p => http.get('/app/help/goods/createPropsVerificationCode', {
  236. params: p
  237. })
  238. }
  239. /**
  240. * 用户地址
  241. */
  242. const address = {
  243. list: p => http.get("sing_user/useraddress/list", {
  244. params: p
  245. }),
  246. detail: p => http.get("sing_user/useraddress/detail", {
  247. params: p
  248. }),
  249. submit: p => http.post('sing_user/useraddress/submitAddress', p),
  250. //获取地址信息
  251. getLocation: p => http.get("sing_user/useraddress/getLocation", {
  252. params: p
  253. }),
  254. }
  255. /**
  256. * 字典地址
  257. */
  258. const area = {
  259. province: p => http.get('blade-system/region/lazy-tree?parentCode=00', {
  260. params: p
  261. }),
  262. list: p => http.get('blade-system/region/lazy-tree', {
  263. params: p
  264. }),
  265. }
  266. const census = {
  267. online: p => http.get('app/index/census/online', {
  268. params: p
  269. }),
  270. offline: p => http.get('app/index/census/offline', {
  271. params: p
  272. }),
  273. }
  274. //活动列表
  275. const activerecord = {
  276. list: p => http.get('sing_active/activerecord/list', {
  277. params: p
  278. }),
  279. detail: p => http.get('sing_active/activerecord/detail', {
  280. params: p
  281. }),
  282. }
  283. //海报配置
  284. const poster={
  285. list: p => http.get('sing_active/activeposter/list', {
  286. params: p
  287. }),
  288. detail: p => http.get('sing_active/activeposter/detail', {
  289. params: p
  290. })
  291. }
  292. //易宝支付
  293. const yeepay={
  294. saveOrderUrlAndColor: p => http.post('app/yeepay/saveOrderUrlAndColor', p ,{
  295. header: {
  296. 'Content-Type': 'application/x-www-form-urlencoded'
  297. }
  298. }),
  299. getOrderUrlAndColor: p => http.get('app/yeepay/getOrderUrlAndColor', {
  300. params: p
  301. })
  302. }
  303. export const api = {
  304. uploadFileUrl,
  305. sms,
  306. uploadFile,
  307. dict,
  308. wxApp,
  309. loginUser,
  310. activity,
  311. platform,
  312. points,
  313. help,
  314. heatrecord,
  315. CMCC,
  316. pointgoods,
  317. goodsorder,
  318. order,
  319. address,
  320. notice,
  321. area,
  322. census,
  323. activerecord,
  324. poster,
  325. yeepay,
  326. }