Kaynağa Gözat

1.修改用户时长问题

FailedToRead 3 yıl önce
ebeveyn
işleme
a550a838a6

+ 23 - 4
app/build.gradle

@@ -10,8 +10,8 @@ android {
         applicationId "com.edufound.android.xyyf"
         minSdkVersion 16
         targetSdkVersion 28
-        versionCode 10001
-        versionName "1.0.0.1"
+        versionCode 10005
+        versionName "1.0.0.5"
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
         multiDexEnabled true
         flavorDimensions "versionCode"
@@ -41,7 +41,7 @@ android {
                 variant.outputs.each { output ->
                     def outputFile = output.outputFileName
                     if (outputFile != null && output.outputFileName.endsWith('.apk')) {
-                        def fileName = "efunbox_tv_v${defaultConfig.versionCode}_${releaseTime()}_${variant.productFlavors[0].manifestPlaceholders.UMENG_CHANNEL_VALUE}_r.apk"
+                        def fileName = "efunbox_mobile_xyyf_v${defaultConfig.versionCode}_${releaseTime()}_${variant.productFlavors[0].manifestPlaceholders.UMENG_CHANNEL_VALUE}_r.apk"
                         def channel = variant.productFlavors[0].manifestPlaceholders.UMENG_CHANNEL_VALUE;
                         def newoutputFile = "";
                         if (channel == ("2006")) {
@@ -60,6 +60,10 @@ android {
                             newoutputFile = "\\oppo\\"
                         } else if (channel == ("2005")) {
                             newoutputFile = "\\huawei\\"
+                        } else if (channel == ("2009")) {
+                            newoutputFile = "\\萌庄园\\"
+                        } else if (channel == ("2010")) {
+                            newoutputFile = "\\步步高\\"
                         }
                         output.outputFileName = new File(newoutputFile, fileName)
                     }
@@ -150,7 +154,22 @@ android {
                     appIcon: "@drawable/icon",
             ]
         }
-
+        //萌状元
+        channel_mengzhuangyuan {
+            signingConfig signingConfigs.efunbox
+            manifestPlaceholders = [
+                    appCode: "2009",
+                    appIcon: "@drawable/icon",
+            ]
+        }
+        //步步高
+        channel_bubugao {
+            signingConfig signingConfigs.efunbox
+            manifestPlaceholders = [
+                    appCode: "2010",
+                    appIcon: "@drawable/icon",
+            ]
+        }
     }
     productFlavors.all {
         flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: manifestPlaceholders.appCode, icon: manifestPlaceholders.appIcon]

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

@@ -102,7 +102,9 @@
         <activity
                 android:name="com.edufound.android.xyyf.wxapi.WXEntryActivity"
                 android:exported="true"
+                android:launchMode="singleTask"
                 android:screenOrientation="landscape"
+                android:taskAffinity="com.edufound.android.xyyf"
                 android:theme="@style/transcutestyle"></activity>
 
         <activity

+ 8 - 1
app/src/main/java/com/edufound/android/xyyf/activity/MainActivity.java

@@ -6,8 +6,11 @@ import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
+import android.content.pm.PackageManager;
 import android.os.Build;
 import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
 import android.support.annotation.Nullable;
 import android.support.annotation.RequiresApi;
 import android.support.v7.widget.RecyclerView;
@@ -17,8 +20,10 @@ import android.view.ViewGroup;
 import android.view.WindowManager;
 import android.view.animation.LinearInterpolator;
 import android.webkit.WebView;
+import android.widget.Button;
 import android.widget.FrameLayout;
 import android.widget.ImageView;
+import android.widget.Toast;
 
 import com.edufound.android.xyyf.R;
 import com.edufound.android.xyyf.application.EApplication;
@@ -26,12 +31,15 @@ import com.edufound.android.xyyf.base.BaseActivity;
 import com.edufound.android.xyyf.bean.WindowVideoParams;
 import com.edufound.android.xyyf.main.MainPersenter;
 import com.edufound.android.xyyf.main.MainView;
+import com.edufound.android.xyyf.pay.PayInit;
 import com.edufound.android.xyyf.util.ContextUtil;
 import com.edufound.android.xyyf.util.DeviceUuidFactory;
 import com.edufound.android.xyyf.util.Logger;
 import com.edufound.android.xyyf.util.NotificationUtil;
 import com.edufound.android.xyyf.util.ShowDebugUrl;
+import com.edufound.android.xyyf.util.ToastUtil;
 import com.google.gson.Gson;
+import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram;
 
 
 //调用Persenter里面的方法
@@ -94,7 +102,6 @@ public class MainActivity extends BaseActivity implements MainView {
         mPersenter.openWeb(getIntent());
     }
 
-
     @Override
     public boolean onKeyDown(int keyCode, KeyEvent event) {
         ShowDebugUrl.dispatchKeyEvent(event, mActivity);

+ 3 - 0
app/src/main/java/com/edufound/android/xyyf/application/EApplication.java

@@ -191,6 +191,7 @@ public class EApplication extends Application {
                 isForeground = true;
 //                ToastUtil.showToast("app回到前台了");
                 Logger.e("app回到前台了");
+                APP_START_TIME = System.currentTimeMillis();
             }
             activityAount++;
         }
@@ -215,6 +216,7 @@ public class EApplication extends Application {
                     public void onError(Request request, Exception e) {
 //                        exitApp();
 //                        android.os.Process.killProcess(android.os.Process.myPid());
+                        APP_START_TIME = 0;
                     }
 
                     @Override
@@ -222,6 +224,7 @@ public class EApplication extends Application {
                         Logger.e("response:" + response);
 //                        exitApp();
 //                        android.os.Process.killProcess(android.os.Process.myPid());
+                        APP_START_TIME = 0;
                     }
                 });
 

+ 34 - 9
app/src/main/java/com/edufound/android/xyyf/interfaces/JsInterfaces.java

@@ -4,6 +4,7 @@ import android.app.AlertDialog;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.pm.ActivityInfo;
+import android.content.pm.PackageManager;
 import android.graphics.Color;
 import android.media.MediaPlayer;
 import android.util.Base64;
@@ -54,7 +55,7 @@ public class JsInterfaces {
     MessageDialogBean mMessageBean;
     PhoneNumberAuthHelper mPhoneNumberAuthHelperl;
     String mSecret = "UgC3rEZPVMBKi8WqdoubeWMSJNSeeA6i0dLu3Z1GZKfIgXFhF8RmMLdsmDSgmwWjg2TUOhkvbuHZH6pt4RUxiQSpVyu9P1Q7h9Th05DhNVqxuOU2GRLLs0C43B59eS6nXrUEy7PZzn3wPTXEpelTmH5rMl+VZ7UKa3tC35qkB073Dfikr6ITRfCF31mTPjOGQRo9RKrtbeIhj4jIqx7M9PJSp9+W8huzLCUEOVquVNKDtpCBUq2Znu+PgISvLg3JouLtVv9ldoftxKci+VfHaO3izxkHOi+3jauqBTigrfA7D4I4va/7PlgCNoXJogcy";
-    public final String GET_USER_PHONENUMBER_URL = "http://ott80test-api.efunbox.cn:81/member/getMobile";
+    public final String GET_USER_PHONENUMBER_URL = "http://m-xyyf-api.ai160.com/member/getMobile";
 
     public JsInterfaces(MainView view) {
         mGson = new Gson();
@@ -288,18 +289,42 @@ public class JsInterfaces {
     }
 
     @JavascriptInterface
-    public void toMiniProgram(String programId, String path) {
-        if (!PayInit.getInstance().WX_API.isWXAppInstalled()) {
-            ToastUtil.showToast("请安装微信");
+    public void toMiniProgram(final String programId, final String path) {
+        PackageManager packageManager = mView.getActivity().getPackageManager();
+        Intent intent = packageManager.getLaunchIntentForPackage("com.tencent.mm");
+        if (intent == null) {
+            mView.loadJSMehtodPost("noWeChat()");
             return;
+        } else {
+            mView.getActivity().startActivity(intent);
+        }
+        mView.acPostDelayed(new Runnable() {
+            @Override
+            public void run() {
+                WXLaunchMiniProgram.Req req = new WXLaunchMiniProgram.Req();
+                req.userName = programId; // 填小程序原始id
+                req.path = path;                  //拉起小程序页面的可带参路径,不填默认拉起小程序首页
+                req.miniprogramType = WXLaunchMiniProgram.Req.MINIPTOGRAM_TYPE_RELEASE;// 可选打开 开发版,体验版和正式版
+                PayInit.getInstance().WX_API.sendReq(req);
+            }
+        }, 800);
+    }
+
+
+    @JavascriptInterface
+    public boolean startOtherApp(String pckName) {
+        PackageManager packageManager = mView.getActivity().getPackageManager();
+        Intent intent = packageManager.getLaunchIntentForPackage(pckName);
+        if (intent == null) {
+//            mView.loadJSMehtodPost("noWeChat()");
+            return false;
+        } else {
+            mView.getActivity().startActivity(intent);
+            return true;
         }
-        WXLaunchMiniProgram.Req req = new WXLaunchMiniProgram.Req();
-        req.userName = programId; // 填小程序原始id
-        req.path = path;                  //拉起小程序页面的可带参路径,不填默认拉起小程序首页
-        req.miniprogramType = WXLaunchMiniProgram.Req.MINIPTOGRAM_TYPE_RELEASE;// 可选打开 开发版,体验版和正式版
-        PayInit.getInstance().WX_API.sendReq(req);
     }
 
+
     @JavascriptInterface
     public void setBackGround(String color) {
         mView.getWebView().setBackgroundColor(Color.parseColor(color));

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

@@ -121,7 +121,9 @@ public class MainPersenter implements MainIPersenter {
         webview.getSettings().setJavaScriptEnabled(true);
         webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);//允许js弹出窗口
         webview.getSettings().setDomStorageEnabled(true);
-//        webview.getSettings().setMediaPlaybackRequiresUserGesture(false);
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
+            webview.getSettings().setMediaPlaybackRequiresUserGesture(false);
+        }
         webview.getSettings().setBlockNetworkImage(false);
         // webview.getSettings().set
         webview.setBackgroundColor(Color.TRANSPARENT);

+ 3 - 2
app/src/main/res/values/projectstring.xml

@@ -1,8 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
     <!--8.0生产环境前端地址 http://ott80-web.ai160.com/stage/index/index.html-->
-    <string name="default_url">http://m-xyyf-web.efunbox.cn/stage/index/index.html</string>
-    <!--    <string name="default_url">http://m-xyyf-web.ai160.com/stage/index/index.html</string>-->
+    <string name="default_url">http://m-xyyf-web.ai160.com/stage/index/index.html</string>
+    <!--    王洋本地-->
+    <!--    <string name="default_url">http://192.168.1.66:8080/efunbox-xyyf-web/1.0.0/stage/index/index.html</string>-->
     <!--义方渠道-->
     <string name="app_code_yf">2006</string>
     <!--应用宝-->

+ 1 - 1
push/build/intermediates/incremental/mergeReleaseResources/compile-file-map.properties

@@ -1,3 +1,3 @@
-#Tue Jan 26 09:27:04 CST 2021
+#Wed Apr 07 10:10:01 CST 2021
 G\:\\WorkSpace\\Git_WorkSpace\\efunbox-xyyf-mobile-android\\efunbox-xyyf-mobile-android-master\\push\\res\\layout\\upush_bar_image_notification.xml=G\:\\WorkSpace\\Git_WorkSpace\\efunbox-xyyf-mobile-android\\efunbox-xyyf-mobile-android-master\\push\\build\\intermediates\\res\\merged\\release\\layout\\upush_bar_image_notification.xml
 G\:\\WorkSpace\\Git_WorkSpace\\efunbox-xyyf-mobile-android\\efunbox-xyyf-mobile-android-master\\push\\res\\layout\\upush_notification.xml=G\:\\WorkSpace\\Git_WorkSpace\\efunbox-xyyf-mobile-android\\efunbox-xyyf-mobile-android-master\\push\\build\\intermediates\\res\\merged\\release\\layout\\upush_notification.xml

+ 1 - 1
push/build/intermediates/incremental/packageReleaseResources/compile-file-map.properties

@@ -1,3 +1,3 @@
-#Tue Jan 26 09:26:18 CST 2021
+#Wed Apr 07 10:09:28 CST 2021
 G\:\\WorkSpace\\Git_WorkSpace\\efunbox-xyyf-mobile-android\\efunbox-xyyf-mobile-android-master\\push\\res\\layout\\upush_bar_image_notification.xml=G\:\\WorkSpace\\Git_WorkSpace\\efunbox-xyyf-mobile-android\\efunbox-xyyf-mobile-android-master\\push\\build\\intermediates\\packaged_res\\release\\layout\\upush_bar_image_notification.xml
 G\:\\WorkSpace\\Git_WorkSpace\\efunbox-xyyf-mobile-android\\efunbox-xyyf-mobile-android-master\\push\\res\\layout\\upush_notification.xml=G\:\\WorkSpace\\Git_WorkSpace\\efunbox-xyyf-mobile-android\\efunbox-xyyf-mobile-android-master\\push\\build\\intermediates\\packaged_res\\release\\layout\\upush_notification.xml