Ver código fonte

添加绑定手机并注册的接口;添加领取福利对话框等

zengjiebin 7 anos atrás
pai
commit
20d1d5c329

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

@@ -199,6 +199,9 @@
         <activity android:name="com.sheep.gamegroup.view.activity.ChangeTelAct"
             android:screenOrientation="portrait"
             android:launchMode="singleTask"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.ActBindMobileRegister"
+            android:screenOrientation="portrait"
+            android:launchMode="singleTask"/>
         <activity android:name="com.sheep.gamegroup.view.activity.TaskDetailAct"
             android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.DialogToastAct"

+ 16 - 0
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -239,6 +239,22 @@ public interface ApiService {
      */
     @POST("app/user/sms_for_bind_mobile")
     Observable<BaseMessage> smsBindMobile(@Body JSONObject jsonObject);
+    /**
+     * 使用第三方登录时,未找到该qq对应的账号,不再直接创建账号,会先绑定手机号来注册新账号
+     * captcha	string
+     验证码 第二步需要
+     mobile	string
+     platform	string
+     登录返回来的platform
+     scope	string
+     传kfzs为官包 传空为邀请包
+     step	string
+     步骤:first发验证码 second绑定
+     token	string
+     登录返回来的token
+     */
+    @POST("app/auth/bind_mobile")
+    Observable<BaseMessage> bindMobileRegister(@Body JSONObject jsonObject);
 
     /**
      * 修改任务进度

+ 21 - 1
app/src/main/java/com/sheep/gamegroup/model/entity/LoginEntity.java

@@ -1,12 +1,16 @@
 package com.sheep.gamegroup.model.entity;
 
+import java.io.Serializable;
+
 /**
  * 手机登录返回数据
  * Created by ljy on 2018/3/17.
  */
 
-public class LoginEntity {
+public class LoginEntity implements Serializable{
     private String token;//11@9667453894253cd1f3e9beec1bb063e9
+    private String code;
+    private String platform;
     private UserEntity user;
 
     public String getToken() {
@@ -24,4 +28,20 @@ public class LoginEntity {
     public void setUser(UserEntity user) {
         this.user = user;
     }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getPlatform() {
+        return platform;
+    }
+
+    public void setPlatform(String platform) {
+        this.platform = platform;
+    }
 }

+ 2 - 0
app/src/main/java/com/sheep/gamegroup/model/util/SheepSubscriber.java

@@ -12,6 +12,7 @@ import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.NetUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 
 import rx.Subscriber;
 
@@ -52,6 +53,7 @@ public abstract class SheepSubscriber<T> extends Subscriber<T> {
                 ExceptionHandle.ResponeThrowable throwable = ExceptionHandle.handleException(e);
                 //token 过期
                 if(throwable.code == 401){
+                    SpUtils.saveToken(SheepApp.getInstance(), "");
                     Jump2View.getInstance().gotoLoginAgain();
                     return;
                 }

+ 8 - 0
app/src/main/java/com/sheep/gamegroup/presenter/LoginPresenter.java

@@ -9,6 +9,7 @@ import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.ChannelContent;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.FastJsonUtils;
+import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.PreferenceUtils;
 import com.sheep.gamegroup.util.TestUtil;
@@ -84,6 +85,13 @@ public class LoginPresenter implements LoginContract.Presenter {
         LoginEntity loginEty = null;
         if(baseMessage!=null){
             loginEty =FastJsonUtils.toBean( JSONObject.toJSONString(baseMessage.getData()),LoginEntity.class);
+            if(loginEty.getCode() != null){
+                switch (loginEty.getCode()){
+                    case "bind_mobile":
+                        Jump2View.getInstance().goBindPhoneRegister(SheepApp.getInstance(), loginEty);
+                        return;
+                }
+            }
             SpUtils.saveToken(SheepApp.mContext, loginEty.getToken());
             DataUtil.getInstance().setUserEntity(loginEty.getUser());
             LogUtil.logI("token--------"+loginEty.getToken());

+ 0 - 5
app/src/main/java/com/sheep/gamegroup/util/DataUtil.java

@@ -92,7 +92,6 @@ public class DataUtil {
      * @return
      */
     public String getInvitationCode() {
-        UserEntity userEntity = DataUtil.getInstance().getUserEntity();
         if (userEntity != null && userEntity.getInvitation_code() != null)
             return userEntity.getInvitation_code();
         return "";
@@ -104,7 +103,6 @@ public class DataUtil {
      * @return
      */
     public String getUserId() {
-        UserEntity userEntity = DataUtil.getInstance().getUserEntity();
         if (userEntity != null && userEntity.getId() != null)
             return userEntity.getId();
         return "";
@@ -116,7 +114,6 @@ public class DataUtil {
      * @return
      */
     public String getUserParentCode() {
-        UserEntity userEntity = DataUtil.getInstance().getUserEntity();
         if (userEntity != null && userEntity.getParent_code() != null)
             return userEntity.getParent_code();
         return "";
@@ -128,7 +125,6 @@ public class DataUtil {
      * @return
      */
     public String getUserMobile() {
-        UserEntity userEntity = DataUtil.getInstance().getUserEntity();
         if (userEntity != null && userEntity.getMobile() != null)
             return userEntity.getMobile();
         return "";
@@ -145,7 +141,6 @@ public class DataUtil {
      * @return
      */
     public String getUserWxOpenId() {
-        UserEntity userEntity = DataUtil.getInstance().getUserEntity();
         if (userEntity != null && userEntity.getWx_openid() != null)
             return userEntity.getWx_openid();
         return "";

+ 16 - 1
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -23,6 +23,7 @@ import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.DialogEntity;
 import com.sheep.gamegroup.model.entity.FindApp;
 import com.sheep.gamegroup.model.entity.FindItem;
+import com.sheep.gamegroup.model.entity.LoginEntity;
 import com.sheep.gamegroup.model.entity.NewbieTask;
 import com.sheep.gamegroup.model.entity.NewbieTaskRecord;
 import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
@@ -33,6 +34,7 @@ import com.sheep.gamegroup.model.entity.WebviewEntity;
 import com.sheep.gamegroup.model.entity.XianWanEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.view.activity.ActAudit;
+import com.sheep.gamegroup.view.activity.ActBindMobileRegister;
 import com.sheep.gamegroup.view.activity.ActCreditCardTaskList;
 import com.sheep.gamegroup.view.activity.ActCreditCardWeb;
 import com.sheep.gamegroup.view.activity.ActDownloadWelfareList;
@@ -639,13 +641,26 @@ public class Jump2View {
      */
     public void goBindPhone(Context context, Object o){
         Intent i = new Intent(context, ChangeTelAct.class);
-        if(o != null && o instanceof Integer)
+        if(o instanceof Integer){
             i.putExtra("where_from", (Integer) o);
+        }
         if(!(context instanceof Activity))
             i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         context.startActivity(i);
     }
     /**
+     * 绑定手机页面并注册第三方账号
+     * @param context
+     * @param loginEntity
+     */
+    public void goBindPhoneRegister(Context context, LoginEntity loginEntity){
+        Intent intent = new Intent(context, ActBindMobileRegister.class);
+        intent.putExtra(LoginEntity.class.getSimpleName(), loginEntity);
+        if(!(context instanceof Activity))
+            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        context.startActivity(intent);
+    }
+    /**
      * 跳转到非wifi网络提示
      * @param context
      * @param o

+ 66 - 4
app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java

@@ -53,6 +53,7 @@ import com.sheep.gamegroup.model.entity.GameAccountEntity;
 import com.sheep.gamegroup.model.entity.HomeListEntity;
 import com.sheep.gamegroup.model.entity.PayEntity;
 import com.sheep.gamegroup.model.entity.RobTask;
+import com.sheep.gamegroup.model.entity.Welfare;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.glide.RoundedCornersTransformation;
 import com.sheep.gamegroup.view.activity.PersonalInfoAct;
@@ -99,7 +100,6 @@ public class ViewUtil {
 
     public static final int REQUEST_CODE_TASK_LIST = 110;
     private static ViewUtil viewUtil;
-    static int result = 0;
     static RobTask mRobTask;
 
     public static ViewUtil newInstance() {
@@ -534,6 +534,67 @@ public class ViewUtil {
         }
 
     }
+    /**
+     * 领取福利成功的对话框
+     *
+     * @param activity
+     * @param welfare
+     */
+    public static void shareGetWelfareDialog(final Activity activity, final Welfare welfare) {
+        View dialog_parent = View.inflate(activity, R.layout.dialog_parent, null);
+        final AlertDialog dialog = new AlertDialog.Builder(activity, R.style.MyDialogActivityTheme)
+                .setView(dialog_parent)
+                .create();
+        TextView dialog_title = dialog_parent.findViewById(R.id.dialog_title);
+        View dialog_close = dialog_parent.findViewById(R.id.dialog_close);
+        LinearLayout dialog_center_ll = dialog_parent.findViewById(R.id.dialog_center_ll);
+        View view = LayoutInflater.from(activity).inflate(R.layout.x_get_welfare_dialog, dialog_center_ll, true);
+        dialog_title.setText("领取成功");
+
+        TextView dialog_btn_left = view.findViewById(R.id.dialog_btn_left);
+        TextView dialog_btn_right = view.findViewById(R.id.dialog_btn_right);
+        dialog_btn_left.setText("关闭");
+        dialog_btn_right.setText("启动游戏");
+
+        final TextView get_welfare_code_tv = view.findViewById(R.id.get_welfare_code_tv);
+        TextView get_welfare_copy_tv = view.findViewById(R.id.get_welfare_copy_tv);
+        TextView get_welfare_content_tv = view.findViewById(R.id.get_welfare_content_tv);
+        //TODO 设置内容与兑换码
+
+        get_welfare_copy_tv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                StringUtils.CopyText(get_welfare_code_tv.getText().toString());
+            }
+        });
+
+        dialog_btn_right.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                dialog.dismiss();
+                //TODO 启动游戏
+            }
+        });
+        dialog_btn_left.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                dialog.dismiss();
+            }
+        });
+        dialog_close.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                dialog.dismiss();
+            }
+        });
+
+        try {
+            dialog.show();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
 
     /**
      * 获取一个 View 的缓存视图
@@ -1298,7 +1359,8 @@ public class ViewUtil {
     public void showGridviewStatues(Context context, TextView textView, HomeListEntity entity) {
         textView.setVisibility(View.INVISIBLE);
 
-        int padding = textView.getContext().getResources().getDimensionPixelSize(R.dimen.content_padding_2);
+        int padding1 = textView.getContext().getResources().getDimensionPixelSize(R.dimen.content_padding_1);
+        int padding2 = textView.getContext().getResources().getDimensionPixelSize(R.dimen.content_padding_2);
         switch (entity.getTag()) {
             default:
 
@@ -1308,14 +1370,14 @@ public class ViewUtil {
                 textView.setBackgroundResource(R.drawable.shape_red_stroke_rectangle_no_lb);
                 textView.setTextColor(context.getResources().getColor(R.color.red_FD2D54));
                 textView.setText("现金");
-                textView.setPadding( padding, padding,  padding, padding);
+                textView.setPadding( padding2, padding1,  padding2, padding1);
                 break;
             case 4:
                 textView.setVisibility(View.VISIBLE);
                 textView.setBackgroundResource(R.drawable.shape_red_f07422_stroke_retangle_no_lb);
                 textView.setTextColor(context.getResources().getColor(R.color.red_F07422));
                 textView.setText("活跃");
-                textView.setPadding( padding, padding,  padding, padding);
+                textView.setPadding( padding2, padding1,  padding2, padding1);
                 break;
         }
 

+ 192 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActBindMobileRegister.java

@@ -0,0 +1,192 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.app.Activity;
+import android.support.v7.widget.AppCompatEditText;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.LoginEntity;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.ChannelContent;
+import com.sheep.gamegroup.util.GlideImageLoader;
+import com.sheep.gamegroup.util.SelfCountDownTimer;
+import com.sheep.gamegroup.util.StringUtils;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.G;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import butterknife.BindView;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+/**
+ * Created by ljy on 2018/3/27.
+ */
+
+public class ActBindMobileRegister extends BaseActivity {
+
+    @BindView(R.id.bind_mobile_register_phone_iv)
+    ImageView bindMobileRegisterPhoneIv;
+    @BindView(R.id.bind_mobile_register_phone_et)
+    AppCompatEditText bindMobileRegisterPhoneEt;
+    @BindView(R.id.bind_mobile_register_code_iv)
+    ImageView bindMobileRegisterCodeIv;
+    @BindView(R.id.bind_mobile_register_code_et)
+    AppCompatEditText bindMobileRegisterCodeEt;
+    @BindView(R.id.bind_mobile_register_code_tv)
+    TextView bind_mobile_register_code_tv;
+    private Activity activity;
+
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.act_bind_mobile_register;
+    }
+
+    @Override
+    public void initView() {
+        activity = this;
+        GlideImageLoader.setImage(bindMobileRegisterPhoneIv, "http://cdngame.kuaifazs.com/phone_icon_iv.png");
+        GlideImageLoader.setImage(bindMobileRegisterCodeIv, "http://cdngame.kuaifazs.com/code_icon_iv.png");
+        TitleBarUtils.getInstance()
+                .setTitle(this, "绑定手机号")
+                .setTitleFinish(this, new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        finish();
+                    }
+                });
+    }
+
+    @Override
+    public void initListener() {
+        selfCountDownTimer = new SelfCountDownTimer(60 * 1000, 1000, SelfCountDownTimer.FULL_SECOND) {
+            @Override
+            public void onTimerRest() {
+                bind_mobile_register_code_tv.setText(getString(R.string.get_captcha));
+                bind_mobile_register_code_tv.setEnabled(true);
+            }
+
+            @Override
+            public void onTimerTick(long millisUntilFinished, int countTime) {
+                String textStr = countTime + " s";
+                bind_mobile_register_code_tv.setText(textStr);
+            }
+
+            @Override
+            public void onTimerFinish() {
+                selfCountDownTimer.reset(SelfCountDownTimer.FULL_SECOND);
+            }
+        };
+    }
+
+    private LoginEntity loginEntity;
+    @Override
+    public void initData() {
+        loginEntity = (LoginEntity) getIntent().getSerializableExtra(LoginEntity.class.getSimpleName());
+        if(loginEntity == null)//必须传入LoginEntity才能保证正常运行
+            finish();
+    }
+
+    private SelfCountDownTimer selfCountDownTimer;
+    /**
+     * 获取验证码
+     * captcha	string
+     验证码 第二步需要
+     mobile	string
+     platform	string
+     登录返回来的platform
+     scope	string
+     传kfzs为官包 传空为邀请包
+     step	string
+     步骤:first发验证码 second绑定
+     token	string
+     登录返回来的token
+     * @param view
+     */
+    public void getCaptcha(View view) {
+        bind_mobile_register_code_tv.setEnabled(false);
+        //检查手机号
+        final String mobile = bindMobileRegisterPhoneEt.getText().toString().trim();
+        if(!StringUtils.isMobile(mobile)){
+            G.showToast("请填写正确的手机号!");
+            return;
+        }
+        //提交数据获取验证码
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("mobile", mobile);
+        jsonObject.put("platform", loginEntity.getPlatform());
+        jsonObject.put("scope", ChannelContent.getInstance().getChannel_name());
+        jsonObject.put("step", "first");
+        jsonObject.put("token", loginEntity.getToken());
+        SheepApp.getInstance().getNetComponent().getApiService().bindMobileRegister(jsonObject)
+                        .subscribeOn(Schedulers.io())
+                        .observeOn(AndroidSchedulers.mainThread())
+                        .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                            @Override
+                            public void onNext(BaseMessage baseMessage) {
+                                mMobile = mobile;
+                                selfCountDownTimer.start();
+                            }
+
+                            @Override
+                            public void onError(BaseMessage baseMessage) {
+                                G.showToast(baseMessage);
+                                bind_mobile_register_code_tv.setEnabled(true);
+                            }
+                        });
+    }
+    private String mMobile;//获取验证码成功后得到手机号
+    /**
+     * 提交
+     * @param view
+     */
+    public void toCommit(View view) {
+        //检查验证码
+        final String captcha = bindMobileRegisterCodeEt.getText().toString().trim();
+        if(TextUtils.isEmpty(captcha)){
+            G.showToast("验证码不能为空!");
+            return;
+        }
+        if(captcha.length() != 6){
+            G.showToast(getString(R.string.toast_warning_phone_captcha_image_code_size));
+            return;
+        }
+        //提交数据注册手机号并绑定第三方账号
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("captcha", captcha);
+        jsonObject.put("mobile", mMobile);
+        jsonObject.put("platform", loginEntity.getPlatform());
+        jsonObject.put("scope", ChannelContent.getInstance().getChannel_name());
+        jsonObject.put("step", "second");
+        jsonObject.put("token", loginEntity.getToken());
+        SheepApp.getInstance().getNetComponent().getApiService().bindMobileRegister(jsonObject)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        G.showToast(baseMessage);
+                    }
+                });
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        if(selfCountDownTimer != null){
+            selfCountDownTimer.cancel();
+        }
+    }
+}

+ 0 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/LoginAct.java

@@ -261,7 +261,6 @@ public class LoginAct extends BaseUMActivity implements LoginContract.View {
         }
     }
     private void goMain(String openId) {
-        LogUtil.logI("goMain--token----"+openId);
         SpUtils.saveToken(getApplicationContext(), openId);
         Jump2View.getInstance().goHomePageView(this, null);
         ActivityManager.getInstance().endActivity(LoginAct.class);

+ 9 - 1
app/src/main/java/com/sheep/gamegroup/view/adapter/DownloadWelfareAdapter.java

@@ -1,10 +1,12 @@
 package com.sheep.gamegroup.view.adapter;
 
+import android.app.Activity;
 import android.content.Context;
 import android.view.View;
 
 import com.sheep.gamegroup.model.entity.Welfare;
 import com.sheep.gamegroup.util.ViewHolder;
+import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.R;
 
 import java.util.List;
@@ -13,7 +15,7 @@ import java.util.List;
  * Created by realicing on 2018/8/28.
  * realicing@sina.com
  */
-public class DownloadWelfareAdapter extends AdbCommonRecycler<Welfare> {
+public class DownloadWelfareAdapter extends AdbCommonRecycler<Welfare> implements View.OnClickListener{
 
     public DownloadWelfareAdapter(Context context, List<Welfare> list) {
         super(context, list);
@@ -26,7 +28,13 @@ public class DownloadWelfareAdapter extends AdbCommonRecycler<Welfare> {
 
     @Override
     public void convert(ViewHolder holder, Welfare welfareCenter) {
+        holder.itemView.setOnClickListener(this);
         View item_download_welfare_line = holder.getView(R.id.item_download_welfare_line);
         item_download_welfare_line.setVisibility(holder.getAdapterPosition() + 1 == getItemCount() ? View.GONE : View.VISIBLE);
     }
+
+    @Override
+    public void onClick(View view) {
+        ViewUtil.shareGetWelfareDialog((Activity) context, null);
+    }
 }

+ 10 - 0
app/src/main/res/drawable/shape_blue_rectangle_15.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <stroke
+        android:width="1dp"
+        android:color="@color/blue_start" />
+
+    <corners android:radius="15dp" />
+
+</shape>

+ 119 - 0
app/src/main/res/layout/act_bind_mobile_register.xml

@@ -0,0 +1,119 @@
+<?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"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:background="@color/bg_gray"
+    android:orientation="vertical"
+    tools:context="com.sheep.gamegroup.view.activity.ActBindMobileRegister">
+
+    <include layout="@layout/title" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="12dp"
+            android:layout_marginRight="12dp"
+            android:layout_marginTop="@dimen/content_padding_13"
+            android:background="@drawable/x_shap_shadow_bg_rectgangle_white"
+            android:orientation="vertical">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_margin="@dimen/content_padding_small"
+                android:gravity="center_vertical"
+                android:orientation="horizontal">
+
+                <ImageView
+                    android:id="@+id/bind_mobile_register_phone_iv"
+                    android:layout_width="@dimen/icon_heigh_default"
+                    android:layout_height="@dimen/icon_heigh_default"
+                    android:layout_marginStart="9dp"
+                    android:src="@mipmap/icon" />
+
+                <android.support.v7.widget.AppCompatEditText
+                    android:id="@+id/bind_mobile_register_phone_et"
+                    style="@style/edt_style"
+                    android:layout_width="match_parent"
+                    android:layout_height="@dimen/edt_heigh_default"
+                    android:layout_marginStart="@dimen/content_padding_small"
+                    android:hint="请输入要绑定的手机号"
+                    android:inputType="phone"
+                    android:maxLength="11" />
+
+            </LinearLayout>
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="1px"
+                android:layout_marginLeft="15dp"
+                android:layout_marginRight="15dp"
+                android:background="@color/white_bg_line" />
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_margin="@dimen/content_padding_small"
+                android:gravity="center_vertical"
+                android:orientation="horizontal">
+
+                <ImageView
+                    android:id="@+id/bind_mobile_register_code_iv"
+                    android:layout_width="@dimen/icon_heigh_default"
+                    android:layout_height="@dimen/icon_heigh_default"
+                    android:layout_marginStart="9dp"
+                    android:src="@mipmap/icon" />
+
+                <android.support.v7.widget.AppCompatEditText
+                    android:id="@+id/bind_mobile_register_code_et"
+                    style="@style/edt_style"
+                    android:layout_width="0dp"
+                    android:layout_height="@dimen/edt_heigh_default"
+                    android:layout_marginStart="@dimen/content_padding_small"
+                    android:layout_weight="2"
+                    android:hint="请输入验证码"
+                    android:inputType="number"
+                    android:maxLength="6"
+                    android:textSize="@dimen/text_size_3" />
+
+                <TextView
+                    android:id="@+id/bind_mobile_register_code_tv"
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center|center_vertical"
+                    android:layout_marginLeft="@dimen/content_padding"
+                    android:layout_weight="1"
+                    android:gravity="center"
+                    android:text="@string/get_captcha"
+                    android:textColor="@color/txt_bule"
+                    android:onClick="getCaptcha"/>
+
+            </LinearLayout>
+        </LinearLayout>
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginBottom="@dimen/content_padding"
+            android:layout_marginStart="27dp"
+            android:layout_marginTop="@dimen/dp_10"
+            android:text="注意:为保证账号安全请验证你的手机号"
+            android:textColor="@color/black_666666"
+            android:textSize="13sp" />
+
+
+        <TextView
+            style="@style/style_button"
+            android:onClick="toCommit"
+            android:text="确 定" />
+
+    </LinearLayout>
+
+
+</LinearLayout>

+ 1 - 1
app/src/main/res/layout/dialog_parent_display.xml

@@ -20,7 +20,7 @@
             android:paddingStart="@dimen/content_padding_10"
             android:paddingEnd="@dimen/content_padding_10"
             android:orientation="vertical">
-            <include layout="@layout/x_msg_dialog"/>
+            <include layout="@layout/x_get_welfare_dialog"/>
         </LinearLayout>
         <TextView
             android:id="@+id/dialog_title"

+ 1 - 4
app/src/main/res/layout/homepage_item_gridview_listview.xml

@@ -4,9 +4,7 @@
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:orientation="vertical"
-    android:paddingLeft="@dimen/content_padding_10"
-    android:paddingTop="@dimen/content_padding_10"
-    android:paddingRight="@dimen/content_padding_10">
+    android:paddingTop="@dimen/content_padding_10">
 
     <com.sheep.gamegroup.util.MyGridview
         android:id="@+id/home_list_gridview_gv"
@@ -17,7 +15,6 @@
         android:numColumns="4"
         android:listSelector="@color/transparent"
         android:verticalSpacing="@dimen/content_padding_5"
-        android:horizontalSpacing="@dimen/content_padding_5"
         android:layout_marginBottom="@dimen/content_padding_5"/>
 
     <com.sheep.gamegroup.util.MyListview

+ 69 - 0
app/src/main/res/layout/x_get_welfare_dialog.xml

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<merge xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="@dimen/content_padding_20"
+        android:layout_marginStart="@dimen/content_padding_20"
+        android:text="兑换码已保存至“我的福利”中,请尽快使用!否则过期将不能使用!"
+        android:textColor="@color/black_666666"
+        android:textSize="13sp" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="30dp"
+        android:layout_marginEnd="@dimen/content_padding_20"
+        android:layout_marginStart="@dimen/content_padding_20"
+        android:layout_marginTop="16dp"
+        android:gravity="center_vertical"
+        android:orientation="horizontal">
+
+        <TextView
+            android:id="@+id/get_welfare_code_tv"
+            android:layout_width="0dp"
+            android:layout_height="30dp"
+            android:layout_weight="1"
+            android:background="@drawable/shape_blue_rectangle_15"
+            android:gravity="start|center_vertical"
+            android:lines="1"
+            android:maxLines="1"
+            android:text="兑换码:854344W"
+            android:paddingLeft="@dimen/content_padding_10"
+            android:paddingRight="@dimen/content_padding_10"
+            android:singleLine="true"
+            android:textColor="#2EBEF2"
+            android:textSize="13sp" />
+
+        <TextView
+            android:id="@+id/get_welfare_copy_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="@dimen/content_padding_30"
+            android:layout_marginStart="12dp"
+            android:background="@drawable/selector_button_full_main"
+            android:gravity="center"
+            android:paddingEnd="20dp"
+            android:paddingStart="20dp"
+            android:text="复制"
+            android:textColor="@color/btn_color_main"
+            android:textSize="@dimen/text_size_12" />
+    </LinearLayout>
+
+
+    <TextView
+        android:id="@+id/get_welfare_content_tv"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginBottom="13dp"
+        android:layout_marginEnd="@dimen/content_padding_20"
+        android:layout_marginStart="@dimen/content_padding_20"
+        android:layout_marginTop="12dp"
+        android:text="礼包内容:钻石*100,套装*1"
+        android:textColor="#999999"
+        android:textSize="11sp" />
+
+    <include layout="@layout/x_msg_dialog_btn" />
+</merge>

+ 0 - 2
app/src/main/res/layout/x_msg_dialog_btn.xml

@@ -2,8 +2,6 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:layout_marginEnd="@dimen/content_padding_20"
-    android:layout_marginStart="@dimen/content_padding_20"
     android:orientation="horizontal">
 
     <TextView