index.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. // index.js
  2. const { HomepageApi } = require('../../service/api.js');
  3. const App = getApp();
  4. Component({
  5. data: {
  6. brandList: [
  7. {
  8. name: "全部IP",
  9. },
  10. {
  11. name: "火影忍者",
  12. },
  13. {
  14. name: "原神",
  15. },
  16. {
  17. name: "柯南",
  18. },
  19. {
  20. name: "非人哉",
  21. },
  22. {
  23. name: "海贼王",
  24. },
  25. {
  26. name: "初音",
  27. },
  28. {
  29. name: "千与千寻",
  30. },
  31. {
  32. name: "樱木花道",
  33. },
  34. {
  35. name: "原神",
  36. },
  37. ],
  38. categoryList: [
  39. {
  40. name: "立绘",
  41. },
  42. {
  43. name: "立绘",
  44. },
  45. {
  46. name: "立绘",
  47. },
  48. {
  49. name: "立绘",
  50. },
  51. {
  52. name: "立绘",
  53. },
  54. {
  55. name: "立绘",
  56. },
  57. {
  58. name: "立绘",
  59. },
  60. {
  61. name: "立绘",
  62. },
  63. ],
  64. goodsList: [
  65. {
  66. name: "哪吒魔童闹海周边",
  67. price: 49.5
  68. },
  69. {
  70. name: "若来十二生肖盲盒 桌面手办",
  71. price: 49.5
  72. },
  73. {
  74. name: "官方正版姜子牙电影四不像",
  75. price: 49.5
  76. },
  77. {
  78. name: "若来十二生肖盲盒 十二节气祖国版",
  79. price: 49.5
  80. },
  81. ],
  82. },
  83. methods: {
  84. onLoad: async function (options) {
  85. // 生命周期函数--监听页面加载
  86. console.log("onLoad");
  87. console.log('App.globalData', App.globalData);
  88. const res = await HomepageApi.getBanners({});
  89. console.log('res', res);
  90. },
  91. },
  92. })