api.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import {http} from './service.js'
  2. //文件上传
  3. const uploadFile =(p)=> http.upload('blade-resource/oss/endpoint/put-file', {name:'file',filePath:p})
  4. //字典
  5. const dict=p => http.get('/blade-system/dict-biz/dictionary', {params:p})
  6. //手机验证码
  7. const sms={
  8. send:p => http.post('huawei/sms/sendSms'+p),
  9. validCode:(p)=> http.post('huawei/sms/validCode'+p)
  10. }
  11. const mall={
  12. //获取商场列表
  13. list:p => http.get('cyzh-ldt/mall/list',{params:p}),
  14. //获取商场区域
  15. getMallAreaByMallId:p => http.get('cyzh-ldt/app/mall/getMallAreaByMallId?mallId='+p),
  16. //获取标签
  17. getShopLabelByMallId:p => http.get("cyzh-ldt/app/mall/getShopLabelByMallId?mallId="+p),
  18. //全部标签
  19. getShopLabelAll:p => http.get("cyzh-ldt/gxlabel/list",{params:p}),
  20. }
  21. //商户管理
  22. const shop={
  23. //获取商户列表
  24. list:p => http.get('cyzh-ldt/shop/list',{params:p}),
  25. detail:p => http.get('cyzh-ldt/shop/detail',{params:p}),
  26. submit:(p)=> http.post('cyzh-ldt/shop/submit',p),
  27. statistic:p => http.get('cyzh-ldt/app/shop/statistic?shopId='+p),
  28. payBefore:p => http.post('cyzh-ldt/loginuser/payBeforeNew',p),
  29. yingshouPage:p => http.get('cyzh-ldt/app/shop/getYingShouPage',{params:p}),
  30. remainDetailPage:p => http.get('cyzh-ldt/app/shop/getRemainDetailPage',{params:p}),
  31. //支付策略
  32. getPointPayType:p => http.post('cyzh-ldt/loginuser/getPointPayType',p),
  33. }
  34. const memberCenter={
  35. list:p => http.get('cyzh-ldt/app/shop/getMembersByShopId',{params:p}),
  36. create:(p)=> http.post('cyzh-ldt/app/shop/createMemberCenter',p),
  37. update:(p)=> http.post('cyzh-ldt/app/shop/updateMemberCenter',p),
  38. billList:(p)=> http.get('cyzh-ldt/app/shop/getMemberBillRecord',{params:p})
  39. }
  40. const activity={
  41. publish:(p)=> http.post('/cyzh-ldt/activity/submit',p),
  42. list:p => http.get("cyzh-ldt/app/shop/getActivity", {params:p}),
  43. //结束活动
  44. stop:(p)=> http.post('/cyzh-ldt/activity/updateBatch',p),
  45. //退出活动
  46. exit:(p)=> http.post('cyzh-ldt/activityjoinrecord/exitBatch',p),
  47. //参加活动
  48. join:(p)=> http.post('cyzh-ldt/activityjoinrecord/submit',p),
  49. //活动详情
  50. detail:p => http.get("/cyzh-ldt/activity/detail", {params:p}),
  51. }
  52. //用户银行
  53. const userBank={
  54. detail:p => http.get('cyzh-ldt/userbank/detail',{params:p}),
  55. list:p => http.get('cyzh-ldt/userbank/list',{params:p}),
  56. appList:p => http.get('cyzh-ldt/userbank/appList',{params:p}),
  57. submit:p => http.post('cyzh-ldt/userbank/submit', p),
  58. remove:p => http.post('cyzh-ldt/userbank/remove?ids='+p),
  59. }
  60. //accout
  61. const accout={
  62. register:p => http.post('cyzh-ldt/appaccount/shop/register',p),
  63. login:p => http.post('cyzh-ldt/appaccount/login',p),
  64. modifPaw:p => http.post('cyzh-ldt/appaccount/setPassword',p),
  65. forgetPaw:p => http.post('cyzh-ldt/appaccount/forgetPassword',p),
  66. }
  67. //webSocket
  68. const webSocket={
  69. sendInfo:p => http.post('cyzh-ldt/webSocket/sendInfo',p),
  70. }
  71. export const api={
  72. uploadFile,
  73. dict,
  74. sms,
  75. mall,
  76. shop,
  77. memberCenter,
  78. activity,
  79. userBank,
  80. accout,
  81. webSocket
  82. }