Commit f59acd50 authored by Roooooobin's avatar Roooooobin Committed by Roooooobin
Browse files

完善题目列表界面和逻辑(跳转完成,等待跳转至的页面提供接口)

parent 89e82755
......@@ -26,4 +26,5 @@ global.storage = new Storage({
global.token = null;
global.url = 'http://192.168.137.1:8000';
// global.url = 'http://192.168.137.1:8000';
global.url = 'http://192.168.1.141:8000';
/* eslint-disable */
import React, { Component } from 'react';
import React from 'react';
import {
AppRegistry,
StyleSheet,
......@@ -13,20 +13,18 @@ import {
} from 'react-native';
import Page from '../components/page';
import { ProblemList } from '../utils/api';
import { StackActions, } from 'react-navigation';
import PropTypes from "prop-types";
export default class ProblemListScene extends Component {
export default class ProblemListScene extends React.Component {
static navigationOptions = {
title: '题目列表'
};
Search = () => {
Alert.alert(this.state.pro_id)
};
constructor(props) {
super(props);
constructor({ navigation }) {
super({ navigation });
this.state = {
page_num: 10, //总页数
activePage:1, //当前活动页码数 (当PageAllNum小于activePage时会自动显示最后一页)
......@@ -36,6 +34,8 @@ export default class ProblemListScene extends Component {
pro_id: "1",
};
}
callBack(CB){
console.log(CB);
this.setState({
......@@ -79,7 +79,12 @@ export default class ProblemListScene extends Component {
placeholder={"请输入题号"}
/>
<Button title={"跳转"} style={{flex: 0.2, marginLeft: 3}}
onPress={this.Search}
onPress={() => {
Alert.alert(this.state.pro_id);
this.props.navigation.dispatch(StackActions.push({
routeName: 'Problem'
}))
}}
/>
</View>
<View style={styles.container}>
......@@ -121,6 +126,8 @@ const styles = StyleSheet.create({
}
});
ProblemListScene.propTypes = {
navigation: PropTypes.object.isRequired
};
// AppRegistry.registerComponent('Page', () => PageIndex);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment