tbom
Version:
Taobao Open Platform Modules
55 lines (49 loc) • 1.14 kB
JavaScript
import {createElement, Component} from 'rax';
import View from 'tboc-view';
import Text from 'tboc-text';
import styles from '../common/style.css';
import { follow } from '../../../src/index';
class FollowDemo extends Component {
state = {
json: null
}
openFollow = () => {
follow({
appkey: "23025092",
sellerId:'2076296416' // 卖家id,
}, (data) => {
this.setState({
json: JSON.stringify(data)
});
});
}
render() {
return (
<View style={styles.app}>
<Text style={demoStyles.text}>调用结果:{this.state.json}</Text>
<View clickable={true}onPress={this.openFollow} onClick={this.openFollow} style={demoStyles.button}>点击关注 2076296416</View>
</View>
);
}
}
const demoStyles = {
input: {
borderWidth: 2,
borderColor: '#CCC',
borderStyle: 'solid'
},
text: {
paddingLeft: 20,
paddingRight: 20
},
button: {
borderWidth: 2,
borderColor: '#CCC',
borderStyle: 'solid',
paddingLeft: 20,
paddingRight: 20,
marginTop: 40,
backgroundColor: '#EEE'
}
}
export default FollowDemo;