Selaa lähdekoodia

一些接口和界面更新

liujiangyao 8 vuotta sitten
vanhempi
commit
740f07ab87
53 muutettua tiedostoa jossa 1747 lisäystä ja 177 poistoa
  1. 0 1
      app/build.gradle
  2. BIN
      app/libs/utils.aar
  3. 4 0
      app/src/main/AndroidManifest.xml
  4. 12 0
      app/src/main/java/com/sheep/gamegroup/di/components/AuthenticationComponent.java
  5. 16 0
      app/src/main/java/com/sheep/gamegroup/di/components/BindOrChangeWeixinComponent.java
  6. 16 0
      app/src/main/java/com/sheep/gamegroup/di/components/WithdrawalComponent.java
  7. 16 0
      app/src/main/java/com/sheep/gamegroup/di/components/WithdrawalResultComponent.java
  8. 22 0
      app/src/main/java/com/sheep/gamegroup/di/modules/AuthenticationModule.java
  9. 23 0
      app/src/main/java/com/sheep/gamegroup/di/modules/BindOrChangeWeixinModule.java
  10. 2 0
      app/src/main/java/com/sheep/gamegroup/di/modules/NetModule.java
  11. 22 0
      app/src/main/java/com/sheep/gamegroup/di/modules/WithdrawalModule.java
  12. 23 0
      app/src/main/java/com/sheep/gamegroup/di/modules/WithdrawalResultModule.java
  13. 25 11
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  14. 9 0
      app/src/main/java/com/sheep/gamegroup/model/entity/BaseMessage.java
  15. 32 0
      app/src/main/java/com/sheep/gamegroup/model/entity/GridViewEntity.java
  16. 27 0
      app/src/main/java/com/sheep/gamegroup/model/entity/LoginEntity.java
  17. 204 0
      app/src/main/java/com/sheep/gamegroup/model/entity/UserEntity.java
  18. 48 0
      app/src/main/java/com/sheep/gamegroup/model/util/AddPuplicParameIntercept.java
  19. 16 0
      app/src/main/java/com/sheep/gamegroup/presenter/AuthenticationContract.java
  20. 20 0
      app/src/main/java/com/sheep/gamegroup/presenter/AuthenticationPresenter.java
  21. 16 0
      app/src/main/java/com/sheep/gamegroup/presenter/BindOrChangeWeixinContract.java
  22. 21 0
      app/src/main/java/com/sheep/gamegroup/presenter/BindOrChangeWeixinPresenter.java
  23. 3 0
      app/src/main/java/com/sheep/gamegroup/presenter/PersonalCenterContract.java
  24. 35 0
      app/src/main/java/com/sheep/gamegroup/presenter/PersonalCenterPresenter.java
  25. 2 0
      app/src/main/java/com/sheep/gamegroup/presenter/PhoneContract.java
  26. 43 34
      app/src/main/java/com/sheep/gamegroup/presenter/PhonePresenter.java
  27. 21 0
      app/src/main/java/com/sheep/gamegroup/presenter/WithdrawalContract.java
  28. 48 0
      app/src/main/java/com/sheep/gamegroup/presenter/WithdrawalPresenter.java
  29. 15 0
      app/src/main/java/com/sheep/gamegroup/presenter/WithdrawalResultContract.java
  30. 20 0
      app/src/main/java/com/sheep/gamegroup/presenter/WithdrawalResultPresenter.java
  31. 3 1
      app/src/main/java/com/sheep/gamegroup/util/ConnectAddress.java
  32. 101 0
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  33. 51 0
      app/src/main/java/com/sheep/gamegroup/util/MyDbManager.java
  34. 27 0
      app/src/main/java/com/sheep/gamegroup/util/MyGridview.java
  35. 26 0
      app/src/main/java/com/sheep/gamegroup/util/XXTEA.java
  36. 31 0
      app/src/main/java/com/sheep/gamegroup/view/activity/AuthenticationAct.java
  37. 73 0
      app/src/main/java/com/sheep/gamegroup/view/activity/BindOrChangeWeixinAct.java
  38. 49 2
      app/src/main/java/com/sheep/gamegroup/view/activity/PersonalCenterAct.java
  39. 106 14
      app/src/main/java/com/sheep/gamegroup/view/activity/PhoneAct.java
  40. 148 0
      app/src/main/java/com/sheep/gamegroup/view/activity/WithdrawalAct.java
  41. 73 0
      app/src/main/java/com/sheep/gamegroup/view/activity/WithdrawalResultAct.java
  42. 81 0
      app/src/main/java/com/sheep/gamegroup/view/adapter/WithdrawalAdapter.java
  43. 5 4
      app/src/main/java/com/sheep/jiuyan/samllsheep/page/SplashActivity.java
  44. 7 0
      app/src/main/res/drawable/radidius_bg_tv_blue_gray_selector.xml
  45. 1 1
      app/src/main/res/drawable/sp_bg_gradient_rectangle_blue.xml
  46. 11 0
      app/src/main/res/drawable/sp_rectangle_bg_gray_radius.xml
  47. 49 1
      app/src/main/res/layout/bind_change_weixin_layout.xml
  48. 15 0
      app/src/main/res/layout/withdrawal_gridview_item.xml
  49. 118 107
      app/src/main/res/layout/withdrawal_layout.xml
  50. 1 0
      app/src/main/res/layout/withdrawal_success_layotu.xml
  51. 3 0
      app/src/main/res/values/common.xml
  52. 5 1
      app/src/main/res/values/gamegroup_styles.xml
  53. 2 0
      app/src/main/res/values/strings.xml

+ 0 - 1
app/build.gradle

@@ -73,7 +73,6 @@ dependencies {
     compile 'com.tencent.bugly:crashreport_upgrade:latest.release'//其中latest.release指代最新版本号,也可以指定明确的版本号,例如1.2.0
     compile 'com.tencent.bugly:nativecrashreport:latest.release' //其中latest.release指代最
     compile 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+'
-//    compile(name: 'utils', ext: 'aar')
     debugCompile 'com.readystatesoftware.chuck:library:1.1.0'
     compile 'de.hdodenhof:circleimageview:2.2.0'
     releaseCompile 'com.readystatesoftware.chuck:library-no-op:1.1.0'

BIN
app/libs/utils.aar


+ 4 - 0
app/src/main/AndroidManifest.xml

@@ -187,6 +187,10 @@
         <!--2.0-->
         <activity android:name="com.sheep.gamegroup.view.activity.LoginAct"/>
         <activity android:name="com.sheep.gamegroup.view.activity.PhoneAct"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.PersonalCenterAct"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.WithdrawalAct"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.WithdrawalResultAct"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.BindOrChangeWeixinAct"/>
 
         <service android:name=".service.TopService"
                  android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"

+ 12 - 0
app/src/main/java/com/sheep/gamegroup/di/components/AuthenticationComponent.java

@@ -0,0 +1,12 @@
+package com.sheep.gamegroup.di.components;
+
+import com.sheep.gamegroup.di.modules.AuthenticationModule;
+
+import dagger.Component;
+
+/**
+ * Created by ljy on 2018/3/17.
+ */
+@Component(modules = AuthenticationModule.class)
+public interface AuthenticationComponent {
+}

+ 16 - 0
app/src/main/java/com/sheep/gamegroup/di/components/BindOrChangeWeixinComponent.java

@@ -0,0 +1,16 @@
+package com.sheep.gamegroup.di.components;
+
+import com.sheep.gamegroup.di.modules.BindOrChangeWeixinModule;
+import com.sheep.gamegroup.di.scopes.UserScope;
+import com.sheep.gamegroup.view.activity.BindOrChangeWeixinAct;
+
+import dagger.Component;
+
+/**
+ * Created by ljy on 2018/3/18.
+ */
+@UserScope
+@Component(modules = BindOrChangeWeixinModule.class, dependencies = NetComponent.class)
+public interface BindOrChangeWeixinComponent {
+    void inject(BindOrChangeWeixinAct bindOrChangeWeixinAct);
+}

+ 16 - 0
app/src/main/java/com/sheep/gamegroup/di/components/WithdrawalComponent.java

@@ -0,0 +1,16 @@
+package com.sheep.gamegroup.di.components;
+
+import com.sheep.gamegroup.di.modules.WithdrawalModule;
+import com.sheep.gamegroup.di.scopes.UserScope;
+import com.sheep.gamegroup.view.activity.WithdrawalAct;
+
+import dagger.Component;
+
+/**
+ * Created by ljy on 2018/3/18.
+ */
+@UserScope
+@Component(modules = WithdrawalModule.class, dependencies = NetComponent.class)
+public interface WithdrawalComponent {
+    void inject(WithdrawalAct withdrawalAct);
+}

+ 16 - 0
app/src/main/java/com/sheep/gamegroup/di/components/WithdrawalResultComponent.java

@@ -0,0 +1,16 @@
+package com.sheep.gamegroup.di.components;
+
+import com.sheep.gamegroup.di.modules.WithdrawalResultModule;
+import com.sheep.gamegroup.di.scopes.UserScope;
+import com.sheep.gamegroup.view.activity.WithdrawalResultAct;
+
+import dagger.Component;
+
+/**
+ * Created by ljy on 2018/3/18.
+ */
+@UserScope
+@Component(modules = WithdrawalResultModule.class, dependencies = NetComponent.class)
+public interface WithdrawalResultComponent {
+    void inject(WithdrawalResultAct withdrawalResultAct);
+}

+ 22 - 0
app/src/main/java/com/sheep/gamegroup/di/modules/AuthenticationModule.java

@@ -0,0 +1,22 @@
+package com.sheep.gamegroup.di.modules;
+
+import com.sheep.gamegroup.presenter.AuthenticationContract;
+
+import dagger.Module;
+import dagger.Provides;
+
+/**
+ * Created by ljy on 2018/3/17.
+ */
+@Module
+public class AuthenticationModule {
+    private AuthenticationContract.View view;
+
+    public AuthenticationModule(AuthenticationContract.View view) {
+        this.view = view;
+    }
+    @Provides
+    public AuthenticationContract.View provideView(){
+        return view;
+    }
+}

+ 23 - 0
app/src/main/java/com/sheep/gamegroup/di/modules/BindOrChangeWeixinModule.java

@@ -0,0 +1,23 @@
+package com.sheep.gamegroup.di.modules;
+
+import com.sheep.gamegroup.presenter.BindOrChangeWeixinContract;
+
+import dagger.Module;
+import dagger.Provides;
+
+/**
+ * Created by ljy on 2018/3/18.
+ */
+@Module
+public class BindOrChangeWeixinModule {
+
+    private BindOrChangeWeixinContract.View view;
+
+    public BindOrChangeWeixinModule(BindOrChangeWeixinContract.View view) {
+        this.view = view;
+    }
+    @Provides
+    public BindOrChangeWeixinContract.View provideView(){
+        return view;
+    }
+}

+ 2 - 0
app/src/main/java/com/sheep/gamegroup/di/modules/NetModule.java

@@ -2,6 +2,7 @@ package com.sheep.gamegroup.di.modules;
 
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.api.StringConverterFactory;
+import com.sheep.gamegroup.model.util.AddPuplicParameIntercept;
 import com.sheep.gamegroup.model.util.EntityUtils;
 import com.sheep.gamegroup.util.ConnectAddress;
 import com.sheep.jiuyan.samllsheep.BuildConfig;
@@ -33,6 +34,7 @@ public class NetModule {
                 .connectTimeout(30, TimeUnit.SECONDS)
                 .connectTimeout(20, TimeUnit.SECONDS)
                 .readTimeout(20,TimeUnit.SECONDS)
+                .addInterceptor(new AddPuplicParameIntercept())
                 .addInterceptor(loggingInterceptor)
                 .build();
         return okhttpClient;

+ 22 - 0
app/src/main/java/com/sheep/gamegroup/di/modules/WithdrawalModule.java

@@ -0,0 +1,22 @@
+package com.sheep.gamegroup.di.modules;
+
+import com.sheep.gamegroup.presenter.WithdrawalContract;
+
+import dagger.Module;
+import dagger.Provides;
+
+/**
+ * Created by ljy on 2018/3/18.
+ */
+@Module
+public class WithdrawalModule {
+    private WithdrawalContract.View view;
+
+    public WithdrawalModule(WithdrawalContract.View view) {
+        this.view = view;
+    }
+    @Provides
+    public WithdrawalContract.View provideView(){
+        return view;
+    }
+}

+ 23 - 0
app/src/main/java/com/sheep/gamegroup/di/modules/WithdrawalResultModule.java

@@ -0,0 +1,23 @@
+package com.sheep.gamegroup.di.modules;
+
+import com.sheep.gamegroup.presenter.WithdrawalResultContract;
+
+import dagger.Module;
+import dagger.Provides;
+
+/**
+ * Created by ljy on 2018/3/18.
+ */
+@Module
+public class WithdrawalResultModule {
+
+    private WithdrawalResultContract.View view;
+
+    public WithdrawalResultModule(WithdrawalResultContract.View view) {
+        this.view = view;
+    }
+    @Provides
+    public WithdrawalResultContract.View provideView(){
+        return view;
+    }
+}

+ 25 - 11
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -1,15 +1,9 @@
 package com.sheep.gamegroup.model.api;
 
-import android.app.DownloadManager;
-import android.support.annotation.StringRes;
-
-import com.alibaba.fastjson.annotation.JSONCreator;
-import com.alibaba.fastjson.annotation.JSONField;
-import com.sheep.gamegroup.model.entity.BaseEntity;
+import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.util.ConnectAddress;
 
-import org.json.JSONObject;
-import org.xutils.http.body.RequestBody;
 
 import java.util.Map;
 
@@ -19,7 +13,9 @@ import retrofit2.http.Field;
 import retrofit2.http.FieldMap;
 import retrofit2.http.FormUrlEncoded;
 import retrofit2.http.GET;
+import retrofit2.http.Header;
 import retrofit2.http.POST;
+import retrofit2.http.PUT;
 import retrofit2.http.Query;
 import retrofit2.http.QueryMap;
 import retrofit2.http.Streaming;
@@ -44,10 +40,28 @@ public interface ApiService {
      * @return
      */
     @Streaming
-    @POST("/v1/app/auth/sms_for_login/")
-    Observable<BaseMessage> getCaptcha(@Body String jsonObject);
+    @POST(ConnectAddress.V1+"app/auth/sms_for_login/")
+    Observable<BaseMessage> getCaptcha(@Body JSONObject jsonObject);
 
-    @POST("/v1/app/auth/login_by_sms/")
+    @POST(ConnectAddress.V1+"app/auth/login_by_sms/")
     Observable<BaseMessage> loginByCaptcha(@Body com.alibaba.fastjson.JSONObject jsonObject);
 
+    /**
+     * 获取用户信息
+     */
+    @GET(ConnectAddress.V1+"app/user/get_info/")
+    Observable<BaseMessage> getInfo();
+
+    /**
+     * 绑定手机号
+     */
+    @PUT(ConnectAddress.V1+"app/user/bind_mobile/")
+    Observable<BaseMessage> bindMobile();
+
+    /**
+     * 用户提现
+     */
+    @POST(ConnectAddress.V1 + "app/withdraw/")
+    Observable<BaseMessage> goWithdrawal(@Body JSONObject parame);
+
 }

+ 9 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/BaseMessage.java

@@ -13,8 +13,17 @@ public class BaseMessage {
 
     private String msg;
     private Integer code = 0;
+    private Object data;
     private Object object;
 
+    public Object getData() {
+        return data == null ?"":data;
+    }
+
+    public void setData(Object data) {
+        this.data = data;
+    }
+
     public String getMsg() {
         return msg == null ?"":msg;
     }

+ 32 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/GridViewEntity.java

@@ -0,0 +1,32 @@
+package com.sheep.gamegroup.model.entity;
+
+/**
+ * Created by ljy on 2018/3/18.
+ */
+
+public class GridViewEntity {
+
+    public GridViewEntity(boolean selectState, String value) {
+        this.selectState = selectState;
+        this.value = value;
+    }
+
+    private boolean selectState;
+    private String value;
+
+    public boolean isSelectState() {
+        return selectState;
+    }
+
+    public void setSelectState(boolean selectState) {
+        this.selectState = selectState;
+    }
+
+    public String getValue() {
+        return value == null? "": value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+}

+ 27 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/LoginEntity.java

@@ -0,0 +1,27 @@
+package com.sheep.gamegroup.model.entity;
+
+/**
+ * 手机登录返回数据
+ * Created by ljy on 2018/3/17.
+ */
+
+public class LoginEntity {
+    private String token;//11@9667453894253cd1f3e9beec1bb063e9
+    private UserEntity user;
+
+    public String getToken() {
+        return token;
+    }
+
+    public void setToken(String token) {
+        this.token = token;
+    }
+
+    public UserEntity getUser() {
+        return user;
+    }
+
+    public void setUser(UserEntity user) {
+        this.user = user;
+    }
+}

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

@@ -0,0 +1,204 @@
+package com.sheep.gamegroup.model.entity;
+
+import org.xutils.db.annotation.Column;
+import org.xutils.db.annotation.Table;
+
+/**
+ * Created by ljy on 2018/3/17.
+ */
+@Table(name = "user")
+public class UserEntity {
+
+    @Column(name = "id", isId = true, autoGen = true)
+    private int _id;//11,
+    @Column(name = "user_id")
+    private String id;//11,
+    @Column(name = "mobile")
+    private String mobile;//13688480841,
+    @Column(name = "nickname")
+    private String nickname;//test332211,
+    @Column(name = "balance")
+    private String balance;//0,
+    @Column(name = "invitation_code")
+    private String invitation_code;//032033476,
+    @Column(name = "parent_code")
+    private String parent_code;//,
+    @Column(name = "total_asset")
+    private String total_asset;//0,
+    @Column(name = "last_login_time")
+    private String last_login_time;//1521254162,
+    @Column(name = "create_time")
+    private String create_time;//1521254162,
+    @Column(name = "update_time")
+    private String update_time;//1521254162,
+    @Column(name = "avatar")
+    private String avatar;//,
+    @Column(name = "access_token")
+    private String access_token;//_T6fiXabS5G_pQhLLP1qKA,
+    @Column(name = "refresh_token")
+    private String refresh_token;//AiO5n79nT-6vjratlulxkg,
+    @Column(name = "open_id")
+    private String open_id;//2804526,
+    @Column(name = "real_name")
+    private String real_name;//,
+    @Column(name = "id_number")
+    private String id_number;//,
+    @Column(name = "bank_card")
+    private String bank_card;//,
+    @Column(name = "total_withdraw")
+    private String total_withdraw;//0,
+    @Column(name = "wx_openid")
+    private String wx_openid;//
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public String getNickname() {
+        return nickname;
+    }
+
+    public void setNickname(String nickname) {
+        this.nickname = nickname;
+    }
+
+    public String getBalance() {
+        return balance;
+    }
+
+    public void setBalance(String balance) {
+        this.balance = balance;
+    }
+
+    public String getInvitation_code() {
+        return invitation_code;
+    }
+
+    public void setInvitation_code(String invitation_code) {
+        this.invitation_code = invitation_code;
+    }
+
+    public String getParent_code() {
+        return parent_code;
+    }
+
+    public void setParent_code(String parent_code) {
+        this.parent_code = parent_code;
+    }
+
+    public String getTotal_asset() {
+        return total_asset;
+    }
+
+    public void setTotal_asset(String total_asset) {
+        this.total_asset = total_asset;
+    }
+
+    public String getLast_login_time() {
+        return last_login_time;
+    }
+
+    public void setLast_login_time(String last_login_time) {
+        this.last_login_time = last_login_time;
+    }
+
+    public String getCreate_time() {
+        return create_time;
+    }
+
+    public void setCreate_time(String create_time) {
+        this.create_time = create_time;
+    }
+
+    public String getUpdate_time() {
+        return update_time;
+    }
+
+    public void setUpdate_time(String update_time) {
+        this.update_time = update_time;
+    }
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
+    public String getAccess_token() {
+        return access_token;
+    }
+
+    public void setAccess_token(String access_token) {
+        this.access_token = access_token;
+    }
+
+    public String getRefresh_token() {
+        return refresh_token;
+    }
+
+    public void setRefresh_token(String refresh_token) {
+        this.refresh_token = refresh_token;
+    }
+
+    public String getOpen_id() {
+        return open_id;
+    }
+
+    public void setOpen_id(String open_id) {
+        this.open_id = open_id;
+    }
+
+    public String getReal_name() {
+        return real_name;
+    }
+
+    public void setReal_name(String real_name) {
+        this.real_name = real_name;
+    }
+
+    public String getId_number() {
+        return id_number;
+    }
+
+    public void setId_number(String id_number) {
+        this.id_number = id_number;
+    }
+
+    public String getBank_card() {
+        return bank_card;
+    }
+
+    public void setBank_card(String bank_card) {
+        this.bank_card = bank_card;
+    }
+
+    public String getTotal_withdraw() {
+        return total_withdraw;
+    }
+
+    public void setTotal_withdraw(String total_withdraw) {
+        this.total_withdraw = total_withdraw;
+    }
+
+    public String getWx_openid() {
+        return wx_openid;
+    }
+
+    public void setWx_openid(String wx_openid) {
+        this.wx_openid = wx_openid;
+    }
+}

+ 48 - 0
app/src/main/java/com/sheep/gamegroup/model/util/AddPuplicParameIntercept.java

@@ -0,0 +1,48 @@
+package com.sheep.gamegroup.model.util;
+
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
+
+import java.io.IOException;
+
+import okhttp3.HttpUrl;
+import okhttp3.Interceptor;
+import okhttp3.Request;
+import okhttp3.Response;
+
+/**
+ * http 请求添加公共的参数
+ * Created by ljy on 2018/3/18.
+ */
+
+public class AddPuplicParameIntercept implements Interceptor {
+    @Override
+    public Response intercept(Chain chain) throws IOException {
+        Request oldRequest = chain.request();
+        String url = oldRequest.url().toString();
+        Response response = null;
+        //新的请求,添加参数
+        Request newRequest = addParam(oldRequest);
+
+        response = chain.proceed(newRequest);
+        return response;
+    }
+
+    /**
+     * 添加公共参数
+     * @param oldRequest
+     * @return
+     */
+    private Request addParam(Request oldRequest) {
+        HttpUrl.Builder b = oldRequest.url()
+                .newBuilder()
+                .setEncodedQueryParameter("test","test")
+                .setEncodedQueryParameter("test2","test2");
+        Request r = oldRequest.newBuilder()
+                .addHeader("Authorization", SpUtils.getOpenId(SheepApp.mContext)+"")//header 会覆盖以前的  header
+                .method(oldRequest.method(), oldRequest.body())
+                .url(b.build())
+                .build();
+        return r;
+    }
+}

+ 16 - 0
app/src/main/java/com/sheep/gamegroup/presenter/AuthenticationContract.java

@@ -0,0 +1,16 @@
+package com.sheep.gamegroup.presenter;
+
+/**
+ * Created by ljy on 2018/3/17.
+ */
+
+public interface AuthenticationContract {
+
+    interface Presenter{
+
+    }
+
+    interface View{
+
+    }
+}

+ 20 - 0
app/src/main/java/com/sheep/gamegroup/presenter/AuthenticationPresenter.java

@@ -0,0 +1,20 @@
+package com.sheep.gamegroup.presenter;
+
+import com.sheep.gamegroup.model.api.ApiService;
+
+import javax.inject.Inject;
+
+/**
+ * Created by ljy on 2018/3/17.
+ */
+
+public class AuthenticationPresenter implements AuthenticationContract.Presenter {
+    private AuthenticationContract.View view;
+    private ApiService apiService;
+
+    @Inject
+    public AuthenticationPresenter(AuthenticationContract.View view, ApiService apiService) {
+        this.view = view;
+        this.apiService = apiService;
+    }
+}

+ 16 - 0
app/src/main/java/com/sheep/gamegroup/presenter/BindOrChangeWeixinContract.java

@@ -0,0 +1,16 @@
+package com.sheep.gamegroup.presenter;
+
+/**
+ * Created by ljy on 2018/3/18.
+ */
+
+public interface BindOrChangeWeixinContract {
+
+    interface Presenter {
+
+    }
+
+    interface View{
+
+    }
+}

+ 21 - 0
app/src/main/java/com/sheep/gamegroup/presenter/BindOrChangeWeixinPresenter.java

@@ -0,0 +1,21 @@
+package com.sheep.gamegroup.presenter;
+
+import com.sheep.gamegroup.model.api.ApiService;
+
+import javax.inject.Inject;
+
+/**
+ * Created by ljy on 2018/3/18.
+ */
+
+public class BindOrChangeWeixinPresenter implements BindOrChangeWeixinContract.Presenter {
+
+    private BindOrChangeWeixinContract.View view;
+    private ApiService apiService;
+
+    @Inject
+    public BindOrChangeWeixinPresenter(BindOrChangeWeixinContract.View view, ApiService apiService) {
+        this.view = view;
+        this.apiService = apiService;
+    }
+}

+ 3 - 0
app/src/main/java/com/sheep/gamegroup/presenter/PersonalCenterContract.java

@@ -8,9 +8,12 @@ public interface PersonalCenterContract {
 
     interface Persenter{
 
+        void getUserInfo();
     }
 
     interface View {
 
+        void updateData2View(Object o);
+        void failData2View(Object o);
     }
 }

+ 35 - 0
app/src/main/java/com/sheep/gamegroup/presenter/PersonalCenterPresenter.java

@@ -1,9 +1,17 @@
 package com.sheep.gamegroup.presenter;
 
+import android.util.Log;
+
 import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 
 import javax.inject.Inject;
 
+import rx.Observer;
+import rx.schedulers.Schedulers;
+
 /**
  * Created by ljy on 2018/3/10.
  */
@@ -17,4 +25,31 @@ public class PersonalCenterPresenter implements PersonalCenterContract.Persenter
         this.view = view;
         this.apiService = apiService;
     }
+
+    @Override
+    public void getUserInfo() {
+        String token = SpUtils.getOpenId(SheepApp.mContext);
+
+        Log.e("token---user",token+"");
+        apiService.getInfo()
+                .subscribeOn(Schedulers.io())
+                .subscribe(new Observer<BaseMessage>() {
+                    @Override
+                    public void onCompleted() {
+
+                    }
+
+                    @Override
+                    public void onError(Throwable throwable) {
+                        view.failData2View(throwable);
+                        Log.e("throwable",throwable+"");
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage o) {
+                        Log.e("token---user",o.toString()+"");
+                        view.updateData2View(o);
+                    }
+                });
+    }
 }

+ 2 - 0
app/src/main/java/com/sheep/gamegroup/presenter/PhoneContract.java

@@ -18,5 +18,7 @@ public interface PhoneContract {
         void returnGaptcha(Object o);
 
         void returnLogindata(Object o);
+
+        void loginFail(Object o);
     }
 }

+ 43 - 34
app/src/main/java/com/sheep/gamegroup/presenter/PhonePresenter.java

@@ -40,36 +40,42 @@ public class PhonePresenter implements PhoneContract.Presenter {
 
     @Override
     public void getCaptcha(String telphone){
-        Map map = new HashMap();
-        map.put("account", telphone);
-        Log.e("hash-map", map.toString());
-        com.alibaba.fastjson.JSONObject j = new com.alibaba.fastjson.JSONObject();
-        j.put("account", telphone);
-        String encry = XXTEA.Encrypt(j.toString(),XXTEA.KEY);
-        Log.e("encry----", com.alibaba.fastjson.JSONObject.toJSONString(encry));
-        apiService.getCaptcha(encry)
-                .subscribeOn(Schedulers.io())
-                .subscribe(new Observer<BaseMessage>() {
-                    @Override
-                    public void onCompleted() {
-                        Log.e("onCompleted--------","onCompleted");
+        try{
+            Map map = new HashMap();
+            map.put("account", telphone);
+            Log.e("hash-map", map.toString());
+            com.alibaba.fastjson.JSONObject j = new com.alibaba.fastjson.JSONObject();
+            j.put("account", telphone);
+//        String encry = XXTEA.Encrypt(j.toString(),XXTEA.KEY);
+            String encry = XXTEA.bytes2HexStr(XXTEA.Encrypt(j.toString(), XXTEA.KEY).getBytes("utf-8"));
+            Log.e("encry----", com.alibaba.fastjson.JSONObject.toJSONString(encry));
+            apiService.getCaptcha(j)
+                    .subscribeOn(Schedulers.io())
+                    .subscribe(new Observer<BaseMessage>() {
+                        @Override
+                        public void onCompleted() {
+                            Log.e("onCompleted--------","onCompleted");
+
+                        }
+
+                        @Override
+                        public void onError(Throwable throwable) {
+                            throwable.printStackTrace();
+                            Logger.e(throwable,"load splash failed:");
+                            Log.e("onError--------","onError:"+throwable);
+                            view.loginFail(null);
+                        }
+
+                        @Override
+                        public void onNext(BaseMessage o) {
+                            Log.e("onNext--------","onNext:"+o.toString());
+                            view.returnGaptcha(o);
+                        }
+                    });
+        }catch (Exception e){
+            e.printStackTrace();
+        }
 
-                    }
-
-                    @Override
-                    public void onError(Throwable throwable) {
-                        throwable.printStackTrace();
-                        Logger.e(throwable,"load splash failed:");
-                        Log.e("onError--------","onError:"+throwable);
-
-                    }
-
-                    @Override
-                    public void onNext(BaseMessage o) {
-                        Log.e("onNext--------","onNext:"+o.toString());
-                        view.returnGaptcha(o);
-                    }
-                });
 
     }
 
@@ -78,9 +84,10 @@ public class PhonePresenter implements PhoneContract.Presenter {
         com.alibaba.fastjson.JSONObject m = new com.alibaba.fastjson.JSONObject();
         m.put("account",telphone);
         m.put("sec_code",code);
+
         apiService.loginByCaptcha(m)
                 .subscribeOn(Schedulers.io())
-                .subscribe(new Observer<Object>() {
+                .subscribe(new Observer<BaseMessage>() {
                     @Override
                     public void onCompleted() {
                         Log.e("onCompleted--------","onCompleted");
@@ -90,13 +97,15 @@ public class PhonePresenter implements PhoneContract.Presenter {
                     @Override
                     public void onError(Throwable throwable) {
                         Log.e("onError--------","onError:"+throwable);
-
+                        view.loginFail(null);
                     }
 
                     @Override
-                    public void onNext(Object o) {
-                        Log.e("onNext--------","onNext:"+o.toString());
-                        view.returnLogindata(o);
+                    public void onNext(BaseMessage jsonObject) {
+//                        Log.e("onNext--------","onNext:"+jsonObject.toString());
+
+                        view.returnLogindata(jsonObject);
+
                     }
                 });
 

+ 21 - 0
app/src/main/java/com/sheep/gamegroup/presenter/WithdrawalContract.java

@@ -0,0 +1,21 @@
+package com.sheep.gamegroup.presenter;
+
+import com.alibaba.fastjson.JSONObject;
+
+/**
+ * Created by ljy on 2018/3/18.
+ */
+
+public interface WithdrawalContract {
+
+    interface Presenter{
+
+        void goWithdrawal(JSONObject jsonObject);
+
+    }
+
+    interface View{
+        void failData(Object o);
+        void updateView(Object o);
+    }
+}

+ 48 - 0
app/src/main/java/com/sheep/gamegroup/presenter/WithdrawalPresenter.java

@@ -0,0 +1,48 @@
+package com.sheep.gamegroup.presenter;
+
+import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+
+import javax.inject.Inject;
+
+import rx.Observer;
+import rx.schedulers.Schedulers;
+
+/**
+ * Created by ljy on 2018/3/18.
+ */
+
+public class WithdrawalPresenter implements WithdrawalContract.Presenter {
+
+    private WithdrawalContract.View view;
+    private ApiService apiService;
+
+    @Inject
+    public WithdrawalPresenter(WithdrawalContract.View view, ApiService apiService) {
+        this.view = view;
+        this.apiService = apiService;
+    }
+
+    @Override
+    public void goWithdrawal(JSONObject jsonObject) {
+        apiService.goWithdrawal(jsonObject)
+                .subscribeOn(Schedulers.io())
+                .subscribe(new Observer<BaseMessage>() {
+                    @Override
+                    public void onCompleted() {
+
+                    }
+
+                    @Override
+                    public void onError(Throwable throwable) {
+                        view.failData(throwable);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        view.updateView(baseMessage);
+                    }
+                });
+    }
+}

+ 15 - 0
app/src/main/java/com/sheep/gamegroup/presenter/WithdrawalResultContract.java

@@ -0,0 +1,15 @@
+package com.sheep.gamegroup.presenter;
+
+/**
+ * Created by ljy on 2018/3/18.
+ */
+
+public interface WithdrawalResultContract {
+
+    interface Presenter{
+
+    }
+    interface View{
+
+    }
+}

+ 20 - 0
app/src/main/java/com/sheep/gamegroup/presenter/WithdrawalResultPresenter.java

@@ -0,0 +1,20 @@
+package com.sheep.gamegroup.presenter;
+
+import com.sheep.gamegroup.model.api.ApiService;
+
+import javax.inject.Inject;
+
+/**
+ * Created by ljy on 2018/3/18.
+ */
+
+public class WithdrawalResultPresenter implements WithdrawalResultContract.Presenter {
+    private WithdrawalResultContract.View view;
+    private ApiService apiService;
+
+    @Inject
+    public WithdrawalResultPresenter(WithdrawalResultContract.View view, ApiService apiService) {
+        this.view = view;
+        this.apiService = apiService;
+    }
+}

+ 3 - 1
app/src/main/java/com/sheep/gamegroup/util/ConnectAddress.java

@@ -6,7 +6,9 @@ package com.sheep.gamegroup.util;
 
 public class ConnectAddress {
 
-    public static final String BASE_HTTP = "http://10.8.220.6:8080/";
+//    public static final String BASE_HTTP = "http://10.8.220.6:8080/";//何威
+    public static final String BASE_HTTP = "http://10.8.220.5:8080/";//张伟
+//    public static final String BASE_HTTP = "http://test.sheep.kfzs.com/";//测试服地址
 
     public static final String V1 = "/v1/";
 

+ 101 - 0
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -0,0 +1,101 @@
+package com.sheep.gamegroup.util;
+
+import android.content.Context;
+import android.content.Intent;
+
+import com.sheep.gamegroup.view.activity.AuthenticationAct;
+import com.sheep.gamegroup.view.activity.BindOrChangeWeixinAct;
+import com.sheep.gamegroup.view.activity.LoginAct;
+import com.sheep.gamegroup.view.activity.PersonalCenterAct;
+import com.sheep.gamegroup.view.activity.PhoneAct;
+import com.sheep.gamegroup.view.activity.WithdrawalAct;
+import com.sheep.gamegroup.view.activity.WithdrawalResultAct;
+
+import javax.inject.Inject;
+
+/**
+ * Created by ljy on 2018/3/18.
+ */
+
+public class Jump2View {
+
+    private static Jump2View jump2View;
+
+    public static Jump2View getInstance(){
+        if (jump2View == null){
+            jump2View = new Jump2View();
+        }
+        return jump2View;
+    }
+
+    /**
+     * 跳转到提现页面
+     * @param context
+     * @param o
+     */
+    public void goWithdrawal(Context context, Object o){
+        Intent intent = new Intent(context, WithdrawalAct.class);
+        context.startActivity(intent);
+    }
+
+    /**
+     * 跳到登录页面
+     * @param context
+     * @param o
+     */
+    public void goLoginView(Context context, Object o){
+        Intent intent = new Intent(context, LoginAct.class);
+        context.startActivity(intent);
+    }
+
+    /**
+     * 跳到手机登录页面
+     * @param context
+     * @param o
+     */
+    public void goPhoneLoginView(Context context, Object o){
+        Intent intent = new Intent(context, PhoneAct.class);
+        context.startActivity(intent);
+    }
+
+    /**
+     * 跳到个人中兴页面
+     * @param context
+     * @param o
+     */
+    public void goPersonnalCenterView(Context context, Object o){
+        Intent intent = new Intent(context, PersonalCenterAct.class);
+        context.startActivity(intent);
+    }
+
+    /**
+     * 身份验证页面,绑定姓名、身份证号、银行卡
+     * @param context
+     * @param o
+     */
+    public void goAuthenticationView(Context context, Object o){
+        Intent intent = new Intent(context, AuthenticationAct.class);
+        context.startActivity(intent);
+    }
+
+    /**
+     * 跳到提现结果页面
+     * @param context
+     * @param o
+     */
+    public void goWithdrawalResultview(Context context, Object o){
+        Intent intent = new Intent(context, WithdrawalResultAct.class);
+        context.startActivity(intent);
+    }
+
+    /**
+     * 跳到提现结果页面
+     * @param context
+     * @param o
+     */
+    public void goBindOrChangeWeixinView(Context context, Object o){
+        Intent intent = new Intent(context, BindOrChangeWeixinAct.class);
+        context.startActivity(intent);
+    }
+
+}

+ 51 - 0
app/src/main/java/com/sheep/gamegroup/util/MyDbManager.java

@@ -0,0 +1,51 @@
+package com.sheep.gamegroup.util;
+
+import com.sheep.gamegroup.model.entity.UserEntity;
+
+import org.xutils.DbManager;
+import org.xutils.ex.DbException;
+import org.xutils.x;
+
+import java.util.List;
+
+/**
+ * Created by ljy on 2018/3/17.
+ */
+
+public class MyDbManager {
+    private static MyDbManager myDbManager;
+    private final DbManager db;
+
+    private MyDbManager() {
+        DbManager.DaoConfig daoConfig = new DbManager.DaoConfig()
+                .setDbName("sheep.db")
+                .setDbVersion(1);
+        db = x.getDb(daoConfig);
+    }
+
+    public static MyDbManager getInstance(){
+        if (myDbManager == null){
+            synchronized (MyDbManager.class){
+                if(myDbManager == null){
+                    myDbManager = new MyDbManager();
+                }
+            }
+        }
+        return myDbManager;
+    }
+
+    /**
+     *保存或更新表表
+     */
+    public void saveOrUpdateUser(UserEntity user) throws DbException {
+        db.saveOrUpdate(user);
+    }
+
+    /**
+     * 查找表
+     */
+    public UserEntity dbFindUser() throws DbException{
+//        List<UserEntity> users = db.findAll(UserEntity.class);
+        return db.findFirst(UserEntity.class);
+    }
+}

+ 27 - 0
app/src/main/java/com/sheep/gamegroup/util/MyGridview.java

@@ -0,0 +1,27 @@
+package com.sheep.gamegroup.util;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.GridView;
+
+/**
+ * Created by ljy on 2018/3/18.
+ */
+
+public class MyGridview extends GridView {
+    public MyGridview(Context context) {
+        super(context);
+    }
+
+    public MyGridview(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,MeasureSpec.AT_MOST);
+        super.onMeasure(widthMeasureSpec, expandSpec);
+    }
+
+
+}

+ 26 - 0
app/src/main/java/com/sheep/gamegroup/util/XXTEA.java

@@ -13,6 +13,7 @@ import java.util.List;
  */
 
 public class XXTEA {
+//    public final static String KEY = "bbu423&(gBUjX#$s";
     public final static String KEY = "bbu423&(gBUjX#$s";
 
     /**
@@ -185,4 +186,29 @@ public class XXTEA {
     private static long DELTA = 0x9E3779B9;
     private static int MIN_LENGTH = 32;
     private static char SPECIAL_CHAR = '\0';
+
+    //byte转为hex串
+    public static String bytes2HexStr(byte[] byteArr) {
+        if (null == byteArr || byteArr.length < 1) return "";
+        StringBuilder sb = new StringBuilder();
+        for (byte t : byteArr) {
+            if ((t & 0xF0) == 0) sb.append("0");
+            sb.append(Integer.toHexString(t & 0xFF));  //t & 0xFF 操作是为去除Integer高位多余的符号位(java数据是用补码表示)
+        }
+        return sb.toString();
+    }
+
+    //hex串转为byte
+    static byte[] hexStr2Bytes(String hexStr) {
+        if (null == hexStr || hexStr.length() < 1) return null;
+
+        int byteLen = hexStr.length() / 2;
+        byte[] result = new byte[byteLen];
+        char[] hexChar = hexStr.toCharArray();
+        for(int i=0 ;i<byteLen;i++){
+            result[i] = (byte)(Character.digit(hexChar[i*2],16)<<4 | Character.digit(hexChar[i*2+1],16));
+        }
+
+        return result;
+    }
 }

+ 31 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/AuthenticationAct.java

@@ -0,0 +1,31 @@
+package com.sheep.gamegroup.view.activity;
+
+import com.sheep.gamegroup.presenter.AuthenticationContract;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.base.BaseActivity;
+
+/**
+ * Created by ljy on 2018/3/17.
+ */
+
+public class AuthenticationAct extends BaseActivity implements AuthenticationContract.View {
+    @Override
+    protected int getLayoutId() {
+        return R.layout.realname_authentication_layout;
+    }
+
+    @Override
+    public void initView() {
+
+    }
+
+    @Override
+    public void initListener() {
+
+    }
+
+    @Override
+    public void initData() {
+
+    }
+}

+ 73 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/BindOrChangeWeixinAct.java

@@ -0,0 +1,73 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.support.v7.widget.AppCompatEditText;
+import android.widget.TextView;
+
+import com.sheep.gamegroup.di.components.DaggerBindOrChangeWeixinComponent;
+import com.sheep.gamegroup.di.modules.BindOrChangeWeixinModule;
+import com.sheep.gamegroup.presenter.BindOrChangeWeixinContract;
+import com.sheep.gamegroup.presenter.BindOrChangeWeixinPresenter;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.base.BaseActivity;
+
+import javax.inject.Inject;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+
+/**
+ * 绑定微信或更改微信
+ * Created by ljy on 2018/3/18.
+ */
+
+public class BindOrChangeWeixinAct extends BaseActivity implements BindOrChangeWeixinContract.View {
+    @BindView(R.id.weinxin_et_account)
+    AppCompatEditText weinxinEtAccount;
+    @BindView(R.id.bindweixin_sure_text)
+    TextView bindweixinSureText;
+
+    Activity activity;
+    @Inject
+    BindOrChangeWeixinPresenter presenter;
+
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.bind_change_weixin_layout;
+    }
+
+    @Override
+    public void initView() {
+        activity = this;
+        DaggerBindOrChangeWeixinComponent.builder()
+                .netComponent(SheepApp.get(this).getNetComponent())
+                .bindOrChangeWeixinModule(new BindOrChangeWeixinModule(this))
+                .build()
+                .inject(this);
+    }
+
+    @Override
+    public void initListener() {
+
+    }
+
+    @Override
+    public void initData() {
+
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        // TODO: add setContentView(...) invocation
+        ButterKnife.bind(this);
+    }
+
+    @OnClick(R.id.bindweixin_sure_text)
+    public void onViewClicked() {
+    }
+}

+ 49 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/PersonalCenterAct.java

@@ -1,22 +1,38 @@
 package com.sheep.gamegroup.view.activity;
 
+import android.app.Activity;
 import android.os.Bundle;
+import android.util.Log;
 import android.view.View;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
+import android.widget.Toast;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.di.components.DaggerPersonalCenterComponent;
 import com.sheep.gamegroup.di.modules.PersonalCenterModule;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.presenter.PersonalCenterContract;
+import com.sheep.gamegroup.presenter.PersonalCenterPresenter;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.MyDbManager;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.base.BaseActivity;
+import com.sheep.jiuyan.samllsheep.utils.G;
+
+import org.xutils.ex.DbException;
+
+import javax.inject.Inject;
 
 import butterknife.BindView;
 import butterknife.ButterKnife;
 import butterknife.OnClick;
 
 /**
+ * 个人中心首页
  * Created by ljy on 2018/3/10.
  */
 
@@ -34,6 +50,10 @@ public class PersonalCenterAct extends BaseActivity implements PersonalCenterCon
     @BindView(R.id.account_detail_layout)
     RelativeLayout accountDetailLayout;
 
+    Activity activity;
+    @Inject
+    PersonalCenterPresenter presenter;
+
     @Override
     protected int getLayoutId() {
         return R.layout.personalcenter_act_layout;
@@ -41,7 +61,7 @@ public class PersonalCenterAct extends BaseActivity implements PersonalCenterCon
 
     @Override
     public void initView() {
-
+        activity = this;
         DaggerPersonalCenterComponent.builder()
                 .netComponent(SheepApp.get(this).getNetComponent())
                 .personalCenterModule(new PersonalCenterModule(this))
@@ -57,7 +77,7 @@ public class PersonalCenterAct extends BaseActivity implements PersonalCenterCon
 
     @Override
     public void initData() {
-
+        presenter.getUserInfo();
     }
 
     @Override
@@ -75,6 +95,7 @@ public class PersonalCenterAct extends BaseActivity implements PersonalCenterCon
             case R.id.my_all_price:
                 break;
             case R.id.withdrawal:
+                Jump2View.getInstance().goWithdrawal(activity, null);
                 break;
             case R.id.account_safe_layout:
                 break;
@@ -84,4 +105,30 @@ public class PersonalCenterAct extends BaseActivity implements PersonalCenterCon
                 break;
         }
     }
+
+    @Override
+    public void updateData2View(Object o) {
+        Log.e("---getInfo-", o.toString());
+        if(o == null){
+            return;
+        }
+        BaseMessage baseMessage = (BaseMessage) o;
+        UserEntity userEntity = JSON.parseObject(JSONObject.toJSONString(baseMessage.getData()), UserEntity.class);
+
+        try {
+            MyDbManager.getInstance().saveOrUpdateUser(userEntity);
+            userEntity = MyDbManager.getInstance().dbFindUser();
+            Log.e("------userEntity",userEntity.getNickname()+"|"+userEntity.getMobile()+"");
+        } catch (DbException e) {
+            e.printStackTrace();
+        }
+        myPrice.setText(userEntity.getBalance());
+        myAllPrice.setText(userEntity.getTotal_asset());
+
+    }
+
+    @Override
+    public void failData2View(Object o) {
+        G.showToast("网络错误");
+    }
 }

+ 106 - 14
app/src/main/java/com/sheep/gamegroup/view/activity/PhoneAct.java

@@ -1,6 +1,7 @@
 package com.sheep.gamegroup.view.activity;
 
 import android.app.Activity;
+import android.content.Intent;
 import android.os.Bundle;
 import android.support.v7.widget.AppCompatEditText;
 import android.text.TextUtils;
@@ -8,23 +9,36 @@ import android.util.Log;
 import android.view.View;
 import android.widget.TextView;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.di.components.DaggerPhoneComponent;
 import com.sheep.gamegroup.di.modules.PhoneModule;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.LoginEntity;
+import com.sheep.gamegroup.model.entity.UserEntity;
+import com.sheep.gamegroup.presenter.PersonalCenterPresenter;
 import com.sheep.gamegroup.presenter.PhoneContract;
 import com.sheep.gamegroup.presenter.PhonePresenter;
+import com.sheep.gamegroup.util.ActivityManager;
+import com.sheep.gamegroup.util.MyDbManager;
 import com.sheep.gamegroup.util.SelfCountDownTimer;
 import com.sheep.gamegroup.util.XXTEA;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.base.BaseActivity;
+import com.sheep.jiuyan.samllsheep.page.LoginActivity;
+import com.sheep.jiuyan.samllsheep.page.MainActivity;
+import com.sheep.jiuyan.samllsheep.page.SplashActivity;
 import com.sheep.jiuyan.samllsheep.utils.G;
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
+
+import org.xutils.ex.DbException;
 
 import javax.inject.Inject;
 
 import butterknife.BindView;
 import butterknife.ButterKnife;
 import butterknife.OnClick;
-import go.kfzssafe.Kfzssafe;
 
 /**
  * Created by ljy on 2018/3/15.
@@ -63,7 +77,7 @@ public class PhoneAct extends BaseActivity implements PhoneContract.View {
                 .phoneModule(new PhoneModule(this))
                 .build()
         .inject(this);
-        testData();
+//        testData();
     }
 
     @Override
@@ -84,7 +98,7 @@ public class PhoneAct extends BaseActivity implements PhoneContract.View {
             @Override
             public void onTimerFinish() {
                 canGetCaptchaPhone = true;
-                phoneBtnCode.setText(getString(R.string.get_captcha)+1);
+                phoneBtnCode.setText(getString(R.string.get_captcha));
             }
         };
     }
@@ -99,7 +113,8 @@ public class PhoneAct extends BaseActivity implements PhoneContract.View {
         super.onCreate(savedInstanceState);
         // TODO: add setContentView(...) invocation
         ButterKnife.bind(this);
-        phoneEtAccount.setText("13688480841");
+        phoneEtAccount.setText("17628083502");
+        phoneEtCode.setText("123456");
     }
 
     @OnClick({R.id.phone_et_account, R.id.phone_et_code, R.id.phone_btn_code, R.id.phone_sure_tv})
@@ -170,6 +185,8 @@ public class PhoneAct extends BaseActivity implements PhoneContract.View {
         if(!checkCodeInput()){
             return;
         }
+
+        showProgress();
         phonePresenter.loginByCaptcha(etPhone, etCode);
     }
 
@@ -181,19 +198,94 @@ public class PhoneAct extends BaseActivity implements PhoneContract.View {
 
     @Override
     public void returnLogindata(Object o) {
+        hideProgress();
+        if(o == null){
+            return;
+        }
+        BaseMessage baseMessage = (BaseMessage) o;
+//        JSONObject a = JSON.parseObject(o.toString());
+        Log.e("------data",baseMessage.getData()+"");
+        LoginEntity loginEty = JSON.parseObject(baseMessage.getData().toString(), LoginEntity.class);
+        SpUtils.login(activity, loginEty.getToken());
+        try {
+            MyDbManager.getInstance().saveOrUpdateUser(loginEty.getUser());
+            UserEntity userEntity = MyDbManager.getInstance().dbFindUser();
+            Log.e("------userEntity",userEntity.getNickname()+"|"+userEntity.getMobile()+"");
+            G.showToast(userEntity.getNickname()+"|"+userEntity.getMobile());
+            goMain();
+        } catch (DbException e) {
+            e.printStackTrace();
+        }
         Log.e("---login_-", o.toString());
     }
 
+    @Override
+    public void loginFail(Object o) {
+        hideProgress();
+        G.showToast("登录失败" + "");
+//        testData();
+    }
+
+    private void goMain() {
+        Intent intent = new Intent(activity, PersonalCenterPresenter.class);
+        startActivity(intent);
+    }
+
     private void testData(){
-        String s1 = "523cbac3be1748ba65be01af9ca4412da011cc0196baf9fa54ce8d1f8b12b986";
-        String s2 = "2b08e160271fd9eeb8de2a7372782478425fe733e79b086fb4cb9353b793eaa6";
-
-        String e1 = "123123";
-        String d1 = "xxxx";
-//        String hexStr = HexUtils.bytes2HexStr(Kfzssafe.XByteEncode(e1.getBytes()));
-//        Log.e("j加密密1--", hexStr);
-//        Log.e("解密2--", XXTEA.Decrypt(hexStr, XXTEA.KEY));
-        Log.e("解密3--", XXTEA.Decrypt(s1, XXTEA.KEY));
-        Log.e("解密4--", XXTEA.Decrypt(s2, XXTEA.KEY));
+        try{
+            String data = "{\n" +
+                    "  \"data\": {\n" +
+                    "    \"token\": \"12@38948cb4b6e74079615b154a80e3054b\",\n" +
+                    "    \"user\": {\n" +
+                    "      \"id\": 12,\n" +
+                    "      \"mobile\": \"17628083502\",\n" +
+                    "      \"nickname\": \"17628083502\",\n" +
+                    "      \"balance\": 0,\n" +
+                    "      \"invitation_code\": \"076031871\",\n" +
+                    "      \"parent_code\": \"\",\n" +
+                    "      \"total_asset\": 0,\n" +
+                    "      \"last_login_time\": 1521280845,\n" +
+                    "      \"create_time\": 1521279330,\n" +
+                    "      \"update_time\": 1521279330,\n" +
+                    "      \"avatar\": \"\",\n" +
+                    "      \"access_token\": \"VOC1Qkg_R_KdbylyvvWwQA\",\n" +
+                    "      \"refresh_token\": \"ZPgcoYhPSYWaZ5m-ySVoKw\",\n" +
+                    "      \"open_id\": \"3135079\",\n" +
+                    "      \"real_name\": \"\",\n" +
+                    "      \"id_number\": \"\",\n" +
+                    "      \"bank_card\": \"\",\n" +
+                    "      \"total_withdraw\": 0,\n" +
+                    "      \"wx_openid\": \"\"\n" +
+                    "    }\n" +
+                    "  }\n" +
+                    "}";
+            String showStr = "登录失败";
+            Log.e("---login_-", data);
+            JSONObject a = JSON.parseObject(data);
+            Log.e("------data",a.get("data")+"");
+            LoginEntity loginEty = JSON.parseObject(a.get("data").toString(), LoginEntity.class);
+            SpUtils.login(activity, loginEty.getToken());
+            try {
+                MyDbManager.getInstance().saveOrUpdateUser(loginEty.getUser());
+                UserEntity userEntity = MyDbManager.getInstance().dbFindUser();
+                Log.e("------userEntity",userEntity.getNickname()+"|"+userEntity.getMobile()+"");
+                G.showToast(userEntity.getNickname()+"|"+userEntity.getMobile());
+            } catch (DbException e) {
+                e.printStackTrace();
+            }
+            showStr = "登录成功";
+//            String s1 = "523cbac3be1748ba65be01af9ca4412da011cc0196baf9fa54ce8d1f8b12b986";
+//            String s2 = "2b08e160271fd9eeb8de2a7372782478425fe733e79b086fb4cb9353b793eaa6";
+//
+//            String e1 = "123123";
+//            String d1 = "xxxx";
+////        String hexStr = HexUtils.bytes2HexStr(Kfzssafe.XByteEncode(e1.getBytes()));
+////        Log.e("j加密密1--", hexStr);
+//            Log.e("解密2--", XXTEA.bytes2HexStr(XXTEA.Encrypt(e1, XXTEA.KEY).getBytes("utf-8")));
+//            Log.e("解密3--", XXTEA.Decrypt(s1, XXTEA.KEY));
+//            Log.e("解密4--", XXTEA.Decrypt(s2, XXTEA.KEY));
+        }catch (Exception e){
+            e.printStackTrace();
+        }
     }
 }

+ 148 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/WithdrawalAct.java

@@ -0,0 +1,148 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.GridView;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.di.components.DaggerWithdrawalComponent;
+import com.sheep.gamegroup.di.modules.WithdrawalModule;
+import com.sheep.gamegroup.model.entity.GridViewEntity;
+import com.sheep.gamegroup.presenter.WithdrawalContract;
+import com.sheep.gamegroup.presenter.WithdrawalPresenter;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.view.adapter.WithdrawalAdapter;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.base.BaseActivity;
+import com.sheep.jiuyan.samllsheep.utils.G;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.inject.Inject;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+
+/**
+ * 提现
+ * Created by ljy on 2018/3/18.
+ */
+
+public class WithdrawalAct extends BaseActivity implements WithdrawalContract.View {
+    @BindView(R.id.withdrawal_change_tv)
+    TextView withdrawalChangeTv;
+    @BindView(R.id.withdrawal_greidview)
+    GridView withdrawalGreidview;
+    @BindView(R.id.withdrawal_sure)
+    TextView withdrawalSure;
+
+    Activity activity;
+    @Inject
+    WithdrawalPresenter presenter;
+
+    private WithdrawalAdapter adapter;
+    ArrayList<Object> listData = new ArrayList<>();
+    private int select;
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.withdrawal_layout;
+    }
+
+    @Override
+    public void initView() {
+        ButterKnife.bind(this);
+        activity = this;
+        DaggerWithdrawalComponent.builder()
+                .netComponent(SheepApp.get(this).getNetComponent())
+                .withdrawalModule(new WithdrawalModule(this))
+                .build()
+                .inject(this);
+        adapter = new WithdrawalAdapter(activity, assemblyData());
+        withdrawalGreidview.setAdapter(adapter);
+        adapter.notifyDataSetChanged();
+        withdrawalGreidview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+            @Override
+            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+                select = position;
+                for(int i=0;i<listData.size();i++){
+                    if(position == i){
+                        ((GridViewEntity)listData.get(i)).setSelectState(true);
+                    }else {
+                        ((GridViewEntity)listData.get(i)).setSelectState(false);
+
+                    }
+                    adapter.notifyDataSetChanged();
+                }
+            }
+        });
+    }
+
+    @Override
+    public void initListener() {
+
+    }
+
+    @Override
+    public void initData() {
+    }
+
+
+    @OnClick({R.id.withdrawal_change_tv, R.id.withdrawal_sure})
+    public void onViewClicked(View view) {
+        switch (view.getId()) {
+            case R.id.withdrawal_change_tv:
+                Jump2View.getInstance().goBindOrChangeWeixinView(activity, null);
+                break;
+            case R.id.withdrawal_sure:
+                doWithdrawal();
+                break;
+        }
+    }
+
+    private void doWithdrawal() {
+//        String price1 = ((GridViewEntity)withdrawalGreidview.getSelectedItem()).getValue();
+        String price = ((GridViewEntity)listData.get(select)).getValue();
+        if(TextUtils.isEmpty(withdrawalGreidview.getSelectedItem()+"")){
+            G.showToast("请选择金额");
+            return;
+        }
+
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("price", withdrawalGreidview.getSelectedItem());
+        showProgress();
+        presenter.goWithdrawal(jsonObject);
+    }
+
+    /**
+     * 组装 adapter 数据
+     */
+    private ArrayList<Object> assemblyData(){
+        listData.clear();
+        listData.add(new GridViewEntity(true,10+""));
+        listData.add(new GridViewEntity(false,30+""));
+        listData.add(new GridViewEntity(false,50+""));
+        listData.add(new GridViewEntity(false,100+""));
+        listData.add(new GridViewEntity(false,500+""));
+        listData.add(new GridViewEntity(false,1000+""));
+        return listData;
+    }
+
+    @Override
+    public void failData(Object o) {
+        hideProgress();
+    }
+
+    @Override
+    public void updateView(Object o) {
+        hideProgress();
+        Jump2View.getInstance().goWithdrawalResultview(activity, o);
+    }
+}

+ 73 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/WithdrawalResultAct.java

@@ -0,0 +1,73 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.sheep.gamegroup.di.components.DaggerWithdrawalResultComponent;
+import com.sheep.gamegroup.di.modules.WithdrawalResultModule;
+import com.sheep.gamegroup.presenter.WithdrawalResultContract;
+import com.sheep.gamegroup.presenter.WithdrawalResultPresenter;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.base.BaseActivity;
+
+import javax.inject.Inject;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+
+/**
+ * 提现结果页面
+ * Created by ljy on 2018/3/18.
+ */
+
+public class WithdrawalResultAct extends BaseActivity implements WithdrawalResultContract.View {
+    Activity activity;
+    @BindView(R.id.withdrawal_image_iv)
+    ImageView withdrawal_image_iv;
+    @BindView(R.id.withdrawal_success_sure_tv)
+    TextView withdrawalSuccessSureTv;
+
+    @Inject
+    WithdrawalResultPresenter presenter;
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.withdrawal_success_layotu;
+    }
+
+    @Override
+    public void initView() {
+        activity = this;
+
+        DaggerWithdrawalResultComponent.builder()
+                .netComponent(SheepApp.get(this).getNetComponent())
+                .withdrawalResultModule(new WithdrawalResultModule(this))
+                .build()
+                .inject(this);
+    }
+
+    @Override
+    public void initListener() {
+
+    }
+
+    @Override
+    public void initData() {
+
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        // TODO: add setContentView(...) invocation
+        ButterKnife.bind(this);
+    }
+
+    @OnClick(R.id.withdrawal_success_sure_tv)
+    public void onViewClicked() {
+    }
+}

+ 81 - 0
app/src/main/java/com/sheep/gamegroup/view/adapter/WithdrawalAdapter.java

@@ -0,0 +1,81 @@
+package com.sheep.gamegroup.view.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AbsListView;
+import android.widget.BaseAdapter;
+import android.widget.TextView;
+
+import com.sheep.gamegroup.model.entity.GridViewEntity;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.utils.G;
+
+import java.util.List;
+
+/**
+ * 提现下gridview的 adapter
+ * Created by ljy on 2018/3/18.
+ */
+
+public class WithdrawalAdapter extends BaseAdapter {
+    private Context context;
+    private List<Object> listData;
+
+    public WithdrawalAdapter(Context context, List<Object> listData) {
+        this.context = context;
+        this.listData = listData;
+    }
+
+    @Override
+    public int getCount() {
+        return listData.size();
+    }
+
+    @Override
+    public Object getItem(int position) {
+        return listData.get(position);
+    }
+
+    @Override
+    public long getItemId(int position) {
+        return 0;
+    }
+
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+        ViewHolder holder = null;
+        if (holder == null) {
+            holder = new ViewHolder();
+            convertView = LayoutInflater.from(context).inflate(R.layout.withdrawal_gridview_item, null);
+
+            holder.priceTv = convertView.findViewById(R.id.item_tv);
+
+            // 获取屏幕宽度
+            int W = G.WIDTH <G.HEIGHT ? G.WIDTH : G.HEIGHT;
+            int cricleRadius = W / 3  -50;
+            int h = cricleRadius  / 3;
+            convertView.setLayoutParams(new AbsListView.LayoutParams(cricleRadius, h));
+            convertView.setPadding(15,15,0,20);
+            convertView.setTag(holder);
+        }else {
+            holder = (ViewHolder) convertView.getTag();
+        }
+        GridViewEntity priceShow = (GridViewEntity) getItem(position);
+        if (priceShow.isSelectState()){
+            convertView.setBackground(context.getResources().getDrawable(R.drawable.sp_bg_gradient_rectangle_blue));
+        }else{
+
+            convertView.setBackground(context.getResources().getDrawable(R.drawable.sp_rectangle_bg_gray_radius));
+        }
+
+        holder.priceTv.setText(priceShow.getValue() +"元");
+
+        return convertView;
+    }
+
+    class ViewHolder{
+        TextView priceTv;
+    }
+}

+ 5 - 4
app/src/main/java/com/sheep/jiuyan/samllsheep/page/SplashActivity.java

@@ -13,7 +13,9 @@ import android.widget.Toast;
 import com.mylhyl.acp.Acp;
 import com.mylhyl.acp.AcpListener;
 import com.mylhyl.acp.AcpOptions;
+import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.view.activity.LoginAct;
+import com.sheep.gamegroup.view.activity.PersonalCenterAct;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.base.BaseActivity;
 import com.sheep.jiuyan.samllsheep.utils.ClassFileHelper;
@@ -84,14 +86,13 @@ public class SplashActivity extends BaseActivity {
 
 
     private  void  goMain(){
+        SpUtils.login(getApplicationContext(), "12@1c421522bb7e44d3cd6a8d59a54df182");
         String openId = SpUtils.getOpenId(getApplicationContext());
         if (!TextUtils.isEmpty(openId)) {
-            Intent intent = new Intent(SplashActivity.this, MainActivity.class);
-            startActivity(intent);
+            Jump2View.getInstance().goPersonnalCenterView(SplashActivity.this, null);
             finish();
         } else {
-            Intent intent = new Intent(SplashActivity.this, LoginAct.class);
-            startActivity(intent);
+            Jump2View.getInstance().goLoginView(SplashActivity.this, null);
             finish();
         }
 

+ 7 - 0
app/src/main/res/drawable/radidius_bg_tv_blue_gray_selector.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:state_selected="true" android:drawable="@drawable/sp_bg_gradient_rectangle_blue"/>
+    <item android:state_selected="false" android:drawable="@drawable/sp_rectangle_bg_gray_radius"/>
+    <item android:drawable="@drawable/sp_rectangle_bg_gray_radius"/>
+</selector>

+ 1 - 1
app/src/main/res/drawable/sp_bg_gradient_rectangle_blue.xml

@@ -10,6 +10,6 @@
         android:endColor="@color/blue_end"/>
 
     <corners
-        android:radius="@dimen/radius_100"/>
+        android:radius="@dimen/radius_25"/>
 
 </shape>

+ 11 - 0
app/src/main/res/drawable/sp_rectangle_bg_gray_radius.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <solid
+        android:color="@color/txt_black_818181"/>
+
+    <corners
+        android:radius="@dimen/radius_25"/>
+
+</shape>

+ 49 - 1
app/src/main/res/layout/bind_change_weixin_layout.xml

@@ -1,6 +1,54 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    android:background="@color/bg_gray">
+
+    <include
+        layout="@layout/title"/>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="@drawable/sp_rectangle_bg_white_radius"
+        android:orientation="vertical"
+        android:layout_margin="@dimen/content_padding"
+        android:padding="@dimen/content_padding_15">
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/bind_weixin_notice_text"
+            style="@style/nomal_txt_style_12"
+            android:layout_marginBottom="@dimen/content_padding_15"
+            android:layout_marginLeft="@dimen/content_padding_small"/>
+        <android.support.v7.widget.AppCompatEditText
+            android:id="@+id/weinxin_et_account"
+            style="@style/edt_style"
+            android:inputType="number"
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/edt_heigh_default"
+            android:gravity="center_vertical"
+            android:hint="@string/input_your_captcha"
+            android:maxLength="11"/>
+    </LinearLayout>
+
+    <TextView
+        android:id="@+id/bindweixin_sure_text"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        style="@style/txt_big_btn_style"
+        android:text="确 定"/>
+
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        style="@style/hint_txt_style"
+        android:text="@string/bind_weixin_withdrawal_notice_text"
+        android:layout_marginTop="@dimen/content_padding_small"
+        android:layout_marginBottom="@dimen/content_padding_30"
+        android:layout_marginLeft="@dimen/content_padding_30"
+        android:layout_marginRight="@dimen/content_padding_30"/>
+
 
 </LinearLayout>

+ 15 - 0
app/src/main/res/layout/withdrawal_gridview_item.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/item_tv"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:minHeight="@dimen/view_size_35"
+    android:gravity="center"
+    android:text="10元"
+    android:textSize="@dimen/text_size_3"
+    android:textColor="@color/txt_black"
+    android:padding="@dimen/content_padding_small"
+    android:background="@drawable/radidius_bg_tv_blue_gray_selector"
+    android:layout_marginBottom="@dimen/content_padding_15">
+
+</TextView>

+ 118 - 107
app/src/main/res/layout/withdrawal_layout.xml

@@ -8,117 +8,128 @@
     android:background="@color/bg_gray">
     <include
         layout="@layout/title"/>
-
-    <android.support.constraint.ConstraintLayout
+    <ScrollView
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:background="@drawable/sp_rectangle_bg_white_radius"
-        android:padding="@dimen/content_padding_20"
-        android:layout_margin="@dimen/content_padding_15">
-        <TextView
-            android:id="@+id/withdrawal_wx_pre_notice_tv"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="当前的提现绑定微信号为"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintLeft_toLeftOf="parent"
-            android:textColor="@color/txt_gray_929292"
-            android:textSize="@dimen/text_size_12" />
-        <TextView
-            android:id="@+id/weixin_name_tv"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="微信帐号"
-            app:layout_constraintTop_toBottomOf="@+id/withdrawal_wx_pre_notice_tv"
-            app:layout_constraintLeft_toLeftOf="@+id/withdrawal_wx_pre_notice_tv"
-            android:layout_marginLeft="36dp"
-            android:layout_marginTop="6dp"
-            android:textSize="@dimen/text_size_3"
-            android:textColor="@color/txt_black_404040"
-            android:layout_marginStart="36dp"/>
-        <TextView
-            android:id="@+id/withdrawal_change_tv"
-            android:layout_width="wrap_content"
+        android:scrollbars="none">
+        <LinearLayout
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:text="更换"
-            app:layout_constraintTop_toBottomOf="@+id/withdrawal_wx_pre_notice_tv"
-            app:layout_constraintStart_toEndOf="@id/weixin_name_tv"
-            app:layout_constraintLeft_toLeftOf="@+id/weixin_name_tv"
-            android:layout_marginTop="6dp"
-            android:textSize="@dimen/text_size_12"
-            android:textColor="@color/txt_bule"
-            android:layout_marginStart="17dp"/>
-        <TextView
-            android:id="@+id/line_one"
-            android:layout_width="0dp"
-            android:layout_height="1dp"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/weixin_name_tv"
-            android:background="@color/txt_gray_929292"
-            android:layout_marginTop="17dp"/>
+            android:orientation="vertical">
+            <android.support.constraint.ConstraintLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:background="@drawable/sp_rectangle_bg_white_radius"
+                android:padding="@dimen/content_padding_20"
+                android:layout_margin="@dimen/content_padding_15">
+                <TextView
+                    android:id="@+id/withdrawal_wx_pre_notice_tv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="当前的提现绑定微信号为"
+                    app:layout_constraintRight_toRightOf="parent"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    android:textColor="@color/txt_gray_929292"
+                    android:textSize="@dimen/text_size_12" />
+                <TextView
+                    android:id="@+id/weixin_name_tv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="微信帐号"
+                    app:layout_constraintTop_toBottomOf="@+id/withdrawal_wx_pre_notice_tv"
+                    app:layout_constraintLeft_toLeftOf="@+id/withdrawal_wx_pre_notice_tv"
+                    android:layout_marginLeft="36dp"
+                    android:layout_marginTop="6dp"
+                    android:textSize="@dimen/text_size_3"
+                    android:textColor="@color/txt_black_404040"
+                    android:layout_marginStart="36dp"/>
+                <TextView
+                    android:id="@+id/withdrawal_change_tv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="更换"
+                    app:layout_constraintTop_toBottomOf="@+id/withdrawal_wx_pre_notice_tv"
+                    app:layout_constraintStart_toEndOf="@id/weixin_name_tv"
+                    app:layout_constraintLeft_toLeftOf="@+id/weixin_name_tv"
+                    android:layout_marginTop="6dp"
+                    android:textSize="@dimen/text_size_12"
+                    android:textColor="@color/txt_bule"
+                    android:layout_marginStart="17dp"/>
+                <TextView
+                    android:id="@+id/line_one"
+                    android:layout_width="0dp"
+                    android:layout_height="1dp"
+                    app:layout_constraintRight_toRightOf="parent"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    app:layout_constraintTop_toBottomOf="@+id/weixin_name_tv"
+                    android:background="@color/txt_gray_929292"
+                    android:layout_marginTop="17dp"/>
+
+                <TextView
+                    android:id="@+id/withdrawal_wx_bank_notice_tv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="微信绑定银行卡的姓名"
+                    app:layout_constraintRight_toRightOf="parent"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    android:textColor="@color/txt_gray_929292"
+                    android:textSize="@dimen/text_size_12"
+                    app:layout_constraintTop_toBottomOf="@+id/line_one"
+                    android:layout_marginTop="@dimen/content_padding_20"/>
+                <TextView
+                    android:id="@+id/withdrawal_real_name_tv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text=""
+                    android:hint="请输入真实姓名"
+                    app:layout_constraintTop_toBottomOf="@+id/withdrawal_wx_bank_notice_tv"
+                    app:layout_constraintRight_toRightOf="parent"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    android:layout_marginTop="6dp"
+                    android:textSize="@dimen/text_size_3"
+                    android:textColor="@color/txt_black_404040"/>
+                <TextView
+                    android:id="@+id/line_two"
+                    android:layout_width="0dp"
+                    android:layout_height="1dp"
+                    app:layout_constraintRight_toRightOf="parent"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    app:layout_constraintTop_toBottomOf="@+id/withdrawal_real_name_tv"
+                    android:background="@color/txt_gray_929292"
+                    android:layout_marginTop="17dp"/>
+
+                <TextView
+                    android:id="@+id/withdrawal_click_bindname_tv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="点我进行实名认证,以后提现都不用验证啦!"
+                    app:layout_constraintRight_toRightOf="parent"
+                    app:layout_constraintLeft_toLeftOf="parent"
+                    android:textColor="@color/txt_gray_929292"
+                    android:textSize="@dimen/text_size_12"
+                    app:layout_constraintTop_toBottomOf="@+id/line_two"
+                    android:layout_marginTop="@dimen/content_padding_20"/>
+                <com.sheep.gamegroup.util.MyGridview
+                    android:id="@+id/withdrawal_greidview"
+                    android:layout_height="wrap_content"
+                    android:layout_width="wrap_content"
+                    app:layout_constraintTop_toBottomOf="@+id/withdrawal_click_bindname_tv"
+                    tools:layout_editor_absoluteX="8dp"
+                    android:scrollbars="none"
+                    android:numColumns="3"
+                    android:layout_marginTop="@dimen/content_padding_20"
+                    android:visibility="visible"/>
+            </android.support.constraint.ConstraintLayout>
+            <TextView
+                android:id="@+id/withdrawal_sure"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                style="@style/txt_big_btn_style"
+                android:text="确 定"
+                android:background="@drawable/sp_bg_gradient_rectqangle_yellow"/>
+        </LinearLayout>
+    </ScrollView>
 
-        <TextView
-            android:id="@+id/withdrawal_wx_bank_notice_tv"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="微信绑定银行卡的姓名"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintLeft_toLeftOf="parent"
-            android:textColor="@color/txt_gray_929292"
-            android:textSize="@dimen/text_size_12"
-            app:layout_constraintTop_toBottomOf="@+id/line_one"
-            android:layout_marginTop="@dimen/content_padding_20"/>
-        <TextView
-            android:id="@+id/withdrawal_real_name_tv"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text=""
-            android:hint="请输入真实姓名"
-            app:layout_constraintTop_toBottomOf="@+id/withdrawal_wx_bank_notice_tv"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintLeft_toLeftOf="parent"
-            android:layout_marginTop="6dp"
-            android:textSize="@dimen/text_size_3"
-            android:textColor="@color/txt_black_404040"/>
-        <TextView
-            android:id="@+id/line_two"
-            android:layout_width="0dp"
-            android:layout_height="1dp"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/withdrawal_real_name_tv"
-            android:background="@color/txt_gray_929292"
-            android:layout_marginTop="17dp"/>
 
-        <TextView
-            android:id="@+id/withdrawal_click_bindname_tv"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="点我进行实名认证,以后提现都不用验证啦!"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintLeft_toLeftOf="parent"
-            android:textColor="@color/txt_gray_929292"
-            android:textSize="@dimen/text_size_12"
-            app:layout_constraintTop_toBottomOf="@+id/line_two"
-            android:layout_marginTop="@dimen/content_padding_20"/>
-        <GridView
-            android:id="@+id/withdrawal_greidview"
-            android:layout_height="wrap_content"
-            android:layout_width="wrap_content"
-            app:layout_constraintTop_toBottomOf="@+id/withdrawal_click_bindname_tv"
-            tools:layout_editor_absoluteX="8dp"
-            android:scrollbars="none"
-            android:numColumns="3"
-            android:layout_marginTop="@dimen/content_padding_20"
-            android:visibility="gone"/>
-    </android.support.constraint.ConstraintLayout>
-    <TextView
-        android:id="@+id/withdrawal_sure"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        style="@style/txt_big_btn_style"
-        android:text="确 定"
-        android:background="@drawable/sp_bg_gradient_rectqangle_yellow"/>
 
 </LinearLayout>

+ 1 - 0
app/src/main/res/layout/withdrawal_success_layotu.xml

@@ -8,6 +8,7 @@
         layout="@layout/title"/>
 
     <ImageView
+        android:id="@+id/withdrawal_image_iv"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:src="@mipmap/yellow_yang"

+ 3 - 0
app/src/main/res/values/common.xml

@@ -71,6 +71,7 @@
     <dimen name="content_padding_10">10dp</dimen>
     <dimen name="content_padding_15">15dp</dimen>
     <dimen name="content_padding_20">20dp</dimen>
+    <dimen name="content_padding_30">30dp</dimen>
     <dimen name="content_padding_40">40dp</dimen>
     <dimen name="content_padding_80">80dp</dimen>
 
@@ -91,6 +92,8 @@
         <dimen name="radius_15">15dp</dimen>
         <dimen name="radius_5">5dp</dimen>
 
+    <dimen name="view_size_35">35dp</dimen>
+    <dimen name="view_size_40">40dp</dimen>
     <dimen name="view_size_45">45dp</dimen>
 
 

+ 5 - 1
app/src/main/res/values/gamegroup_styles.xml

@@ -11,6 +11,10 @@
         <item name="android:textSize">20dp</item>
     </style>
 
+    <style name="nomal_txt_style_12">
+        <item name="android:textSize">@dimen/text_size_12</item>
+        <item name="android:textColor">@color/black_444444</item>
+    </style>
     <style name="nomal_txt_style">
         <item name="android:textSize">@dimen/text_size_3</item>
         <item name="android:textColor">@color/black_444444</item>
@@ -53,7 +57,7 @@
         <item name="android:textSize">@dimen/text_size_5</item>
         <item name="android:textColor">@color/txt_black</item>
         <item name="android:gravity">center</item>
-        <item name="android:layout_margin">@dimen/content_padding_small</item>
+        <item name="android:layout_margin">@dimen/content_padding</item>
         <item name="android:background">@drawable/sp_bg_gradient_rectqangle_yellow</item>
     </style>
 </resources>

+ 2 - 0
app/src/main/res/values/strings.xml

@@ -14,4 +14,6 @@
     <integer name="size_phone_number">11</integer>
     <string name="toast_warning_phone_number_size">手机号码为11位</string>
     <string name="toast_warning_phone_number_error">手机号码为纯数字</string>
+    <string name="bind_weixin_notice_text">请用需要绑定的微信号关注微信公众号"好玩",在公众号中点击"微信验证码"获取验证码并填入下方</string>
+    <string name="bind_weixin_withdrawal_notice_text">你的每次收入提现,我们都会通过微信的企业商户入账功能将收入实时入账到绑定微信号的微信零钱上</string>
 </resources>