需求
使用小程序实现网络数据获取,加载新闻列表,点击查看详情,和上划加载新数据
列表页面
wxml样式
<view class="newContainer" bindscrolltolower="upper">
<view class="newsItem" wx:for="{
{newsData}}" wx:key="key" data-id="{
{item.id}}" bindtap="showDetail">
<view>
<image class="imageClass" src="{
{item.imgUrl}}">图片</image>
</view>
<view class="newRight">
<text>{
{
item.title}}</text>
<text>{
{
item.newTime}}</text>
</view>
</view>
</view>
生命周期函数–监听页面加载
onLoad: function (options