1 Star 0 Fork 0

周诗阳/reactnative-iOS

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index.ios.js 4.89 KB
一键复制 编辑 原始数据 按行查看 历史
周诗阳 提交于 2016-04-21 17:02 . umeng
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
Image,
NativeModules,
TouchableHighlight
} from 'react-native';
var shareRN = NativeModules.shareSDKForRN;
var umengRN = NativeModules.umengForRN;
class AwesomeProject extends Component {
shareForTittle(){
shareRN. shareForTittle('Birthday Party', 'Birthday Party');
}
shareToQQForTittleACT(){
shareRN.shareToQQForTittle('Birthday Party', 'Birthday Party');
}
shareToQzoneForTittleACT(){
shareRN.shareToQzoneForTittle('Birthday Party', 'Birthday Party');
}
shareToWechatSessionForTittleACT(){
shareRN.shareToWechatSessionForTittle('Birthday Party', 'Birthday Party');
}
shareToWechatTimelineForTittleACT(){
shareRN.shareToWechatTimelineForTittle('Birthday Party', 'Birthday Party');
}
loginByWechatACT(){
shareRN.loginByWechat();
}
loginByQQACT(){
shareRN.loginByQQ();
}
logoutByQQACT(){
shareRN. logoutByQQ();
}
logoutByWechatACT(){
shareRN. logoutByWechat();
}
umengBegin(){
umengRN. umengBegin();
}
umengEnd(){
umengRN. umengEnd();
}
render() {
return (
<View style={styles.container}>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this. umengBegin();}}>
<Text style={{width: 320, height: 40}}> 友盟begin </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this. umengEnd();}}>
<Text style={{width: 320, height: 40}}> 友盟end </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this. shareForTittle();}}>
<Text style={{width: 320, height: 40}}> 原生UI </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this. shareToQQForTittleACT();}}>
<Text style={{width: 320, height: 40}}> QQ好友分享 </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this.shareToQzoneForTittleACT();}}>
<Text style={{width: 320, height: 40}}> Qzone分享 </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this. shareToWechatSessionForTittleACT();}}>
<Text style={{width: 320, height: 40}}> 微信好友分享 </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this.shareToWechatTimelineForTittleACT();}}>
<Text style={{width: 320, height: 40}}> 微信朋友圈分享 </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this. loginByWechatACT();}}>
<Text style={{width: 320, height: 40}}> 微信登录 </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this. logoutByWechatACT();}}>
<Text style={{width: 320, height: 40}}> 微信退出登录 </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this. loginByQQACT();}}>
<Text style={{width: 320, height: 40}}> QQ登录 </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this. logoutByQQACT();}}>
<Text style={{width: 320, height: 40}}> QQ退出登录 </Text>
</TouchableHighlight>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhshy/reactnative-iOS.git
[email protected]:zhshy/reactnative-iOS.git
zhshy
reactnative-iOS
reactnative-iOS
master

搜索帮助