api.js 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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. }
  75. //微信api
  76. const wxApp = {
  77. getOpenId: p => http.get('/wx-app/getOpenId', {
  78. params: p
  79. }),
  80. getOpenData: p => http.post('/wx-app/getOpenData', p),
  81. getGenerateScheme: p => http.get('/wx-app/getGenerateScheme', {
  82. params: p
  83. }),
  84. getWxShareData: p => http.get('/wxOfficial/getShareData', {
  85. params: p
  86. }),
  87. getH5WxAuth: p => http.get('/user/login/getH5WeixinAuthorizeUrl', {
  88. params: p
  89. }),
  90. getH5WxUserInfo: p => http.get('/user/login/getWeiXinH5UserInfo', {
  91. params: p
  92. }),
  93. }
  94. //字典
  95. const dict = {
  96. list: p => http.get('/blade-system/dict-biz/dictionary', {
  97. params: p
  98. }),
  99. parentList: p => http.get('/blade-system/dict-biz/parent-list', {
  100. params: p
  101. }),
  102. dictionaryTree: p => http.get('/blade-system/dict-biz/dictionary-tree', {
  103. params: p
  104. }),
  105. }
  106. const loginUser = {
  107. list: p => http.get('ldt_user/loginuser/list', {
  108. params: p
  109. }),
  110. submit: p => http.post('sing_user/loginuser/submit', p),
  111. updateInfo: p => http.post('sing_user/loginuser/updateInfo', p),
  112. login: p => http.post('/user/login/login', p),
  113. h5Login: p => http.post('/user/login/h5Login', p, {
  114. header: {
  115. 'Content-Type': 'application/x-www-form-urlencoded'
  116. }
  117. }),
  118. updatePhone: p => http.post('/user/login/updatePhone', p, {
  119. header: {
  120. 'Content-Type': 'application/x-www-form-urlencoded'
  121. }
  122. }),
  123. savePhone: p => http.post('/user/login/savePhone', p, {
  124. header: {
  125. 'Content-Type': 'application/x-www-form-urlencoded'
  126. }
  127. }),
  128. detail: p => http.get('sing_user/loginuser/detail', {
  129. params: p
  130. }),
  131. userHeatValueAndPufaPoint: p => http.get('/user/login/userHeatValueAndPufaPoint', {
  132. params: p
  133. }),
  134. }
  135. const CMCC = {
  136. isCMCC: p => http.get('/user/login/isCMCC', {
  137. params: p
  138. }),
  139. h5IsCMCC: p => http.get('/user/login/h5IsCMCC', {
  140. params: p
  141. }),
  142. queryCmccPoint: p => http.post('app/cmcc/queryCmccPoint' + p),
  143. }
  144. const points = {
  145. list: p => http.get('sing_point/pointrecord/list', {
  146. params: p
  147. }),
  148. }
  149. //我的助力
  150. const help = {
  151. list: p => http.get('sing_active/activehelprecord/list', {
  152. params: p
  153. }),
  154. }
  155. //热力明细
  156. const heatrecord = {
  157. list: p => http.get('sing_heat_value/heatrecord/list', {
  158. params: p
  159. }),
  160. }
  161. /**
  162. * 积分商城
  163. */
  164. const pointgoods = {
  165. list: p => http.get('sing_goods/pointgoods/list', {
  166. params: p
  167. }),
  168. detail: p => http.get('sing_goods/pointgoods/detail', {
  169. params: p
  170. }),
  171. queryList: p => http.get('sing_goods/pointgoods/queryList', {
  172. params: p
  173. }),
  174. queryLogistics: p => http.post('app/point/queryLogistics', p, {
  175. header: {
  176. 'Content-Type': 'application/x-www-form-urlencoded'
  177. }
  178. }),
  179. exchange: p => http.post('app/point/exchange', p, {
  180. header: {
  181. 'Content-Type': 'application/x-www-form-urlencoded'
  182. }
  183. }),
  184. }
  185. /**
  186. * 兑换记录
  187. */
  188. const goodsorder = {
  189. list: p => http.get('sing_goods/goodsorder/list', {
  190. params: p
  191. }),
  192. detail: p => http.get('sing_goods/goodsorder/detail', {
  193. params: p
  194. }),
  195. submit: p => http.post('sing_goods/goodsorder/submit', p),
  196. }
  197. /**
  198. * 道具
  199. */
  200. const order = {
  201. sendCmccSms: p => http.post('/app/help/goods/sendCmccSms', p, {
  202. header: {
  203. 'Content-Type': 'application/x-www-form-urlencoded'
  204. }
  205. }),
  206. create: p => http.post('/app/help/goods/createPropsOrder', p, {
  207. header: {
  208. 'Content-Type': 'application/x-www-form-urlencoded'
  209. }
  210. }),
  211. exchange: p => http.post('/app/help/goods/exchangeProps', p, {
  212. header: {
  213. 'Content-Type': 'application/x-www-form-urlencoded'
  214. }
  215. }),
  216. cashExchange: p => http.post('/app/help/goods/createCashPropsOrder', p, {
  217. header: {
  218. 'Content-Type': 'application/x-www-form-urlencoded'
  219. }
  220. }),
  221. orderDetail: p => http.get('/sing_yeepay/yeepayorder/detail', {
  222. params: p
  223. }),
  224. verificationCode: p => http.get('/app/help/goods/createPropsVerificationCode', {
  225. params: p
  226. })
  227. }
  228. /**
  229. * 用户地址
  230. */
  231. const address = {
  232. list: p => http.get("sing_user/useraddress/list", {
  233. params: p
  234. }),
  235. detail: p => http.get("sing_user/useraddress/detail", {
  236. params: p
  237. }),
  238. submit: p => http.post('sing_user/useraddress/submitAddress', p),
  239. //获取地址信息
  240. getLocation: p => http.get("sing_user/useraddress/getLocation", {
  241. params: p
  242. }),
  243. }
  244. /**
  245. * 字典地址
  246. */
  247. const area = {
  248. province: p => http.get('blade-system/region/lazy-tree?parentCode=00', {
  249. params: p
  250. }),
  251. list: p => http.get('blade-system/region/lazy-tree', {
  252. params: p
  253. }),
  254. }
  255. const census = {
  256. online: p => http.get('app/index/census/online', {
  257. params: p
  258. }),
  259. offline: p => http.get('app/index/census/offline', {
  260. params: p
  261. }),
  262. }
  263. //活动列表
  264. const activerecord = {
  265. list: p => http.get('sing_active/activerecord/list', {
  266. params: p
  267. }),
  268. detail: p => http.get('sing_active/activerecord/detail', {
  269. params: p
  270. }),
  271. }
  272. //海报配置
  273. const poster={
  274. list: p => http.get('sing_active/activeposter/list', {
  275. params: p
  276. }),
  277. detail: p => http.get('sing_active/activeposter/detail', {
  278. params: p
  279. })
  280. }
  281. //易宝支付
  282. const yeepay={
  283. saveOrderUrlAndColor: p => http.post('app/yeepay/saveOrderUrlAndColor', p ,{
  284. header: {
  285. 'Content-Type': 'application/x-www-form-urlencoded'
  286. }
  287. }),
  288. getOrderUrlAndColor: p => http.get('app/yeepay/getOrderUrlAndColor', {
  289. params: p
  290. })
  291. }
  292. export const api = {
  293. uploadFileUrl,
  294. sms,
  295. uploadFile,
  296. dict,
  297. wxApp,
  298. loginUser,
  299. activity,
  300. platform,
  301. points,
  302. help,
  303. heatrecord,
  304. CMCC,
  305. pointgoods,
  306. goodsorder,
  307. order,
  308. address,
  309. notice,
  310. area,
  311. census,
  312. activerecord,
  313. poster,
  314. yeepay,
  315. }