Api.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. const requestFn = require("../requestFn/requestFn")
  2. const API = {
  3. login: "/user/login",
  4. pay_test: "/charge/pay_test",
  5. house: "/user/house",
  6. car: "/user/vehicle",
  7. userinfo: "/user/info",
  8. provice_city_area: "/area/province_city_area",
  9. street_committee: "/area/street_committee",
  10. gardenList: "/garden/list",
  11. gardenBuilding: "/garden/building",
  12. gardenUnit: "/garden/unit",
  13. gardenHouse: "/garden/house",
  14. opload: "/upload",
  15. householdApply: "/household/apply",
  16. householdHouse: "/household/house",
  17. userNickName: "/user/nick_name",
  18. userRealName: "/user/real_name_auth",
  19. unpay_list: "/charge/unpay_list",
  20. payed_bill: "/charge/payed_bill_list",
  21. order_list: "/charge/order/list",
  22. pay: "/charge/pay",
  23. bill_List: "/charge/bill_list",
  24. order_cancle: "/charge/order/cancel",
  25. order_info: "/charge/order/info",
  26. payed_list: "/charge/payed_bill_list",
  27. announcement: "/service/announcement",
  28. event: "/service/event",
  29. event_sign: "/service/event/sign",
  30. vote: "/service/vote",
  31. vote_anawer: "/service/vote/answer",
  32. gate: "/gate",
  33. gate_qcode: "/gate/qcode",
  34. qcode_visitor: "/gate/qcode_visitor",
  35. phone: "/service_phone",
  36. phone_class: "/service_phone/class",
  37. repair_class: "/repair/class",
  38. repair_order: "/repair/order",
  39. repair_order_info: "/repair/order/info",
  40. return_visit: "/repair/order/return_visit",
  41. article: "/service/neighbor/article",
  42. like: "/service/neighbor/like",
  43. neighbor_class: "/service/neighbor/class",
  44. comment: '/service/neighbor/comment',
  45. suggestion: "/suggestion/order",
  46. suggestion_info: "/suggestion/order/info",
  47. suggestion_return_visit: "/suggestion/order/return_visit",
  48. rent_house: "/rent/house",
  49. house_manager: "/rent/house/manager",
  50. garden_info: "/garden/info",
  51. appointment: "/rent/house/appointment",
  52. buildingmanager: "/garden/buildings/manager",
  53. addread_count: "/service/announcement/read_count",
  54. property: "/charge/months/property",
  55. vehicle: "/charge/months/vehicle",
  56. pre_pay_info: "/charge/pre_pay_info",
  57. pre_pay: "/charge/pre_pay",
  58. visitor: "/gate/visitor",
  59. housedown: "/rent/house/down",
  60. space: "/user/space",
  61. visitorShare: "/gate/visitor/share",
  62. getcity_code: "/area/city",
  63. has_face_device: "/gate/has_face_device",
  64. face: "/gate/face",
  65. openim: "/user/openim_token",
  66. openimusers: "/user/openim_users_info"
  67. }
  68. const HTTP = {
  69. Login(data) {
  70. return requestFn.Request({
  71. url: API.login,
  72. data,
  73. method: "POST"
  74. })
  75. },
  76. //批量获取openim用户信息
  77. OpenimUsers(data) {
  78. return requestFn.Request({
  79. url: API.openimusers,
  80. data,
  81. method: "get"
  82. })
  83. },
  84. //获取openim token
  85. OpenimLogin(data) {
  86. return requestFn.Request({
  87. url: API.openim,
  88. data,
  89. method: "get"
  90. })
  91. },
  92. //是否有人脸设备
  93. Has_Face(data) {
  94. return requestFn.Request({
  95. url: API.has_face_device,
  96. data
  97. })
  98. },
  99. //人脸信息
  100. Face(data) {
  101. return requestFn.Request({
  102. url: API.face,
  103. method: data.method || "",
  104. data
  105. })
  106. },
  107. //用城市换取城市code
  108. GetCityCode(data) {
  109. return requestFn.Request({
  110. url: API.getcity_code,
  111. data
  112. })
  113. },
  114. //访客获取到的分享页面
  115. VisitorShare(data) {
  116. return requestFn.Request({
  117. url: API.visitorShare,
  118. data
  119. })
  120. },
  121. //用户房屋下的车位
  122. GetMySpace(data) {
  123. return requestFn.Request({
  124. url: API.space,
  125. method: 'get',
  126. data
  127. })
  128. },
  129. //房屋下架
  130. HouseDown(data) {
  131. return requestFn.Request({
  132. url: API.housedown,
  133. method: 'put',
  134. data
  135. })
  136. },
  137. //测试接口
  138. Pay_test(data) {
  139. return requestFn.Request({
  140. url: API.pay_test,
  141. method: "put",
  142. data
  143. })
  144. },
  145. //获取用户房屋信息
  146. GetuserHouse() {
  147. return requestFn.Request({
  148. url: API.house
  149. })
  150. },
  151. //用户小区下的车辆
  152. GetuserCar(data) {
  153. return requestFn.Request({
  154. url: API.car,
  155. data
  156. })
  157. },
  158. //获取省市区列表
  159. GetProvince() {
  160. return requestFn.Request({
  161. url: API.provice_city_area
  162. })
  163. },
  164. //获取街道社区列表
  165. GetStreetCommittee(data) {
  166. return requestFn.Request({
  167. url: API.street_committee,
  168. data
  169. })
  170. },
  171. //获取小区列表
  172. GetGardenList(data) {
  173. return requestFn.Request({
  174. url: API.gardenList,
  175. data
  176. })
  177. },
  178. //获取楼栋列表
  179. GetGardenBuilding(data) {
  180. return requestFn.Request({
  181. url: API.gardenBuilding,
  182. data
  183. })
  184. },
  185. //获取单元列表
  186. GetGardenUnit(data) {
  187. return requestFn.Request({
  188. url: API.gardenUnit,
  189. data
  190. })
  191. },
  192. //获取房屋列表
  193. GetGardenHouse(data) {
  194. return requestFn.Request({
  195. url: API.gardenHouse,
  196. data
  197. })
  198. },
  199. //房屋认证申请
  200. HouseholdApply(data) {
  201. return requestFn.Request({
  202. url: API.householdApply,
  203. method: "post",
  204. data
  205. })
  206. },
  207. //房屋列表
  208. HouseholdHouse(data) {
  209. return requestFn.Request({
  210. url: API.householdHouse,
  211. data,
  212. method: data.method || ''
  213. })
  214. },
  215. //解绑房屋
  216. DeleteHousehold(data) {
  217. return requestFn.Request({
  218. url: API.householdHouse + `?house_id=${data.house_id}&garden_id=${data.garden_id}`,
  219. data: {},
  220. method: 'delete',
  221. })
  222. },
  223. //修改昵称
  224. UsernickName(data) {
  225. return requestFn.Request({
  226. url: API.userNickName,
  227. data,
  228. method: 'put'
  229. })
  230. },
  231. //实名认证
  232. UserRealName(data) {
  233. return requestFn.Request({
  234. url: API.userRealName,
  235. data,
  236. method: "put"
  237. })
  238. },
  239. //获取代缴费的费项列表
  240. GetUnpay_list(data) {
  241. return requestFn.Request({
  242. url: API.unpay_list,
  243. data
  244. })
  245. },
  246. //获取已缴费的账单列表
  247. GetPayed_list(data) {
  248. return requestFn.Request({
  249. urL: API.payed_bill,
  250. data
  251. })
  252. },
  253. //获取未支付订单列表
  254. GetOrder_list(data) {
  255. return requestFn.Request({
  256. url: API.order_list,
  257. data
  258. })
  259. },
  260. //欠费线上缴费
  261. Pay(data) {
  262. return requestFn.Request({
  263. url: API.pay,
  264. data,
  265. method: "put"
  266. })
  267. },
  268. //获取代缴费某个费项的账单列表
  269. GetBill_List(data) {
  270. return requestFn.Request({
  271. url: API.bill_List,
  272. data
  273. })
  274. },
  275. //取消支付
  276. CancleOrder(data) {
  277. return requestFn.Request({
  278. url: API.order_cancle,
  279. data,
  280. method: "put"
  281. })
  282. },
  283. //未支付订单的订单详情
  284. GetOrderInfo(data) {
  285. return requestFn.Request({
  286. url: API.order_info,
  287. data,
  288. })
  289. },
  290. //获取已缴费的账单列表
  291. GetPayed_list(data) {
  292. return requestFn.Request({
  293. url: API.payed_list,
  294. data
  295. })
  296. },
  297. //获取公告列表
  298. GetAnnouncement(data) {
  299. return requestFn.Request({
  300. url: API.announcement,
  301. data
  302. })
  303. },
  304. //获取社区活动列表
  305. GetEvent(data) {
  306. return requestFn.Request({
  307. url: API.event,
  308. data
  309. })
  310. },
  311. //社区活动报名
  312. EventSign(data) {
  313. return requestFn.Request({
  314. url: API.event_sign,
  315. method: "post",
  316. data
  317. })
  318. },
  319. //获取投票列表
  320. GetVote(data) {
  321. return requestFn.Request({
  322. url: API.vote,
  323. data
  324. })
  325. },
  326. //提交投票回答
  327. VoteAnswer(data) {
  328. return requestFn.Request({
  329. url: API.vote_anawer,
  330. data,
  331. method: 'post'
  332. })
  333. },
  334. //门禁列表
  335. GetGate(data) {
  336. return requestFn.Request({
  337. url: API.gate,
  338. data
  339. })
  340. },
  341. //门禁二维码
  342. GetQcode(data) {
  343. return requestFn.Request({
  344. url: API.gate_qcode,
  345. data
  346. })
  347. },
  348. //门禁访客邀约二维码
  349. GetQcode_Visitor(data) {
  350. return requestFn.Request({
  351. url: API.qcode_visitor,
  352. data
  353. })
  354. },
  355. //分类列表
  356. GetPhone_class(data) {
  357. return requestFn.Request({
  358. url: API.phone_class,
  359. data
  360. })
  361. },
  362. //电话列表
  363. GetPhone(data) {
  364. return requestFn.Request({
  365. url: API.phone,
  366. data
  367. })
  368. },
  369. //报事报修分类列表
  370. GetRepair_class(data) {
  371. return requestFn.Request({
  372. url: API.repair_class,
  373. data,
  374. })
  375. },
  376. //工单列表操作
  377. Repair_order(data) {
  378. return requestFn.Request({
  379. url: API.repair_order,
  380. data,
  381. method: data.method || ''
  382. })
  383. },
  384. //工单详情
  385. Order_info(data) {
  386. return requestFn.Request({
  387. url: API.repair_order_info,
  388. data
  389. })
  390. },
  391. //报事报修回访
  392. Repair_return_visit(data) {
  393. return requestFn.Request({
  394. url: API.return_visit,
  395. data,
  396. method: "put"
  397. })
  398. },
  399. //文章列表操作
  400. NeighborArticle(data) {
  401. return requestFn.Request({
  402. url: API.article,
  403. data,
  404. method: data.method || ''
  405. })
  406. },
  407. //删除文章
  408. DeleteArticle(data) {
  409. return requestFn.Request({
  410. url: API.article + `?id=${data.id}&garden_id=${data.garden_id}`,
  411. data: {},
  412. method: 'delete',
  413. })
  414. },
  415. //评论操作
  416. NeighborComment(data) {
  417. return requestFn.Request({
  418. url: API.comment,
  419. data,
  420. method: data.method || ''
  421. })
  422. },
  423. //删除评论
  424. DeleteComment(data) {
  425. return requestFn.Request({
  426. url: API.comment + `?id=${data.id}&garden_id=${data.garden_id}`,
  427. data: {},
  428. method: 'delete',
  429. })
  430. },
  431. //点赞或取消点赞
  432. Like(data) {
  433. return requestFn.Request({
  434. url: API.like,
  435. data,
  436. method: "put"
  437. })
  438. },
  439. //社区邻里分类列表
  440. Neighbor_class(data) {
  441. return requestFn.Request({
  442. url: API.neighbor_class,
  443. data
  444. })
  445. },
  446. //投诉建议操作
  447. Suggestion(data) {
  448. return requestFn.Request({
  449. url: API.suggestion,
  450. data,
  451. method: data.method || ''
  452. })
  453. },
  454. //投诉建议详情
  455. Suggestion_info(data) {
  456. return requestFn.Request({
  457. url: API.suggestion_info,
  458. data
  459. })
  460. },
  461. //投诉建议回访
  462. Suggestion_return_visit(data) {
  463. return requestFn.Request({
  464. url: API.suggestion_return_visit,
  465. data,
  466. method: 'put'
  467. })
  468. },
  469. //房屋租赁操作
  470. RentHouse(data) {
  471. return requestFn.Request({
  472. url: API.rent_house,
  473. data,
  474. method: data.method || ''
  475. })
  476. },
  477. //房屋的经纪人列表
  478. HouseManager(data) {
  479. return requestFn.Request({
  480. url: API.house_manager,
  481. data
  482. })
  483. },
  484. //小区详情
  485. GardenInfo(data) {
  486. return requestFn.Request({
  487. url: API.garden_info,
  488. data
  489. })
  490. },
  491. //租房预约看房
  492. Appointment(data) {
  493. return requestFn.Request({
  494. url: API.appointment,
  495. data,
  496. method: data.method || 'get',
  497. })
  498. },
  499. DeleteAppointment(data) {
  500. return requestFn.Request({
  501. url: API.appointment + `?id=${data.id}`,
  502. method: "delete"
  503. })
  504. },
  505. //获取用户信息
  506. GetUserInfo() {
  507. return requestFn.Request({
  508. url: API.userinfo,
  509. method: "get"
  510. })
  511. },
  512. //楼栋管家列表
  513. GetBuildManger(data) {
  514. return requestFn.Request({
  515. url: API.buildingmanager,
  516. method: "get",
  517. data
  518. })
  519. },
  520. //公告增加阅读次数
  521. AddRead_count(data) {
  522. return requestFn.Request({
  523. url: API.addread_count,
  524. method: "put",
  525. data
  526. })
  527. },
  528. //预缴物业费前获取月数和赠送信息
  529. GetMonthsProperty(data) {
  530. return requestFn.Request({
  531. url: API.property,
  532. data
  533. })
  534. },
  535. //预缴月租停车费前获取月数和赠送信息
  536. GetMonthsVehicle(data) {
  537. return requestFn.Request({
  538. url: API.vehicle,
  539. data
  540. })
  541. },
  542. //预缴物业费或车位费前获取对应的金额信息
  543. Getpre_pay_info(data) {
  544. return requestFn.Request({
  545. url: API.pre_pay_info,
  546. method: 'get',
  547. data
  548. })
  549. },
  550. //线上预缴物业费
  551. Pre_pay(data) {
  552. return requestFn.Request({
  553. url: API.pre_pay,
  554. method: "put",
  555. data
  556. })
  557. },
  558. //我的邀约
  559. MyVisitor(data) {
  560. return requestFn.Request({
  561. method: 'get',
  562. url: API.visitor,
  563. data
  564. })
  565. },
  566. //删除访客记录
  567. DeleteVisitor(data) {
  568. return requestFn.Request({
  569. url: API.visitor + `?id=${data.id}`,
  570. method: "delete"
  571. })
  572. }
  573. }
  574. module.exports = HTTP