From c760431eab487ea93a6367bbe8fe125f48c3a3e1 Mon Sep 17 00:00:00 2001 From: liming <820139338@qq.com> Date: Tue, 19 Nov 2019 09:29:37 +0800 Subject: [PATCH] 修改Ui --- .idea/caches/gradle_models.ser | Bin 0 -> 142717 bytes .idea/misc.xml | 14 +++++++++----- app/build.gradle | 13 +++++++++++++ app/src/main/AndroidManifest.xml | 22 ++++++++++++++++++++++ app/src/main/java/com/hh/xuetubao/MyApplication.java | 5 +++++ app/src/main/java/com/hh/xuetubao/MyServer.java | 8 +++++--- app/src/main/java/com/hh/xuetubao/activity/login/BdsjActivity.java | 20 ++++++++++++++++++-- app/src/main/java/com/hh/xuetubao/activity/login/ForgetPasActivity.java | 185 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/java/com/hh/xuetubao/activity/login/JgdlActivity.java | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/java/com/hh/xuetubao/activity/login/LoginActivity.java | 13 +++++++++++-- app/src/main/java/com/hh/xuetubao/activity/study/CourseDetailActivity.java | 1 - app/src/main/java/com/hh/xuetubao/adapter/ListRecGroupAdapter.java | 2 +- app/src/main/java/com/hh/xuetubao/bean/PasLoginBean.java | 39 +++++++++++++++++++++++++++++++++++++++ app/src/main/java/com/hh/xuetubao/model/AccountModel.java | 49 +++++++++++++++++++++++++++++++++++++++++++++---- app/src/main/java/com/hh/xuetubao/wxapi/UIUtils.java | 23 +++++++++++++++++++++++ app/src/main/java/com/hh/xuetubao/wxapi/WXEntryActivity.java | 326 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/java/com/hh/xuetubao/wxapi/WxData.java | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/java/com/hh/xuetubao/wxapi/WxLogin.java | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/res/layout/activity_course_detail.xml | 16 ++++++++++++++++ app/src/main/res/layout/activity_forget_pas.xml | 237 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/res/layout/activity_jgdl.xml | 162 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/res/layout/activity_wxentry.xml | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/res/layout/rv_listgroup.xml | 4 +++- app/src/main/res/values/colors.xml | 8 ++++++++ 24 files changed, 1447 insertions(+), 19 deletions(-) create mode 100644 .idea/caches/gradle_models.ser create mode 100644 app/src/main/java/com/hh/xuetubao/activity/login/ForgetPasActivity.java create mode 100644 app/src/main/java/com/hh/xuetubao/activity/login/JgdlActivity.java create mode 100644 app/src/main/java/com/hh/xuetubao/bean/PasLoginBean.java create mode 100644 app/src/main/java/com/hh/xuetubao/wxapi/UIUtils.java create mode 100644 app/src/main/java/com/hh/xuetubao/wxapi/WXEntryActivity.java create mode 100644 app/src/main/java/com/hh/xuetubao/wxapi/WxData.java create mode 100644 app/src/main/java/com/hh/xuetubao/wxapi/WxLogin.java create mode 100644 app/src/main/res/layout/activity_forget_pas.xml create mode 100644 app/src/main/res/layout/activity_jgdl.xml create mode 100644 app/src/main/res/layout/activity_wxentry.xml diff --git a/.idea/caches/gradle_models.ser b/.idea/caches/gradle_models.ser new file mode 100644 index 0000000..b272e69 Binary files /dev/null and b/.idea/caches/gradle_models.ser differ diff --git a/.idea/misc.xml b/.idea/misc.xml index 74d5827..cc04cd3 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -5,7 +5,7 @@ <option name="myDefaultNotNull" value="android.support.annotation.NonNull" /> <option name="myNullables"> <value> - <list size="7"> + <list size="10"> <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" /> <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" /> <item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" /> @@ -13,25 +13,29 @@ <item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" /> <item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" /> <item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" /> + <item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" /> + <item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" /> + <item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" /> </list> </value> </option> <option name="myNotNulls"> <value> - <list size="6"> + <list size="9"> <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" /> <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" /> <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" /> <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" /> <item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" /> <item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" /> + <item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" /> + <item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" /> + <item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" /> </list> </value> </option> </component> -======= ->>>>>>> liming - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK"> + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/build/classes" /> </component> <component name="ProjectType"> diff --git a/app/build.gradle b/app/build.gradle index e142c6f..5b90482 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -95,5 +95,18 @@ dependencies { implementation files('libs/AMap3DMap_7.1.0_AMapSearch_7.1.0_AMapLocation_4.7.2_20191030.jar') implementation 'com.youth.banner:banner:1.4.10' + // 微信 + implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+' + implementation 'com.zhy:okhttputils:2.4.1' + + //ijkplayer + implementation 'com.dou361.ijkplayer:jjdxm-ijkplayer:1.0.5' + implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8' + implementation 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8' + implementation 'tv.danmaku.ijk.media:ijkplayer-armv5:0.8.8' + implementation 'tv.danmaku.ijk.media:ijkplayer-arm64:0.8.8' + implementation 'tv.danmaku.ijk.media:ijkplayer-x86:0.8.8' + implementation 'tv.danmaku.ijk.media:ijkplayer-x86_64:0.8.8' + implementation 'tv.danmaku.ijk.media:ijkplayer-exo:0.8.8' } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6d190ca..b7ee143 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -48,6 +48,22 @@ <category android:name="android.intent.category.LAUNCHER" /> </intent-filter>--> </activity> + + <!-- 绑定微信 --> + <activity + android:name=".activity.login.BdsjActivity" + android:screenOrientation="portrait" /> + + <!-- 机构登录 --> + <activity + android:name=".activity.login.JgdlActivity" + android:screenOrientation="portrait" /> + + <!-- 忘记密码 --> + <activity + android:name=".activity.login.ForgetPasActivity" + android:screenOrientation="portrait" /> + <activity android:name=".activity.personal.InfromationActivity" android:screenOrientation="portrait" /> @@ -124,6 +140,12 @@ android:name=".activity.pratice.AnswerWrongActivity" android:screenOrientation="portrait" /> + <!-- 微信 --> + <activity + android:name=".wxapi.WXEntryActivity" + android:label="WXEntryActivity" + android:exported="true" /> + </application> </manifest> \ No newline at end of file diff --git a/app/src/main/java/com/hh/xuetubao/MyApplication.java b/app/src/main/java/com/hh/xuetubao/MyApplication.java index 3484e72..6bece53 100644 --- a/app/src/main/java/com/hh/xuetubao/MyApplication.java +++ b/app/src/main/java/com/hh/xuetubao/MyApplication.java @@ -3,6 +3,8 @@ package com.hh.xuetubao; import android.app.Application; import android.content.Context; +import com.hh.xuetubao.wxapi.WxLogin; + public class MyApplication extends Application { public static MyApplication sMyApplication; @@ -12,6 +14,9 @@ public class MyApplication extends Application { public void onCreate() { super.onCreate(); sMyApplication = this; + + WxLogin.initWx(this); // wx + } public static MyApplication getMyApplication() { diff --git a/app/src/main/java/com/hh/xuetubao/MyServer.java b/app/src/main/java/com/hh/xuetubao/MyServer.java index 61f9129..1e8dd3c 100644 --- a/app/src/main/java/com/hh/xuetubao/MyServer.java +++ b/app/src/main/java/com/hh/xuetubao/MyServer.java @@ -150,8 +150,6 @@ public interface MyServer { Observable<UserBean> mobileLogin(@Query("mobileNumber") String mobileNumber, @Query("verCode") String verCode); /** -<<<<<<< HEAD -======= * 微信绑定手机 * * @param OpenId @@ -165,7 +163,6 @@ public interface MyServer { /** ->>>>>>> liming * 微信登录接口 * * @param wxOpenId 微信用户的OpenId @@ -195,6 +192,11 @@ public interface MyServer { @GET("AccountLogin") Observable<UserBean> AccountLogin(@Query("account") String account, @Query("password") String password); + + @FormUrlEncoded + @POST("ResetPwd") + Observable<UserBean> Forget_Pas(@Field("mobileNumber") String num, @Field("verCode") String code, @Field("modifyPwd") String pas); + /** * 手机号码绑定接口 * diff --git a/app/src/main/java/com/hh/xuetubao/activity/login/BdsjActivity.java b/app/src/main/java/com/hh/xuetubao/activity/login/BdsjActivity.java index 0fc1975..6301d14 100644 --- a/app/src/main/java/com/hh/xuetubao/activity/login/BdsjActivity.java +++ b/app/src/main/java/com/hh/xuetubao/activity/login/BdsjActivity.java @@ -65,16 +65,24 @@ public class BdsjActivity extends BaseMvpActivity<CommonPresenter, AccountModel> @Override public void getData(Object o, int api, int intent) { + if (api != 1) { + return; + } switch (intent) { case 1: // 验证码 UserBean bean = (UserBean) o; if (bean.getSuccess()) { Toast.makeText(this, "验证码发送成功", Toast.LENGTH_LONG).show(); + time = 60; timer = new CountDownTimer(60000, 1000) { @Override public void onTick(long millisUntilFinished) { time--; + tvYanzheng.setText(String.valueOf(time) + "s"); + tvYanzheng.setFocusable(false); + tvYanzheng.setFocusableInTouchMode(false); + tvYanzheng.setClickable(false); try { tvYanzheng.setText(String.valueOf(time) + "s"); tvYanzheng.setFocusable(false); @@ -87,15 +95,23 @@ public class BdsjActivity extends BaseMvpActivity<CommonPresenter, AccountModel> public void onFinish() { tvYanzheng.setText("获取验证码"); tvYanzheng.setFocusable(true); + tvYanzheng.setFocusableInTouchMode(true); + tvYanzheng.setClickable(true); time = 60; } }.start(); } else { - Toast.makeText(this, "验证码发送失败", Toast.LENGTH_LONG).show(); + Toast.makeText(this, "验证码发送失败", Toast.LENGTH_SHORT).show(); } break; case 3: // 绑定 - + UserBean bean1 = (UserBean) o; + if (bean1.getSuccess()) { + Toast.makeText(this, "微信绑定成功", Toast.LENGTH_SHORT).show(); + this.finish(); + } else { + Toast.makeText(this, "微信绑定失败", Toast.LENGTH_SHORT).show(); + } break; } } diff --git a/app/src/main/java/com/hh/xuetubao/activity/login/ForgetPasActivity.java b/app/src/main/java/com/hh/xuetubao/activity/login/ForgetPasActivity.java new file mode 100644 index 0000000..00d06e4 --- /dev/null +++ b/app/src/main/java/com/hh/xuetubao/activity/login/ForgetPasActivity.java @@ -0,0 +1,185 @@ +package com.hh.xuetubao.activity.login; + +import android.content.Intent; +import android.os.Bundle; +import android.os.CountDownTimer; +import android.util.Log; +import android.view.View; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import com.hh.xuetubao.R; +import com.hh.xuetubao.bean.UserBean; +import com.hh.xuetubao.model.AccountModel; +import com.hh.xuetubao.mvp.BaseMvpActivity; +import com.hh.xuetubao.mvp.CommonPresenter; +import com.hh.xuetubao.mvp.ICommonView; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; + +public class ForgetPasActivity extends BaseMvpActivity<CommonPresenter, AccountModel> implements ICommonView { + + @BindView(R.id.for_pas_phone) + EditText forPasPhone; + @BindView(R.id.for_pas_code) + EditText forPasCode; + @BindView(R.id.tv_yanzheng) + TextView tvYanzheng; + @BindView(R.id.for_pas_pas) + EditText forPasPas; + @BindView(R.id.for_pas_pas2) + EditText forPasPas2; + + @BindView(R.id.forget_pas_sure) + TextView forgetPasSure; + @BindView(R.id.forget_pas_fhdl) + TextView forgetPasFhdl; + + private int time = 60; + private CountDownTimer timer; + + @Override + public void initView() { + + } + + @Override + public int initLayout() { + return R.layout.activity_forget_pas; + } + + @Override + public void initData() { + + } + + @Override + public CommonPresenter getPresenter() { + return new CommonPresenter(); + } + + @Override + public AccountModel getModel() { + return new AccountModel(); + } + + @Override + public void getData(Object o, int api, int intent) { + + // 验证码 + if (api == 1 && intent == 1) { + UserBean bean = (UserBean) o; + if (bean.getSuccess()) { + Toast.makeText(this, "验证码发送成功", Toast.LENGTH_LONG).show(); + time = 60; + + timer = new CountDownTimer(60000, 1000) { + @Override + public void onTick(long millisUntilFinished) { + time--; + tvYanzheng.setText(String.valueOf(time) + "s"); + tvYanzheng.setFocusable(false); + tvYanzheng.setFocusableInTouchMode(false); + tvYanzheng.setClickable(false); + try { + tvYanzheng.setText(String.valueOf(time) + "s"); + tvYanzheng.setFocusable(false); + } catch (Exception e) { + Log.e("zhangtao", e.toString()); + } + } + + @Override + public void onFinish() { + tvYanzheng.setText("获取验证码"); + tvYanzheng.setFocusable(true); + tvYanzheng.setFocusableInTouchMode(true); + tvYanzheng.setClickable(true); + time = 60; + } + }.start(); + } else { + Toast.makeText(this, "验证码发送失败", Toast.LENGTH_LONG).show(); + } + } + + // 修改密码 + if (api == 1 && intent == 5) { + UserBean bean = (UserBean) o; + if (bean.getSuccess()) { + Toast.makeText(this, "修改成功", Toast.LENGTH_SHORT).show(); + this.finish(); + } else { + Toast.makeText(this, "修改失败", Toast.LENGTH_SHORT).show(); + } + } + + } + + @Override + public void onComplete(int api) { + + } + + @Override + public void onError(Throwable e, int api) { + + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + // TODO: add setContentView(...) invocation + ButterKnife.bind(this); + } + + @OnClick({R.id.tv_yanzheng, R.id.forget_pas_sure, R.id.forget_pas_fhdl}) + public void onViewClicked(View view) { + switch (view.getId()) { + case R.id.tv_yanzheng: // - > 获取验证码 + if (isCellphone(forPasPhone.getText().toString()) == true) + mPresenter.getPresenter(1, 1, forPasPhone.getText().toString(), String.valueOf(2)); // 修改密码部分type == 2 + else + Toast.makeText(this, "请输入正确的手机号码", Toast.LENGTH_LONG).show(); + break; + case R.id.forget_pas_sure: // - > 确定修改 + + String pasA = forPasPas.getText().toString().trim(); + String pasB = forPasPas2.getText().toString().trim(); + String code = forPasCode.getText().toString().trim(); + + if (isCellphone(forPasPhone.getText().toString()) == false) { + Toast.makeText(this, "请输入正确的手机号码", Toast.LENGTH_SHORT).show(); + return; + } else if (code.length() == 0) { + Toast.makeText(this, "验证码不可为空", Toast.LENGTH_SHORT).show(); + return; + } else if (pasA.length() == 0 || pasB.length() == 0) { + Toast.makeText(this, "新密码不可为空", Toast.LENGTH_SHORT).show(); + return; + } else if (!pasA.equals(pasB)) { + Toast.makeText(this, "两次密码必须保持一致", Toast.LENGTH_SHORT).show(); + return; + } else { // 确定修改 + mPresenter.getPresenter(1, 5, forPasPhone.getText().toString().trim(), forPasCode.getText().toString().trim(), forPasPas.getText().toString().trim()); + } + break; + case R.id.forget_pas_fhdl: // - > 返回登录 + startActivity(new Intent(ForgetPasActivity.this, LoginActivity.class)); + break; + } + } + + public static boolean isCellphone(String str) { + Pattern pattern = Pattern.compile("^((13[0-9])|(14[5,7,9])|(15[^4])|(18[0-9])|(17[0,1,3,5,6,7,8]))\\d{8}$"); + Matcher matcher = pattern.matcher(str); + return matcher.matches(); + } + +} diff --git a/app/src/main/java/com/hh/xuetubao/activity/login/JgdlActivity.java b/app/src/main/java/com/hh/xuetubao/activity/login/JgdlActivity.java new file mode 100644 index 0000000..e0feeee --- /dev/null +++ b/app/src/main/java/com/hh/xuetubao/activity/login/JgdlActivity.java @@ -0,0 +1,133 @@ +package com.hh.xuetubao.activity.login; + +import android.content.Intent; +import android.os.Bundle; +import android.text.method.HideReturnsTransformationMethod; +import android.text.method.PasswordTransformationMethod; +import android.view.View; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import com.hh.xuetubao.MainActivity; +import com.hh.xuetubao.R; +import com.hh.xuetubao.Utils.SharedPrefrenceUtils; +import com.hh.xuetubao.bean.PasLoginBean; +import com.hh.xuetubao.bean.UserBean; +import com.hh.xuetubao.model.AccountModel; +import com.hh.xuetubao.mvp.BaseMvpActivity; +import com.hh.xuetubao.mvp.CommonPresenter; +import com.hh.xuetubao.mvp.ICommonView; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; + +public class JgdlActivity extends BaseMvpActivity<CommonPresenter, AccountModel> implements ICommonView { + + @BindView(R.id.ed_yhm) + EditText edYhm; + @BindView(R.id.ed_pas) + EditText edPas; + @BindView(R.id.jgdl_wjmm) + TextView jgdlWjmm; + @BindView(R.id.jgdl_sure) + TextView jgdlSure; + @BindView(R.id.jgdl_fhdl) + TextView jgdlFhdl; + @BindView(R.id.jgdl_image) + ImageView jgdlImage; + + private boolean isOpenEye = false; + + @Override + public void initView() { + //从密码可见模式变为密码不可见模式 + edPas.setTransformationMethod(PasswordTransformationMethod.getInstance()); + } + + @Override + public int initLayout() { + return R.layout.activity_jgdl; + } + + @Override + public void initData() { + + } + + @Override + public CommonPresenter getPresenter() { + return new CommonPresenter(); + } + + @Override + public AccountModel getModel() { + return new AccountModel(); + } + + @Override + public void getData(Object o, int api, int intent) { + if (api == 1 && intent == 4) { + UserBean bean = (UserBean) o; + if (bean.getSuccess()) { + Toast.makeText(this, "登录成功", Toast.LENGTH_SHORT).show(); + SharedPrefrenceUtils.saveString(this, "AccountOid", bean.getAccountOid()); + startActivity(new Intent(this, MainActivity.class)); + this.finish(); + } else { + Toast.makeText(this, "登录失败", Toast.LENGTH_SHORT).show(); + } + } + } + + @Override + public void onComplete(int api) { + + } + + @Override + public void onError(Throwable e, int api) { + + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + // TODO: add setContentView(...) invocation + ButterKnife.bind(this); + } + + @OnClick({R.id.jgdl_wjmm, R.id.jgdl_sure, R.id.jgdl_fhdl, R.id.jgdl_image}) + public void onViewClicked(View view) { + switch (view.getId()) { + case R.id.jgdl_wjmm: // - > 忘记密码? + startActivity(new Intent(this, ForgetPasActivity.class)); + break; + case R.id.jgdl_sure: // - > 确定 + if (edYhm.getText().length() == 0 || edPas.length() == 0) { + Toast.makeText(this, "用户名和密码不可为空", Toast.LENGTH_SHORT).show(); + return; + } else { + mPresenter.getPresenter(1, 4, edYhm.getText().toString().trim(), edPas.getText().toString().trim()); + } + break; + case R.id.jgdl_fhdl: // - > 返回登录 + this.finish(); + break; + case R.id.jgdl_image: // - > 登录密码可见 + if (isOpenEye == false) { + //从密码不可见模式变为密码可见模式 + edPas.setTransformationMethod(HideReturnsTransformationMethod.getInstance()); + isOpenEye = true; + } else { + //从密码可见模式变为密码不可见模式 + edPas.setTransformationMethod(PasswordTransformationMethod.getInstance()); + isOpenEye = false; + } + break; + } + } + +} diff --git a/app/src/main/java/com/hh/xuetubao/activity/login/LoginActivity.java b/app/src/main/java/com/hh/xuetubao/activity/login/LoginActivity.java index bcefe2b..7472e5b 100644 --- a/app/src/main/java/com/hh/xuetubao/activity/login/LoginActivity.java +++ b/app/src/main/java/com/hh/xuetubao/activity/login/LoginActivity.java @@ -19,6 +19,10 @@ import com.hh.xuetubao.model.AccountModel; import com.hh.xuetubao.mvp.BaseMvpActivity; import com.hh.xuetubao.mvp.CommonPresenter; import com.hh.xuetubao.mvp.ICommonView; +import com.hh.xuetubao.wxapi.WxLogin; +import com.tencent.mm.opensdk.modelmsg.SendAuth; +import com.tencent.mm.opensdk.openapi.IWXAPI; +import com.tencent.mm.opensdk.openapi.WXAPIFactory; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -150,6 +154,8 @@ public class LoginActivity extends BaseMvpActivity<CommonPresenter, AccountModel ButterKnife.bind(this); } + IWXAPI api; + @Override public void onClick(View v) { switch (v.getId()) { @@ -166,9 +172,12 @@ public class LoginActivity extends BaseMvpActivity<CommonPresenter, AccountModel else Toast.makeText(this, "请输入正确的手机号码", Toast.LENGTH_LONG).show(); break; - case R.id.img_wechat: + case R.id.img_wechat: // 微信 + WxLogin.longWx(); +// startActivity(new Intent(LoginActivity.this, BdsjActivity.class)); break; - case R.id.img_jigou: + case R.id.img_jigou: // 机构登录 + startActivity(new Intent(LoginActivity.this, JgdlActivity.class)); break; } } diff --git a/app/src/main/java/com/hh/xuetubao/activity/study/CourseDetailActivity.java b/app/src/main/java/com/hh/xuetubao/activity/study/CourseDetailActivity.java index 7aa2dd7..f6526de 100644 --- a/app/src/main/java/com/hh/xuetubao/activity/study/CourseDetailActivity.java +++ b/app/src/main/java/com/hh/xuetubao/activity/study/CourseDetailActivity.java @@ -69,7 +69,6 @@ public class CourseDetailActivity extends BaseMvpActivity<CommonPresenter, Learn linIntroduce.setOnClickListener(this); linList.setOnClickListener(this); - } diff --git a/app/src/main/java/com/hh/xuetubao/adapter/ListRecGroupAdapter.java b/app/src/main/java/com/hh/xuetubao/adapter/ListRecGroupAdapter.java index 5c1cd65..28ad25d 100644 --- a/app/src/main/java/com/hh/xuetubao/adapter/ListRecGroupAdapter.java +++ b/app/src/main/java/com/hh/xuetubao/adapter/ListRecGroupAdapter.java @@ -37,12 +37,12 @@ public class ListRecGroupAdapter extends RecyclerView.Adapter<ListRecGroupAdapte if (list.get(position).getChapterName() != null) holder.textView.setText(list.get(position).getChapterName()); - List<ChapterLstBean.SectionLstObject> sectionLst = list.get(position).getSectionLst(); ListRecChildAdapter childAdapter = new ListRecChildAdapter(context, sectionLst); holder.recChild.setAdapter(childAdapter); holder.recChild.setLayoutManager(new LinearLayoutManager(context)); + } @Override diff --git a/app/src/main/java/com/hh/xuetubao/bean/PasLoginBean.java b/app/src/main/java/com/hh/xuetubao/bean/PasLoginBean.java new file mode 100644 index 0000000..24f4135 --- /dev/null +++ b/app/src/main/java/com/hh/xuetubao/bean/PasLoginBean.java @@ -0,0 +1,39 @@ +package com.hh.xuetubao.bean; + +public class PasLoginBean { + + + /** + * IsSuccess : true + * AccountOid : 16EA2C01-20E3-420D-AB4E-4E44F0539349 + * IsBindMobile : false + */ + + private boolean IsSuccess; + private String AccountOid; + private boolean IsBindMobile; + + public boolean isIsSuccess() { + return IsSuccess; + } + + public void setIsSuccess(boolean IsSuccess) { + this.IsSuccess = IsSuccess; + } + + public String getAccountOid() { + return AccountOid; + } + + public void setAccountOid(String AccountOid) { + this.AccountOid = AccountOid; + } + + public boolean isIsBindMobile() { + return IsBindMobile; + } + + public void setIsBindMobile(boolean IsBindMobile) { + this.IsBindMobile = IsBindMobile; + } +} diff --git a/app/src/main/java/com/hh/xuetubao/model/AccountModel.java b/app/src/main/java/com/hh/xuetubao/model/AccountModel.java index 5b4fa00..165cd83 100644 --- a/app/src/main/java/com/hh/xuetubao/model/AccountModel.java +++ b/app/src/main/java/com/hh/xuetubao/model/AccountModel.java @@ -18,12 +18,21 @@ public class AccountModel implements ICommonModel { public void getModel(ICommonView commonView, int api, int intent, String... params) { mServers = HttpUtils.getInstance().getServer(NetConfig.accountUrl); - if (api == 1 && intent == 1) { + if (api == 1 && intent == 1) { // - > 验证码 sendValidateCode(commonView, api, intent, params); } - if (api == 1 && intent == 2) { + if (api == 1 && intent == 2) { // - > 验证码登录 mobileLogin(commonView, api, intent, params); } + if (api == 1 && intent == 3) { // - > 微信绑定手机号 + bd_phone(commonView, api, intent, params); + } + if (api == 1 && intent == 4) { // - > 机构登录 + jg_login(commonView, api, intent, params); + } + if(api == 1 && intent == 5){ // 忘记密码 + forget_pas(commonView, api, intent, params); + } } @@ -43,7 +52,7 @@ public class AccountModel implements ICommonModel { }); } - /* 手机号登录 */ + /* 验证码登录 */ private void mobileLogin(final ICommonView commonView, final int api, final int intent, String... params) { if (api == 1 && intent == 2) mServers.mobileLogin(params[0], params[1]) @@ -59,8 +68,9 @@ public class AccountModel implements ICommonModel { }); } + /* 微信绑定手机号 */ private void bd_phone(final ICommonView commonView, final int api, final int tag, String... params) { - if (api == 1 && tag == 2) { + if (api == 1 && tag == 3) { mServers.bd_phone(params[0], params[1], params[2]) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) @@ -74,5 +84,36 @@ public class AccountModel implements ICommonModel { } } + /* 机构登录 */ + private void jg_login(final ICommonView commonView, final int api, final int tag, String... params) { + if (api == 1 && tag == 4) { + mServers.AccountLogin(params[0], params[1]) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObsever() { + @Override + public void onNext(Object value) { + super.onNext(value); + commonView.getData(value, api, tag); + } + }); + } + } + + /* 忘记密码 */ + private void forget_pas(final ICommonView commonView, final int api, final int tag, String... params) { + if (api == 1 && tag == 5) { + mServers.Forget_Pas(params[0], params[1], params[2]) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObsever() { + @Override + public void onNext(Object value) { + super.onNext(value); + commonView.getData(value, api, tag); + } + }); + } + } } diff --git a/app/src/main/java/com/hh/xuetubao/wxapi/UIUtils.java b/app/src/main/java/com/hh/xuetubao/wxapi/UIUtils.java new file mode 100644 index 0000000..f98c1e5 --- /dev/null +++ b/app/src/main/java/com/hh/xuetubao/wxapi/UIUtils.java @@ -0,0 +1,23 @@ +package com.hh.xuetubao.wxapi; + +import android.content.Context; +import android.widget.Toast; + +/** + * Created by 14178 on 2018/1/19. + */ + +public class UIUtils { + + private static Context mContext; + + public static void initContext(Context context) { + + mContext = context; + } + + public static void runOnUIToast(String str){ + Toast.makeText(mContext, str, Toast.LENGTH_SHORT).show(); + + } +} diff --git a/app/src/main/java/com/hh/xuetubao/wxapi/WXEntryActivity.java b/app/src/main/java/com/hh/xuetubao/wxapi/WXEntryActivity.java new file mode 100644 index 0000000..8b0e5b6 --- /dev/null +++ b/app/src/main/java/com/hh/xuetubao/wxapi/WXEntryActivity.java @@ -0,0 +1,326 @@ +package com.hh.xuetubao.wxapi; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.os.CountDownTimer; +import android.util.Log; +import android.view.View; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import com.hh.xuetubao.R; +import com.hh.xuetubao.bean.UserBean; +import com.hh.xuetubao.model.AccountModel; +import com.hh.xuetubao.mvp.BaseMvpActivity; +import com.hh.xuetubao.mvp.CommonPresenter; +import com.hh.xuetubao.mvp.ICommonView; +import com.tencent.mm.opensdk.modelbase.BaseReq; +import com.tencent.mm.opensdk.modelbase.BaseResp; +import com.tencent.mm.opensdk.modelmsg.SendAuth; +import com.tencent.mm.opensdk.openapi.IWXAPI; +import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler; +import com.tencent.mm.opensdk.openapi.WXAPIFactory; +import com.zhy.http.okhttp.OkHttpUtils; +import com.zhy.http.okhttp.callback.StringCallback; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; + +public class WXEntryActivity extends BaseMvpActivity<CommonPresenter, AccountModel> implements ICommonView, IWXAPIEventHandler { + private static final int RETURN_MSG_TYPE_LOGIN = 1; + private static final int RETURN_MSG_TYPE_SHARE = 2; + private IWXAPI mWeixinAPI; + + @BindView(R.id.ed_phone) + EditText edPhone; + @BindView(R.id.ed_code) + EditText edCode; + @BindView(R.id.tv_yanzheng) + TextView tvYanzheng; + @BindView(R.id.bdsj_sure) + TextView bdsjSure; + @BindView(R.id.bdsj_fhdl) + TextView bdsjFhdl; + + private CountDownTimer timer; + private int time = 60; + + @Override + public void initView() { + ButterKnife.bind(this); + mWeixinAPI = WXAPIFactory.createWXAPI(this, WxData.WEIXIN_APP_ID, true); + mWeixinAPI.handleIntent(this.getIntent(), this); + } + + @Override + public int initLayout() { + return R.layout.activity_bdsj; // R.layout.activity_wxentry + } + + @Override + public void initData() { + + } + + @Override + public CommonPresenter getPresenter() { + return new CommonPresenter(); + } + + @Override + public AccountModel getModel() { + return new AccountModel(); + } + + @Override + public void getData(Object o, int api, int intent) { + if (api != 1) { + return; + } + switch (intent) { + case 1: // 验证码 + UserBean bean = (UserBean) o; + if (bean.getSuccess()) { + Toast.makeText(this, "验证码发送成功", Toast.LENGTH_LONG).show(); + time = 60; + + timer = new CountDownTimer(60000, 1000) { + @Override + public void onTick(long millisUntilFinished) { + time--; + tvYanzheng.setText(String.valueOf(time) + "s"); + tvYanzheng.setFocusable(false); + tvYanzheng.setFocusableInTouchMode(false); + tvYanzheng.setClickable(false); + try { + tvYanzheng.setText(String.valueOf(time) + "s"); + tvYanzheng.setFocusable(false); + } catch (Exception e) { + Log.e("zhangtao", e.toString()); + } + } + + @Override + public void onFinish() { + tvYanzheng.setText("获取验证码"); + tvYanzheng.setFocusable(true); + tvYanzheng.setFocusableInTouchMode(true); + tvYanzheng.setClickable(true); + time = 60; + } + }.start(); + } else { + Toast.makeText(this, "验证码发送失败", Toast.LENGTH_SHORT).show(); + } + break; + case 3: // 绑定 + UserBean bean1 = (UserBean) o; + if (bean1.getSuccess()) { + Toast.makeText(this, "微信绑定成功", Toast.LENGTH_SHORT).show(); + this.finish(); + } else { + Toast.makeText(this, "微信绑定失败", Toast.LENGTH_SHORT).show(); + } + break; + } + } + + @OnClick({R.id.tv_yanzheng, R.id.bdsj_sure, R.id.bdsj_fhdl}) + public void onViewClicked(View view) { + switch (view.getId()) { + case R.id.tv_yanzheng: // - > 验证码 + if (isCellphone(edPhone.getText().toString())) + mPresenter.getPresenter(1, 1, edPhone.getText().toString(), String.valueOf(1)); // 1 -> 微信或手机号码绑定时发送 + else + Toast.makeText(this, "请输入正确的手机号码", Toast.LENGTH_LONG).show(); + break; + case R.id.bdsj_sure: // - > 确定 + if (isCellphone(edPhone.getText().toString())) { + Toast.makeText(this, "请输入正确的手机号码", Toast.LENGTH_LONG).show(); + return; + } else if (edPhone.getText().length() > 0 && edCode.getText().length() > 0) { + Toast.makeText(this, "手机号和验证码不可为空", Toast.LENGTH_LONG).show(); + return; + } else { + mPresenter.getPresenter(1, 3, edPhone.getText().toString().trim(), edCode.getText().toString().trim()); // - > 绑定 + } + break; + case R.id.bdsj_fhdl: // - > 返回登录 + this.finish(); + break; + } + } + + public static boolean isCellphone(String str) { + Pattern pattern = Pattern.compile("^((13[0-9])|(14[5,7,9])|(15[^4])|(18[0-9])|(17[0,1,3,5,6,7,8]))\\d{8}$"); + Matcher matcher = pattern.matcher(str); + return matcher.matches(); + } + + + + + + @Override + protected void onNewIntent(Intent intent) { + super.onNewIntent(intent); + setIntent(intent); + mWeixinAPI.handleIntent(intent, this);//必须调用此句话 + } + + @Override + public void onReq(BaseReq baseReq) { + Log.e("-----", "onReq: " + baseReq); + finish(); + } + + + @Override + public void onResp(BaseResp baseResp) { + Log.e("-----", "errStr: " + baseResp.errStr); + Log.e("-----", "openId: " + baseResp.openId); + Log.e("-----", "transaction: " + baseResp.transaction); + Log.e("-----", "errCode: " + baseResp.errCode); + Log.e("-----", "getType: " + baseResp.getType()); + Log.e("-----", "checkArgs: " + baseResp.checkArgs()); + + + switch (baseResp.errCode) { + + case BaseResp.ErrCode.ERR_AUTH_DENIED: + case BaseResp.ErrCode.ERR_USER_CANCEL: + if (RETURN_MSG_TYPE_SHARE == baseResp.getType()) UIUtils.runOnUIToast("分享失败"); + else UIUtils.runOnUIToast("登录失败"); + break; + case BaseResp.ErrCode.ERR_OK: + switch (baseResp.getType()) { + case RETURN_MSG_TYPE_LOGIN: + //拿到了微信返回的code,立马再去请求access_token + String code = ((SendAuth.Resp) baseResp).code; + getAccess_token(code); + //就在这个地方,用网络库什么的或者自己封的网络api,发请求去咯,注意是get请求 + + Log.e("--------", "code: " + code); +// id_tv.setText("code: " + code); // + break; + + case RETURN_MSG_TYPE_SHARE: + UIUtils.runOnUIToast("微信分享成功"); + finish(); + break; + } + break; + } + } + + + /** + * 获取openid accessToken值用于后期操作 + * + * @param code 请求码 + */ + private void getAccess_token(final String code) { + String path = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + + WxData.WEIXIN_APP_ID + + "&secret=" + + WxData.APP_SECRET + + "&code=" + + code + + "&grant_type=authorization_code"; + OkHttpUtils.get().url(path).build().execute(new StringCallback() { + + @Override + public void onError(okhttp3.Call call, Exception e) { + + } + + @Override + public void onResponse(String response) { + + Log.e("-----", "onResponse: " + response); + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(response); + String openid = jsonObject.getString("openid").toString().trim(); + String access_token = jsonObject.getString("access_token").toString().trim(); + getUserMesg(access_token, openid); + } catch (JSONException e) { + e.printStackTrace(); + } + + } + }); + + } + + + /** + * 获取微信的个人信息 + * + * @param access_token + * @param openid + */ + private void getUserMesg(final String access_token, final String openid) { + String path = "https://api.weixin.qq.com/sns/userinfo?access_token=" + + access_token + + "&openid=" + + openid; + + + OkHttpUtils.get().url(path).build().execute(new StringCallback() { + + + @Override + public void onError(okhttp3.Call call, Exception e) { + + } + + @Override + public void onResponse(String response) { + Log.e("------", "全部数据: " + response); + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(response); + String nickname = jsonObject.getString("nickname"); + int sex = Integer.parseInt(jsonObject.get("sex").toString()); + String headimgurl = jsonObject.getString("headimgurl"); + String openid1 = jsonObject.getString("openid"); + Log.e("---", "用户基本信息:"); + Log.e("---", "nickname:" + nickname); +// nickname_tv.setText("nickname: " +nickname); + Log.e("---", "sex: " + sex); +// sex_tv.setText("sex: " + sex + ""); + Log.e("---", "headimgurl:" + headimgurl); + // startLoca(nickname, openid1); + } catch (JSONException e) { + e.printStackTrace(); + UIUtils.runOnUIToast("登陆错误,请重新再试"); + + } + // finish(); + } + }); + + } + + + + @Override + public void onComplete(int api) { + + } + + @Override + public void onError(Throwable e, int api) { + + } +} diff --git a/app/src/main/java/com/hh/xuetubao/wxapi/WxData.java b/app/src/main/java/com/hh/xuetubao/wxapi/WxData.java new file mode 100644 index 0000000..30d624b --- /dev/null +++ b/app/src/main/java/com/hh/xuetubao/wxapi/WxData.java @@ -0,0 +1,57 @@ +package com.hh.xuetubao.wxapi; + +/** + * XINHAO_HAN存储信息 + */ + +public class WxData { + + + /** + * 你的AppID + * + * 在此特别注意,本Demo只适用微信的登陆功能,并不能用到微信支付功能 + * + * 在此注意,必须要和微信官网签名一致,否则调用不起来微信APP, + * + * 如果在你调用出错的情况下(微信APP死活不出来的情况下),请参阅作者简书网址 : https://www.jianshu.com/p/04ed0b65f3df + * + * 微信APP掉不出来:有以下原因: + * + * 1.签名不正确(APK所使用签名的MD5码) 签名MD5码不要有 : 如A0:5B:12:63.... ,要全部是小写(推荐)a05b1263...,这种形式的 + * + * 2.APP_ID不正确 + * + * 3.密匙不正确 + * + * 4.包名不正确 + * + * 不走回调WXEntryActivity + * + * 1.AndroidManifest.xml里没有配置 + * + * <activity + * android:name=".wxapi.WXEntryActivity" + * android:exported="true" + * android:label="WXEntryActivity" /> + * 2.必须是 你的包名.wxapi + * 如果你的所有信息填写正确,还是掉不起来微信,那就可能是微信服务器问题,请稍等3-5分钟,在尝试调用,否则就重复以上选项 + * 大兄弟,记得细心一点哟~~~ + * + * + * + * + */ + public static final String WEIXIN_APP_ID = ""; + public static final String APP_SECRET = ""; + + /** + * 固定的 + * + */ + + public static final String SCOPE = "snsapi_userinfo"; + public static final String STATE = "wechat_sdk_demo_test_neng"; + + +} diff --git a/app/src/main/java/com/hh/xuetubao/wxapi/WxLogin.java b/app/src/main/java/com/hh/xuetubao/wxapi/WxLogin.java new file mode 100644 index 0000000..dd8e5fa --- /dev/null +++ b/app/src/main/java/com/hh/xuetubao/wxapi/WxLogin.java @@ -0,0 +1,52 @@ +package com.hh.xuetubao.wxapi; + +import android.content.Context; +import android.widget.Toast; + +import com.tencent.mm.opensdk.modelmsg.SendAuth; +import com.tencent.mm.opensdk.openapi.IWXAPI; +import com.tencent.mm.opensdk.openapi.WXAPIFactory; + +/** + * Created by 14178 on 2018/1/19. + */ + +public class WxLogin { + + public static IWXAPI api; + public static Context mContext; + + /** + * 急的初始化 + * + * @param context + */ + public static void initWx(Context context) { + UIUtils.initContext(context); + mContext = context; + api = WXAPIFactory.createWXAPI(context, WxData.WEIXIN_APP_ID, true); + api.registerApp(WxData.WEIXIN_APP_ID); + + final IWXAPI msgApi = WXAPIFactory.createWXAPI(context, null); + // 将该app注册到微信 + msgApi.registerApp(WxData.WEIXIN_APP_ID); + } + + public static void longWx() { + if (mContext == null) { + Toast.makeText(mContext, "你没有初始化,请在Application中做初始化动作,请调用 initWx(context)方法", Toast.LENGTH_SHORT).show(); + return; + } + if (!api.isWXAppInstalled()) { + Toast.makeText(mContext, "您还未安装微信客户端", Toast.LENGTH_SHORT).show(); + return; + } + final SendAuth.Req req = new SendAuth.Req(); + req.scope = WxData.SCOPE; + req.state = WxData.STATE; + api.sendReq(req); + + } + + +} diff --git a/app/src/main/res/layout/activity_course_detail.xml b/app/src/main/res/layout/activity_course_detail.xml index 03e6fb7..603c5ca 100644 --- a/app/src/main/res/layout/activity_course_detail.xml +++ b/app/src/main/res/layout/activity_course_detail.xml @@ -28,6 +28,14 @@ android:textColor="#FF5400" android:textSize="12sp" /> + <TextView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + android:text="介绍" + android:textColor="#616161" + android:textSize="@dimen/sp_15" /> + </LinearLayout> <View android:layout_width="@dimen/dp_1" @@ -46,6 +54,14 @@ android:textColor="#616161" android:textSize="12sp" /> + <TextView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + android:text="目录" + android:textColor="#616161" + android:textSize="12sp" /> + </LinearLayout> </LinearLayout> diff --git a/app/src/main/res/layout/activity_forget_pas.xml b/app/src/main/res/layout/activity_forget_pas.xml new file mode 100644 index 0000000..f0cc1b9 --- /dev/null +++ b/app/src/main/res/layout/activity_forget_pas.xml @@ -0,0 +1,237 @@ +<?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:gravity="center_horizontal" + android:orientation="vertical"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="@dimen/dp_60" + android:text="忘记密码" + android:textColor="@color/color_232323" + android:textSize="@dimen/sp_17" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="@dimen/dp_40" + android:layout_marginLeft="@dimen/dp_29" + android:layout_marginTop="@dimen/dp_32" + android:layout_marginRight="@dimen/dp_29" + android:gravity="center_vertical" + android:orientation="horizontal"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="手机号" + android:textColor="@color/color_6666666" + android:textSize="@dimen/sp_12" /> + + <EditText + android:layout_width="@dimen/dp_0" + android:layout_height="match_parent" + android:layout_weight="1" + android:background="@null" + android:hint="| 请输入手机号" + android:textColor="@color/color_c7c7c7" + android:textSize="@dimen/sp_12" + android:layout_marginLeft="@dimen/dp_37" + android:id="@+id/for_pas_phone" + /> + + </LinearLayout> + + <View + android:layout_width="match_parent" + android:layout_height="@dimen/dp_1" + android:layout_marginLeft="@dimen/dp_29" + android:layout_marginRight="@dimen/dp_29" + android:background="@color/color_333333" /> + + <!--<LinearLayout--> + <!--android:layout_width="match_parent"--> + <!--android:layout_height="@dimen/dp_40"--> + <!--android:layout_marginLeft="@dimen/dp_29"--> + <!--android:layout_marginTop="@dimen/dp_22"--> + <!--android:layout_marginRight="@dimen/dp_29"--> + <!--android:gravity="center_vertical"--> + <!--android:orientation="horizontal">--> + + <!--<TextView--> + <!--android:layout_width="wrap_content"--> + <!--android:layout_height="wrap_content"--> + <!--android:text="问题"--> + <!--android:textColor="@color/color_6666666"--> + <!--android:textSize="@dimen/sp_12" />--> + + <!--<EditText--> + <!--android:layout_width="@dimen/dp_0"--> + <!--android:layout_height="match_parent"--> + <!--android:layout_weight="1"--> + <!--android:background="@null"--> + <!--android:hint="请输入正确答案"--> + <!--android:textColor="@color/color_c7c7c7"--> + <!--android:textSize="@dimen/sp_12"--> + <!--android:layout_marginLeft="@dimen/dp_54"--> + <!--android:id="@+id/for_pas_wt"--> + <!--/>--> + + <!--</LinearLayout>--> + + <!--<View--> + <!--android:layout_width="match_parent"--> + <!--android:layout_height="@dimen/dp_1"--> + <!--android:layout_marginLeft="@dimen/dp_29"--> + <!--android:layout_marginRight="@dimen/dp_29"--> + <!--android:background="@color/color_d5d5d5" />--> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="@dimen/dp_40" + android:layout_marginLeft="@dimen/dp_29" + android:layout_marginTop="@dimen/dp_22" + android:layout_marginRight="@dimen/dp_29" + android:gravity="center_vertical" + android:orientation="horizontal"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="验证码" + android:textColor="@color/color_6666666" + android:textSize="@dimen/sp_12" /> + + <EditText + android:layout_width="@dimen/dp_0" + android:layout_height="match_parent" + android:layout_weight="1" + android:background="@null" + android:hint="请输入短信验证码" + android:textColor="@color/color_c7c7c7" + android:textSize="@dimen/sp_12" + android:layout_marginLeft="@dimen/dp_43" + android:id="@+id/for_pas_code" + /> + + <TextView + android:id="@+id/tv_yanzheng" + android:layout_width="@dimen/dp_75" + android:layout_height="@dimen/dp_25" + android:background="@drawable/login_circle" + android:gravity="center" + android:text="获取验证码" + android:textColor="#FFFFFF" + android:textSize="11sp" /> + + </LinearLayout> + + <View + android:layout_width="match_parent" + android:layout_height="@dimen/dp_1" + android:layout_marginLeft="@dimen/dp_29" + android:layout_marginRight="@dimen/dp_29" + android:background="@color/color_d5d5d5" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="@dimen/dp_40" + android:layout_marginLeft="@dimen/dp_29" + android:layout_marginTop="@dimen/dp_22" + android:layout_marginRight="@dimen/dp_29" + android:gravity="center_vertical" + android:orientation="horizontal"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="新密码" + android:textColor="@color/color_6666666" + android:textSize="@dimen/sp_12" /> + + <EditText + android:layout_width="@dimen/dp_0" + android:layout_height="match_parent" + android:layout_weight="1" + android:background="@null" + android:hint="请输入新密码" + android:textColor="@color/color_c7c7c7" + android:textSize="@dimen/sp_12" + android:layout_marginLeft="@dimen/dp_43" + android:id="@+id/for_pas_pas" + /> + + </LinearLayout> + + <View + android:layout_width="match_parent" + android:layout_height="@dimen/dp_1" + android:layout_marginLeft="@dimen/dp_29" + android:layout_marginRight="@dimen/dp_29" + android:background="@color/color_d5d5d5" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="@dimen/dp_40" + android:layout_marginLeft="@dimen/dp_29" + android:layout_marginTop="@dimen/dp_22" + android:layout_marginRight="@dimen/dp_29" + android:gravity="center_vertical" + android:orientation="horizontal"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="确认新密码" + android:textColor="@color/color_6666666" + android:textSize="@dimen/sp_12" /> + + <EditText + android:layout_width="@dimen/dp_0" + android:layout_height="match_parent" + android:layout_weight="1" + android:background="@null" + android:hint="请再次输入新密码" + android:textColor="@color/color_c7c7c7" + android:textSize="@dimen/sp_12" + android:layout_marginLeft="@dimen/dp_19" + android:id="@+id/for_pas_pas2" + /> + + </LinearLayout> + + <View + android:layout_width="match_parent" + android:layout_height="@dimen/dp_1" + android:layout_marginLeft="@dimen/dp_29" + android:layout_marginRight="@dimen/dp_29" + android:background="@color/color_d5d5d5" /> + + <TextView + android:id="@+id/forget_pas_sure" + android:layout_width="match_parent" + android:layout_height="@dimen/dp_50" + android:layout_marginLeft="@dimen/dp_25" + android:layout_marginTop="@dimen/dp_124" + android:layout_marginRight="@dimen/dp_25" + android:background="@drawable/circle_orange" + android:gravity="center" + android:text="确定" + android:textColor="#FFFFFF" + android:textSize="16sp" /> + + <TextView + android:id="@+id/forget_pas_fhdl" + android:layout_width="match_parent" + android:layout_height="@dimen/dp_50" + android:layout_marginLeft="@dimen/dp_25" + android:layout_marginTop="@dimen/dp_10" + android:layout_marginRight="@dimen/dp_25" + android:background="@drawable/circle_grey_25" + android:gravity="center" + android:text="返回登录" + android:textColor="@color/color_6666666" + android:textSize="16sp" /> + +</LinearLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_jgdl.xml b/app/src/main/res/layout/activity_jgdl.xml new file mode 100644 index 0000000..79fb4ed --- /dev/null +++ b/app/src/main/res/layout/activity_jgdl.xml @@ -0,0 +1,162 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <TextView + android:id="@+id/tv_login" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_marginTop="@dimen/dp_60" + android:text="机构登录" + android:textColor="#232323" + android:textSize="17sp" /> + + <ImageView + android:id="@+id/img_phone" + android:layout_width="@dimen/dp_18" + android:layout_height="@dimen/dp_18" + android:layout_below="@+id/tv_login" + android:layout_marginLeft="@dimen/dp_25" + android:layout_marginTop="@dimen/dp_50" + android:src="@mipmap/login_phone" + android:visibility="invisible" /> + + <TextView + android:id="@+id/tv_phone" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignBottom="@+id/img_phone" + android:layout_marginLeft="@dimen/dp_29" + android:text="用户名" + android:textColor="#666666" + android:textSize="@dimen/sp_12" /> + + <EditText + android:id="@+id/ed_yhm" + android:layout_width="match_parent" + android:layout_height="@dimen/dp_18" + android:layout_alignBottom="@id/img_phone" + android:layout_marginLeft="@dimen/dp_15" + android:layout_marginRight="@dimen/dp_29" + android:layout_toRightOf="@id/tv_phone" + android:background="@null" + android:hint="|请输入登录用户名" + android:textColorHint="#C7C7C7" + android:textSize="12sp" /> + + <View + android:id="@+id/line2" + android:layout_width="match_parent" + android:layout_height="@dimen/dp_1" + android:layout_below="@id/img_phone" + android:layout_marginLeft="@dimen/dp_29" + android:layout_marginTop="@dimen/dp_15" + android:layout_marginRight="@dimen/dp_29" + android:background="#333333" /> + + <ImageView + android:id="@+id/img_message" + android:layout_width="@dimen/dp_18" + android:layout_height="@dimen/dp_18" + android:layout_below="@id/line2" + android:layout_marginLeft="@dimen/dp_25" + android:layout_marginTop="@dimen/dp_35" + android:src="@mipmap/login_message" + android:visibility="invisible" /> + + <TextView + android:id="@+id/tv_message" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignBottom="@+id/img_message" + android:layout_marginLeft="@dimen/dp_29" + android:text="密码" + android:textColor="#666666" + android:textSize="@dimen/sp_12" /> + + <LinearLayout + android:id="@+id/sss" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignBottom="@id/img_message" + android:layout_marginLeft="@dimen/dp_15" + android:layout_toRightOf="@id/tv_message" + android:gravity="center_vertical" + android:orientation="horizontal"> + + <EditText + android:id="@+id/ed_pas" + android:layout_width="0dp" + android:layout_height="@dimen/dp_18" + android:layout_weight="1" + android:background="@null" + android:hint="请输入登录密码" + android:textColorHint="#C7C7C7" + android:textSize="12sp" /> + + <ImageView + android:layout_width="@dimen/dp_12" + android:layout_height="@dimen/dp_9" + android:layout_alignTop="@+id/ed_pas" + android:layout_marginLeft="@dimen/dp_10" + android:layout_marginRight="@dimen/dp_30" + android:layout_toRightOf="@+id/ed_pas" + android:id="@+id/jgdl_image" + android:padding="@dimen/dp_10" + /> + + </LinearLayout> + + <View + android:id="@+id/ling2" + android:layout_width="match_parent" + android:layout_height="@dimen/dp_1" + android:layout_below="@+id/sss" + android:layout_marginLeft="@dimen/dp_29" + android:layout_marginTop="@dimen/dp_10" + android:layout_marginRight="@dimen/dp_29" + android:background="#D5D5D5" /> + + <TextView + android:id="@+id/jgdl_wjmm" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/ling2" + android:layout_alignRight="@+id/ling2" + android:layout_marginTop="@dimen/dp_15" + android:gravity="right" + android:text="忘记密码?" + android:textColor="@color/color_ff5400" + android:textSize="@dimen/sp_12" /> + + <TextView + android:id="@+id/jgdl_sure" + android:layout_width="match_parent" + android:layout_height="@dimen/dp_50" + android:layout_below="@id/jgdl_wjmm" + android:layout_marginLeft="@dimen/dp_25" + android:layout_marginTop="@dimen/dp_226" + android:layout_marginRight="@dimen/dp_25" + android:background="@drawable/circle_orange" + android:gravity="center" + android:text="确定" + android:textColor="#FFFFFF" + android:textSize="16sp" /> + + <TextView + android:id="@+id/jgdl_fhdl" + android:layout_width="match_parent" + android:layout_height="@dimen/dp_50" + android:layout_below="@id/jgdl_sure" + android:layout_marginLeft="@dimen/dp_25" + android:layout_marginTop="@dimen/dp_10" + android:layout_marginRight="@dimen/dp_25" + android:background="@drawable/circle_grey_25" + android:gravity="center" + android:text="返回登录" + android:textColor="@color/color_6666666" + android:textSize="16sp" /> + +</RelativeLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_wxentry.xml b/app/src/main/res/layout/activity_wxentry.xml new file mode 100644 index 0000000..d7d5689 --- /dev/null +++ b/app/src/main/res/layout/activity_wxentry.xml @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context="com.xinhao.xhwxlogin.wxapi.WXEntryActivity"> + + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + <TextView + android:id="@+id/id_tv" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="10dp" + android:text="code: 由于隐私,该项不给予显示" + android:textColor="#323232" + android:textSize="14sp" /> + + <TextView + android:layout_width="200dp" + android:textColor="#fff" + android:textSize="14sp" + + android:padding="10dp" + android:layout_alignParentRight="true" + android:background="@android:color/holo_red_dark" + android:text="涉及到隐私隐藏一部分" + android:layout_height="wrap_content" /> + + </RelativeLayout> + + + <TextView + android:id="@+id/nickname_tv" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="10dp" + android:text="nickname: 由于隐私,该项不给予显示" + android:textColor="#323232" + android:textSize="14sp" /> + + <TextView + android:id="@+id/sex_tv" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="10dp" + android:text="sex: 由于隐私,该项不给予显示" + android:textColor="#323232" + android:textSize="14sp" /> + <TextView + + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="10dp" + android:text="头像:" + android:textColor="#323232" + android:textSize="14sp" /> + + <ImageView + android:id="@+id/imageView" + android:layout_gravity="center" + android:layout_width="wrap_content" + android:layout_height="wrap_content" /> + + + </LinearLayout> + +</RelativeLayout> diff --git a/app/src/main/res/layout/rv_listgroup.xml b/app/src/main/res/layout/rv_listgroup.xml index 1019592..c11bd65 100644 --- a/app/src/main/res/layout/rv_listgroup.xml +++ b/app/src/main/res/layout/rv_listgroup.xml @@ -26,7 +26,9 @@ android:layout_alignParentRight="true" android:layout_centerVertical="true" android:layout_marginRight="@dimen/dp_20" - android:src="@mipmap/down" /> + android:src="@mipmap/down" + android:id="@+id/rv_list_xiala" + /> </RelativeLayout> diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index a2fae31..fceb4af 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -20,5 +20,13 @@ <color name="color_575757">#575757</color> <color name="color_333333">#333333</color> <color name="color_e4e4e4">#E4E4E4</color> +<<<<<<< Updated upstream <color name="color_616161">#616161</color> +======= + <color name="color_232323">#232323</color> + <color name="color_6666666">#666666</color> + <color name="color_dddddd">#dddddd</color> + <color name="color_c7c7c7">#c7c7c7</color> + <color name="color_d5d5d5">#d5d5d5</color> +>>>>>>> Stashed changes </resources> -- libgit2 0.24.0