qiye.js 1.6 KB

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