api.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. import {
  2. http
  3. } from './service.js'
  4. //微信api
  5. const wxApp = {
  6. getOpenId: p => http.get('/wx-app/getOpenId', {
  7. params: p
  8. }),
  9. getOpenData: p => http.post('/wx-app/getOpenData', p),
  10. getGenerateScheme: p => http.get('/wx-app/getGenerateScheme', {
  11. params: p
  12. }),
  13. createWxaQrCode: p => http.get('/wx-app/createWxaQrCode', {
  14. params: p
  15. }),
  16. getCode: p => http.get('/wx-app/getCode', {params: p}),
  17. appParams: p => http.get('blade-system/param/detail', {params: p}),
  18. }
  19. //字典
  20. const dict = {
  21. list: p => http.get('/blade-system/dict-biz/dictionary', {
  22. params: p
  23. }),
  24. dictionaryPage: p => http.get('/blade-system/dict-biz/dictionaryPage', {
  25. params: p
  26. }),
  27. }
  28. //文件上传
  29. const uploadFile = (p) => http.upload('blade-resource/oss/endpoint/put-file', {
  30. name: 'file',
  31. filePath: p
  32. })
  33. //活动管理
  34. const activity = {
  35. //音乐之声活动
  36. yyzs_list: p => http.get('yyzs/cyzh-activity/activity/selectPageWithTag', {
  37. params: p,
  38. custom: {
  39. yyzs: true
  40. }
  41. }),
  42. //商户活动
  43. list: p => http.get("/common/activity/list", {
  44. params: p
  45. }),
  46. //活动详情
  47. detail: p => http.get("ldt_activity/activity/detail", {
  48. params: p
  49. }),
  50. //获取地址信息
  51. getLocation: p => http.get("/common/activity/getLocation", {
  52. params: p
  53. }),
  54. }
  55. //用户管理
  56. const loginUser = {
  57. detail: p => http.get('ldt_user/loginuser/detail', {
  58. params: p
  59. }),
  60. submit: p => http.post('ldt_user/loginuser/submit', p),
  61. login: p => http.post('client/user/login', p),
  62. payBefore: p => http.post('cyzh-ldt/loginuser/payBeforeNew', p),
  63. payBeforeForNormal: p => http.post('cyzh-ldt/loginuser/payBeforeForNormal', p),
  64. getBillrecordFromRedis: p => http.get('cyzh-ldt/loginuser/getBillrecordFromRedis', {
  65. params: p
  66. }),
  67. clearBillRecordCache: p => http.get('cyzh-ldt/loginuser/clearBillRecordCache', {
  68. params: p
  69. }),
  70. }
  71. //商户管理
  72. const shop = {
  73. list: p => http.get('shop/list', {
  74. params: p
  75. }),
  76. detail: p => http.get('ldt_shop/shop/detail', {
  77. params: p
  78. }),
  79. indexInfo: p => http.get("shop/indexInfo", {
  80. params: p
  81. }),
  82. }
  83. //审核管理
  84. const audit = {
  85. list: p => http.get("ldt_shop/audit/list", {
  86. params: p
  87. }),
  88. submit: p => http.post('ldt_shop/audit/submit', p),
  89. detail: p => http.get("ldt_shop/audit/detail", {
  90. params: p
  91. }),
  92. }
  93. //商场管理
  94. const mall = {
  95. //获取商场列表
  96. list: p => http.get('mall/list', {params: p}),
  97. }
  98. //代理商
  99. const agenter = {
  100. agentLevelList: p => http.get('ldt_agent/agent/list', {params: p}),
  101. addAgentOrder: p => http.post('/app/agent/addAgentOrder', p),
  102. list: p => http.get('ldt_agent/agentrecord/list', {
  103. params: p
  104. }),
  105. submit: p => http.post('ldt_agent/agentrecord/submit', p),
  106. statistics: p => http.get('app/agent/agenterInfo', {
  107. params: p
  108. }),
  109. earningsDetail: p => http.get('app/agent/earningsDetail', {
  110. params: p
  111. }),
  112. }
  113. //代理类型
  114. const agenterType = {
  115. detail: p => http.get('ldt_platform/platformsetting/detail', {
  116. params: p
  117. }),
  118. }
  119. //用户银行
  120. const userBank = {
  121. detail: p => http.get('ldt_user/userbank/detail', {
  122. params: p
  123. }),
  124. list: p => http.get('ldt_user/userbank/list', {
  125. params: p
  126. }),
  127. appList: p => http.get('common/userbank/list', {
  128. params: p
  129. }),
  130. submit: p => http.post('ldt_user/userbank/submit', p),
  131. remove: p => http.post('ldt_user/userbank/remove?ids=' + p),
  132. }
  133. //支付
  134. const pay = {
  135. //获取wx支付所需参数
  136. getPayOrderPamams: p => http.post('client/trade/scanPay', p),
  137. //h5获取wx支付所需参数
  138. getPayOrderPamamsForH5: p => http.post('client/trade/scanPayByWeChat', p),
  139. //wx支付
  140. payOrder: p => http.get('payment/payOrder/YEE_PAY/MINI_PROGRAM', {
  141. params: p
  142. }),
  143. //扫码支付
  144. payOrderOfscanCode: p => http.get('payment/payOrder/YEE_PAY/SCAN_CODE', {
  145. params: p
  146. }),
  147. //支付策略
  148. getPointPayType: p => http.post('cyzh-ldt/loginuser/getPointPayType', p),
  149. //取消支付
  150. cancelTrade:p => http.post('client/trade/cancelTrade', p),
  151. }
  152. const billRecord = {
  153. submit: p => http.post('ldt_bills/bills/submit', p),
  154. detail: p => http.get('ldt_bills/bills/detail', {
  155. params: p
  156. }),
  157. }
  158. const balanceBills = {
  159. list: p => http.get('common/balancebills/list', {
  160. params: p
  161. }),
  162. }
  163. const pointbills = {
  164. list: p => http.get('common/pointbills/list', {params: p}),
  165. channelList: p => http.get('common/pointbills/channelList', {params: p}),
  166. }
  167. const goodsbills = {
  168. list: p => http.get('goodsbills/list', {
  169. params: p
  170. }),
  171. submit: p => http.post('ldt_bills/goodsbills/submit', p)
  172. }
  173. const bills = {
  174. list: p => http.get('/common/bills/myBills', {
  175. params: p
  176. }),
  177. }
  178. const setting = {
  179. feedback: p => http.post('ldt_feedback/feedback/submit', p)
  180. }
  181. //账号
  182. const account = {
  183. pointList: p => http.get('cyzh-ldt/loginuser/channeluserpoint/list', {
  184. params: p
  185. }),
  186. remainList: p => http.get('cyzh-ldt/loginuser/remaining/list', {
  187. params: p
  188. }),
  189. }
  190. //webSocket
  191. const webSocket = {
  192. sendInfo: p => http.post('webSocket/sendInfo', p),
  193. }
  194. const joinRecord = {
  195. //活动详情查看该活动的参加者
  196. list: p => http.get("ldt_activity/joinrecord/list", {
  197. params: p
  198. }),
  199. }
  200. const statistics = {
  201. getBillStatistics: p => http.get('/common/bills/getBillStatistics', {
  202. params: p
  203. })
  204. }
  205. const withdraw = {
  206. submit: p => http.post('common/withdrawrec/withdraw', p),
  207. payOrder: p => http.get('payment/payOrder/YEE_PAY/USER_WITHDRAW', {
  208. params: p
  209. }),
  210. list: p => http.get("ldt_bills/withdrawrec/list", {
  211. params: p
  212. }),
  213. }
  214. const goods = {
  215. menu: p => http.get("goods/getGoodsMenuList", {
  216. params: p
  217. }),
  218. order: p => http.post('goodsbills/order', p),
  219. }
  220. const address = {
  221. list: p => http.get("client/useraddress/list", {
  222. params: p
  223. }),
  224. detail: p => http.get("ldt_user_address/useraddress/detail", {
  225. params: p
  226. }),
  227. submit: p => http.post('client/useraddress/submit', p),
  228. }
  229. const userChannelPoint = {
  230. list: p => http.get('common/userchannelpoint/list', {
  231. params: p
  232. }),
  233. }
  234. const order = {
  235. list: p => http.get("ldt_bills/goodsbills/list", {
  236. params: p
  237. }),
  238. detail: p => http.get("goodsbills/detail", {
  239. params: p
  240. }),
  241. }
  242. const area={
  243. province: p => http.get('blade-system/region/lazy-tree?parentCode=00', {params: p}),
  244. list:p => http.get('blade-system/region/lazy-tree', {params: p}),
  245. }
  246. const shopConfig={
  247. list: p => http.get("ldt_goods/shopconfig/list", {
  248. params: p
  249. }),
  250. }
  251. const notice={
  252. notReadIdList:p => http.get('app/notice/notReadIdList', {params: p}),
  253. list:p => http.get('app/notice/list', {params: p}),
  254. detail:p => http.get('ldt_notice/notice/detail', {params: p}),
  255. isRead: p => http.post('app/notice/isRead', p),
  256. }
  257. const test={
  258. submit: p => http.post('/common/account/decrypt/test', p),
  259. remove: p => http.post('ldt_bills/bills/remove?ids=' + p),
  260. }
  261. export const api = {
  262. wxApp,
  263. dict,
  264. uploadFile,
  265. activity,
  266. loginUser,
  267. shop,
  268. audit,
  269. mall,
  270. agenter,
  271. agenterType,
  272. userBank,
  273. pay,
  274. billRecord,
  275. balanceBills,
  276. pointbills,
  277. goodsbills,
  278. bills,
  279. setting,
  280. account,
  281. webSocket,
  282. joinRecord,
  283. statistics,
  284. withdraw,
  285. goods,
  286. address,
  287. userChannelPoint,
  288. order,
  289. area,
  290. shopConfig,
  291. notice,
  292. test
  293. }