brandInfor.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // 品牌相关产品列表
  2. var contentList = [];
  3. Page({
  4. data: {
  5. placeholder: "输入搜索关键字",
  6. pageNo: 1,
  7. contentList: contentList,
  8. loadingHidden: false,
  9. num: 1,
  10. title: '',
  11. intro: '',
  12. id: '',
  13. src: '',
  14. src1: '',
  15. limt: 20
  16. },
  17. onLoad: function (options) {
  18. this.setData({
  19. title: options.title,
  20. intro: options.intro,
  21. id: options.id,
  22. src: options.src,
  23. src1: options.src1,
  24. })
  25. that = this;
  26. var host = getApp().globalData.servsers;
  27. //首页banner
  28. wx.request({
  29. url: host+"commodityapi/findAllfor",
  30. data: {
  31. commodity_brand: options.id
  32. },
  33. method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
  34. header: {
  35. 'Accept': 'application/json'
  36. },
  37. success: function (res) {
  38. that.setData({
  39. contentList: res.data.rows
  40. });
  41. if (res == null || res.data == null) {
  42. console.error('网络请求失败');
  43. return;
  44. }
  45. }
  46. });
  47. wx.setNavigationBarTitle({
  48. title: options.title
  49. })
  50. }
  51. })
  52. var that;
  53. var Util = require('../../utils/util.js');