Skip to content

Commit

Permalink
hzuapps#5 hzuapps#27 第5次实验代码
Browse files Browse the repository at this point in the history
  • Loading branch information
hongxiangliu committed Dec 22, 2017
1 parent d8d8746 commit fcb27cb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
21 changes: 20 additions & 1 deletion 1514080901119/pages/scrollView/scrollView.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Page({
* 页面的初始数据
*/
data: {
session: []
sessions: []
},

/**
Expand Down Expand Up @@ -59,6 +59,25 @@ Page({
}]
})
},
onLoad: function () {
var that = this;
// 从服务器取回来 JSON
wx.request({
url: 'https://infoaas.com/data/1514080901128/ComicNew.json',
//仅为示例,并非真实的接口地址
data: {},
header: {
'content-type': 'application/json' // 默认值
},
success: function (res) {
//console.log(res.data.list)
that.setData({
hasError: true,
sessions: res.data.list
})
}
})
},

/**
* 生命周期函数--监听页面初次渲染完成
Expand Down
2 changes: 1 addition & 1 deletion 1514080901119/pages/scrollView/scrollView.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<image class="weui-media-box__thumb" src="../example/images/a.png" />
</view>
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
<view class="weui-media-box__title">({{index+1}}) {{item.name}}</view>
<view class="weui-media-box__title">({{index+1}}) {{item.CNtitle}}</view>
<view class="weui-media-box__desc">{{item.msg}}</view>
</view>
</navigator>
Expand Down

0 comments on commit fcb27cb

Please sign in to comment.