index-api.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // import request from './request.js'
  2. const baseUrl = "https://www.cqna.gov.cn"
  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 yjzjList() {
  26. const params = {'siteId': 254, 'pageSize': 10}
  27. // https://www.cqna.gov.cn/IGI/opinion/web/list?siteId=254&pageSize=10
  28. return request({
  29. url: `/IGI/opinion/web/list`,
  30. method: 'GET',
  31. data: params
  32. })
  33. }
  34. export function info() {
  35. const params = {'siteId': 254, 'pageSize': 10}
  36. return request({
  37. url: `/IGI/opinion/web/list`,
  38. method: 'GET',
  39. data: params
  40. })
  41. }
  42. export function send(page,limit,channelId) {
  43. const params = {'page': page, 'limit': limit,'channelId': channelId}
  44. return request({
  45. url: `/mini/hlw/send`,
  46. method: 'GET',
  47. data: params
  48. })
  49. }