浏览代码

完善页面修改问题

Limengbo 5 年之前
父节点
当前提交
f6ae5ad4bc

文件差异内容过多而无法显示
+ 141 - 139
android/app/src/main/assets/index.android.bundle


二进制
android/app/src/main/res/drawable-mdpi/pages_images_common_novip.png


二进制
android/app/src/main/res/drawable-mdpi/pages_images_coursedetails_nobuy.png


二进制
android/app/src/main/res/drawable-xhdpi/pages_images_common_novip.png


二进制
android/app/src/main/res/drawable-xhdpi/pages_images_coursedetails_nobuy.png


二进制
android/app/src/main/res/drawable-xxhdpi/pages_images_common_novip.png


二进制
android/app/src/main/res/drawable-xxhdpi/pages_images_coursedetails_nobuy.png


+ 35 - 18
pages/components/Header.js

@@ -65,40 +65,57 @@ const styles = StyleSheet.create({
 export default class Header extends Component<Props> {
 export default class Header extends Component<Props> {
   render() {
   render() {
     return (
     return (
-      <TouchableOpacity activeOpacity={1} onPress={this.props.onPress}>
+      <View
-        <View
+        style={styles.wrapper}
-          style={styles.wrapper}
+      >
-        >
+        <TouchableOpacity activeOpacity={1} onPress={this.props.onPress}>
           <Image
           <Image
             source={this.props.uri ? {
             source={this.props.uri ? {
               uri: this.props.uri
               uri: this.props.uri
             } : require('../images/userInfo/default_photo.png')}
             } : require('../images/userInfo/default_photo.png')}
             style={styles.avatar}
             style={styles.avatar}
           />
           />
-          <View
+        </TouchableOpacity>
-            style={styles.leftBox}
+        <View
-          >
+          style={styles.leftBox}
-            <View style={styles.leftBottomRow}>
+        >
-              <Text
+          <View style={styles.leftBottomRow}>
-                style={styles.userName}
+            <Text
-              >
+              style={styles.userName}
-                {this.props.username}
+            >
-              </Text>
+              {this.props.isVisitor ? '新用户登录送7天VIP' : this.props.username}
+            </Text>
+            { 
+              this.props.isVisitor ?
+              null
+              :
               <Image
               <Image
-                source={require("../images/common/vip.png")}
+                source={this.props.isVip ? require("../images/common/vip.png") : require("../images/common/novip.png")}
                 style={styles.flowerIcon}
                 style={styles.flowerIcon}
               />
               />
-            </View>
+            }
+          </View>
+          <TouchableOpacity activeOpacity={1} onPress={ () => this.click()}>
             <Text
             <Text
               style={styles.flowerNumber}
               style={styles.flowerNumber}
             >
             >
-              {this.props.isVip ? '' : '开通VIP'}
+              {this.props.isVisitor ? '立即登录' : this.props.isVip ? '' : '开通VIP'}
             </Text>
             </Text>
-          </View>
+          </TouchableOpacity>
         </View>
         </View>
-      </TouchableOpacity>
+      </View>
     );
     );
   }
   }
+  click() {
+    // alert(this.props.isVisitor)
+    // this.props.nav('Loading')
+    if (this.props.isVisitor) {
+      this.props.nav('Login')
+    } else if (!this.props.isVip) {
+      this.props.nav('Buy')
+    }
+    
+  }
 }
 }
 /**
 /**
 
 

+ 7 - 3
pages/components/MainPage.js

@@ -98,7 +98,8 @@ export default class MainPage extends BasePage {
 		username: '游客',
 		username: '游客',
 		avatar: '',
 		avatar: '',
 		isVip: false,
 		isVip: false,
-		showLoading: true
+		showLoading: true,
+		isVisitor: true
 	};
 	};
 
 
 	renderBtn = (item, index) => {
 	renderBtn = (item, index) => {
@@ -205,8 +206,10 @@ export default class MainPage extends BasePage {
 					uri={this.state.avatar}
 					uri={this.state.avatar}
 					width={400}
 					width={400}
 					height={150}
 					height={150}
+					isVisitor={this.state.isVisitor}
 					username={this.state.username}
 					username={this.state.username}
 					isVip={this.state.isVip}
 					isVip={this.state.isVip}
+					nav={this.props.navigation.navigate}
 					onPress={() => this.toNextPage('userCenter')}
 					onPress={() => this.toNextPage('userCenter')}
 				/>
 				/>
 				{/* 搜索区域 */}
 				{/* 搜索区域 */}
@@ -486,8 +489,9 @@ export default class MainPage extends BasePage {
 	// 获取用户信息
 	// 获取用户信息
 	async getUserInfo() {
 	async getUserInfo() {
 		this.setState({
 		this.setState({
-			username: global.userInfo.nickName,
+			username: global.userInfo.nickName ? global.userInfo.nickName : global.userInfo.mobile,
-			avatar: global.userInfo.avatar
+			avatar: global.userInfo.avatar,
+			isVisitor: global.userInfo.isVisitor
 		});
 		});
 		let ageindex = 0;
 		let ageindex = 0;
 		if (global.userInfo.ageGroup === 'PRESCHOOL') {
 		if (global.userInfo.ageGroup === 'PRESCHOOL') {

+ 16 - 0
pages/components/ScrollRow.js

@@ -42,6 +42,7 @@ export default class ScrollRow extends Component {
                     // flex: 1,
                     // flex: 1,
                     height: this.props.itemHeight,
                     height: this.props.itemHeight,
                     width: this.props.itemWidth,
                     width: this.props.itemWidth,
+
                     flexDirection: 'row',
                     flexDirection: 'row',
                     alignItems: 'center',
                     alignItems: 'center',
                     marginLeft: 9,
                     marginLeft: 9,
@@ -54,6 +55,7 @@ export default class ScrollRow extends Component {
                     width: this.props.itemWidth,
                     width: this.props.itemWidth,
                     flexDirection: 'column',
                     flexDirection: 'column',
                     alignItems: 'center',
                     alignItems: 'center',
+                    position: 'relative'
                     // flex: 1,
                     // flex: 1,
                 }}>
                 }}>
                     <Image
                     <Image
@@ -82,6 +84,20 @@ export default class ScrollRow extends Component {
                         :
                         :
                         null
                         null
                     }
                     }
+                    {
+                        item.price ?
+                        <Image
+                        // source={ require('../images/courseDetails/nobuy.png')}
+                        style={{
+                            position: 'absolute',
+                            width: 30,
+                            height: 30
+                        }}
+                        />
+                        :
+                        null
+
+                    }
 
 
                 </View>
                 </View>
 
 

二进制
pages/images/common/novip.png


二进制
pages/images/common/novip@2x.png


二进制
pages/images/common/novip@3x.png


二进制
pages/images/courseDetails/nobuy.png


二进制
pages/images/courseDetails/nobuy@2x.png


二进制
pages/images/courseDetails/nobuy@3x.png


二进制
pages/images/courseDetails/nobuyrow.png


二进制
pages/images/courseDetails/nobuyrow@2x.png


二进制
pages/images/courseDetails/nobuyrow@3x.png