index.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. // index.js
  2. const { API } = require('../../service/api.js');
  3. const App = getApp();
  4. Page({
  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. showAddCartModal: false,
  65. currentProduct: null
  66. },
  67. // 显示商品属性模态框
  68. showAddCartModal(e) {
  69. const product = e.detail;
  70. this.setData({
  71. showAddCartModal: true,
  72. currentProduct:product
  73. });
  74. },
  75. // 关闭商品属性模态框
  76. handleCloseAddCartModal() {
  77. this.setData({ showAddCartModal: false });
  78. },
  79. methods: {
  80. onLoad: async function (options) {
  81. // 生命周期函数--监听页面加载
  82. console.log("onLoad");
  83. console.log('App.globalData', App.globalData);
  84. const res = await API.getBanners({});
  85. console.log('res', res);
  86. },
  87. },
  88. })