yxna-api.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. const baseUrl = "https://www.cqna.gov.cn/data/"
  2. // const baseUrl = "http://192.168.1.253:7777/"
  3. const request = (options) => {
  4. return new Promise((resolve,reject) => {
  5. options.url = baseUrl + options.url
  6. wx.request({
  7. // 配置 "wx.request" 请求参数
  8. ...options,
  9. header: {
  10. 'content-type': 'application/json;charset=UTF-8'
  11. },
  12. success: function (res) {
  13. // console.log("network-res=>", res);
  14. // 返回成功信息
  15. resolve(res.data)
  16. },
  17. fail: function (error) {
  18. // console.log("network-err=>", error);
  19. // 返回错误信息
  20. reject(error)
  21. }
  22. })
  23. })
  24. }
  25. export function getAlbumList(data) {
  26. return request({
  27. url: `/yxna/getAlbumList`,
  28. method: 'GET',
  29. data: data
  30. })
  31. }
  32. export function getDocumentPageFront(data) {
  33. return request({
  34. url: `yxna/getDocumentPageFront`,
  35. method: 'GET',
  36. data: data
  37. })
  38. }
  39. export function getMapDataType(data) {
  40. return request({
  41. url: `mapdata/getMapDataType`,
  42. method: 'GET',
  43. data: data
  44. })
  45. }
  46. export function getHandMatterPage(data) {
  47. return request({
  48. url: `mapdata/getHandMatterPage`,
  49. method: 'GET',
  50. data: data
  51. })
  52. }
  53. export function getHandMatterBySearch(data) {
  54. return request({
  55. url: `mapdata/getHandMatterBySearch`,
  56. method: 'GET',
  57. data: {
  58. queryVal: data
  59. }
  60. })
  61. }
  62. export function getMapDataAll() {
  63. return request({
  64. url: `mapdata/getMapDataAll`,
  65. method: 'GET',
  66. })
  67. }
  68. export function searchHandMatterByVal(queryVal) {
  69. return request({
  70. url: `mapdata/searchHandMatterByVal`,
  71. method: 'GET',
  72. data: {
  73. queryVal: queryVal
  74. }
  75. })
  76. }