react-native 项目实战 -- 新闻客户端(4) -- 请求网络数据
1.Home.js
/**
* 首页
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
ListView,
Image,
TouchableOpacity,
Platform
} from 'react-native'; // 导入本地json数据
var LocalData = require('../LocalData.json'); var Home = React.createClass({
// 不可改变的默认值
getDefaultProps(){
return{
url_api:'http://c.m.163.com/nc/article/headline/T1348647853363/0-20.html',
key_word:'T1348647853363'
}
}, // 初始化
getInitialState(){
return{
// ListView头部轮播图的数据源
headerDataArr:[],
// cell的数据源
dataSource: new ListView.DataSource({
rowHasChanged:(r1,r2)=>{r1 !== r2}
})
}
}, render() {
return (
<View style={styles.container}>
{/*导航条*/}
{this.renderNavBar()}
<Text style={styles.welcome}>
首页
</Text>
</View>
);
}, // 导航条
renderNavBar(){
return(
<View style={styles.navOutViewStyle}>
<Text style={{color:'white',fontSize:16,fontWeight:'bold'}}>消息</Text>
</View>
)
}, // 组件加载完毕之后调用
componentDidMount(){
// 请求网络数据
this.loadDataFromNet();
}, // 请求网络数据的方法
loadDataFromNet(){
fetch(this.props.url_api)
.then((response)=>response.json())
.then((responseData)=>{
// 拿到需要的数据
var jsonData = responseData[this.props.key_word]; // 处理数据
this.dealWithData(jsonData);
})
.catch((error)=>{
if(error){
// 网络请求失败,就用本地数据
console.log('网络请求失败');
var jsonData = LocalData[this.props.key_word];
this.dealWithData(jsonData);
}
})
}, // 处理网络数据的细节方法
dealWithData(jsonData){
// 定义临时变量
var headerArr = [], listDataArr = [];
// 遍历拿到的json数据
for (var i=0;i<jsonData.length;i++){
// 取出单个对象
var data = jsonData[i];
if(data.hasAD == 1){
// 取出广告数据
headerArr = data.ads;
}else {
// 非广告数据(行数据)
listDataArr.push(data)
}
} // 更新状态机
this.setState({
// ListView头部轮播图的数据源
headerDataArr:headerArr,
// cell的数据源
dataSource:this.state.dataSource.cloneWithRows(listDataArr),
}); console.log(headerArr,listDataArr);
},
}); const styles = StyleSheet.create({
// 导航条视图
navOutViewStyle:{
height:Platform.OS === 'ios' ? 64 : 44,
backgroundColor:'#468AFF',
// 主轴方向
flexDirection:'row',
// 侧轴对齐方式 垂直居中
alignItems:'center',
// 主轴方向居中
justifyContent:'center',
},
container: {
flex: 1,
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
}); // 输出类
module.exports = Home;
2.分析:
需要在组件加载完毕之后做网络请求。这个案例中为了演示方便,如果网络请求失败,就加载本地的数据
LocalData.json:
{
"T1348647853363": [
{
"postid": "PHOT22RVE000100A",
"hasCover": false,
"hasHead": 1,
"replyCount": 21242,
"hasImg": 1,
"digest": "",
"hasIcon": true,
"docid": "9IG74V5H00963VRO_BUH0FJGTbjzhounaupdateDoc",
"title": "朝鲜奥运首金举重女将的家:奖牌挂满墙",
"order": 1,
"priority": 330,
"lmodify": "2016-08-15 14:16:47",
"boardid": "photoview_bbs",
"ads": [
{
"title": "海关破今年最大象牙走私案 混杂仿冒品",
"tag": "photoset",
"imgsrc": "http://cms-bucket.nosdn.127.net/5797c3df512b4c51aaa50b0e4fd0f2b120160815110259.jpeg",
"subtitle": "",
"url": "00AP0001|2191332"
},
{
"title": "美国密尔沃基市黑人骚乱 非裔上街抗议",
"tag": "photoset",
"imgsrc": "http://cms-bucket.nosdn.127.net/9f3d19a63b274b4db1e700736248eccd20160815104126.jpeg",
"subtitle": "",
"url": "00AO0001|2191302"
},
{
"title": "山东济南一内流河道成市民“洗衣池”",
"tag": "photoset",
"imgsrc": "http://cms-bucket.nosdn.127.net/e4eeb079fc654268ac8952f5e44e991f20160815085940.jpeg",
"subtitle": "",
"url": "00AP0001|2191296"
},
{
"title": "山东青岛持续高温 海水31℃热死养殖鱼",
"tag": "photoset",
"imgsrc": "http://cms-bucket.nosdn.127.net/5ee918677a6e427083d66d2e9fb140e920160815080709.jpeg",
"subtitle": "",
"url": "00AP0001|2191299"
},
{
"title": "美国加州山火肆虐 消防员救出被困动物",
"tag": "photoset",
"imgsrc": "http://cms-bucket.nosdn.127.net/ae724cbb656242fd8fc9571dcb56bb2320160815155219.jpeg",
"subtitle": "",
"url": "00AO0001|2191352"
}
],
"photosetID": "00AO0001|2191344",
"template": "normal1",
"votecount": 20054,
"skipID": "00AO0001|2191344",
"alias": "Top News",
"skipType": "photoset",
"cid": "C1348646712614",
"hasAD": 1,
"imgextra": [
{
"imgsrc": "http://cms-bucket.nosdn.127.net/852839be4fa84b78b7c523204cd125d120160815140427.jpeg"
},
{
"imgsrc": "http://cms-bucket.nosdn.127.net/053d1f8caa6646d688ef6d4462c01bc020160815140429.jpeg"
}
],
"source": "网易原创",
"ename": "iosnews",
"imgsrc": "http://cms-bucket.nosdn.127.net/cd46ac6c7c7c4c0d952ffb5a9f49426b20160815141115.jpeg",
"tname": "头条",
"ptime": "2016-08-15 13:51:53"
},
{
"postid": "BUH5NEB300014PRF",
"url_3w": "http://news.163.com/16/0815/15/BUH5NEB300014PRF.html",
"votecount": 8,
"replyCount": 66,
"skipID": "S1451880983492",
"ltitle": "习主席将出席并主持G20杭州峰会 发表主旨演讲",
"digest": "新华社北京8月15日电外交部发言人陆慷15日宣布:二十国集团领导人第十一次峰会将于9月4日至5日在浙江杭州举行。峰会主题为“构建创新、活力、联动、包容的世界经济",
"skipType": "special",
"url": "http://3g.163.com/news/16/0815/15/BUH5NEB300014PRF.html",
"specialID": "S1451880983492",
"docid": "BUH5NEB300014PRF",
"title": "习主席将出席并主持G20杭州峰会 发表主旨演讲",
"source": "新华网$",
"priority": 310,
"lmodify": "2016-08-15 16:16:58",
"boardid": "news_guonei8_bbs",
"subtitle": "",
"imgsrc": "http://cms-bucket.nosdn.127.net/182b6a70e0584839b9101767718a9ada20160807151210.jpeg",
"ptime": "2016-08-15 15:23:33"
},
{
"postid": "BUH6MQFD00031H2L",
"url_3w": "http://ent.163.com/16/0815/15/BUH6MQFD00031H2L.html",
"votecount": 40963,
"replyCount": 43880,
"skipID": "S1471108219015",
"ltitle": "王宝强离婚案法院按1亿暂计财产 收24.9万诉讼费",
"digest": "新京报即时新闻8月15日报道今天上午9时许,王宝强在律师张起淮的陪同下到北京朝阳法院,起诉离婚并交纳诉讼费。王宝强方预估财产总额至少在1个亿,法院遂按照1亿元暂",
"skipType": "special",
"url": "http://3g.163.com/ent/16/0815/15/BUH6MQFD00031H2L.html",
"specialID": "S1471108219015",
"docid": "BUH6MQFD00031H2L",
"title": "王宝强离婚案法院按1亿暂计财产 收24.9万诉讼费",
"source": "新京报即时新闻",
"priority": 210,
"lmodify": "2016-08-15 16:01:38",
"boardid": "ent2_bbs",
"subtitle": "",
"imgsrc": "http://cms-bucket.nosdn.127.net/3ce8f25b333748819b5675a60ed3a28d20160815154517.png",
"ptime": "2016-08-15 15:40:41"
},
{
"url_3w": "http://help.3g.163.com/16/0815/12/BUGRUNCO00963VRO.html",
"postid": "BUGRUNCO00963VRO",
"votecount": 184353,
"replyCount": 202574,
"ltitle": "王宝强:离婚纠纷案已借款交费 相信法律是公正的",
"digest": "王宝强工作室发声明,称与马蓉离婚纠纷案已正式立案,并已借款交费;王宝强表示:离婚决心已定,坚信法律是公正的。王宝强正式起诉离婚争孩子抚养权分割9套房产法制晚报8",
"url": "http://3g.163.com/ntes/16/0815/12/BUGRUNCO00963VRO.html",
"docid": "BUGRUNCO00963VRO",
"title": "王宝强:离婚纠纷案已借款交费 相信法律是公正的",
"source": "王宝强工作室",
"priority": 165,
"lmodify": "2016-08-15 13:56:32",
"imgsrc": "http://cms-bucket.nosdn.127.net/a9cae6e2444c4f57880c618ae6df250620160815123451.jpeg",
"subtitle": "",
"boardid": "3g_bbs",
"ptime": "2016-08-15 12:32:46"
},
{
"url_3w": "http://ent.163.com/16/0815/15/BUH64L0J00031H2L.html",
"postid": "BUH64L0J00031H2L",
"votecount": 49276,
"replyCount": 51267,
"ltitle": "知情人称王宝强借钱是因账户大笔钱一日内被取走",
"digest": "网易娱乐8月15日报道15日上午9时许,王宝强本人在律师张起淮的陪同下来到北京朝阳法院,起诉其妻马蓉要求离婚。据悉,朝阳法院经审查符合立案条件,已正式受理此案。",
"url": "http://3g.163.com/ent/16/0815/15/BUH64L0J00031H2L.html",
"docid": "BUH64L0J00031H2L",
"title": "知情人称王宝强借钱是因账户大笔钱一日内被取走",
"source": "网易娱乐",
"priority": 162,
"lmodify": "2016-08-15 15:52:00",
"imgsrc": "http://cms-bucket.nosdn.127.net/9ed8283f475445c4868faba9b72c730620160815153433.png",
"subtitle": "",
"boardid": "ent2_bbs",
"ptime": "2016-08-15 15:30:46"
},
{
"url_3w": "http://ent.163.com/16/0815/11/BUGOHCKE00031H2L.html",
"postid": "BUGOHCKE00031H2L",
"votecount": 231774,
"replyCount": 241460,
"ltitle": "王宝强称马蓉曾伤害家人 网友:他家出过2次车祸",
"digest": "网易娱乐8月15日报道王宝强离婚一事昨日凌晨开始持续在网上发酵,王宝强在其微博上发布离婚声明称妻子马蓉出轨前经纪人宋喆,表示无法容忍恶意背叛婚姻破坏家庭的行为。",
"url": "http://3g.163.com/ent/16/0815/11/BUGOHCKE00031H2L.html",
"docid": "BUGOHCKE00031H2L",
"title": "王宝强称马蓉曾伤害家人 网友:他家出过2次车祸",
"source": "网易娱乐专稿",
"priority": 162,
"lmodify": "2016-08-15 14:45:04",
"imgsrc": "http://cms-bucket.nosdn.127.net/4acd671949ba432e8adced832dce615e20160815114418.png",
"subtitle": "",
"boardid": "ent2_bbs",
"ptime": "2016-08-15 11:33:03"
},
{
"url_3w": "http://ent.163.com/16/0815/12/BUGQ3GO700031H2L.html",
"postid": "BUGQ3GO700031H2L",
"votecount": 141084,
"replyCount": 146553,
"ltitle": "陈思诚等好友发文力挺王宝强:我在你身边!",
"digest": "陈思诚微博截图陈祉希微博截图网易娱乐8月15日报道(文/小易)8月14日凌晨,王宝强发布离婚声明,称“无法容忍恶意背叛婚姻、破坏家庭”。王宝强声明中指出:马蓉与",
"url": "http://3g.163.com/ent/16/0815/12/BUGQ3GO700031H2L.html",
"docid": "BUGQ3GO700031H2L",
"title": "陈思诚等好友发文力挺王宝强:我在你身边!",
"source": "网易娱乐专稿",
"priority": 161,
"lmodify": "2016-08-15 14:44:59",
"imgsrc": "http://cms-bucket.nosdn.127.net/9a0c198dbda74934b778b83032a773da20160815120226.png",
"subtitle": "",
"boardid": "ent2_bbs",
"ptime": "2016-08-15 12:00:26"
},
{
"postid": "PHOT22RVJ000100A",
"votecount": 745,
"replyCount": 809,
"skipID": "00AP0001|2191347",
"digest": "",
"skipType": "photoset",
"docid": "9IG74V5H00963VRO_BUH4N116bjzhounaupdateDoc",
"title": "河南一游泳馆20多名泳客中毒 被紧急抢救",
"source": "天中晚报",
"imgextra": [
{
"imgsrc": "http://cms-bucket.nosdn.127.net/1b1322ce1784436ba9f551cb7b931a1920160815150744.jpeg"
},
{
"imgsrc": "http://cms-bucket.nosdn.127.net/e9e70de2d41243d18919676746293dd720160815150814.jpeg"
}
],
"priority": 124,
"lmodify": "2016-08-15 15:25:26",
"boardid": "photoview_bbs",
"imgsrc": "http://cms-bucket.nosdn.127.net/d9c0834621f049a5afdb4bb50bac19d920160815150743.jpeg",
"photosetID": "00AP0001|2191347",
"ptime": "2016-08-15 15:05:51"
},
{
"url_3w": "http://news.163.com/16/0815/15/BUH5ARHG0001124J.html",
"postid": "BUH5ARHG0001124J",
"votecount": 192,
"replyCount": 216,
"ltitle": "希腊货轮涉嫌撞沉中国渔船被扣留 船员接受审讯",
"digest": "参考消息网8月15日报道俄媒称,中国政府扣留一艘疑似在东海撞沉中国渔船的希腊“天使勇气”号(AnangelCourage)货轮。福建省海事局通报称,现在这艘货轮",
"url": "http://3g.163.com/news/16/0815/15/BUH5ARHG0001124J.html",
"docid": "BUH5ARHG0001124J",
"title": "希腊货轮涉嫌撞沉中国渔船被扣留 船员接受审讯",
"source": "参考消息网",
"priority": 123,
"lmodify": "2016-08-15 15:35:15",
"imgsrc": "http://cms-bucket.nosdn.127.net/7b9d385f26094994a9d71c8663dd84dc20160815152246.jpeg",
"subtitle": "",
"boardid": "news_guonei8_bbs",
"ptime": "2016-08-15 15:16:40"
},
{
"url_3w": "http://ent.163.com/16/0815/13/BUGVHJ2700031H2L.html",
"postid": "BUGVHJ2700031H2L",
"votecount": 180135,
"replyCount": 186059,
"ltitle": "疑似宋喆小号发文:你站在道德高地上不冷吗?",
"digest": "网易娱乐8月15日报道(文/小易)8月14日凌晨,王宝强发布离婚声明,声称妻子马蓉因与经纪人宋喆发生不正当两性关系,正式决定解除与马蓉的婚姻关系,同时解除宋喆的",
"url": "http://3g.163.com/ent/16/0815/13/BUGVHJ2700031H2L.html",
"docid": "BUGVHJ2700031H2L",
"title": "疑似宋喆小号发文:你站在道德高地上不冷吗?",
"source": "网易娱乐专稿",
"priority": 123,
"lmodify": "2016-08-15 15:52:09",
"imgsrc": "http://cms-bucket.nosdn.127.net/9bca45fd4d84413d83c08b178cff594220160815133641.jpeg",
"subtitle": "",
"boardid": "ent2_bbs",
"ptime": "2016-08-15 13:35:30"
},
{
"url_3w": "http://news.163.com/16/0815/12/BUGT4I4G0001121M.html",
"postid": "BUGT4I4G0001121M",
"votecount": 502,
"replyCount": 661,
"ltitle": "美国驻阿富汗大使馆附近15日传出爆炸声",
"digest": "【新华社快讯】美国驻阿富汗大使馆附近15日传出爆炸声。美国驻缅甸大使馆发生爆炸?系催泪弹防暴演习据当地媒体报道,“美国驻缅甸大使馆当地时间24日晚8时许发生爆炸",
"url": "http://3g.163.com/news/16/0815/12/BUGT4I4G0001121M.html",
"docid": "BUGT4I4G0001121M",
"title": "美国驻阿富汗大使馆附近15日传出爆炸声",
"source": "新华网",
"priority": 123,
"lmodify": "2016-08-15 15:12:57",
"imgsrc": "http://cms-bucket.nosdn.127.net/7e297ea57397465d82d25518644364a320160815125420.jpeg",
"subtitle": "",
"boardid": "news_guoji2_bbs",
"ptime": "2016-08-15 12:53:26"
},
{
"postid": "PHOTIH52000300B7",
"votecount": 15865,
"replyCount": 16481,
"skipID": "00B70003|607394",
"digest": "",
"skipType": "photoset",
"docid": "9IG74V5H00963VRO_BUH03IBQbjlitongupdateDoc",
"title": "王宝强:综艺里\"硬汉\" 感情上\"弱者\"",
"source": "网易原创",
"imgextra": [
{
"imgsrc": "http://cms-bucket.nosdn.127.net/79e1ec512cc849a5b25c4382d01e192420160815134622.jpeg"
},
{
"imgsrc": "http://cms-bucket.nosdn.127.net/8c08abc468634a6c81d468a2cd09d0c420160815134624.jpeg"
}
],
"priority": 122,
"lmodify": "2016-08-15 15:35:08",
"boardid": "photoview_bbs",
"imgsrc": "http://cms-bucket.nosdn.127.net/f1660b7d7a2a454d87914b0926d748b820160815134621.jpeg",
"photosetID": "00B70003|607394",
"ptime": "2016-08-15 13:45:19"
},
{
"url_3w": "http://news.163.com/16/0815/11/BUGOUPHP000146BE.html",
"postid": "BUGOUPHP000146BE",
"votecount": 23512,
"replyCount": 24807,
"ltitle": "3名中国囚犯在菲律宾监狱中遭刺杀 嫌犯自首",
"digest": "中新网8月15日电据菲律宾《商报》报道,菲律宾当局14日日说,位于北纳卯省仙道杜马斯的纳卯惩戒监狱内的3名中国籍囚犯遭同监狱囚犯刺杀。北纳卯省警局收到的报告确认",
"url": "http://3g.163.com/news/16/0815/11/BUGOUPHP000146BE.html",
"docid": "BUGOUPHP000146BE",
"title": "3名中国囚犯在菲律宾监狱中遭刺杀 嫌犯自首",
"source": "中国新闻网",
"priority": 122,
"lmodify": "2016-08-15 14:03:59",
"imgsrc": "http://cms-bucket.nosdn.127.net/0b7e13282fd141c1aacdba9029ccb9bf20160815114258.jpeg",
"subtitle": "",
"boardid": "news3_bbs",
"ptime": "2016-08-15 11:34:00"
},
{
"url_3w": "http://ent.163.com/16/0815/08/BUGF8F6U00031H2L.html",
"postid": "BUGF8F6U00031H2L",
"votecount": 236940,
"replyCount": 248785,
"ltitle": "大学同学否认马蓉曾是校花:她出轨不奇怪",
"digest": "网易娱乐8月15日报道王宝强宣布和马蓉离婚,马蓉出轨经纪人宋喆,在娱乐圈引发了热议。一时间,众说纷纭,舆论的矛头指向了王宝强的“校花”妻子马蓉。出轨事件后,有媒",
"url": "http://3g.163.com/ent/16/0815/08/BUGF8F6U00031H2L.html",
"docid": "BUGF8F6U00031H2L",
"title": "大学同学否认马蓉曾是校花:她出轨不奇怪",
"source": "网易娱乐",
"priority": 122,
"lmodify": "2016-08-15 15:11:13",
"imgsrc": "http://cms-bucket.nosdn.127.net/2c9c4706805146a9932fdf509779fc5720160815090051.jpeg",
"subtitle": "",
"boardid": "ent2_bbs",
"ptime": "2016-08-15 08:50:54"
},
{
"url_3w": "http://news.163.com/16/0815/12/BUGS6CJ000014SEH.html",
"postid": "BUGS6CJ000014SEH",
"votecount": 68262,
"replyCount": 71106,
"ltitle": "男子徒步6省市讨学校工程款 诋毁政府声誉被拘",
"digest": "为讨要330万元学校工程建设欠款,云南省曲靖市马龙县男子戴克健徒步六省市。8月12日,其因”诋毁马龙县政府的声誉、不听政府工作人员劝阻、严重扰乱了公共场所秩序”",
"url": "http://3g.163.com/news/16/0815/12/BUGS6CJ000014SEH.html",
"docid": "BUGS6CJ000014SEH",
"title": "男子徒步6省市讨学校工程款 诋毁政府声誉被拘",
"source": "澎湃新闻网",
"priority": 121,
"lmodify": "2016-08-15 13:25:44",
"imgsrc": "http://cms-bucket.nosdn.127.net/55b7aa9f18e04d5e84d3c41d1ae6924620160815130857.jpeg",
"subtitle": "",
"boardid": "news3_bbs",
"ptime": "2016-08-15 12:36:00"
},
{
"postid": "BUGTOGFR00050I18",
"url_3w": "http://sports.163.com/16/0815/13/BUGTOGFR00050I18.html",
"votecount": 3295,
"replyCount": 3615,
"skipID": "S1470674428144",
"ltitle": "GIF-日本女乒遭争议球绝杀 气愤!福原爱脸都哭红",
"digest": "里约奥运会女团半决赛,日本对阵德国,前四盘双方战至2平。决胜盘决胜局,福原爱在3比7落后的情况,顽强地将比分追至9平。此时,韩莹顶住了压力,再得1分,10-9拿",
"skipType": "special",
"url": "http://3g.163.com/sports/16/0815/13/BUGTOGFR00050I18.html",
"specialID": "S1470674428144",
"docid": "BUGTOGFR00050I18",
"title": "GIF-日本女乒遭争议球绝杀 气愤!福原爱脸都哭红",
"source": "网易体育",
"priority": 119,
"lmodify": "2016-08-15 16:25:10",
"boardid": "sports2_bbs",
"subtitle": "",
"imgsrc": "http://img5.cache.netease.com/news/2016/8/15/201608151304592e58f.jpg",
"ptime": "2016-08-15 13:04:19"
},
{
"url_3w": "",
"postid": "BUGQTUSM05119734",
"votecount": 9,
"replyCount": 24,
"ltitle": "博尔特并非最快的人类 谁曾突破百米极限?",
"digest": "谁是地球上跑得最快的人?可能几乎所有人都会脱口而出,尤塞恩·博尔特!他在今天上午9:25分在里约以9.81秒的成绩再度夺取男子100米金牌,成为了首个奥运百米三",
"url": "null",
"docid": "BUGQTUSM05119734",
"title": "博尔特并非最快的人类 谁曾突破百米极限?",
"source": "DeepTech深科技",
"priority": 80,
"lmodify": "2016-08-15 15:22:19",
"imgsrc": "http://cms-bucket.nosdn.127.net/5d96d42b0d254e64bffb58f4e5e46a7620160815152050.jpeg",
"subtitle": "",
"boardid": "dy_wemedia_bbs",
"ptime": "2016-08-15 12:15:27"
},
{
"postid": "PHOT4FIN00056TT3",
"votecount": 14195,
"replyCount": 14992,
"skipID": "6TT30005|147031",
"digest": "",
"skipType": "photoset",
"docid": "9IG74V5H00963VRO_BUGSHOMRguowei2009updateDoc",
"title": "日本羽球女神被打懵泪洒赛场 酷似陈妍希",
"source": "网易原创",
"imgextra": [
{
"imgsrc": "http://cms-bucket.nosdn.127.net/b4c9ba25eac640219cbcf6fcd8ce691720160815124329.jpeg"
},
{
"imgsrc": "http://cms-bucket.nosdn.127.net/550044193b164dc4a3e9db8a28aea00d20160815124330.jpeg"
}
],
"priority": 118,
"lmodify": "2016-08-15 15:11:01",
"boardid": "photoview_bbs",
"imgsrc": "http://cms-bucket.nosdn.127.net/cab2d160caac4cb5b46d1778931d374a20160815124329.jpeg",
"photosetID": "6TT30005|147031",
"ptime": "2016-08-15 12:43:10"
},
{
"postid": "PHOT22RVR000100A",
"votecount": 2,
"replyCount": 9,
"skipID": "00AN0001|2191355",
"digest": "",
"skipType": "photoset",
"docid": "9IG74V5H00963VRO_BUH860E5bjjikeupdateDoc",
"title": "湖北荆门突遭龙卷风袭击 房屋被掀翻",
"source": "网易原创",
"imgextra": [
{
"imgsrc": "http://cms-bucket.nosdn.127.net/4289006a79364b0fac0ac533d82bd09e20160815160722.jpeg"
},
{
"imgsrc": "http://cms-bucket.nosdn.127.net/5c6ccc19acc64f0eb21b3ccdcd51028920160815160723.jpeg"
}
],
"priority": 117,
"lmodify": "2016-08-15 16:22:00",
"boardid": "photoview_bbs",
"imgsrc": "http://cms-bucket.nosdn.127.net/1364b3f72ec94772a05c6c4808bf502f20160815160722.jpeg",
"photosetID": "00AN0001|2191355",
"ptime": "2016-08-15 16:06:27"
},
{
"url_3w": "http://auto.163.com/16/0815/10/BUGLQ46A00084TUO.html",
"postid": "BUGLQ46A00084TUO",
"votecount": 3516,
"replyCount": 3971,
"ltitle": "2.0T版价格涨了?奥迪全新A4L售价疑似曝光",
"digest": "版权声明:本文版权为网易汽车所有,转载请注明出处。网易汽车8月15日报道近日有媒体曝光了一组国产全新A4L的经销商订货参考价,该车的价格区间为34.5万-42万",
"url": "http://3g.163.com/auto/16/0815/10/BUGLQ46A00084TUO.html",
"docid": "BUGLQ46A00084TUO",
"title": "2.0T版价格涨了?奥迪全新A4L售价疑似曝光",
"source": "网易汽车",
"priority": 70,
"lmodify": "2016-08-15 11:36:00",
"imgsrc": "http://cms-bucket.nosdn.127.net/b5fbdcfa1d504469af604f1da65b60fd20160815110707.jpeg",
"subtitle": "",
"boardid": "auto_bbs",
"ptime": "2016-08-15 10:45:24"
},
{
"url_3w": "http://money.163.com/16/0815/15/BUH4H3S800254TFQ.html",
"postid": "BUH4H3S800254TFQ",
"votecount": 5039,
"replyCount": 5350,
"ltitle": "High翻天!沪指强势收涨2.44%创7个月新高",
"digest": "网易财经8月15日讯今日,两市小幅高开后强势上行,随着房地产、银行、券商的接连发力,沪指站上3100点,午后开盘,A股继续上攻,沪指盘中站上年线3129点。截止",
"url": "http://3g.163.com/money/16/0815/15/BUH4H3S800254TFQ.html",
"docid": "BUH4H3S800254TFQ",
"title": "High翻天!沪指强势收涨2.44%创7个月新高",
"source": "网易财经",
"priority": 117,
"lmodify": "2016-08-15 15:13:39",
"imgsrc": "http://cms-bucket.nosdn.127.net/60cbd160d8e84c8cb4cf14b01e86590520160815150347.jpeg",
"subtitle": "",
"boardid": "money_bbs",
"ptime": "2016-08-15 15:02:37"
},
{
"url_3w": "http://news.163.com/16/0815/13/BUGUFK7900014SEH.html",
"postid": "BUGUFK7900014SEH",
"votecount": 2691,
"replyCount": 2842,
"ltitle": "湖北黄石教育局6年前号召团购房子 至今无法交房",
"digest": "动向新闻8月15日消息,6年前团购的房子,至今仍不能入住,黄石市数十名教职工为此奔波4年无果,背后究竟有何蹊跷?几天前接到报料后,记者进行了多方采访。教育局发文",
"url": "http://3g.163.com/news/16/0815/13/BUGUFK7900014SEH.html",
"docid": "BUGUFK7900014SEH",
"title": "湖北黄石教育局6年前号召团购房子 至今无法交房",
"source": "动向新闻",
"priority": 117,
"lmodify": "2016-08-15 15:10:54",
"imgsrc": "http://cms-bucket.nosdn.127.net/e2748fc5ac41411dbb0c6b5c0d34ee5520160815135354.jpeg",
"subtitle": "",
"boardid": "news3_bbs",
"ptime": "2016-08-15 13:16:00"
}
]
}
.
react-native 项目实战 -- 新闻客户端(4) -- 请求网络数据的更多相关文章
- 【腾讯Bugly干货分享】React Native项目实战总结
本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/577e16a7640ad7b4682c64a7 “8小时内拼工作,8小时外拼成长 ...
- React Native 项目实战-Tamic
layout: post title: React Native 项目实战 date: 2016-10-18 15:02:29 +0800 comments: true categories: Rea ...
- react-native 项目实战 -- 新闻客户端(7) -- 新闻详情页
http://c.3g.163.com/nc/article/BUH64L0J00031H2L/full.html 观察这个地址,BUH64L0J00031H2L 就是每条新闻数据里的postid. ...
- react-native 项目实战 -- 新闻客户端(6) -- 完善ListView头部视图
1.因为需要定时器,所以我们要cd到当前项目根目录下安装这个类库: $ npm i react-timer-mixin --save 2.Component/ScrollImage.js /** * ...
- react-native 项目实战 -- 新闻客户端(5) -- 完善首页列表数据
1.Home.js: /** * 首页 */ import React, { Component } from 'react'; import { AppRegistry, StyleSheet, T ...
- React Native 项目实战 -- DoubanProject
引言:本文是我研究react-native时写的一个简单的demo,代码里有详细的注释,好废话不多说,直接上代码. 1.项目目录 2.index.android.js /** * index.andr ...
- React Native项目实战
算是学习React Native的一次项目总结吧,目的还是提高自己. 包含的内容: 1>仿"美团"页面的实现; 2>封装项目中和自己常用的一些组件; 3>学习别人 ...
- react-native 项目实战 -- 新闻客户端(3) -- 包装导航控制器
1.修改后的 Main.js /** * 主页面 */ import React, { Component } from 'react'; import { StyleSheet, Text, Vie ...
- react-native 项目实战 -- 新闻客户端(2) -- 完善TabBar
1.创建 drawable-xxhdpi 文件夹,保存 TabBar 的 icon图标 android -- app -- src -- main -- res -- drawab ...
随机推荐
- dedeCMS常用功能板块记忆
1.自动调到栏目第一个子栏目 <script> {dede:channel type='son' row='1'} window.location.href='[field:typelin ...
- (转)Python 操作 Windows 粘贴板
转自: http://outofmemory.cn/code-snippet/3939/Python-operation-Windows-niantie-board Python 操作 Windows ...
- Cocos2D研究院之CCNode详解(三)
http://www.xuanyusong.com/archives/950 上一章我们了解了cocos2d的项目路径以及工作原理,这次作者要真刀真枪地讲解代码了,咱们先来看看cocos2d最常用.也 ...
- PHPUnit安装(无需PEAR)
转自:http://www.cnblogs.com/bourneli/articles/2447155.html phpunit源代码下载:http://pear.phpunit.de/ 如何 ...
- 网站开发只需数小时?Meteor 说这才是未来
原文: http://www.geekpark.net/topics/211573/ 那个想要挑战过去数十年沿用至今的网站开发模式的新势力来了. Meteor 是从 YC 孵化而出的现代网站开发平台, ...
- python中函数和生成器的运行原理
#!/usr/bin/env python # -*- coding:utf-8 -*- # author:love_cat # python的函数是如何工作的 # 比方说我们定义了两个函数 def ...
- 虚拟机linux 挂载windows共享目录 给linux的nginx服务器使用
mount -t cifs -o username=administrator,password=xxxx,file_mode=0777,dir_mode=0777 //192.168.xx.xxx/ ...
- 【linux高级程序设计】(第十五章)UDP网络编程应用 2
UDP广播通信 单播:一对一,TCP和UDP均可完成 广播:只能UDP完成.广播时发送方只发送一个数据包,但是网络上的交换机默认转发广播数据包到所有端口.路由器默认不转发任何广播数据包.故广播在局域网 ...
- hdu 1162(最小生成树)
Eddy's picture Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)To ...
- EntityFramework之多对多关系(四)
上篇介绍了一对多关系,下面介绍下多对多关系代码编写. 1.新建model实体,User是用户类,Role是角色类,由于是多对多关系,必须得有一个中间类,所以产生了UserRole类 public cl ...