From 3e88825906b7043c3dfd2e450a45dc563d950cd3 Mon Sep 17 00:00:00 2001 From: lh_wang Date: Sat, 13 Jun 2015 20:15:50 +0800 Subject: [PATCH] add code of 4 page --- .../index.ios.js" | 160 ++++++++++ .../index.ios.js" | 33 ++ .../pages/Index.js" | 292 ++++++++++++++++++ 3 files changed, 485 insertions(+) create mode 100644 "code/\347\254\2544\347\257\207\345\270\203\345\261\200\345\256\236\346\210\230\357\274\210\344\270\200\357\274\211\344\273\243\347\240\201/index.ios.js" create mode 100644 "code/\347\254\2544\347\257\207\345\270\203\345\261\200\345\256\236\346\210\230\357\274\210\344\272\214\357\274\211\344\273\243\347\240\201/index.ios.js" create mode 100644 "code/\347\254\2544\347\257\207\345\270\203\345\261\200\345\256\236\346\210\230\357\274\210\344\272\214\357\274\211\344\273\243\347\240\201/pages/Index.js" diff --git "a/code/\347\254\2544\347\257\207\345\270\203\345\261\200\345\256\236\346\210\230\357\274\210\344\270\200\357\274\211\344\273\243\347\240\201/index.ios.js" "b/code/\347\254\2544\347\257\207\345\270\203\345\261\200\345\256\236\346\210\230\357\274\210\344\270\200\357\274\211\344\273\243\347\240\201/index.ios.js" new file mode 100644 index 0000000..964c8b7 --- /dev/null +++ "b/code/\347\254\2544\347\257\207\345\270\203\345\261\200\345\256\236\346\210\230\357\274\210\344\270\200\357\274\211\344\273\243\347\240\201/index.ios.js" @@ -0,0 +1,160 @@ +/** + * Sample React Native App + * https://github.com/facebook/react-native + */ +'use strict'; + +var React = require('react-native'); +var { + AppRegistry, + StyleSheet, + Text, + View, + Image, +} = React; + + +var HelloWorld = React.createClass({ + render: function() { + return ( + + + + 我们约吧 + 恋爱家人好朋友 + + + + + + 超低价值 + 十元惠生活 + + + + + + + + 聚餐宴请 + 朋友家人常聚聚 + + + + 名店抢购 + 还有 + 12:06:12分 + + + + + + + + 一元吃大餐 + 新用户专享 + + + + + + + + + + + 撸串节狂欢 + 烧烤6.6元起 + + + + + + + + 毕业旅行 + 选好酒店才安心 + + + + + + + + + + 0元餐来袭 + 免费吃喝玩乐购 + + + + + + + + 热门团购 + 大家都在买什么 + + + + + + + + + ); + } +}); +var styles = StyleSheet.create({ + row:{ + flexDirection: 'row', + paddingTop:20 + }, + marTop18:{ + marginTop:18, + }, + marTop14:{ + marginTop:14, + }, + font14:{ + fontSize:14, + }, + font10:{ + fontSize:12, + }, + height160:{ + height: 160 + }, + yue:{ + height:80, + }, + green:{ + color:'#55A44B', + fontWeight: '900' + }, + red:{ + color: '#FF3F0D', + fontWeight: '900' + }, + marLeft10:{ + marginLeft:10, + }, + part_1_left:{ + flex: 1, + borderColor: '#DCD7CD', + borderRightWidth: 0.5, + borderBottomWidth: 1, + }, + part_1_right:{ + flex:2, + borderColor: '#DCD7CD', + borderBottomWidth: 1, + }, + hanbao:{ + height:55, + width:55 + } +}); + + +AppRegistry.registerComponent('HelloWorld', () => HelloWorld); diff --git "a/code/\347\254\2544\347\257\207\345\270\203\345\261\200\345\256\236\346\210\230\357\274\210\344\272\214\357\274\211\344\273\243\347\240\201/index.ios.js" "b/code/\347\254\2544\347\257\207\345\270\203\345\261\200\345\256\236\346\210\230\357\274\210\344\272\214\357\274\211\344\273\243\347\240\201/index.ios.js" new file mode 100644 index 0000000..2241206 --- /dev/null +++ "b/code/\347\254\2544\347\257\207\345\270\203\345\261\200\345\256\236\346\210\230\357\274\210\344\272\214\357\274\211\344\273\243\347\240\201/index.ios.js" @@ -0,0 +1,33 @@ + + +var React = require('react-native'); +var Index = require('./pages/Index'); + +var { + NavigatorIOS, + AppRegistry, + StyleSheet, +} = React; + +var NV = React.createClass({ + render: function(){ + return( + + ); + } +}); + +var styles = StyleSheet.create({ + container: { + flex: 1, + } +}); + + +AppRegistry.registerComponent('HelloWorld', () => NV); \ No newline at end of file diff --git "a/code/\347\254\2544\347\257\207\345\270\203\345\261\200\345\256\236\346\210\230\357\274\210\344\272\214\357\274\211\344\273\243\347\240\201/pages/Index.js" "b/code/\347\254\2544\347\257\207\345\270\203\345\261\200\345\256\236\346\210\230\357\274\210\344\272\214\357\274\211\344\273\243\347\240\201/pages/Index.js" new file mode 100644 index 0000000..bfd4755 --- /dev/null +++ "b/code/\347\254\2544\347\257\207\345\270\203\345\261\200\345\256\236\346\210\230\357\274\210\344\272\214\357\274\211\344\273\243\347\240\201/pages/Index.js" @@ -0,0 +1,292 @@ +/** + * Sample React Native App + * https://github.com/facebook/react-native + */ +'use strict'; +var React = require('react-native'); +var Swiper = require('react-native-swiper'); +// var Detail = require('./ProDetails'); + +var { + StyleSheet, + Text, + View, + Image, + TouchableHighlight, + ScrollView, +} = React; + +var sliderImgs = [ + 'http://images3.c-ctrip.com/SBU/apph5/201505/16/app_home_ad16_640_128.png', + 'http://images3.c-ctrip.com/rk/apph5/C1/201505/app_home_ad49_640_128.png', + 'http://images3.c-ctrip.com/rk/apph5/D1/201506/app_home_ad05_640_128.jpg' +]; + +var BUIcon = [ + 'https://raw.githubusercontent.com/vczero/vczero.github.io/master/ctrip/%E6%9C%AA%E6%A0%87%E9%A2%98-1.png', + 'https://raw.githubusercontent.com/vczero/vczero.github.io/master/ctrip/feiji.png', + 'https://raw.githubusercontent.com/vczero/vczero.github.io/master/ctrip/lvyou.png', + 'https://raw.githubusercontent.com/vczero/vczero.github.io/master/ctrip/gonglue.png' + +]; + +var Images = [ + 'http://webresource.c-ctrip.com/ResCRMOnline/R5/html5/images/zzz_pic_salead01.png', + 'http://images3.c-ctrip.com/rk/apph5/B1/201505/app_home_ad06_310_120.jpg' +]; + +var sliderImgs = [ + 'http://images3.c-ctrip.com/SBU/apph5/201505/16/app_home_ad16_640_128.png', + 'http://images3.c-ctrip.com/rk/apph5/C1/201505/app_home_ad49_640_128.png', + 'http://images3.c-ctrip.com/rk/apph5/D1/201506/app_home_ad05_640_128.jpg' +]; +var Slider = React.createClass({ + render: function(){ + return ( + + + + + + ); + } +}); + + +var Index = React.createClass({ + //onPress={this.showDetail} + // showDetail: function(){ + // this.props.navigator.push({ + // title: '详情页', + // component: Detail, + // }); + // }, + render: function() { + return ( + + + + + + + + + 酒店 + + + + + + + + + 海外 + + + 周边 + + + + + 团购.特惠 + + + 客栈.公寓 + + + + + + + + 机票 + + + + + + + + 火车票 + + + 接收机 + + + + + 汽车票 + + + 自驾.专车 + + + + + + + + 旅游 + + + + + + + + 门票.玩乐 + + + 出境WiFi + + + + + 邮轮 + + + 签证 + + + + + + + 攻略 + + + + + + + + 周末游 + + + 礼品卡 + + + + + 美食.购物 + + + 更多 + + + + + + + + + + + + + + ); + } +}); +var styles = StyleSheet.create({ + //container + container:{ + backgroundColor:'#F2F2F2', + flex:1, + }, + //slider + wrapper: { + height:80, + }, + slide: { + height:80, + resizeMode: Image.resizeMode.contain, + }, + //sbu + sbu_view:{ + height:84, + marginLeft: 5, + marginRight:5, + borderWidth:1, + borderRadius:5, + marginBottom:10, + flexDirection:'row', + }, + sbu_red:{ + backgroundColor: '#FA6778', + borderColor:'#FA6778', + marginTop:-70, + }, + + sbu_blue:{ + backgroundColor: '#3D98FF', + borderColor:'#3D98FF', + }, + + sbu_green:{ + backgroundColor: '#5EBE00', + borderColor:'#5EBE00', + }, + + sbu_yellow:{ + backgroundColor: '#FC9720', + borderColor:'#FC9720', + }, + sbu_flex:{ + flex:1, + }, + sbu_borderRight:{ + borderColor:'#fff', + borderRightWidth: 0.5, + }, + sbu_icon_img:{ + height:40, + width:40, + resizeMode:Image.resizeMode.contain, + }, + sub_con_flex:{ + flex:1, + justifyContent: 'center', + alignItems: 'center', + }, + sub_text:{ + justifyContent:'center', + }, + font16:{ + fontSize:17, + color:'#FFF', + fontWeight:'900', + }, + sbu_borderBottom:{ + borderBottomWidth:0.5, + borderBottomColor:'#fff', + }, + img_view:{ + height:62, + marginLeft:5, + marginRight:5, + flexDirection: 'row', + marginBottom:20, + backgroundColor:'#fff', + }, + img_flex:{ + flex:1, + borderWidth:1, + borderColor:'#ccc', + }, + img_wh: { + height:59, + borderRightWidth:0, + resizeMode:Image.resizeMode.contain, + } +}); + + + +module.exports = Index; + + + + + +