Bladeren bron

1.提交代码更新点击多次支付问题

FailedToRead 3 jaren geleden
bovenliggende
commit
9d07964a87

+ 17 - 6
app/src/main/AndroidManifest.xml

@@ -45,18 +45,31 @@
                 android:resizeableActivity="true"
                 android:screenOrientation="landscape"
                 android:theme="@style/AppStartTheme">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+            <intent-filter>
+                <action android:name="android.intent.action.VIEW" />
 
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="android.intent.category.BROWSABLE" />
+
+                <data
+                        android:host="com.edufound.android.xyyf"
+                        android:path="/main"
+                        android:scheme="efunbox" />
+            </intent-filter>
         </activity>
+
+<!--        音响端暂时不加用户隐私协议界面-->
         <activity
                 android:name="com.edufound.android.xyyf.activity.AgreementActivity"
                 android:maxAspectRatio="2.1"
                 android:resizeableActivity="true"
                 android:screenOrientation="portrait">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
 
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
         </activity>
 
         <!--友盟start-->
@@ -120,8 +133,6 @@
                 android:launchMode="singleTask" />
 
 
-
-
     </application>
 
 </manifest>

+ 12 - 5
app/src/main/java/com/edufound/android/xyyf/interfaces/EfunboxPayInterfaces.java

@@ -2,9 +2,11 @@ package com.edufound.android.xyyf.interfaces;
 
 import android.content.Intent;
 import android.webkit.JavascriptInterface;
+import android.widget.Toast;
 
 import com.edufound.android.xyyf.main.MainView;
 import com.edufound.android.xyyf.pay.PayActivity;
+import com.edufound.android.xyyf.pay.PayInit;
 import com.edufound.android.xyyf.util.Logger;
 
 public class EfunboxPayInterfaces {
@@ -40,10 +42,15 @@ public class EfunboxPayInterfaces {
 
     @JavascriptInterface
     public void TMailPay(String orderInfo) {
-        Logger.e("orderInfo:" + orderInfo);
-        Intent intent = new Intent(mView.getActivity(), PayActivity.class);
-        intent.putExtra("type", "3");
-        intent.putExtra("payString", orderInfo);
-        mView.getActivity().startActivity(intent);
+        if (!PayInit.isPaying) {
+            PayInit.isPaying = true;
+            Logger.e("orderInfo:" + orderInfo);
+            Intent intent = new Intent(mView.getActivity(), PayActivity.class);
+            intent.putExtra("type", "3");
+            intent.putExtra("payString", orderInfo);
+            mView.getActivity().startActivity(intent);
+        } else {
+            Toast.makeText(mView.getActivity(), "正在打开支付页面", Toast.LENGTH_SHORT).show();
+        }
     }
 }

+ 1 - 0
app/src/main/java/com/edufound/android/xyyf/pay/PayActivity.java

@@ -126,6 +126,7 @@ public class PayActivity extends Activity implements BaseView {
     @Override
     protected void onDestroy() {
         super.onDestroy();
+        PayInit.isPaying = false;
         unregisterReceiver(payBroad);
     }
 }

+ 1 - 0
app/src/main/java/com/edufound/android/xyyf/pay/PayInit.java

@@ -8,6 +8,7 @@ import com.tencent.mm.opensdk.openapi.WXAPIFactory;
 
 public class PayInit {
     private static PayInit mIntences;
+    public static boolean isPaying = false;
     //微信api
     public IWXAPI WX_API;
     //微信appid

+ 1 - 3
app/src/main/java/com/edufound/android/xyyf/util/Logger.java

@@ -11,9 +11,7 @@ public class Logger {
     }
 
     public static void DebugE(String message) {
-        if (ContextUtil.isIsDebug()) {
-            Log.e(TAG, message);
-        }
+        Log.e(TAG, message);
     }
 
 }