trevorHsu 2 лет назад
Родитель
Сommit
daa51d642e
25 измененных файлов с 703 добавлено и 105 удалено
  1. 1 1
      app/src/main/AndroidManifest.xml
  2. 3 1
      hnqj/src/main/java/com/yyrh/constant/InitConfig.java
  3. 4 0
      hnqj/src/main/java/com/yyrh/constant/LoginData.java
  4. 1 0
      hnqj/src/main/java/com/yyrh/constant/URLConstants.java
  5. 126 54
      hnqj/src/main/java/com/yyrh/networking/NetRequestApi.java
  6. 31 0
      hnqj/src/main/java/com/yyrh/networking/urlhttp/UrlHttpUtil.java
  7. 4 3
      hnqj/src/main/java/com/yyrh/sdk/YyrhSdkManager.java
  8. 1 1
      hnqj/src/main/java/com/yyrh/ui/AccountLoginListView.java
  9. 95 0
      hnqj/src/main/java/com/yyrh/ui/NewProgressDialogUtils.java
  10. 20 0
      hnqj/src/main/java/com/yyrh/ui/activity/UseLoginActivity.java
  11. 3 2
      hnqj/src/main/java/com/yyrh/ui/dialog/AutoLoginDialog.java
  12. 4 0
      hnqj/src/main/java/com/yyrh/ui/dialog/UserCenterDialog.java
  13. 17 2
      hnqj/src/main/java/com/yyrh/ui/dialog/WvPageListDialog.java
  14. 3 0
      hnqj/src/main/java/com/yyrh/ui/fragment/FragmentUtils.java
  15. 4 3
      hnqj/src/main/java/com/yyrh/ui/fragment/UserAccountLoginFragment.java
  16. 27 24
      hnqj/src/main/java/com/yyrh/ui/fragment/UserPhoneLoginFragment.java
  17. 193 0
      hnqj/src/main/java/com/yyrh/ui/fragment/UserPhoneLoginSetpwdFragment.java
  18. 1 1
      hnqj/src/main/java/com/yyrh/ui/fragment/UserRegisterFragment.java
  19. 4 2
      hnqj/src/main/java/com/yyrh/ui/fragment/UserRetrievePwdFragment.java
  20. 9 8
      hnqj/src/main/java/com/yyrh/ui/fragment/UserSwitchAccountLoginFragment.java
  21. 1 1
      hnqj/src/main/java/com/yyrh/ui/userlist/DatabaseHelper.java
  22. 1 0
      hnqj/src/main/java/com/yyrh/ui/userlist/User.java
  23. 145 0
      hnqj/src/main/res/layout/qj_phone_register_setpwd_dialog.xml
  24. 3 2
      hnqj/src/main/res/layout/qj_usercenter_dialog.xml
  25. 2 0
      hnqj/src/main/res/values/strings.xml

+ 1 - 1
app/src/main/AndroidManifest.xml

@@ -13,7 +13,7 @@
         android:supportsRtl="true"
         android:theme="@style/AppTheme">
         <activity android:name="constant.yysdk.com.main_yy_rh_sdk.MainActivity"
-            android:screenOrientation="portrait"
+            android:screenOrientation="landscape"
             android:launchMode="singleTop"
             android:configChanges="keyboardHidden|orientation|screenSize"
 

+ 3 - 1
hnqj/src/main/java/com/yyrh/constant/InitConfig.java

@@ -15,6 +15,8 @@ public class InitConfig {
 
     public String service_center = "";
 
+    public String access_token = "";
+
     public String agreement_user = "";
 
     public JSONObject links = null;
@@ -33,7 +35,7 @@ public class InitConfig {
 
         initConfig.reg_tabs = json.optJSONArray("reg_tabs");
         initConfig.sdk_login = json.optInt("sdk_login", 100);
-
+        initConfig.access_token = json.optString("access_token");
         initConfig.bswitch = json.optInt("bswitch");
 
         if (initConfig.reg_tabs != null){

+ 4 - 0
hnqj/src/main/java/com/yyrh/constant/LoginData.java

@@ -29,6 +29,7 @@ public class LoginData {
 
     public String authentication = "";
 
+    public String login_token = "";
 
     public static LoginData toBean(JSONObject json){
         if (TextUtils.isEmpty(json.toString())) {
@@ -48,6 +49,8 @@ public class LoginData {
 
         loginData.links = json.optJSONObject("links");
 
+        loginData.login_token = json.optString("login_token");
+
         if (loginData.links == null){
             loginData.solo_email = "";
             loginData.user_center = "";
@@ -76,6 +79,7 @@ public class LoginData {
                 ", solo_email='" + solo_email + '\'' +
                 ", user_center='" + user_center + '\'' +
                 ", authentication='" + authentication + '\'' +
+                ", login_token='" + login_token + '\'' +
                 '}';
     }
 }

+ 1 - 0
hnqj/src/main/java/com/yyrh/constant/URLConstants.java

@@ -22,6 +22,7 @@ public class URLConstants {
     public static final String  QUERYORDER = BASEURL +  "/order_query";
   	public static final String  AGREEMENTINIT = BASEURL +  "/agreement_init";
     public static final String  PAYMENTWAY = BASEURL +  "/payment_way";
+  public static final String  LOGINWITHSMS = BASEURL +  "/phone_sms_login";
 
     public static final String  CHANNELZTAG = "YYRHSDK";
 

+ 126 - 54
hnqj/src/main/java/com/yyrh/networking/NetRequestApi.java

@@ -12,6 +12,7 @@ import com.yyrh.pay.PaymentNotify;
 import com.yyrh.sdk.SDKEntry;
 import com.yyrh.sdk.callback.ShowPolicyCallback;
 import com.yyrh.ui.fragment.UserPhoneLoginFragment;
+import com.yyrh.ui.fragment.UserPhoneLoginSetpwdFragment;
 import com.yyrh.ui.fragment.UserRetrievePwdFragment;
 import com.yyrh.utils.ResourceUtil;
 import com.yyrh.utils.SignUtils;
@@ -31,13 +32,13 @@ import com.yyrh.sdk.callback.RegisterCallback;
 import com.yyrh.ui.ProgressDialogUtils;
 import com.yythird.sdk.ChannelSDK;
 
-import org.json.JSONArray;
+
 import org.json.JSONException;
 import org.json.JSONObject;
 
 
 import java.util.HashMap;
-import java.util.List;
+
 import java.util.Map;
 
 
@@ -57,9 +58,10 @@ import static com.yyrh.constant.URLConstants.FASTREGISTER;
 import static com.yyrh.constant.URLConstants.GETCAPTCHA;
 import static com.yyrh.constant.URLConstants.INIT;
 
+import static com.yyrh.constant.URLConstants.LOGINWITHSMS;
 import static com.yyrh.constant.URLConstants.QUERYORDER;
 import static com.yyrh.constant.URLConstants.REALNAMERECORD;
-import static com.yyrh.constant.URLConstants.RECHARGEINT;
+
 import static com.yyrh.constant.URLConstants.REGISTERWITHPHONE;
 import static com.yyrh.constant.URLConstants.RESETPWDWITHPHONE;
 import static com.yyrh.constant.URLConstants.RSAKEY;
@@ -73,7 +75,7 @@ public class NetRequestApi {
 
         ProgressDialogUtils.show(activity, activity.getString(ResourceUtil.getStringId(activity, "qj_initing")));
 
-        HashMap<String, String> map = getCommonParams();
+        HashMap<String, String> map = getCommonParams(true);
 
         String time = SignUtils.toURLEncoded(System.currentTimeMillis() / 1000 + "");
         String paramSign = SignUtils.paramSign(map, time);
@@ -144,27 +146,28 @@ public class NetRequestApi {
 
     }
 
-    public static void loginWithYy(boolean isShowPrg, final Activity activity, String account, String password, final LoginCallback loginCallback) {
-        if (isShowPrg){
-            ProgressDialogUtils.show(activity, activity.getString(ResourceUtil.getStringId(activity, "qj_logging")));
-        }
+    public static void loginWithYy(boolean isShowPrg, final Activity activity, String account, String password,String login_token, final LoginCallback loginCallback) {
 
 
-        HashMap<String, String> map = getCommonParams();
+        HashMap<String, String> map = getCommonParams(false);
 
 
         map.put("smt_type", SignUtils.toURLEncoded(SDKSettings.isSimulator));
 
+        if (Utils.judgeStrNull(password)){
+            map.put("login_token", login_token);
+        }else {
+            String uname_pwd = null;
 
-        String uname_pwd = null;
-
-        try {
-            uname_pwd = SignUtils.encryptRsaByPublicKey(RSAKEY, account + "|" + password);
-        } catch (Exception e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
+            try {
+                uname_pwd = SignUtils.encryptRsaByPublicKey(RSAKEY, account + "|" + password);
+            } catch (Exception e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+            map.put("uname_pwd", uname_pwd);
         }
-        map.put("uname_pwd", uname_pwd);
+
         map.put("package_name", SDKSettings.package_name);
 
         String time = SignUtils.toURLEncoded(System.currentTimeMillis() / 1000 + "");
@@ -173,21 +176,19 @@ public class NetRequestApi {
         map.put("sign", paramSign);
 
 
-        UrlHttpUtil.post(USERLOGIN, map, new CallBackUtil.CallBackString() {
+        UrlHttpUtil.post(activity,USERLOGIN, map, new CallBackUtil.CallBackString() {
             @Override
             public void onFailure(int code, String errorMessage) {
-                ProgressDialogUtils.dismiss();
-                new TosUtil(activity, TosUtil.TOAST_ERROR, activity.getString(ResourceUtil.getStringId(activity, "qj_network_error_tip"))).show();
 
-                loginCallback.onLoginError(activity.getString(ResourceUtil.getStringId(activity, "qj_network_error_tip")));
+                new TosUtil(activity, TosUtil.TOAST_ERROR, activity.getString(ResourceUtil.getStringId(activity, "hnyy_network_error_tip"))).show();
+
+                loginCallback.onLoginError(activity.getString(ResourceUtil.getStringId(activity, "hnyy_network_error_tip")));
             }
 
             @Override
             public void onResponse(String response) {
 
 
-                ProgressDialogUtils.dismiss();
-
                 JSONObject json = null;
                 JSONObject data = null;
                 try {
@@ -211,7 +212,7 @@ public class NetRequestApi {
 
                 SDKSettings.LOGINTAG = LOGIN;
 
-                if (loginData.is_rn == 0) {
+                if (Utils.judgeStrNull(loginData.authentication)) {
                     SDKSettings.isVefityRealName = false;
                 } else {
                     SDKSettings.isVefityRealName = true;
@@ -226,6 +227,8 @@ public class NetRequestApi {
 
     }
 
+
+
     public static void registerWithYy(final Activity activity, String account, String password, final RegisterCallback registerCallback) {
 
         if (ProgressDialogUtils.isShowing()) {
@@ -235,7 +238,7 @@ public class NetRequestApi {
 
         ProgressDialogUtils.show(activity, activity.getString(ResourceUtil.getStringId(activity, "qj_registering")));
 
-        HashMap<String, String> map = getCommonParams();
+        HashMap<String, String> map = getCommonParams(false);
 
 
         map.put("smt_type", SignUtils.toURLEncoded(SDKSettings.isSimulator));
@@ -305,7 +308,7 @@ public class NetRequestApi {
     public static void loginWithChannel(final Activity activity, String channelLoginInfo, final LoginCallback loginCallback) {
         ProgressDialogUtils.show(activity, activity.getString(ResourceUtil.getStringId(activity, "qj_logging")));
 
-        HashMap<String, String> map = getCommonParams();
+        HashMap<String, String> map = getCommonParams(false);
 
 
         map.put("sdk_params", channelLoginInfo);
@@ -375,7 +378,7 @@ public class NetRequestApi {
                                          String roleId, String roleName, String roleLevel, String serverId,
                                          String serverName, String hasGold, String vipLevel, String role_power, String partyId, String partyName, String createTime, String charge) {
 
-        HashMap<String, String> map = getCommonParams();
+        HashMap<String, String> map = getCommonParams(false);
 
 
         if (type.equals(Constants.UPLOADTYPE_CREATEROLE)) {
@@ -500,7 +503,7 @@ public class NetRequestApi {
         }
 
 
-        HashMap<String, String> orderMap = getCommonParams();
+        HashMap<String, String> orderMap = getCommonParams(false);
 
 
         orderMap.put("uname", loginData.uname);
@@ -596,7 +599,7 @@ public class NetRequestApi {
 
         ProgressDialogUtils.show(activity, activity.getString(ResourceUtil.getStringId(activity, "qj_get_code")));
 
-        HashMap<String, String> map = getCommonParams();
+        HashMap<String, String> map = getCommonParams(false);
 
 
         map.put("phone", SignUtils.toURLEncoded(phone));
@@ -648,13 +651,13 @@ public class NetRequestApi {
 
     }
 
-    public static void registerWithPhone(final Activity activity, String code, String userInfo, final UserPhoneLoginFragment.PhoneRegisterCallback phoneRegisterCallback) {
+    public static void registerWithPhone(final Activity activity, String code, String userInfo, final UserPhoneLoginSetpwdFragment.PhoneRegisterCallback phoneRegisterCallback) {
         if (ProgressDialogUtils.isShowing()) {
             return;
         }
         ProgressDialogUtils.show(activity, activity.getString(ResourceUtil.getStringId(activity, "qj_registering")));
 
-        HashMap<String, String> map = getCommonParams();
+        HashMap<String, String> map = getCommonParams(false);
 
 
         map.put("uname_pwd", userInfo);
@@ -736,7 +739,7 @@ public class NetRequestApi {
 
         ProgressDialogUtils.show(activity, activity.getString(ResourceUtil.getStringId(activity, "qj_resetpwd")));
 
-        HashMap<String, String> map = getCommonParams();
+        HashMap<String, String> map = getCommonParams(false);
 
 
         String uname_pwd = null;
@@ -798,7 +801,7 @@ public class NetRequestApi {
     }
 
     public static void upLoadUserRealNameInfo(String report_type, String channelRealNameInfo) {
-        HashMap<String, String> map = getCommonParams();
+        HashMap<String, String> map = getCommonParams(false);
 
 
         map.put("channel_uid", SignUtils.toURLEncoded(loginData.channel_uid));
@@ -858,7 +861,7 @@ public class NetRequestApi {
 
     public static void recordUserRealNameInfo(Activity activity, String report_type, String channelRealNameInfo) {
 
-        HashMap<String, String> map = getCommonParams();
+        HashMap<String, String> map = getCommonParams(false);
 
 
         map.put("channel_uid", SignUtils.toURLEncoded(loginData.channel_uid));
@@ -921,7 +924,7 @@ public class NetRequestApi {
     }
 
     public static void queryOrder(String order_id, final HashMap<String, Object> payMap) {
-        HashMap<String, String> map = getCommonParams();
+        HashMap<String, String> map = getCommonParams(false);
 
 
         String query_params = (String) payMap.get("query_params");
@@ -1042,29 +1045,98 @@ public class NetRequestApi {
         });
     }
 
-    private static HashMap<String, String> getCommonParams() {
-        HashMap<String, String> map = new HashMap();
 
-        map.put("game_code", SignUtils.toURLEncoded(SDKSettings.game_code));
-        map.put("gcp_code", SignUtils.toURLEncoded(SDKSettings.gcp_code));
-        map.put("cs_ver", SignUtils.toURLEncoded(SDKSettings.SDK_VERSION));
-        map.put("system", SignUtils.toURLEncoded(SDKSettings.system));
-        map.put("ifa", SignUtils.toURLEncoded(SDKSettings.imei));
-        map.put("device_ver", SignUtils.toURLEncoded(SDKSettings.version));
-        map.put("sp_code", SignUtils.toURLEncoded(SDKSettings.sp_code));
+    public static void phoneLoginWithSms(final Activity activity, String phone,String code,final UserPhoneLoginFragment.PhoneLoginCallback phoneLoginCallback) {
+        if (ProgressDialogUtils.isShowing()) {
+            return;
+        }
+
+        HashMap<String, String> map = getCommonParams(false);
 
-        map.put("device_model", SignUtils.toURLEncoded(SDKSettings.device_model));
-        map.put("package_name", SDKSettings.package_name);
-        map.put("ifa_type", SDKSettings.ifa_type);
-        map.put("android_id", SDKSettings.android_id);
-
-        if (!Utils.judgeStrNull(SDKSettings.o_cfg)) {
-            map.put("o_cfg", SDKSettings.o_cfg);
-            YYLog.i("o_cfg : " + SDKSettings.o_cfg);
-        } else {
-            YYLog.i("o_cfg is null");
+
+
+        map.put("sms", SignUtils.toURLEncoded(code));
+        map.put("phone", SignUtils.toURLEncoded(phone));
+
+
+        String time = SignUtils.toURLEncoded(System.currentTimeMillis() / 1000 + "");
+        String paramSign = SignUtils.paramSign(map, time);
+        map.put("time", time);
+        map.put("sign", paramSign);
+
+
+
+        UrlHttpUtil.post(activity,LOGINWITHSMS, map, new CallBackUtil.CallBackString() {
+            @Override
+            public void onFailure(int code, String errorMessage) {
+
+                phoneLoginCallback.onPhoneLoginFailed(activity.getString(ResourceUtil.getStringId(activity, "qj_network_error_tip")));
+
+                YYLog.i(errorMessage);
+            }
+
+            @Override
+            public void onResponse(String response) {
+
+
+                JSONObject json = null;
+                JSONObject data = null;
+                try {
+                    json = new JSONObject(response);
+                    data = json.getJSONObject("data");
+                } catch (JSONException e) {
+                    e.printStackTrace();
+                }
+                int code = json.optInt("code", -1);
+                if (code != 1) {
+
+                    YYLog.i("手机登录失败:" + json.optString("msg", "手机登录失败"));
+                    phoneLoginCallback.onPhoneLoginFailed(json.optString("msg", "手机登录失败"));
+
+                    return;
+                }
+                if (data.optInt("new_user") == 1){
+                    phoneLoginCallback.onPhoneNewLogin();
+                }else{
+                    SDKSettings.loginData = LoginData.toBean(data);
+                    YYLog.i("手机注册成功,正在登录游戏。+ token:" + loginData.token);
+                    phoneLoginCallback.onPhoneLoginSuccess(loginData.token);
+
+                }
+
+            }
+        });
+    }
+
+
+    private static HashMap<String, String> getCommonParams(boolean isInitApi) {
+        HashMap<String, String> map = new HashMap();
+        if (isInitApi){
+            map.put("game_code", SignUtils.toURLEncoded(SDKSettings.game_code));
+            map.put("gcp_code", SignUtils.toURLEncoded(SDKSettings.gcp_code));
+            map.put("cs_ver", SignUtils.toURLEncoded(SDKSettings.SDK_VERSION));
+            map.put("system", SignUtils.toURLEncoded(SDKSettings.system));
+            map.put("ifa", SignUtils.toURLEncoded(SDKSettings.imei));
+            map.put("device_ver", SignUtils.toURLEncoded(SDKSettings.version));
+            map.put("sp_code", SignUtils.toURLEncoded(SDKSettings.sp_code));
+
+            map.put("device_model", SignUtils.toURLEncoded(SDKSettings.device_model));
+            map.put("package_name", SDKSettings.package_name);
+            map.put("ifa_type", SDKSettings.ifa_type);
+            map.put("android_id", SDKSettings.android_id);
+            if (!Utils.judgeStrNull(SDKSettings.o_cfg)) {
+                map.put("o_cfg", SDKSettings.o_cfg);
+                YYLog.i("o_cfg : " + SDKSettings.o_cfg);
+            } else {
+                YYLog.i("o_cfg is null");
+            }
+        }else{
+            map.put("access_token", SDKSettings.initConfig.access_token);
         }
 
+
+
+
         return map;
     }
 

+ 31 - 0
hnqj/src/main/java/com/yyrh/networking/urlhttp/UrlHttpUtil.java

@@ -1,5 +1,9 @@
 package com.yyrh.networking.urlhttp;
 
+import android.app.Activity;
+import android.app.Dialog;
+
+import com.yyrh.ui.NewProgressDialogUtils;
 import com.yyrh.utils.YYLog;
 
 import java.io.File;
@@ -79,6 +83,33 @@ public class UrlHttpUtil {
     public static void post(String url, Map<String, String> paramsMap, Map<String, String> headerMap, CallBackUtil callBack) {
         new RequestUtil(METHOD_POST,url,paramsMap,headerMap,callBack).execute();
     }
+
+    /**
+     * post请求,可以传递参数
+     * @param url:url
+     * @param paramsMap:map集合,封装键值对参数
+     * @param callBack:回调接口,onFailure方法在请求失败时调用,onResponse方法在请求成功后调用,这两个方法都执行在UI线程。
+     */
+    public static void post(Activity activity, String url, Map<String, String> paramsMap, final CallBackUtil callBack) {
+        YYLog.i(url + "------" + paramsMap.toString());
+
+        final Dialog newProgressDialogUtils = new NewProgressDialogUtils().show(activity,url);
+
+        post(url, paramsMap, null, new CallBackUtil.CallBackString() {
+            @Override
+            public void onFailure(int code, String errorMessage) {
+                newProgressDialogUtils.dismiss();
+                callBack.onFailure(code,errorMessage);
+            }
+
+
+            @Override
+            public void onResponse(String response) {
+                newProgressDialogUtils.dismiss();
+                callBack.onResponse(response);
+            }
+        });
+    }
     /**
      * post请求,可以传递参数
      * @param url:url

+ 4 - 3
hnqj/src/main/java/com/yyrh/sdk/YyrhSdkManager.java

@@ -363,13 +363,14 @@ public class YyrhSdkManager {
 
     }
 
-    public void saveUserLoginInfo(final Context context, final String account, String pwd, final String token){
+    public void saveUserLoginInfo(final Context context, final String account, String pwd,String login_token, final String token){
         SharedPreferences sp = context
                 .getSharedPreferences("yyrh",
                         Activity.MODE_PRIVATE);
         SharedPreferences.Editor editor = sp.edit();
         editor.putString("username", account);
         editor.putString("password", pwd);
+        editor.putString("login_token", login_token);
         editor.commit();
 
 
@@ -377,8 +378,8 @@ public class YyrhSdkManager {
 
         String delete_sql = "delete from user where name = '" + account + "'";
 
-        String insert_sql = "insert into user(name,pwd,time) values('" + account
-                + "','" + pwd + "','" + timeStamp + "')";
+        String insert_sql = "insert into user(name,pwd,login_token,time) values('" + account
+                + "','" + pwd + "','" + login_token + "','" + timeStamp + "')";
 
         DatabaseHelper.excuteSql(context, delete_sql);
         DatabaseHelper.excuteSql(context, insert_sql);

+ 1 - 1
hnqj/src/main/java/com/yyrh/ui/AccountLoginListView.java

@@ -22,7 +22,7 @@ public class AccountLoginListView extends RelativeLayout {
     public ImageView iv_account_icon;
     public TextView tv_account_type,tv_account;
     public Button btn_common_use,btn_delete;
-    public String password;
+    public String password,login_token;
     public AccountLoginListView(Context context) {
         super(context);
         intView(context);

+ 95 - 0
hnqj/src/main/java/com/yyrh/ui/NewProgressDialogUtils.java

@@ -0,0 +1,95 @@
+package com.yyrh.ui;
+
+
+import android.app.Activity;
+import android.app.Dialog;
+import android.widget.TextView;
+
+import com.yyrh.utils.ResourceUtil;
+import com.yyrh.utils.Utils;
+
+import static com.yyrh.constant.URLConstants.CHANNELLOGIN;
+import static com.yyrh.constant.URLConstants.FASTREGISTER;
+import static com.yyrh.constant.URLConstants.GETCAPTCHA;
+import static com.yyrh.constant.URLConstants.INIT;
+import static com.yyrh.constant.URLConstants.PAYMENTWAY;
+import static com.yyrh.constant.URLConstants.RECHARGEINT;
+import static com.yyrh.constant.URLConstants.REGISTERWITHPHONE;
+import static com.yyrh.constant.URLConstants.RESETPWDWITHPHONE;
+import static com.yyrh.constant.URLConstants.USERLOGIN;
+
+
+public class NewProgressDialogUtils {
+
+
+	 private String getShowMessage(String url){
+	 	String message;
+		switch (url){
+			case INIT:
+				message =  "qj_network_error_tip";
+				break;
+			case USERLOGIN:
+				message =  "qj_logging";
+			break;
+			case FASTREGISTER:
+				message =  "qj_registering";
+			break;
+			case CHANNELLOGIN:
+				message =  "qj_logging";
+				break;
+			case PAYMENTWAY:
+				message =  "qj_pay_init";
+				break;
+			case RECHARGEINT:
+				message =  "qj_pay_init";
+				break;
+			case GETCAPTCHA:
+				message =  "qj_get_code";
+				break;
+			case REGISTERWITHPHONE:
+				message =  "qj_registering";
+				break;
+			case RESETPWDWITHPHONE:
+				message =  "qj_resetpwd";
+				break;
+
+			default :
+				 message = "";
+			break;
+		}
+		return message;
+	}
+
+	
+	public  Dialog show(Activity _activity,final String _mesage){
+
+
+
+
+			Dialog progressDialog = new Dialog(_activity, ResourceUtil.getStyleId(_activity, "qj_progress_dialog"));
+			progressDialog.setContentView(ResourceUtil.getLayoutId(_activity, "qj_dialog_progress"));
+            progressDialog.setCancelable(false);
+            progressDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
+            TextView msg =  progressDialog.findViewById(ResourceUtil.getId(_activity, "id_tv_loadingmsg"));
+
+
+			String message = getShowMessage(_mesage);
+
+			if (!Utils.judgeStrNull(message)){
+
+				msg.setText(_activity.getString(ResourceUtil.getStringId(_activity, message)));
+
+			}
+
+
+
+
+		progressDialog.show();
+
+		return progressDialog;
+
+		
+	}
+
+
+}

+ 20 - 0
hnqj/src/main/java/com/yyrh/ui/activity/UseLoginActivity.java

@@ -7,10 +7,14 @@ import android.app.Fragment;
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.ActivityInfo;
+import android.os.Build;
 import android.os.Bundle;
 import android.support.annotation.Nullable;
 import android.view.KeyEvent;
 
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
 import android.widget.FrameLayout;
 
 
@@ -27,6 +31,22 @@ public class UseLoginActivity extends BaseActivity {
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(ResourceUtil.getLayoutId(this,"qj_login_activity"));
+
+
+
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
+            Window window = getWindow();
+            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
+            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+
+
+            WindowManager.LayoutParams lp = getWindow().getAttributes();
+            lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
+            getWindow().setAttributes(lp);
+        }
+
+
         initView(this);
     }
     private void initView(Context context){

+ 3 - 2
hnqj/src/main/java/com/yyrh/ui/dialog/AutoLoginDialog.java

@@ -118,13 +118,14 @@ public class AutoLoginDialog extends Dialog {
 				SharedPreferences sp = context.getSharedPreferences("yyrh", Activity.MODE_PRIVATE);
 				final String account = sp.getString("username", "");
 				final String pwd = sp.getString("password", "");
-				NetRequestApi.loginWithYy(false,(Activity) context,account,pwd, new LoginCallback() {
+				final String login_token = sp.getString("login_token", "");
+				NetRequestApi.loginWithYy(false,(Activity) context,account,pwd,login_token, new LoginCallback() {
 					@Override
 					public void onLoginSuccess(String token) {
 
 						closeDialogCallback.onclose();
 
-						YyrhSdkManager.defaultManager(context).saveUserLoginInfo(context,account,pwd,token);
+						YyrhSdkManager.defaultManager(context).saveUserLoginInfo(context,account,pwd,login_token,token);
 
 					}
 

+ 4 - 0
hnqj/src/main/java/com/yyrh/ui/dialog/UserCenterDialog.java

@@ -15,6 +15,8 @@ import android.webkit.DownloadListener;
 import android.webkit.WebSettings;
 import android.webkit.WebView;
 import android.webkit.WebViewClient;
+import android.widget.Button;
+import android.widget.EditText;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
@@ -44,6 +46,7 @@ public class UserCenterDialog extends BaseDialog {
     private WebView webView;
     private WebSettings webSettings;
 
+
     private String url;
     public OnClosePageListener listener;
 
@@ -172,6 +175,7 @@ public class UserCenterDialog extends BaseDialog {
         });
 
 
+
         webView.setBackgroundColor(0);
         webView.getBackground().setAlpha(0);
 

+ 17 - 2
hnqj/src/main/java/com/yyrh/ui/dialog/WvPageListDialog.java

@@ -6,9 +6,12 @@ import android.content.Context;
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.net.Uri;
+import android.os.Build;
 import android.os.Bundle;
 import android.util.Log;
 import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
 import android.view.animation.Animation;
 import android.view.animation.AnimationUtils;
 import android.webkit.DownloadListener;
@@ -81,6 +84,18 @@ public class WvPageListDialog extends BaseDialog {
             setContentView(ResourceUtil.getLayoutId(context,
                     "qj_webview_common_dialog"));
 
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
+            Window window = getWindow();
+            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
+            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+
+
+            WindowManager.LayoutParams lp = getWindow().getAttributes();
+            lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
+            getWindow().setAttributes(lp);
+        }
+
             setCancelable(false);
 
 
@@ -264,7 +279,7 @@ public class WvPageListDialog extends BaseDialog {
     public void openq0q0(String url) {
         super.openq0q0(url);
 
-        {
+
             Log.i("openq0q0", url);
             if (Utils.judgeStrNull(url)) {
                 return;
@@ -291,7 +306,7 @@ public class WvPageListDialog extends BaseDialog {
             }
 
 
-        }
+
     }
 
     @Override

+ 3 - 0
hnqj/src/main/java/com/yyrh/ui/fragment/FragmentUtils.java

@@ -12,6 +12,7 @@ public class FragmentUtils {
     public static final int SDK_LOGIN_TAG = 2;
     public static final int SDK_PHONE_REGISTER_TAG = 3;
     public static final int SDK_USER_SWITCH_ACCOUNT = 4;
+    public static final int SDK_PHONE_SET_LOGIN_PWD_TAG = 5;
     public static final int SDK_RETRIEVE_PWD_TAG = 6;
 
 
@@ -30,6 +31,8 @@ public class FragmentUtils {
                 return UserRegisterFragment.instantiate(context,UserAccountLoginFragment.class.getName());
             case SDK_USER_SWITCH_ACCOUNT:
                 return UserRegisterFragment.instantiate(context,UserSwitchAccountLoginFragment.class.getName());
+            case SDK_PHONE_SET_LOGIN_PWD_TAG:
+                return UserRegisterFragment.instantiate(context,UserPhoneLoginSetpwdFragment.class.getName());
                 default:
                 return null;
 

+ 4 - 3
hnqj/src/main/java/com/yyrh/ui/fragment/UserAccountLoginFragment.java

@@ -22,6 +22,7 @@ import android.widget.ImageView;
 import android.widget.ListView;
 import android.widget.TextView;
 
+import com.yyrh.constant.SDKSettings;
 import com.yyrh.networking.NetRequestApi;
 import com.yyrh.sdk.SDKEntry;
 import com.yyrh.sdk.YyrhSdkManager;
@@ -197,14 +198,14 @@ public class UserAccountLoginFragment extends BaseFragment {
             return;
         }
 
-        NetRequestApi.loginWithYy(true,getActivity(), account, pwd, new LoginCallback() {
+        NetRequestApi.loginWithYy(true,getActivity(), account, pwd,"", new LoginCallback() {
             @Override
             public void onLoginSuccess(String token) {
 
 
                 getActivity().finish();
 
-                YyrhSdkManager.defaultManager(SDKEntry.getSdkInstance().gameAct).saveUserLoginInfo(SDKEntry.getSdkInstance().gameAct,account,pwd,token);
+                YyrhSdkManager.defaultManager(SDKEntry.getSdkInstance().gameAct).saveUserLoginInfo(SDKEntry.getSdkInstance().gameAct,account,pwd, SDKSettings.loginData.login_token,token);
 
             }
 
@@ -237,7 +238,7 @@ public class UserAccountLoginFragment extends BaseFragment {
         dbHelper = new DatabaseHelper(getActivity());
         SQLiteDatabase db = null;
         db = dbHelper.getReadableDatabase();
-        String qurey_sql = "select name,pwd from user order by time desc";
+        String qurey_sql = "select name,pwd,login_token from user order by time desc";
         Cursor cursor = db.rawQuery(qurey_sql, null);
         while (cursor.moveToNext()) {
             User user = new User();

+ 27 - 24
hnqj/src/main/java/com/yyrh/ui/fragment/UserPhoneLoginFragment.java

@@ -135,9 +135,9 @@ public class UserPhoneLoginFragment extends BaseFragment {
     }
 
     private void registerWithPhone(final Activity activity){
-        String code = et_user_code.getText().toString();
+        final String code = et_user_code.getText().toString();
         final String account = et_user_phone.getText().toString();
-        final String pwd = et_user_code.getText().toString();
+
         String userInfo ="";
 
         if(account.length() < 10 || Utils.judgeStrNull(account))
@@ -147,15 +147,7 @@ public class UserPhoneLoginFragment extends BaseFragment {
 
             return;
         }
-        if(pwd.length() < 6 || Utils.judgeStrNull(pwd))
-        {
-
-            new TosUtil(getActivity(),TosUtil.TOAST_ERROR, getString(ResourceUtil.getStringId(getActivity(), "qj_pwd_limit_6"))).show();
 
-
-
-            return;
-        }
         if(code.length() < 4 || Utils.judgeStrNull(code))
         {
             new TosUtil(getActivity(),TosUtil.TOAST_ERROR, getString(ResourceUtil.getStringId(getActivity(), "qj_pls_input_right_code"))).show();
@@ -171,31 +163,36 @@ public class UserPhoneLoginFragment extends BaseFragment {
 
         }
 
-        try {
-            userInfo =  SignUtils.encryptRsaByPublicKey(RSAKEY,account+"|"+ pwd);
-        } catch (Exception e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-
-        NetRequestApi.registerWithPhone(activity,code,userInfo, new PhoneRegisterCallback() {
-            @Override
-            public void onRegisterSuccess(String msg) {
-
 
 
-                YyrhSdkManager.defaultManager(SDKEntry.getSdkInstance().gameAct).saveUserLoginInfo(SDKEntry.getSdkInstance().gameAct,account,pwd,msg);
+        NetRequestApi.phoneLoginWithSms(activity,account,code, new PhoneLoginCallback() {
+            @Override
+            public void onPhoneLoginSuccess(String msg) {
+                    YyrhSdkManager.defaultManager(SDKEntry.getSdkInstance().gameAct).saveUserLoginInfo(getActivity(),account,"",SDKSettings.loginData.login_token,msg);
 
                 SDKEntry.getSdkInstance().adSdkCallback.onRegisterSuccess(account);
 
                 getActivity().finish();
-
             }
 
             @Override
-            public void onRegisterFailed(String msg) {
+            public void onPhoneLoginFailed(String msg) {
                 new TosUtil(getActivity(),TosUtil.TOAST_ERROR, msg).show();
             }
+
+            @Override
+            public void onPhoneNewLogin() {
+                Fragment accountLoginFragment = FragmentUtils.getSdkFragment(getActivity(),FragmentUtils.SDK_PHONE_SET_LOGIN_PWD_TAG);
+                Bundle bundle  = new Bundle();
+                bundle.putString("account",account);
+                bundle.putString("code",code);
+                accountLoginFragment.setArguments(bundle);
+                replaceFragmentToActivity(getFragmentManager(),accountLoginFragment,ResourceUtil.getId(getActivity(),"qj_content"));
+
+            }
+
+
+
         });
     }
 
@@ -268,6 +265,12 @@ public class UserPhoneLoginFragment extends BaseFragment {
 
     }
 
+    public interface PhoneLoginCallback {
 
+        void onPhoneLoginSuccess(String msg);
+        void onPhoneLoginFailed(String msg);
+        void onPhoneNewLogin();
+
+    }
 
 }

+ 193 - 0
hnqj/src/main/java/com/yyrh/ui/fragment/UserPhoneLoginSetpwdFragment.java

@@ -0,0 +1,193 @@
+package com.yyrh.ui.fragment;
+
+import android.app.Activity;
+import android.app.Fragment;
+import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.TextView;
+
+import com.yyrh.constant.SDKSettings;
+import com.yyrh.networking.NetRequestApi;
+import com.yyrh.sdk.SDKEntry;
+import com.yyrh.sdk.YyrhSdkManager;
+import com.yyrh.ui.dialog.WvPageListDialog;
+import com.yyrh.utils.ResourceUtil;
+import com.yyrh.utils.SignUtils;
+import com.yyrh.utils.TosUtil;
+import com.yyrh.utils.Utils;
+import com.yyrh.utils.YYLog;
+
+import static com.yyrh.constant.Constants.CLICK_INTERVAL;
+import static com.yyrh.constant.URLConstants.RSAKEY;
+
+
+public class UserPhoneLoginSetpwdFragment extends BaseFragment {
+
+
+    private EditText reg_pwd_edit;
+    private CheckBox cb_register;
+    private TextView tv_tip,tv_private_policy;
+    private Button reg_compete_btn;
+    private ImageButton close_btn;
+    private long clickLoginTime = 0L;
+
+    private String account,code;
+    @Nullable
+    @Override
+    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+        View view = inflater.inflate(ResourceUtil.getLayoutId(getActivity(),"qj_phone_register_setpwd_dialog"), container, false);
+        view.setClickable(true);
+
+        Bundle bundle = getArguments();
+        account = bundle.getString("account");
+        code = bundle.getString("code");
+        return view;
+    }
+
+    @Override
+    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+        super.onViewCreated(view, savedInstanceState);
+        reg_pwd_edit = view.findViewById(ResourceUtil.getId(getActivity(),"reg_pwd_edit"));
+
+        cb_register = view.findViewById(ResourceUtil.getId(getActivity(),"cb_register"));
+
+        tv_tip = view.findViewById(ResourceUtil.getId(getActivity(),"tv_tip"));
+        tv_tip.setOnClickListener(this);
+
+        tv_private_policy = view.findViewById(ResourceUtil.getId(getActivity(),"tv_private_policy"));
+        tv_private_policy.setOnClickListener(this);
+
+        reg_compete_btn = view.findViewById(ResourceUtil.getId(getActivity(),"reg_compete_btn"));
+        reg_compete_btn.setOnClickListener(this);
+
+
+        close_btn = view.findViewById(ResourceUtil.getId(getActivity(),"close_btn"));
+
+        close_btn.setOnClickListener(this);
+    }
+
+    @Override
+    public void onClick(View v) {
+        super.onClick(v);
+        int id = v.getId();
+        if(id == ResourceUtil.getId(getActivity(), "tv_tip")){
+
+            new WvPageListDialog(getActivity(), ResourceUtil.getStyleId(getActivity(),"hnyy_base_dialog"), SDKSettings.initConfig.agreement_user).show();
+
+        }else if(id == ResourceUtil.getId(getActivity(), "tv_private_policy")){
+
+            new WvPageListDialog(getActivity(), ResourceUtil.getStyleId(getActivity(),"hnyy_base_dialog"), SDKSettings.initConfig.agreement_privacy).show();
+
+        }else if(id == ResourceUtil.getId(getActivity(), "reg_compete_btn")){
+
+            if (System.currentTimeMillis() - clickLoginTime < CLICK_INTERVAL) {
+                YYLog.i("调用登录接口太频繁,拦截此次操作");
+                return;
+            }
+            clickLoginTime = System.currentTimeMillis();
+
+            registerWithPhone(getActivity());
+
+        }else if(id == ResourceUtil.getId(getActivity(), "close_btn")){
+
+            Fragment accountLoginFragment = FragmentUtils.getSdkFragment(getActivity(), FragmentUtils.SDK_PHONE_REGISTER_TAG);
+            replaceFragmentToActivity(getFragmentManager(),accountLoginFragment, ResourceUtil.getId(getActivity(),"hnyy_content"));
+
+
+        }
+
+
+
+    }
+
+
+
+    private void registerWithPhone(final Activity activity){
+
+        final String pwd = reg_pwd_edit.getText().toString();
+
+        String userInfo ="";
+
+        if(account.length() < 10 || Utils.judgeStrNull(account))
+        {
+            new TosUtil(getActivity(), TosUtil.TOAST_ERROR,getString(ResourceUtil.getStringId(getActivity(), "qj_pls_input_right_phone"))).show();
+
+
+            return;
+        }
+        if(pwd.length() < 6 || Utils.judgeStrNull(pwd))
+        {
+
+            new TosUtil(getActivity(), TosUtil.TOAST_ERROR, getString(ResourceUtil.getStringId(getActivity(), "qj_pwd_limit_6"))).show();
+
+
+
+            return;
+        }
+        if(code.length() < 4 || Utils.judgeStrNull(code))
+        {
+            new TosUtil(getActivity(), TosUtil.TOAST_ERROR, getString(ResourceUtil.getStringId(getActivity(), "qj_pls_input_right_code"))).show();
+
+            return;
+        }
+
+        if (!cb_register.isChecked()){
+
+            new TosUtil(getActivity(), TosUtil.TOAST_ERROR,getString(ResourceUtil.getStringId(getActivity(), "qj_pls_checked_reg_tip"))).show();
+
+            return;
+
+        }
+
+        try {
+            userInfo =  SignUtils.encryptRsaByPublicKey(RSAKEY,account+"|"+ pwd);
+        } catch (Exception e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+
+        NetRequestApi.registerWithPhone(activity,code,userInfo, new PhoneRegisterCallback() {
+            @Override
+            public void onRegisterSuccess(String msg) {
+
+
+
+                YyrhSdkManager.defaultManager(SDKEntry.getSdkInstance().gameAct).saveUserLoginInfo(SDKEntry.getSdkInstance().gameAct,account,pwd, SDKSettings.loginData.login_token,msg);
+
+                SDKEntry.getSdkInstance().adSdkCallback.onRegisterSuccess(account);
+
+                getActivity().finish();
+
+            }
+
+            @Override
+            public void onRegisterFailed(String msg) {
+                new TosUtil(getActivity(), TosUtil.TOAST_ERROR, msg).show();
+            }
+        });
+    }
+
+
+
+
+
+
+    public interface PhoneRegisterCallback {
+
+        void onRegisterSuccess(String msg);
+        void onRegisterFailed(String msg);
+
+
+    }
+
+
+
+}

+ 1 - 1
hnqj/src/main/java/com/yyrh/ui/fragment/UserRegisterFragment.java

@@ -207,7 +207,7 @@ public class UserRegisterFragment extends BaseFragment {
                 }
 
                 SDKSettings.isVefityRealName = false;
-                YyrhSdkManager.defaultManager(SDKEntry.getSdkInstance().gameAct).saveUserLoginInfo(SDKEntry.getSdkInstance().gameAct,account,pwd,token);
+                YyrhSdkManager.defaultManager(SDKEntry.getSdkInstance().gameAct).saveUserLoginInfo(SDKEntry.getSdkInstance().gameAct,account,pwd,SDKSettings.loginData.login_token,token);
                 SDKEntry.getSdkInstance().adSdkCallback.onRegisterSuccess(account);
 
                 getActivity().finish();

+ 4 - 2
hnqj/src/main/java/com/yyrh/ui/fragment/UserRetrievePwdFragment.java

@@ -186,11 +186,13 @@ public class UserRetrievePwdFragment extends BaseFragment {
                 SharedPreferences.Editor editor = sp.edit();
                 editor.putString("username", phone);
                 editor.putString("password", pwd);
+                editor.putString("login_token", "");
+
                 editor.commit();
                 String timeStamp = System.currentTimeMillis() + "";
                 String delete_sql = "delete from user where name = '" + phone + "'";
-                String insert_sql = "insert into user(name,pwd,time) values('" + phone
-                        + "','" + pwd + "','" + timeStamp + "')";
+                String insert_sql = "insert into user(name,pwd,login_token,time) values('" + phone
+                        + "','" + pwd + "','"  + "" + "','" + timeStamp + "')";
 
                 DatabaseHelper.excuteSql(getActivity(), delete_sql);
                 DatabaseHelper.excuteSql(getActivity(), insert_sql);

+ 9 - 8
hnqj/src/main/java/com/yyrh/ui/fragment/UserSwitchAccountLoginFragment.java

@@ -118,11 +118,11 @@ public class UserSwitchAccountLoginFragment extends BaseFragment{
 
         }else  if (id == ResourceUtil.getId(getActivity(), "all_item_1")) {
 
-            startLogin(all_item_1.tv_account.getText().toString(),all_item_1.password);
+            startLogin(all_item_1.tv_account.getText().toString(),all_item_1.password,all_item_1.login_token);
         }else  if (id == ResourceUtil.getId(getActivity(), "all_item_2")) {
-            startLogin(all_item_2.tv_account.getText().toString(),all_item_2.password);
+            startLogin(all_item_2.tv_account.getText().toString(),all_item_2.password,all_item_1.login_token);
         }else  if (id == ResourceUtil.getId(getActivity(), "all_item_3")) {
-            startLogin(all_item_3.tv_account.getText().toString(),all_item_3.password);
+            startLogin(all_item_3.tv_account.getText().toString(),all_item_3.password,all_item_1.login_token);
         }else  if (id == ResourceUtil.getId(getActivity(), "tv_other_login_type")) {
             Fragment accountLoginFragment = FragmentUtils.getSdkFragment(getActivity(),FragmentUtils.SDK_PHONE_REGISTER_TAG);
             replaceFragmentToActivity(getFragmentManager(),accountLoginFragment,ResourceUtil.getId(getActivity(),"qj_content"));
@@ -130,21 +130,21 @@ public class UserSwitchAccountLoginFragment extends BaseFragment{
         }
     }
 
-    private void startLogin(final String account, final String pwd){
+    private void startLogin(final String account, final String pwd,final String login_token){
         if (System.currentTimeMillis() - clickLoginTime < CLICK_INTERVAL) {
             YYLog.i("调用登录接口太频繁,拦截此次操作");
             return;
         }
         clickLoginTime = System.currentTimeMillis();
 
-        NetRequestApi.loginWithYy(true,getActivity(), account, pwd, new LoginCallback() {
+        NetRequestApi.loginWithYy(true,getActivity(), account, pwd,login_token, new LoginCallback() {
             @Override
             public void onLoginSuccess(String token) {
 
 
                 getActivity().finish();
 
-                YyrhSdkManager.defaultManager(SDKEntry.getSdkInstance().gameAct).saveUserLoginInfo(SDKEntry.getSdkInstance().gameAct,account,pwd,token);
+                YyrhSdkManager.defaultManager(SDKEntry.getSdkInstance().gameAct).saveUserLoginInfo(SDKEntry.getSdkInstance().gameAct,account,pwd,login_token,token);
 
             }
 
@@ -167,7 +167,7 @@ public class UserSwitchAccountLoginFragment extends BaseFragment{
         accountLoginListView.setVisibility(View.VISIBLE);
         accountLoginListView.tv_account.setText(user.uname);
         accountLoginListView.password = user.pwd;
-
+        accountLoginListView.login_token = user.login_token;
         if (Utils.isNumeric(user.uname)){
             accountLoginListView.tv_account_type.setText(ResourceUtil.getStringId(getActivity(),"qj_phone_login_user"));
             accountLoginListView.iv_account_icon.setImageResource(ResourceUtil.getMipmapId(getActivity(), "qj_phone_user"));
@@ -178,13 +178,14 @@ public class UserSwitchAccountLoginFragment extends BaseFragment{
         ArrayList<User> userList = new ArrayList<User>();
         DatabaseHelper dbHelper = new DatabaseHelper(getActivity());
         SQLiteDatabase db = dbHelper.getReadableDatabase();
-        String qurey_sql = "select name,pwd from user order by time desc";
+        String qurey_sql = "select name,pwd,login_token from user order by time desc";
         Cursor cursor = db.rawQuery(qurey_sql, null);
 
         while (cursor.moveToNext()) {
             User user = new User();
             user.uname = cursor.getString(0);
             user.pwd = cursor.getString(1);
+            user.login_token = cursor.getString(2);
             userList.add(user);
         }
         cursor.close();

+ 1 - 1
hnqj/src/main/java/com/yyrh/ui/userlist/DatabaseHelper.java

@@ -19,7 +19,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
     public void onCreate(SQLiteDatabase db) {
     	
        
-        db.execSQL("create table user(uid varchar(100) primary key , name varchar(100), pwd varchar(100),time varchar(100))");
+        db.execSQL("create table user(uid varchar(100) primary key , name varchar(100), pwd varchar(100),login_token varchar(200),time varchar(100))");
         
     }
 

+ 1 - 0
hnqj/src/main/java/com/yyrh/ui/userlist/User.java

@@ -3,4 +3,5 @@ package com.yyrh.ui.userlist;
 public class User {
     public String uname;
     public String pwd;
+    public String login_token;
 }

+ 145 - 0
hnqj/src/main/res/layout/qj_phone_register_setpwd_dialog.xml

@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="360dp"
+    android:layout_height="280dp"
+    android:background="@drawable/qj_login_bg"
+    >
+
+    <RelativeLayout
+        android:id="@+id/rl1"
+        android:layout_width="match_parent"
+        android:layout_height="60dp">
+
+        <ImageButton
+            android:id="@+id/close_btn"
+            android:layout_width="26dp"
+            android:layout_height="match_parent"
+            android:layout_centerVertical="true"
+            android:layout_marginLeft="30dp"
+            android:src="@mipmap/qj_reback"
+            android:background="@color/qj_transparent"/>
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/qj_set_pwd"
+            android:textSize="19sp"
+            android:layout_centerInParent="true"
+            android:textColor="@color/qj_gray"
+            />
+
+        <ImageButton
+            android:id="@+id/btn_kefu"
+            android:layout_width="26dp"
+            android:layout_height="match_parent"
+            android:layout_alignParentRight="true"
+            android:layout_centerVertical="true"
+            android:layout_marginRight="30dp"
+            android:src="@mipmap/qj_kefu"
+            android:background="@color/qj_transparent" />
+
+    </RelativeLayout>
+
+
+
+
+
+
+        <EditText
+
+            android:id="@+id/reg_pwd_edit"
+            android:layout_width="300dp"
+            android:layout_height="40dp"
+            android:background="@drawable/qj_edittext_bg"
+            android:hint="@string/qj_set_pwd"
+            android:textColorHint="@color/qj_text_hint_color"
+            android:digits="0123456789abcdefghijgklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+            android:maxLength="20"
+            android:maxLines="1"
+            android:textSize="14dp"
+            android:gravity="center_vertical"
+            android:textColor="@color/qj_text_black"
+            android:layout_below="@+id/rl1"
+            android:layout_centerInParent="true"
+            android:layout_marginTop="30dp"
+            android:drawableLeft="@mipmap/qj_lock"
+            android:drawablePadding="5dp"
+            android:paddingLeft="10dp"
+
+            />
+
+
+
+    <RelativeLayout
+        android:id="@+id/reg_tip_ll"
+        android:layout_width="300dp"
+        android:layout_height="35dp"
+        android:layout_marginTop="30dp"
+        android:layout_below="@+id/reg_compete_btn"
+        android:gravity="center"
+        android:layout_centerInParent="true"
+        >
+        <CheckBox
+            android:id="@+id/cb_register"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:layout_marginLeft="20dp"
+            android:checked="true"
+            android:gravity="left|center"
+            style="@style/qj_checkbox_style"
+             />
+        <TextView
+            android:id="@+id/tv_agree_tip"
+            android:layout_toRightOf="@id/cb_register"
+            android:layout_marginLeft="10dp"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:gravity="center"
+            android:textSize="11.2sp"
+            android:text="@string/qj_agreement_tip"
+            android:textColor="@color/qj_text_black"/>
+        <TextView
+            android:id="@+id/tv_tip"
+           android:layout_toRightOf="@id/tv_agree_tip"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:gravity="center"
+            android:textSize="11.2sp"
+            android:text="@string/qj_agree_register_tip"
+            android:textColor="@color/qj_text_deep_orange_color"/>
+        <TextView
+            android:id="@+id/tv_and_tip"
+            android:layout_toRightOf="@id/tv_tip"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:gravity="center"
+            android:textSize="11.2sp"
+            android:text="@string/qj_and"
+            android:textColor="@color/qj_text_black"/>
+        <TextView
+            android:id="@+id/tv_private_policy"
+            android:layout_toRightOf="@id/tv_and_tip"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:gravity="center|left"
+            android:textSize="11.2sp"
+            android:text="@string/qj_private_policy"
+            android:textColor="@color/qj_text_deep_orange_color"/>
+    </RelativeLayout>
+
+
+    <Button
+        android:id="@+id/reg_compete_btn"
+        android:layout_width="300dp"
+        android:layout_height="40dp"
+        android:layout_below="@id/reg_pwd_edit"
+        android:layout_gravity="center_horizontal"
+        android:background="@drawable/qj_login_button_style"
+        android:layout_centerHorizontal="true"
+        android:text="@string/qj_register"
+        android:textColor="@color/qj_white"
+        android:textSize="16sp"
+        android:layout_marginTop="20dp"/>
+
+
+</RelativeLayout>

+ 3 - 2
hnqj/src/main/res/layout/qj_usercenter_dialog.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical"
@@ -42,4 +42,5 @@
 
 
 
-</LinearLayout>
+
+</RelativeLayout>

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

@@ -67,4 +67,6 @@
     <string name="qj_close_float_view_tip">点击确认隐藏,我们将在下次 登录时回归</string>
     <string name="qj_delete_account_tip">是否删除账号:</string>
     <string name="qj_commit_edit">完成编辑</string>
+
+    <string name="qj_set_pwd">设置密码</string>
 </resources>