hot.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. export const hotInit = (that) => {
  2. that.setData({
  3. hotData: {
  4. title: '热门',
  5. imgUrls: [
  6. 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg',
  7. 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg',
  8. 'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg'
  9. ],
  10. indicatorDots: true,
  11. autoplay: true,
  12. interval: 5000,
  13. duration: 700,
  14. circular: true,
  15. hotSearch: '鹅鹅鹅',
  16. wareCards:[
  17. {
  18. title:"铺满金色巴掌的水泥道",
  19. grade:"一年级 上学期",
  20. img: "../../static/image/timg.jpg",
  21. plays: "1",
  22. likes: "2",
  23. classId: "1"
  24. },
  25. {
  26. title:"铺满金色巴掌的水泥道",
  27. grade:"一年级 上学期",
  28. img: "../../static/image/timg.jpg",
  29. plays: "12345",
  30. likes: "54321",
  31. classId: "2"
  32. },
  33. {
  34. title:"铺满金色巴掌的水泥道",
  35. grade:"一年级 上学期",
  36. img: "../../static/image/timg.jpg",
  37. plays: "12345",
  38. likes: "54321",
  39. classId: "2"
  40. },
  41. {
  42. title:"铺满金色巴掌的水泥道",
  43. grade:"一年级 上学期",
  44. img: "../../static/image/timg.jpg",
  45. plays: "12345",
  46. likes: "54321",
  47. classId: "2"
  48. },
  49. {
  50. title:"铺满金色巴掌的水泥道",
  51. grade:"一年级 上学期",
  52. img: "../../static/image/timg.jpg",
  53. plays: "12345",
  54. likes: "54321",
  55. classId: "2"
  56. },
  57. {
  58. title:"铺满金色巴掌的水泥道",
  59. grade:"一年级 上学期",
  60. img: "../../static/image/timg.jpg",
  61. plays: "12345",
  62. likes: "54321",
  63. classId: "2"
  64. },
  65. {
  66. title:"铺满金色巴掌的水泥道",
  67. grade:"一年级 上学期",
  68. img: "../../static/image/timg.jpg",
  69. plays: "12345",
  70. likes: "54321",
  71. classId: "2"
  72. },
  73. {
  74. title:"铺满金色巴掌的水泥道",
  75. grade:"一年级 上学期",
  76. img: "../../static/image/timg.jpg",
  77. plays: "12345",
  78. likes: "54321",
  79. classId: "2"
  80. },
  81. {
  82. title:"铺满金色巴掌的水泥道",
  83. grade:"一年级 上学期",
  84. img: "../../static/image/timg.jpg",
  85. plays: "12345",
  86. likes: "54321",
  87. classId: "2"
  88. },
  89. {
  90. title:"铺满金色巴掌的水泥道",
  91. grade:"一年级 上学期",
  92. img: "../../static/image/timg.jpg",
  93. plays: "12345",
  94. likes: "54321",
  95. classId: "2"
  96. },
  97. {
  98. title:"铺满金色巴掌的水泥道",
  99. grade:"一年级 上学期",
  100. img: "../../static/image/timg.jpg",
  101. plays: "12345",
  102. likes: "54321",
  103. classId: "2"
  104. },
  105. {
  106. title:"铺满金色巴掌的水泥道",
  107. grade:"一年级 上学期",
  108. img: "../../static/image/timg.jpg",
  109. plays: "12345",
  110. likes: "54321",
  111. classId: "2"
  112. },
  113. {
  114. title:"铺满金色巴掌的水泥道",
  115. grade:"一年级 上学期",
  116. img: "../../static/image/timg.jpg",
  117. plays: "12345",
  118. likes: "54321",
  119. classId: "2"
  120. },
  121. ]
  122. }
  123. }),
  124. // 搜索方法
  125. that.searchHandler = () => {
  126. console.log('搜索按钮')
  127. console.log(that.data.hotInput);
  128. },
  129. // 输入框输入
  130. that.inputHandler = (e) => {
  131. that.setData({
  132. hotInput: e.detail.value
  133. });
  134. console.log(that.data.hotInput)
  135. }
  136. // 打开课程页面
  137. that.openClass = (e) =>{
  138. let classId = e.currentTarget.dataset.classid;
  139. let title = e.currentTarget.dataset.title;
  140. wx.navigateTo({
  141. url: `../main/class/class?id=${classId}&title=${title}`
  142. })
  143. }
  144. }