公司名称 | 北京爱耳目科技有限公司 | |
MP帐号(邮箱) | iermuadmin@iermu.com | |
开发者微信号 | popotiger | |
机型(如iPhone 6s plus) | iPhone 6s plus | |
操作系统(如iOS 9.3) | iOS 10.2.1 | |
是否必现 | 必现 | |
出现时间 | 2016/2/7 20:21 | |
操作路径(即如何操作可以复现该问题) | ||
问题描述(具体问题介绍) | ||
ide中绑定固定数据可以显示,但是预览时在手机上无法显示。 | ||
问题截图(客户端问题界面截图) | ||
代码片段截图 | ||
wxml: <!--index.wxml--> <template name = 'video-card'> <scroll-view scroll-y="true" hidden = '{{currentTabIndex != index}}'> <text>111111</text> <text>{{list.length}}</text> <view class = 'item' wx:for='{{list}}' wx:key='id'> <text>{{item.description}}</text> </view> </scroll-view> </template> <view class="container"> <view class="tabs" bindtap = "bindSelectTab"> <view class = 'tab {{currentTabIndex==0?"active":""}}' data-tab-index='0'>推荐</view> <view class = 'tab {{currentTabIndex==1?"active":""}}' data-tab-index='1'>最新</view> <view class = 'tab {{currentTabIndex==2?"active":""}}' data-tab-index='2'>最热</view> </view> <template is="video-card" data='{{list: supportList, index: 0, currentTabIndex}}'></template> <template is="video-card" data='{{list: latestList, index: 1, currentTabIndex}}'></template> <template is="video-card" data='{{list: hotList, index: 2, currentTabIndex}}'></template> </view> javascript: //index.js //获取应用实例 var app = getApp() var tabList = [{ name: "推荐", type: "support", loaded: false, loading: false }, { name: "最新", type: "latest", loaded: false, loading: false }, { name: "最热", type: "hot", loaded: false, loading: false }]; const PAGE_SIZE = 5; var a = 1; Page({ data: { supportList: [], latestList: [], hotList: [], currentTabIndex: 0 }, showTab: function(_tabIndex){ this.setData({ currentTabIndex: _tabIndex }); if(!tabList[_tabIndex].loaded) { tabList[_tabIndex].loaded = true; this.bindList(tabList[_tabIndex], 0); } }, bindList: function(_tab, _pageIndex){ if(_tab.loading) return; _tab.loading = true; var list = [{ id: 1, description: "1" + _tab.type, thumbnail: "" }, { id: 2, description: "2", thumbnail: "" }, { id: 3, description: "3", thumbnail: "" }]; var data = {}; data[_tab.type + "List"] = list; console.info(data); wx.showToast({ title: list.length + "" }); this.setData(data); _tab.loading = false; }, //事件处理函数 bindSelectTab: function(event) { var targetData = event.target.dataset; var tabIndex = targetData.tabIndex; this.showTab(tabIndex); }, onShow: function(){ this.showTab(this.data.currentTabIndex); } }) | ||