publics.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. // pages/nais/nais.js
  2. let app = getApp();
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. // 屏幕高度
  9. navHeight: '',
  10. background: ['1', '2', '3', '4', '5'],
  11. // 政策解读
  12. policyInterpretation: [{
  13. name: '文字解读'
  14. }, {
  15. name: '图片解读'
  16. }, {
  17. name: '视频解读'
  18. }, {
  19. name: '媒体解读'
  20. }],
  21. // 政策解读数据
  22. policyInterpretationContent: [{
  23. url: 'http://192.168.1.253:7777/applet/图层 3261.png',
  24. title: '重庆市南岸区集体土地征收补偿安置 实施办法政策解读(视频解读)'
  25. }, {
  26. url: 'http://192.168.1.253:7777/applet/图层 3262.png',
  27. title: '关于印发支持科技创新若干财政金融 政策的通知(视频解读)'
  28. }],
  29. // 政策解读默认项
  30. currentTab: 0,
  31. // 政务专题
  32. topics: ['http://192.168.1.253:7777/applet/图层 3269.png', 'http://192.168.1.253:7777/applet/图层 3270.png', 'http://192.168.1.253:7777/applet/图层 3269.png']
  33. },
  34. /**
  35. * 生命周期函数--监听页面初次渲染完成
  36. */
  37. onReady() {
  38. if (typeof this.getTabBar === 'function' && this.getTabBar()) {
  39. this.getTabBar().setData({
  40. selected: 1
  41. })
  42. }
  43. },
  44. onHide(){
  45. if (typeof this.getTabBar === 'function' &&
  46. this.getTabBar()) {
  47. this.getTabBar().setData({
  48. selected: -1
  49. })
  50. }
  51. },
  52. // 事件处理函数
  53. onLoad() {
  54. this.setData({
  55. navHeight: app.globalData.navHeight + app.globalData.menuHeight / 2
  56. })
  57. },
  58. // 跳转更多界面
  59. goToMore() {
  60. console.log("跳转到详细界面");
  61. },
  62. // 切换政策解读
  63. tabNav(e) {
  64. let currentTab = e.currentTarget.dataset.index
  65. this.setData({
  66. currentTab
  67. })
  68. },
  69. // 滑动政策解读
  70. handleSwiper(e) {
  71. console.log("1212121");
  72. let {
  73. current,
  74. source
  75. } = e.detail
  76. if (source === 'autoplay' || source === 'touch') {
  77. const currentTab = current
  78. this.setData({
  79. currentTab
  80. })
  81. }
  82. },
  83. /**
  84. * 生命周期函数--监听页面显示
  85. */
  86. onShow() {
  87. console.log(2);
  88. if (typeof this.getTabBar === 'function' && this.getTabBar()) {
  89. this.getTabBar().setData({
  90. selected: 1
  91. })
  92. }
  93. },
  94. /**
  95. * 生命周期函数--监听页面隐藏
  96. */
  97. onHide() {
  98. },
  99. /**
  100. * 生命周期函数--监听页面卸载
  101. */
  102. onUnload() {
  103. },
  104. /**
  105. * 页面相关事件处理函数--监听用户下拉动作
  106. */
  107. onPullDownRefresh() {
  108. },
  109. /**
  110. * 页面上拉触底事件的处理函数
  111. */
  112. onReachBottom() {
  113. },
  114. /**
  115. * 用户点击右上角分享
  116. */
  117. onShareAppMessage() {
  118. }
  119. })