material_serch.js 937 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import http from '../../../base/httputil'
  2. const app = getApp()
  3. Page({
  4. /**
  5. * 组件的初始数据
  6. */
  7. data: {
  8. host: app.globalData.host,
  9. materialList: [],
  10. },
  11. onLoad() {
  12. // this.list(null)
  13. },
  14. // 搜索结果跳页
  15. bindViewSearchEnd() {
  16. // wx.navigateTo({
  17. // url: '../search/search'
  18. // })
  19. },
  20. // 物资详情页
  21. bindViewDetails(e) {
  22. let material_details = e.currentTarget.dataset.index
  23. wx.navigateTo({
  24. url: '../details/material_details?details=' + JSON.stringify(material_details)
  25. })
  26. },
  27. searchEnterprise(e) {
  28. var obj = new Object()
  29. obj.materialName = e.detail.value
  30. this.list(obj)
  31. },
  32. list(data) {
  33. http.send_get("/system/AppMaterialController/geMaterialList", data, this.getMaterListSuccess)
  34. },
  35. getMaterListSuccess(res) {
  36. console.log("!!!!",res.data.rows.length)
  37. this.setData({
  38. materialList: res.data.rows
  39. })
  40. }
  41. })