Переглянути джерело

Merge branch 'master' of http://gogs.efunbox.cn/Rorschach/efunbox-mobile-8

Rorschach 5 роки тому
батько
коміт
f7c5f484fb

Різницю між файлами не показано, бо вона завелика
+ 52 - 121
android/app/src/main/assets/index.android.bundle


+ 2 - 1
pages/CourseDetails.js

@@ -26,6 +26,7 @@ import courseDetails from './services/courseDetails'
 export default class CourseDetails extends Component {
   componentDidMount() {
     const { courseId } = this.props.navigation.state.params;
+    console.log(courseId)
     courseDetails.getCourseDetails(courseId).success(res => {
       console.log('列表',res.data)
       const courseList = res.data.course;
@@ -70,7 +71,7 @@ export default class CourseDetails extends Component {
           <View style={ this.state.fullStyle }>
             <CourseListRow title={'课件'} wareList={ this.state.wareList} changeUri={ this.changeUri.bind(this) }></CourseListRow>
             {/* <CourseListLine title={'课件'} wareList={ this.state.wareList}></CourseListLine> */}
-            <Comment title={ '全部评论' }  postsList={ this.state.postsList } courseId= { this.state.courseList.id }></Comment>
+            <Comment title={ '全部评论' } courseId= { this.state.courseList.id }></Comment>
           </View> 
         </ScrollView>
         {/* <Order left={ this.state.lefts }></Order> */}

+ 12 - 3
pages/components/Comment.js

@@ -21,8 +21,17 @@ export default class Comment extends Component {
   }
   componentWillReceiveProps(nextProps) {
     console.log('--------', nextProps)
-    this.setState({
-      postsList: nextProps.postsList
+    // this.setState({
+    //   postsList: nextProps.postsList
+    // })
+    courseDetails.getPostsList(nextProps.columnId).success(res => {
+      const postsList = res.data.list;
+      console.log('==========', postsList)
+      this.setState({
+        postsList,
+      })
+    }).fail(error => {
+      console.log('失败', error)
     })
   }
   render() {
@@ -167,7 +176,7 @@ const styles = StyleSheet.create({
     width: '100%',
     backgroundColor: '#fff',
     marginTop: 8,
-    marginBottom: 60
+    // marginBottom: 60
   },
   padding: {
     paddingLeft: 20,