// pages/nais/nais.js let app = getApp(); Page({ /** * 页面的初始数据 */ data: { // 屏幕高度 navHeight: '', background: ['1', '2', '3', '4', '5'], // 政策解读 policyInterpretation: [{ name: '文字解读' }, { name: '图片解读' }, { name: '视频解读' }, { name: '媒体解读' }], // 政策解读数据 policyInterpretationContent: [{ url: 'http://192.168.1.253:7777/applet/图层 3261.png', title: '重庆市南岸区集体土地征收补偿安置 实施办法政策解读(视频解读)' }, { url: 'http://192.168.1.253:7777/applet/图层 3262.png', title: '关于印发支持科技创新若干财政金融 政策的通知(视频解读)' }], // 政策解读默认项 currentTab: 0, // 政务专题 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'] }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { if (typeof this.getTabBar === 'function' && this.getTabBar()) { this.getTabBar().setData({ selected: 1 }) } }, onHide(){ if (typeof this.getTabBar === 'function' && this.getTabBar()) { this.getTabBar().setData({ selected: -1 }) } }, // 事件处理函数 onLoad() { this.setData({ navHeight: app.globalData.navHeight + app.globalData.menuHeight / 2 }) }, // 跳转更多界面 goToMore() { console.log("跳转到详细界面"); }, // 切换政策解读 tabNav(e) { let currentTab = e.currentTarget.dataset.index this.setData({ currentTab }) }, // 滑动政策解读 handleSwiper(e) { console.log("1212121"); let { current, source } = e.detail if (source === 'autoplay' || source === 'touch') { const currentTab = current this.setData({ currentTab }) } }, /** * 生命周期函数--监听页面显示 */ onShow() { console.log(2); if (typeof this.getTabBar === 'function' && this.getTabBar()) { this.getTabBar().setData({ selected: 1 }) } }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { } })