hanjing 7 年 前
コミット
a0e253678f

+ 14 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/UserEntity.java

@@ -87,6 +87,8 @@ public class UserEntity implements Serializable {
     private int create_time_line;//1:小绵羊3.0之前的用户(注:以后如果再次有这种区分之前用户的需求就陆续加一)
     @Column(name = "bind_flag")
     private int bind_flag;//绑定表示 二进制形式 从低到高 第一位手机号 第二位QQ号 第三位微信
+    @Column(name = "level")
+    private int level = 0;//用户等级   0普通   1VIP
 
     public int getPackage_cate() {
         return package_cate;
@@ -388,6 +390,18 @@ public class UserEntity implements Serializable {
         return TestUtil.isSheep() ? getShare_link() : "http://10.8.210.230:8902/share.html?invitation_code=" + getInvitation_code();
     }
 
+    public int getLevel() {
+        return level;
+    }
+
+    public void setLevel(int level) {
+        this.level = level;
+    }
+
+    public boolean isVIP() {
+        return level == 1;
+    }
+
     /**
      * 是否绑定手机号
      */

+ 3 - 1
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPersonalCenter.java

@@ -108,6 +108,8 @@ public class FgtPersonalCenter extends BaseFragment {
     View fgt_person_center_my_focus_line;
     @BindView(R.id.fgt_person_center_my_focus)
     View fgt_person_center_my_focus;
+    @BindView(R.id.vip_flag_view)
+    View vipFlagView;
 
     public UserEntity userEntity;
     private String faqUrl;
@@ -288,7 +290,7 @@ public class FgtPersonalCenter extends BaseFragment {
         ViewUtil.setText(nameTv, userEntity.getNickname());
         sheepNumTv.setText(String.format(Locale.CHINA, "绵羊号:%s", userEntity.getInvitation_code()));
         GlideImageLoader.setAvatar(iconImgIv, userEntity.getAvatar(), Color.argb(128, 255, 255, 255));
-
+        vipFlagView.setVisibility(userEntity.isVIP()?View.VISIBLE:View.GONE);
     }
 
     /**

+ 27 - 4
app/src/main/res/layout/fgt_personacenter_item_top.xml

@@ -85,14 +85,14 @@
             android:id="@+id/name_tv"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginBottom="@dimen/content_padding_small"
             android:layout_marginStart="@dimen/content_padding_10"
-            android:layout_marginTop="@dimen/content_padding_small"
-            android:text=""
+            android:layout_marginTop="@dimen/content_padding_3"
+            android:layout_marginBottom="@dimen/content_padding_3"
+            android:text="Hanjing"
             android:textColor="@color/txt_white"
             android:textSize="@dimen/text_size_12"
             app:layout_constraintStart_toEndOf="@+id/icon_img_iv"
-            app:layout_constraintTop_toTopOf="@+id/icon_img_iv" />
+            app:layout_constraintBottom_toTopOf="@+id/sheep_num_tv" />
 
         <TextView
             android:id="@+id/sheep_num_tv"
@@ -105,6 +105,29 @@
             android:textSize="@dimen/text_size_10"
             app:layout_constraintBottom_toBottomOf="@+id/icon_img_iv"
             app:layout_constraintStart_toEndOf="@+id/icon_img_iv" />
+
+        <LinearLayout
+            android:id="@+id/vip_flag_view"
+            android:orientation="horizontal"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:visibility="gone"
+            android:layout_marginStart="@dimen/content_padding_10"
+            app:layout_constraintStart_toEndOf="@+id/icon_img_iv"
+            app:layout_constraintBottom_toTopOf="@+id/name_tv">
+            <ImageView
+                android:src="@mipmap/vip_1"
+                android:layout_width="12dp"
+                android:layout_height="12dp" />
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="5dp"
+                android:text="VIP"
+                android:textColor="@color/txt_white"
+                android:textSize="@dimen/text_size_12"/>
+        </LinearLayout>
     </android.support.constraint.ConstraintLayout>
 
     <LinearLayout

BIN
app/src/main/res/mipmap-xhdpi/vip.png


BIN
app/src/main/res/mipmap-xhdpi/vip_1.png


BIN
app/src/main/res/mipmap-xxhdpi/vip.png


BIN
app/src/main/res/mipmap-xxhdpi/vip_1.png