Browse Source

1.修改播放器

zhangmengjie 5 years ago
parent
commit
c9d2dba9a7

+ 13 - 3
pages/components/CusVideo.js

@@ -187,6 +187,9 @@ export default class CusVideo extends React.Component {
       }
     });
   }
+  componentWillUnmount() {
+    clearTimeout(this.time_hideController);
+  }
 
   loadStart() {
     // alert("loadStart");
@@ -208,13 +211,13 @@ export default class CusVideo extends React.Component {
   onLoad = data => {
     //获取的是秒数
     this.setState({ duration: data.duration });
-    this.bottomcontroller.setMax(data.duration);
+    // this.bottomcontroller.setMax(data.duration);
   };
   onProgress = data => {
     this.setState({
       currentTime: data.currentTime
     });
-    if (this.state.show_controller) {
+    if (this.state.show_controller && this.props.show) {
       this.bottomcontroller.setProgress(this.state.currentTime);
       this.bottomcontroller.setMax(this.state.duration);
     }
@@ -333,9 +336,13 @@ export default class CusVideo extends React.Component {
       show_controller: false
       // needback: false
     });
+
     this.bottomcontroller.setBottom(-50);
     this.topcontroller.setTop(-50);
   }
+  componentWillUnmount() {
+    clearTimeout(this.time_hideController);
+  }
 }
 
 /**
@@ -439,9 +446,12 @@ class Loading extends Component {
   componentWillMount() {
     this.changeIndex();
   }
+  componentWillUnmount() {
+    clearTimeout(this.changeindex);
+  }
 
   changeIndex() {
-    setTimeout(() => {
+    this.changeindex = setTimeout(() => {
       if (this.loading_index > this.props.loading_arr.length - 2) {
         this.loading_index = 0;
       } else {

+ 28 - 37
pages/components/PersonalInfo.js

@@ -34,7 +34,7 @@ export default class PersonalInfo extends BasePage {
   state = {
     nickName: "初始昵称",
     schoolName: "未设置",
-    cisys: "所在地区"
+    cisys: "北京市"
   };
   updateState(data) {
     this.setState(data);
@@ -55,7 +55,7 @@ export default class PersonalInfo extends BasePage {
           backgroundColor={"transparent"}
           barStyle={"dark-content"}
           backgroundColor={"white"}
-          translucent={false}
+          translucent={true}
         />
 
         <View
@@ -76,7 +76,7 @@ export default class PersonalInfo extends BasePage {
           >
             <View
               style={{
-                flex: 1,
+                flex: 0.9,
                 alignItems: "center",
                 justifyContent: "center",
                 flexDirection: "column"
@@ -94,7 +94,7 @@ export default class PersonalInfo extends BasePage {
               />
               <TouchableOpacity
                 style={{
-                  flex: 1,
+                  flex: 0.9,
                   backgroundColor: "white",
                   width: "90%",
                   alignItems: "center",
@@ -128,10 +128,10 @@ export default class PersonalInfo extends BasePage {
                     <Image
                       style={{
                         borderRadius: 50,
-                        width: "100%",
-                        height: "78%",
-                        borderWidth: 3,
-                        borderColor: "red"
+                        width: "80%",
+                        height: "70%"
+                        // borderWidth: 3
+                        // borderColor: "red"
                       }}
                       source={{
                         uri:
@@ -144,7 +144,6 @@ export default class PersonalInfo extends BasePage {
                       flex: 9,
                       backgroundColor: "white",
                       height: "100%",
-
                       justifyContent: "center"
                     }}
                   >
@@ -155,8 +154,8 @@ export default class PersonalInfo extends BasePage {
                   <View
                     style={{
                       flex: 1.5,
+                      height: "65%",
                       alignItems: "center",
-                      height: "56%",
                       justifyContent: "center"
                     }}
                   >
@@ -190,27 +189,7 @@ export default class PersonalInfo extends BasePage {
               {this.userInfo123()}
             </View>
           </View>
-          {/* <View
-            style={{
-              width: "100%",
-              alignItems: "center",
-              justifyContent: "center",
-              flex: 4.1,
-              backgroundColor: "#F0F1F5"
-            }}
-          >
-            <View
-              style={{
-                backgroundColor: "#F3F3F3",
-                width: "90%",
-                height: "90%",
-                overflow: "hidden",
-                borderRadius: 20
-              }}
-            >
-              {this.userInfo456()}
-            </View>
-          </View> */}
+
           <View
             style={{ flex: 0.5, backgroundColor: "rgba(242, 242, 242, 1)" }}
           />
@@ -222,7 +201,7 @@ export default class PersonalInfo extends BasePage {
               flexDirection: "column"
             }}
           >
-            <View style={{ flex: 0.5 }} />
+            <View style={{ flex: 1 }} />
             <View style={{ flex: 1, flexDirection: "row" }}>
               <View style={{ flex: 1 }} />
               <View
@@ -313,9 +292,11 @@ export default class PersonalInfo extends BasePage {
               <Text
                 style={{
                   flex: 1,
-                  fontSize: 16,
+                  fontSize: 15,
                   textAlignVertical: "center"
                 }}
+                numberOfLines={1}
+                ellipsizeMode={"tail"}
               >
                 {this.state.nickName}
               </Text>
@@ -360,9 +341,11 @@ export default class PersonalInfo extends BasePage {
               <Text
                 style={{
                   flex: 1,
-                  fontSize: 16,
+                  fontSize: 15,
                   textAlignVertical: "center"
                 }}
+                numberOfLines={1}
+                ellipsizeMode={"tail"}
               >
                 生日。。。。
               </Text>
@@ -405,9 +388,11 @@ export default class PersonalInfo extends BasePage {
               <Text
                 style={{
                   flex: 1,
-                  fontSize: 16,
+                  fontSize: 15,
                   textAlignVertical: "center"
                 }}
+                numberOfLines={1}
+                ellipsizeMode={"tail"}
               >
                 {this.state.cisys}
               </Text>
@@ -450,9 +435,11 @@ export default class PersonalInfo extends BasePage {
               <Text
                 style={{
                   flex: 1,
-                  fontSize: 16,
+                  fontSize: 15,
                   textAlignVertical: "center"
                 }}
+                numberOfLines={1}
+                ellipsizeMode={"tail"}
               >
                 {this.state.schoolName}
               </Text>
@@ -495,9 +482,11 @@ export default class PersonalInfo extends BasePage {
               <Text
                 style={{
                   flex: 1.1,
-                  fontSize: 16,
+                  fontSize: 15,
                   textAlignVertical: "center"
                 }}
+                numberOfLines={1}
+                ellipsizeMode={"tail"}
               >
                 年级。。。
               </Text>
@@ -524,6 +513,8 @@ export default class PersonalInfo extends BasePage {
           width: "100%",
           height: "100%",
           alignItems: "center",
+
+          resizeMode: "contain",
           justifyContent: "center"
         }}
         onPress={() => this.arrowpress(type)}

+ 5 - 3
pages/components/RegionModal.js

@@ -145,10 +145,10 @@ export default class RegionModal extends Component<Props> {
             </View>
             <View
               style={{
-                flex: 0.01,
+                flex: 0.05,
                 width: "90%",
-                // backgroundColor: "rgba(246, 247, 248, 1)"
-                backgroundColor: "red"
+                backgroundColor: "rgba(246, 247, 248, 1)"
+                // backgroundColor: "red"
               }}
             />
             <View
@@ -168,6 +168,7 @@ export default class RegionModal extends Component<Props> {
                   }}
                   ref={view => (this.provinces_scroll = view)}
                   onLayout={() => this.provinces_onlayout()}
+                  showsVerticalScrollIndicator={false}
                 >
                   {this.scroll_item()}
                 </ScrollView>
@@ -183,6 +184,7 @@ export default class RegionModal extends Component<Props> {
                   style={{
                     flex: 1
                   }}
+                  showsVerticalScrollIndicator={false}
                 >
                   {this.scroll_city_item(this.state.city_data)}
                 </ScrollView>

+ 4 - 10
pages/components/SchedulePage.js

@@ -264,27 +264,21 @@ export default class SchedulePage extends BasePage {
   }
 
   componentWillMount() {
-    BackHandler.addEventListener(
-      "hardwareBackPress",
-      this.onBackAndroid.bind(this)
-    );
+    BackHandler.addEventListener("hardwareBackPress", this.onBackAndroid);
   }
   componentWillUnmount() {
-    BackHandler.removeEventListener(
-      "hardwareBackPress",
-      this.onBackAndroid.bind(this)
-    );
+    BackHandler.removeEventListener("hardwareBackPress", this.onBackAndroid);
   }
   showSharedDialog() {
     this.video.pause();
     this.shareddialog.setModalVisible(true);
   }
-  onBackAndroid() {
+  onBackAndroid = () => {
     if (this.state.isFull) {
       return true;
     } else {
     }
-  }
+  };
   onError() {
     alert("播放器异常");
     this.setState({