Commit 003948d2d7cfe8135f9019cf967340daec7dcac5

Authored by 王琳
1 parent edda399f

1、添加判断是否设置过支付密码接口

2、添加跳转到设置支付密码页面页面
.idea/gradle.xml
@@ -3,11 +3,14 @@ @@ -3,11 +3,14 @@
3 <component name="GradleSettings"> 3 <component name="GradleSettings">
4 <option name="linkedExternalProjectsSettings"> 4 <option name="linkedExternalProjectsSettings">
5 <GradleProjectSettings> 5 <GradleProjectSettings>
6 - <compositeConfiguration>  
7 - <compositeBuild compositeDefinitionSource="SCRIPT" />  
8 - </compositeConfiguration>  
9 <option name="distributionType" value="DEFAULT_WRAPPED" /> 6 <option name="distributionType" value="DEFAULT_WRAPPED" />
10 <option name="externalProjectPath" value="$PROJECT_DIR$" /> 7 <option name="externalProjectPath" value="$PROJECT_DIR$" />
  8 + <option name="modules">
  9 + <set>
  10 + <option value="$PROJECT_DIR$" />
  11 + <option value="$PROJECT_DIR$/app" />
  12 + </set>
  13 + </option>
11 <option name="resolveModulePerSourceSet" value="false" /> 14 <option name="resolveModulePerSourceSet" value="false" />
12 </GradleProjectSettings> 15 </GradleProjectSettings>
13 </option> 16 </option>
.idea/misc.xml
@@ -5,6 +5,30 @@ @@ -5,6 +5,30 @@
5 <configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" /> 5 <configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
6 </configurations> 6 </configurations>
7 </component> 7 </component>
  8 + <component name="NullableNotNullManager">
  9 + <option name="myDefaultNullable" value="android.support.annotation.Nullable" />
  10 + <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
  11 + <option name="myNullables">
  12 + <value>
  13 + <list size="4">
  14 + <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
  15 + <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
  16 + <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
  17 + <item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
  18 + </list>
  19 + </value>
  20 + </option>
  21 + <option name="myNotNulls">
  22 + <value>
  23 + <list size="4">
  24 + <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
  25 + <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
  26 + <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
  27 + <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
  28 + </list>
  29 + </value>
  30 + </option>
  31 + </component>
8 <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> 32 <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
9 <output url="file://$PROJECT_DIR$/build/classes" /> 33 <output url="file://$PROJECT_DIR$/build/classes" />
10 </component> 34 </component>
.idea/vcs.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="VcsDirectoryMappings">
  4 + <mapping directory="$PROJECT_DIR$" vcs="Git" />
  5 + </component>
  6 +</project>
0 \ No newline at end of file 7 \ No newline at end of file
README.md
@@ -4,6 +4,14 @@ @@ -4,6 +4,14 @@
4 版本更新说明 4 版本更新说明
5 --------- 5 ---------
6 ---------------- 6 ----------------
  7 +
  8 +**`v1.0.4`**
  9 +
  10 +**增加功能**
  11 +
  12 +> 1.增加判断是否设置过支付密码接口
  13 +
  14 +
7 **`v1.0.3`** 15 **`v1.0.3`**
8 16
9 **增加功能** 17 **增加功能**
app/build.gradle
1 apply plugin: 'com.android.application' 1 apply plugin: 'com.android.application'
  2 +apply plugin: 'com.alibaba.arouter'
2 3
3 static def stringValue(def value) { 4 static def stringValue(def value) {
4 return "\"${value}\"" 5 return "\"${value}\""
@@ -14,6 +15,12 @@ android { @@ -14,6 +15,12 @@ android {
14 versionCode 1 15 versionCode 1
15 versionName "1.0" 16 versionName "1.0"
16 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 17 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  18 +
  19 + javaCompileOptions {
  20 + annotationProcessorOptions {
  21 + arguments = [AROUTER_MODULE_NAME: project.getName(), AROUTER_GENERATE_DOC: "enable"]
  22 + }
  23 + }
17 } 24 }
18 compileOptions { 25 compileOptions {
19 sourceCompatibility JavaVersion.VERSION_1_8 26 sourceCompatibility JavaVersion.VERSION_1_8
@@ -42,7 +49,11 @@ dependencies { @@ -42,7 +49,11 @@ dependencies {
42 androidTestImplementation 'com.android.support.test:runner:1.0.2' 49 androidTestImplementation 'com.android.support.test:runner:1.0.2'
43 androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 50 androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
44 51
45 - implementation "com.cnlive.libs:wjjpay:1.0.3" 52 + implementation "com.cnlive.libs:wjjpay:1.0.4"
46 implementation "com.cnlive.libs:base:1.0.7" 53 implementation "com.cnlive.libs:base:1.0.7"
47 implementation "com.cnlive:lib_network:1.0.12" 54 implementation "com.cnlive:lib_network:1.0.12"
  55 +
  56 + //ARouter
  57 + implementation 'com.alibaba:arouter-api:1.4.0'
  58 + annotationProcessor 'com.alibaba:arouter-compiler:1.2.1'
48 } 59 }
49 \ No newline at end of file 60 \ No newline at end of file
app/src/main/java/com/cnlive/test/wjjpayutil/MainActivity.java
@@ -5,6 +5,7 @@ import android.support.v7.app.AppCompatActivity; @@ -5,6 +5,7 @@ import android.support.v7.app.AppCompatActivity;
5 import android.os.Bundle; 5 import android.os.Bundle;
6 import android.util.Log; 6 import android.util.Log;
7 7
  8 +import com.alibaba.android.arouter.launcher.ARouter;
8 import com.cnlive.libs.base.application.AppConfig; 9 import com.cnlive.libs.base.application.AppConfig;
9 import com.cnlive.libs.wjjpay.pay.WjjPay; 10 import com.cnlive.libs.wjjpay.pay.WjjPay;
10 import com.cnlive.strike.BuildConfig; 11 import com.cnlive.strike.BuildConfig;
@@ -28,6 +29,12 @@ public class MainActivity extends AppCompatActivity { @@ -28,6 +29,12 @@ public class MainActivity extends AppCompatActivity {
28 commitPaymentOrder(this, "uid", "preId", "password"); 29 commitPaymentOrder(this, "uid", "preId", "password");
29 30
30 setPassword(this, "uid", ""); 31 setPassword(this, "uid", "");
  32 +
  33 + passwordExisting(this, "uid");
  34 +
  35 + findViewById(R.id.setting).setOnClickListener(view -> settingPaySecret());
  36 +
  37 + findViewById(R.id.modify).setOnClickListener(view -> modifyPaySecret());
31 } 38 }
32 39
33 /** 40 /**
@@ -76,4 +83,41 @@ public class MainActivity extends AppCompatActivity { @@ -76,4 +83,41 @@ public class MainActivity extends AppCompatActivity {
76 .setSuccessCallback(data -> Log.e("DemoView", "成功")) 83 .setSuccessCallback(data -> Log.e("DemoView", "成功"))
77 .start(); 84 .start();
78 } 85 }
  86 +
  87 + /**
  88 + * 判断是设置 过支付密码
  89 + *
  90 + * @param context
  91 + * @param userId
  92 + */
  93 + public static void passwordExisting(Context context, String userId) {
  94 + WjjPay.passwordIsExisting(context, userId)
  95 + .setFailureCallback((i, s) -> {
  96 + if (i == 402) {
  97 + Log.e("DemoView 1", "没有设置支付密码");
  98 + } else {
  99 + Log.e("DemoView 1", s);
  100 + }
  101 + })
  102 + .setSuccessCallback(groupBalanceInfoPayBaseInfo -> Log.e("DemoView 1", "成功"))
  103 + .start();
  104 + }
  105 +
  106 + /**
  107 + * 跳转到第一次设置支付密码页面
  108 + */
  109 + public static void settingPaySecret() {
  110 + ARouter.getInstance().build("/paysecret/PaySecretActivity")
  111 + .withString("type", "set_pay_secret")//设置支付密码
  112 + .navigation();
  113 + }
  114 +
  115 + /**
  116 + * 跳转到修改支付密码页面
  117 + */
  118 + public static void modifyPaySecret() {
  119 + ARouter.getInstance().build("/paysecret/PaySecretActivity")
  120 + .withString("type", "modify_pay_secret")//修改支付密码
  121 + .navigation();
  122 + }
79 } 123 }
app/src/main/res/layout/activity_main.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 -<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"  
3 - xmlns:app="http://schemas.android.com/apk/res-auto"  
4 - xmlns:tools="http://schemas.android.com/tools" 2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
5 android:layout_width="match_parent" 3 android:layout_width="match_parent"
6 - android:layout_height="match_parent"  
7 - tools:context=".MainActivity"> 4 + android:layout_height="match_parent">
8 5
9 - <TextView 6 + <Button
  7 + android:id="@+id/setting"
10 android:layout_width="wrap_content" 8 android:layout_width="wrap_content"
11 android:layout_height="wrap_content" 9 android:layout_height="wrap_content"
12 - android:text="Hello World!"  
13 - app:layout_constraintBottom_toBottomOf="parent"  
14 - app:layout_constraintLeft_toLeftOf="parent"  
15 - app:layout_constraintRight_toRightOf="parent"  
16 - app:layout_constraintTop_toTopOf="parent" /> 10 + android:layout_gravity="center_horizontal"
  11 + android:text="设置支付密码" />
17 12
18 -</android.support.constraint.ConstraintLayout>  
19 \ No newline at end of file 13 \ No newline at end of file
  14 +
  15 + <Button
  16 + android:id="@+id/modify"
  17 + android:layout_width="wrap_content"
  18 + android:layout_height="wrap_content"
  19 + android:layout_gravity="center_horizontal"
  20 + android:text="修改支付密码" />
  21 +</LinearLayout>
20 \ No newline at end of file 22 \ No newline at end of file
build.gradle
@@ -11,6 +11,7 @@ buildscript { @@ -11,6 +11,7 @@ buildscript {
11 11
12 // NOTE: Do not place your application dependencies here; they belong 12 // NOTE: Do not place your application dependencies here; they belong
13 // in the individual module build.gradle files 13 // in the individual module build.gradle files
  14 + classpath "com.alibaba:arouter-register:1.0.2"
14 } 15 }
15 } 16 }
16 17