sortCommodity.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // pages/Mall/sortCommodity/sortCommodity.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. filterList1:[
  8. {title:'火影忍者',id:1},
  9. {title:'初音',id:1},
  10. {title:'原神',id:1},
  11. {title:'柯南',id:1},
  12. {title:'非人哉',id:1},
  13. {title:'全部',id:1}
  14. ],
  15. filterList2:[
  16. {title:'立绘',id:1},
  17. {title:'吧唧',id:1},
  18. {title:'官周',id:1},
  19. {title:'痛包',id:1},
  20. {title:'卡牌',id:1},
  21. {title:'全部',id:1}
  22. ],
  23. filterIndex1:0,
  24. filterIndex2:0
  25. },
  26. // 监听筛选
  27. selectFilter(e){
  28. let {index,index2,item} = e.currentTarget.dataset;
  29. this.setData({
  30. [index === 0?'filterIndex1':'filterIndex2']:index2,
  31. })
  32. },
  33. /**
  34. * 生命周期函数--监听页面加载
  35. */
  36. onLoad(options) {
  37. },
  38. /**
  39. * 生命周期函数--监听页面初次渲染完成
  40. */
  41. onReady() {
  42. },
  43. /**
  44. * 生命周期函数--监听页面显示
  45. */
  46. onShow() {
  47. },
  48. /**
  49. * 生命周期函数--监听页面隐藏
  50. */
  51. onHide() {
  52. },
  53. /**
  54. * 生命周期函数--监听页面卸载
  55. */
  56. onUnload() {
  57. },
  58. /**
  59. * 页面相关事件处理函数--监听用户下拉动作
  60. */
  61. onPullDownRefresh() {
  62. },
  63. /**
  64. * 页面上拉触底事件的处理函数
  65. */
  66. onReachBottom() {
  67. },
  68. /**
  69. * 用户点击右上角分享
  70. */
  71. onShareAppMessage() {
  72. }
  73. })