qiye.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // pages/qiye/qiye.js
  2. import http from '../../base/httputil'
  3. Page({
  4. /**
  5. * 组件的初始数据
  6. */
  7. onLoad() {
  8. this.initQiyePage()
  9. },
  10. data: {
  11. weekCount: 0,
  12. monthCount: 0,
  13. totalCount: 0,
  14. enterpriseList: [],
  15. menulist: [{
  16. "id": "1",
  17. "url": "icon-anquanxuncha",
  18. "title": "巡查",
  19. },
  20. {
  21. "id": "2",
  22. "url": "icon-xunjian",
  23. "title": "巡检",
  24. },
  25. ],
  26. mainmodel: {
  27. }
  28. },
  29. // 搜索结果跳页
  30. bindViewSearchEnd() {
  31. wx.navigateTo({
  32. url: '../search/search'
  33. })
  34. },
  35. // 企业详细页
  36. bindViewDetails(e) {
  37. let busEnterpriseId = e.currentTarget.dataset.enterpriseid
  38. wx.navigateTo({
  39. url: '../details/details?busEnterpriseId=' + busEnterpriseId
  40. })
  41. },
  42. //企业表单详细
  43. bindViewQiYeMore() {
  44. wx.navigateTo({
  45. url: '../qiyemore/qiyemore'
  46. })
  47. },
  48. initQiyePage() {
  49. http.send_post("/system/AppEnterpriseController/getInitEnterpriseData", null, this.getQiyePageSuccess)
  50. http.send_post("/system/AppEnterpriseController/getInitEnterpriseList", null, this.getQiyeEnterpriseListSuccess)
  51. },
  52. getQiyePageSuccess(res) {
  53. let enterpriseCount = res.data.enterpriseCount;
  54. this.setData({
  55. weekCount: enterpriseCount.weekCount,
  56. monthCount: enterpriseCount.monthCount,
  57. totalCount: enterpriseCount.totalCount,
  58. })
  59. },
  60. getQiyeEnterpriseListSuccess(res) {
  61. this.setData({
  62. enterpriseList: res.data.rows
  63. })
  64. },
  65. changeSearch(e) {
  66. console.log(e.detail.value)
  67. }
  68. })