classification.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. // pages/classification/classification.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. activeIndex:0,
  8. VerticalNavTop: 0,
  9. TabCur: 0,
  10. ificationTitle:[
  11. {title:"有声书"},
  12. {title:"畅销书"},
  13. {title:"儿童"},
  14. {title:"相声评书"},
  15. {title:"情感生活"},
  16. {title:"人文"},
  17. {title:"历史"},
  18. {title:"国学书院"},
  19. {title:"音乐"},
  20. {title:"英语"},
  21. {title:"教育培训"},
  22. {title:"健康养生"},
  23. {title:"广播剧"},
  24. {title:"戏曲"}
  25. ],
  26. ificationContent:[
  27. {
  28. title:"有声书",
  29. content:[
  30. {text:"言情"},
  31. {text:"悬疑"},
  32. {text:"都市"},
  33. {text:"幻想"},
  34. {text:"武侠"},
  35. {text:"历史"}
  36. ]
  37. },
  38. {
  39. title:"畅销书",
  40. content:[
  41. {text:"社科"},
  42. {text:"经管"},
  43. {text:"文学"},
  44. {text:"励志"},
  45. {text:"名著"},
  46. {text:"生活"}
  47. ]
  48. },
  49. {
  50. title:"儿童",
  51. content:[
  52. {text:"故事"},
  53. {text:"儿歌"},
  54. {text:"动画"},
  55. {text:"科普"},
  56. {text:"名著"},
  57. {text:"国学"}
  58. ]
  59. },
  60. {
  61. title:"相声评书",
  62. content:[
  63. {text:"单田芳"},
  64. {text:"郭德纲"},
  65. {text:"热门相声"},
  66. {text:"单口相声"},
  67. {text:"名家评书"},
  68. {text:"新锐笑将"}
  69. ]
  70. },
  71. {
  72. title:"情感生活",
  73. content:[
  74. {text:"恋爱技巧"},
  75. {text:"睡前夜话"},
  76. {text:"情绪压力"},
  77. {text:"婚姻家庭"},
  78. {text:"个人成长"},
  79. {text:"心理健康"}
  80. ]
  81. },
  82. {
  83. title:"人文",
  84. content:[
  85. {text:"言情"},
  86. {text:"悬疑"},
  87. {text:"都市"},
  88. {text:"幻想"},
  89. {text:"武侠"},
  90. {text:"历史"}
  91. ]
  92. },
  93. {
  94. title:"历史",
  95. content:[
  96. {text:"言情"},
  97. {text:"悬疑"},
  98. {text:"都市"},
  99. {text:"幻想"},
  100. {text:"武侠"},
  101. {text:"历史"}
  102. ]
  103. },
  104. {
  105. title:"国学书院",
  106. content:[
  107. {text:"言情"},
  108. {text:"悬疑"},
  109. {text:"都市"},
  110. {text:"幻想"},
  111. {text:"武侠"},
  112. {text:"历史"}
  113. ]
  114. },
  115. {
  116. title:"音乐",
  117. content:[
  118. {text:"言情"},
  119. {text:"悬疑"},
  120. {text:"都市"},
  121. {text:"幻想"},
  122. {text:"武侠"},
  123. {text:"历史"}
  124. ]
  125. },
  126. {
  127. title:"英语",
  128. content:[
  129. {text:"言情"},
  130. {text:"悬疑"},
  131. {text:"都市"},
  132. {text:"幻想"},
  133. {text:"武侠"},
  134. {text:"历史"}
  135. ]
  136. },
  137. {
  138. title:"教育培训",
  139. content:[
  140. {text:"言情"},
  141. {text:"悬疑"},
  142. {text:"都市"},
  143. {text:"幻想"},
  144. {text:"武侠"},
  145. {text:"历史"}
  146. ]
  147. },
  148. {
  149. title:"健康养生",
  150. content:[
  151. {text:"言情"},
  152. {text:"悬疑"},
  153. {text:"都市"},
  154. {text:"幻想"},
  155. {text:"武侠"},
  156. {text:"历史"}
  157. ]
  158. },
  159. ]
  160. },
  161. /**
  162. * 生命周期函数--监听页面加载
  163. */
  164. onLoad: function (options) {
  165. var that = this;
  166. wx.getSystemInfo({
  167. success (res) {
  168. console.log(res.screenHeight);
  169. var height = (res.screenHeight*2);
  170. console.log(height);
  171. that.setData({
  172. phoneHeight:height
  173. })
  174. }
  175. })
  176. },
  177. showActive:function (e) {
  178. console.log(e);
  179. if(e.target.offsetTop=== parseInt(281.4*e.target.dataset.index)){
  180. that.setData({
  181. activeIndex: e.target.dataset.index,
  182. })
  183. }
  184. // this.setData({
  185. // activeIndex: e.detail
  186. // })
  187. },
  188. change:function (e){
  189. var that = this;
  190. console.log(e)
  191. that.setData({
  192. VerticalNavTop: (e.currentTarget.dataset.index - 1) * 50,
  193. activeIndex: e.currentTarget.dataset.index,
  194. TabCur: e.currentTarget.dataset.id,
  195. })
  196. },
  197. /**
  198. * 生命周期函数--监听页面初次渲染完成
  199. */
  200. onReady: function () {
  201. },
  202. /**
  203. * 生命周期函数--监听页面显示
  204. */
  205. onShow: function () {
  206. },
  207. /**
  208. * 生命周期函数--监听页面隐藏
  209. */
  210. onHide: function () {
  211. },
  212. /**
  213. * 生命周期函数--监听页面卸载
  214. */
  215. onUnload: function () {
  216. },
  217. /**
  218. * 页面相关事件处理函数--监听用户下拉动作
  219. */
  220. onPullDownRefresh: function () {
  221. },
  222. /**
  223. * 页面上拉触底事件的处理函数
  224. */
  225. onReachBottom: function () {
  226. },
  227. /**
  228. * 用户点击右上角分享
  229. */
  230. onShareAppMessage: function () {
  231. }
  232. })