qiye.js 1.7 KB

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