index.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. // pages/home/index.js
  2. const app = getApp()
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. // 组件所需的参数
  9. nvabarData: {
  10. showCapsule: 1, //是否显示左上角图标,消息中心 1表示显示 0表示不显示
  11. showBack: 0, //返回
  12. title: '我的主页', //导航栏 中间的标题
  13. // 此页面 页面内容距最顶部的距离
  14. height: app.globalData.height * 2 + 20,
  15. },
  16. // 此页面 页面内容距最顶部的距离
  17. active: 0,
  18. icon: {
  19. normal: '/pages/images/home.png',
  20. active: '/pages/images/home_fill.png',
  21. bankNormal:'/pages/images/duijie.png',
  22. bankActive:'/pages/images/duijie_fill.png',
  23. marketNormal:'/pages/images/recharge.png',
  24. marketActive:'/pages/images/recharge_fill.png',
  25. policyNormal:'/pages/images/news_hot.png',
  26. policyActive:'/pages/images/news_hot_fill.png',
  27. myNormal:'/pages/images/people.png',
  28. myActive:'/pages/images/people_fill.png'
  29. },
  30. // 热门产品
  31. productList: [{
  32. "pic": '/pages/images/cooperation01.png',
  33. title: '热门产品'
  34. },
  35. {
  36. "pic": '/pages/images/cooperation01.png',
  37. title: '热门产品'
  38. }
  39. ],
  40. // 政策解读
  41. policyList: [{
  42. "pic": "/pages/images/test.jpg",
  43. "title": "中国银保监会就《商业银行小微企业金融服务监管评价暂行办法(试行)》中国银保监会就《商业银行小微企业金融服务监管评价暂行办法(试行)》",
  44. "zhuti": "疫情",
  45. "dengji": "吉林省"
  46. },
  47. {
  48. "pic": "/pages/images/test.jpg",
  49. "title": "中国银保监会就《商业银行小微企业金融服务监管评价暂行办法(试行)》",
  50. "zhuti": "疫情",
  51. "dengji": "吉林省"
  52. },
  53. {
  54. "pic": "/pages/images/test.jpg",
  55. "title": "中国银保监会就《商业银行小微企业金融服务监管评价暂行办法(试行)》",
  56. "zhuti": "疫情",
  57. "dengji": "吉林省"
  58. },
  59. {
  60. "pic": "/pages/images/test.jpg",
  61. "title": "中国银保监会就《商业银行小微企业金融服务监管评价暂行办法(试行)》",
  62. "zhuti": "疫情",
  63. "dengji": "吉林省"
  64. },
  65. ],
  66. // 轮播
  67. background: [{
  68. "pic": "/pages/images/test1.png",
  69. },
  70. {
  71. "pic": "/pages/images/test.jpg",
  72. }
  73. ],
  74. indicatorDots: true,
  75. vertical: false,
  76. autoplay: true,
  77. interval: 2000,
  78. duration: 500
  79. },
  80. // 政策解读页面列表跳转
  81. policyList: function () {
  82. wx.navigateTo({
  83. url: '/pages/policy/index'
  84. })
  85. },
  86. // 政策解读页面详情跳转
  87. // 判断id
  88. policyListDetail: function (e) {
  89. console.log(e.currentTarget.id)
  90. wx.navigateTo({
  91. url: '/pages/policyDetail/index?id=' + e.currentTarget.id // 希望跳转过去的页面
  92. })
  93. },
  94. // 无id,模拟数据跳转
  95. policyListDetail: function () {
  96. wx.navigateTo({
  97. url: '/pages/policyDetail/index'
  98. })
  99. },
  100. // 热门产品跳转
  101. productListDetail: function (e) {
  102. console.log(e.currentTarget.id)
  103. wx.navigateTo({
  104. // url: '/pages/policyDetail/index?id=' + e.currentTarget.id // 希望跳转过去的页面
  105. })
  106. },
  107. // 无id,模拟数据跳转
  108. productListDetail: function () {
  109. wx.navigateTo({
  110. // url: '/pages/policyDetail/index'
  111. })
  112. },
  113. // 切换菜单
  114. onChange(event) {
  115. this.setData({
  116. active: event.detail
  117. });
  118. if (event.detail == 0) {
  119. wx.navigateTo({
  120. url: '/pages/home/index'
  121. })
  122. } else if (event.detail == 1) {
  123. wx.navigateTo({
  124. url: '/pages/bank/index'
  125. })
  126. } else if (event.detail == 2) {
  127. wx.navigateTo({
  128. url: '/pages/market/index'
  129. })
  130. } else if (event.detail == 3) {
  131. wx.navigateTo({
  132. url: '/pages/policy/index'
  133. })
  134. } else if (event.detail == 4) {
  135. wx.navigateTo({
  136. url: '/pages/my/index'
  137. })
  138. }
  139. },
  140. /**
  141. * 生命周期函数--监听页面加载
  142. */
  143. onLoad: function (options) {
  144. },
  145. /**
  146. * 生命周期函数--监听页面初次渲染完成
  147. */
  148. onReady: function () {
  149. },
  150. /**
  151. * 生命周期函数--监听页面显示
  152. */
  153. onShow: function () {
  154. },
  155. /**
  156. * 生命周期函数--监听页面隐藏
  157. */
  158. onHide: function () {
  159. },
  160. /**
  161. * 生命周期函数--监听页面卸载
  162. */
  163. onUnload: function () {
  164. },
  165. /**
  166. * 页面相关事件处理函数--监听用户下拉动作
  167. */
  168. onPullDownRefresh: function () {
  169. },
  170. /**
  171. * 页面上拉触底事件的处理函数
  172. */
  173. onReachBottom: function () {
  174. },
  175. /**
  176. * 用户点击右上角分享
  177. */
  178. onShareAppMessage: function () {
  179. }
  180. })