raomeng 8 years ago
parent
commit
21437cd68f

+ 12 - 0
WeiChat/src/main/AndroidManifest.xml

@@ -1043,6 +1043,18 @@
             android:name="com.modular.appmessages.activity.UUSportActivity"
             android:label="@string/set_sport" />
 
+
+        <!--微信支付回调页面-->
+        <activity
+            android:name="com.xzjmyk.pm.activity.wxapi.WXEntryActivity"
+            android:exported="true"
+            android:launchMode="singleTop"
+            />
+        <activity
+            android:name="com.xzjmyk.pm.activity.wxapi.WXPayEntryActivity"
+            android:exported="true"
+            android:launchMode="singleTop"
+            />
     </application>
 
 </manifest>

+ 2 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/adapter/WorkMenuParentAdapter.java

@@ -219,9 +219,11 @@ public class WorkMenuParentAdapter extends BaseAdapter {
                     }
                     intent.putExtra("url", url);
                     intent.putExtra("p", context.getString(R.string.work_business_me));
+                    intent.putExtra("cookie", true);
                 } else if ("ic_work_usoft_mall".equals(menuIcon)) {
                     intent.putExtra("url", "http://mall.ubtob.com");
                     intent.putExtra("p", context.getString(R.string.work_business_find));
+                    intent.putExtra("cookie", true);
                 }
                 break;
             case "com.modular.work.CommonDataFormActivity":

+ 2 - 4
WeiChat/src/main/java/com/xzjmyk/pm/activity/wxapi/WXEntryActivity.java

@@ -4,13 +4,11 @@ import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
 
-import com.core.app.Constants;
 import com.tencent.mm.sdk.modelbase.BaseReq;
 import com.tencent.mm.sdk.modelbase.BaseResp;
 import com.tencent.mm.sdk.modelmsg.SendAuth;
 import com.tencent.mm.sdk.openapi.IWXAPI;
 import com.tencent.mm.sdk.openapi.IWXAPIEventHandler;
-import com.tencent.mm.sdk.openapi.WXAPIFactory;
 
 public class WXEntryActivity extends Activity implements IWXAPIEventHandler {
     private IWXAPI api;
@@ -18,8 +16,8 @@ public class WXEntryActivity extends Activity implements IWXAPIEventHandler {
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        api = WXAPIFactory.createWXAPI(this, Constants.WXPAY_APPID, true);
-        api.handleIntent(getIntent(), this);
+//        api = WXAPIFactory.createWXAPI(this, Constants.WXPAY_APPID);
+//        api.handleIntent(getIntent(), this);
     }
 
     @Override

+ 5 - 2
WeiChat/src/main/java/com/xzjmyk/pm/activity/wxapi/WXPayEntryActivity.java

@@ -3,6 +3,7 @@ package com.xzjmyk.pm.activity.wxapi;
 import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
+import android.util.Log;
 import android.widget.Toast;
 
 import com.core.app.Constants;
@@ -20,7 +21,7 @@ public class WXPayEntryActivity extends Activity implements IWXAPIEventHandler {
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-//        setContentView(R.layout.pay_result);
+
         api = WXAPIFactory.createWXAPI(this, Constants.WXPAY_APPID);
         api.handleIntent(getIntent(), this);
     }
@@ -34,10 +35,12 @@ public class WXPayEntryActivity extends Activity implements IWXAPIEventHandler {
 
     @Override
     public void onReq(BaseReq req) {
+
     }
 
     @Override
     public void onResp(BaseResp resp) {
+        Log.d("WXPayEntryOnResp", "onPayFinish, errCode = " + resp.errCode);
         /**
          * 0 支付成功
          * -1 支付错误
@@ -52,6 +55,6 @@ public class WXPayEntryActivity extends Activity implements IWXAPIEventHandler {
                 Toast.makeText(this, R.string.str_error_wechat_pay_cancel, Toast.LENGTH_LONG).show();
             }
         }
-        finish();
+//        finish();
     }
 }

+ 3 - 3
WeiChat/version.properties

@@ -1,5 +1,5 @@
-#Tue Dec 26 18:41:26 CST 2017
-debugName=277
+#Thu Dec 28 08:47:37 CST 2017
+debugName=310
 versionName=613
-debugCode=277
+debugCode=310
 versionCode=152

+ 2 - 1
app_core/common/build.gradle

@@ -57,6 +57,7 @@ dependencies {
     compile project(':lib-zxing')
     compile project(':library-refreshlayout')
     compile project(':recyclerlibrary')
-    compile files('libs/hellocharts-library-1.5.8.jar')
     //折线库
+    compile files('libs/hellocharts-library-1.5.8.jar')
+    compile 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+'
 }

+ 12 - 1
app_core/common/src/main/java/com/core/app/Constants.java

@@ -452,10 +452,21 @@ public class Constants {
 
 
     public interface FLAG {
+        //webview Cookie缓存
+        String WEBVIEW_COOKIE = "webview_cookie";
+        /**
+         * 设备管理
+         */
         String DEVICE_CALLER = "device_caller";
         String DEVICE_CLASS = "device_class";
         String DEVICE_WHICH_PAGE = "device_which_page";
         String DEVICE_FROM_COMMON = "device_from_common";
-        String DEVICE_FROM_QUERY = "device_from_common";
+        String DEVICE_FROM_QUERY = "device_from_query";
+
+        /**
+         * 一元捐
+         */
+        int WEIXIN_PAY = 101;
+        int API_PAY = 102;
     }
 }

+ 370 - 363
app_core/common/src/main/java/com/core/app/MyApplication.java

@@ -44,6 +44,8 @@ import com.nostra13.universalimageloader.core.ImageLoader;
 import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
 import com.nostra13.universalimageloader.core.assist.QueueProcessingType;
 import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer;
+import com.tencent.mm.opensdk.openapi.IWXAPI;
+import com.tencent.mm.opensdk.openapi.WXAPIFactory;
 import com.umeng.analytics.MobclickAgent;
 import com.umeng.socialize.Config;
 import com.umeng.socialize.PlatformConfig;
@@ -60,376 +62,381 @@ import cat.ereza.customactivityoncrash.CustomActivityOnCrash;
  */
 public class MyApplication extends BaseApplication {
 
-	private static MyApplication INSTANCE = null;
-	/*********************
-	 * 提供全局配置
-	 ************************/
-	private AppConfig mConfig;
-	/*****************
-	 * 提供全局的Volley
-	 ***************************/
-
-	private FastVolley mFastVolley;
-	public static Cookie cookieERP;
-	public static RequestQueue mRequestQueue;
-	public static HttpUtils mHttpUtils;
-
-	/* 文件缓存的目录 */
-	public String mAppDir;
-	public String mPicturesDir;
-	public String mVoicesDir;
-	public String mVideosDir;
-	public String mFilesDir;
-	/***********************
-	 * 保存当前登陆用户的全局信息
-	 ***************/
-	public String roomName;
-	public String mAccessToken;
-	public long mExpiresIn;
-	public int mUserStatus;
-	public boolean mUserStatusChecked = false;
-	public User mLoginUser = new User();// 当前登陆的用户
-
-	/*******************
-	 * 初始化图片加载
-	 **********************/
-	// 显示的设置
-	public static DisplayImageOptions mNormalImageOptions;
-	public static DisplayImageOptions mAvatarRoundImageOptions;
-	public static DisplayImageOptions mAvatarNormalImageOptions;
-
-	/*********************
-	 * 提供网络全局监听
-	 ************************/
-	private NetWorkObservable mNetWorkObservable;
-	/*********************
-	 * 百度地图定位服务
-	 ************************/
-	private BdLocationHelper mBdLocationHelper;
-
-	public BdLocationHelper getBdLocationHelper() {
-		if (mBdLocationHelper == null)
-			mBdLocationHelper = new BdLocationHelper(this);
-		mBdLocationHelper.requestLocation();
-		return mBdLocationHelper;
-	}
-
-
-	@Override
-	public void initConfig() throws Exception {
-		Stetho.initializeWithDefaults(this);
-		SpeechUtility.createUtility(this, SpeechConstant.APPID + "=5876dc99");
-		//自定义闪退页面初始化
-		CustomActivityOnCrash.install(this);
-		//设置ErrorActivity在后台启动,默认为true
-		CustomActivityOnCrash.setLaunchErrorActivityWhenInBackground(true);
-		//设置展示详细错误信息,默认为true
-		CustomActivityOnCrash.setShowErrorDetails(true);
-		//启用APP Restart,默认为true
-		CustomActivityOnCrash.setEnableAppRestart(true);
-		//设置重新启动的activity
-		//  CustomActivityOnCrash.setRestartActivityClass(SplashActivity.class);
-		Config.REDIRECT_URL = "http://sns.whalecloud.com/sina2/callback";
-		INSTANCE = this;
-		ZXingLibrary.initDisplayOpinion(this);
-		mRequestQueue = Volley.newRequestQueue(this);
-
-		mHttpUtils = new HttpUtils();
-		configHttpUtils();
-
-
-		SharedUtil.init(this);
-		initShareAPI();
-		//  CrashReport.initCrashReport(getApplicationContext(), "900050585", false);
-		PreferenceUtils.putBoolean(this, Constants.IS_NOTIFICATION, false);//不进行通知
-		new Handler().postDelayed(new Runnable() {
-			@Override
-			public void run() {
-				//定位场景设置
-				MobclickAgent.setScenarioType(MyApplication.this, MobclickAgent.EScenarioType.E_UM_NORMAL);
-				initUmengStatistics();
-				SDKInitializer.initialize(getApplicationContext());
-				// 初始化数据库
-				SQLiteHelper.copyDatabaseFile(getApplicationContext());
-				// 初始化定位
-				getBdLocationHelper();
-				// 初始化App目录
-				initAppDir();
-				// 初始化图片加载
-				initImageLoader();
-
-			}
-		}, 1);
-		if (AppConfig.DEBUG) {
-			Log.d(AppConfig.TAG, "MyApplication onCreate");
-		}
-		if (AppConfig.DEBUG) {
-			StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
-			StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build());
-		}
-		// 初始化网络监听
-		mNetWorkObservable = new NetWorkObservable(this);
-		initErpDB();
-	/*    try {
-	        com.core.app.Constants.cleanRed(this);
+    private static MyApplication INSTANCE = null;
+    /*********************
+     * 提供全局配置
+     ************************/
+    private AppConfig mConfig;
+    /*****************
+     * 提供全局的Volley
+     ***************************/
+
+    private FastVolley mFastVolley;
+    public static Cookie cookieERP;
+    public static RequestQueue mRequestQueue;
+    public static HttpUtils mHttpUtils;
+
+    /* 文件缓存的目录 */
+    public String mAppDir;
+    public String mPicturesDir;
+    public String mVoicesDir;
+    public String mVideosDir;
+    public String mFilesDir;
+    /***********************
+     * 保存当前登陆用户的全局信息
+     ***************/
+    public String roomName;
+    public String mAccessToken;
+    public long mExpiresIn;
+    public int mUserStatus;
+    public boolean mUserStatusChecked = false;
+    public User mLoginUser = new User();// 当前登陆的用户
+
+    /*******************
+     * 初始化图片加载
+     **********************/
+    // 显示的设置
+    public static DisplayImageOptions mNormalImageOptions;
+    public static DisplayImageOptions mAvatarRoundImageOptions;
+    public static DisplayImageOptions mAvatarNormalImageOptions;
+
+    /*********************
+     * 提供网络全局监听
+     ************************/
+    private NetWorkObservable mNetWorkObservable;
+    /*********************
+     * 百度地图定位服务
+     ************************/
+    private BdLocationHelper mBdLocationHelper;
+
+    public BdLocationHelper getBdLocationHelper() {
+        if (mBdLocationHelper == null)
+            mBdLocationHelper = new BdLocationHelper(this);
+        mBdLocationHelper.requestLocation();
+        return mBdLocationHelper;
+    }
+
+
+    @Override
+    public void initConfig() throws Exception {
+        Stetho.initializeWithDefaults(this);
+        SpeechUtility.createUtility(this, SpeechConstant.APPID + "=5876dc99");
+        //自定义闪退页面初始化
+        CustomActivityOnCrash.install(this);
+        //设置ErrorActivity在后台启动,默认为true
+        CustomActivityOnCrash.setLaunchErrorActivityWhenInBackground(true);
+        //设置展示详细错误信息,默认为true
+        CustomActivityOnCrash.setShowErrorDetails(true);
+        //启用APP Restart,默认为true
+        CustomActivityOnCrash.setEnableAppRestart(true);
+        //设置重新启动的activity
+        //  CustomActivityOnCrash.setRestartActivityClass(SplashActivity.class);
+        Config.REDIRECT_URL = "http://sns.whalecloud.com/sina2/callback";
+        INSTANCE = this;
+        ZXingLibrary.initDisplayOpinion(this);
+        mRequestQueue = Volley.newRequestQueue(this);
+
+        mHttpUtils = new HttpUtils();
+        configHttpUtils();
+
+        SharedUtil.init(this);
+        initShareAPI();
+
+        initWxPay(this);
+        //  CrashReport.initCrashReport(getApplicationContext(), "900050585", false);
+        PreferenceUtils.putBoolean(this, Constants.IS_NOTIFICATION, false);//不进行通知
+        new Handler().postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                //定位场景设置
+                MobclickAgent.setScenarioType(MyApplication.this, MobclickAgent.EScenarioType.E_UM_NORMAL);
+                initUmengStatistics();
+                SDKInitializer.initialize(getApplicationContext());
+                // 初始化数据库
+                SQLiteHelper.copyDatabaseFile(getApplicationContext());
+                // 初始化定位
+                getBdLocationHelper();
+                // 初始化App目录
+                initAppDir();
+                // 初始化图片加载
+                initImageLoader();
+
+            }
+        }, 1);
+        if (AppConfig.DEBUG) {
+            Log.d(AppConfig.TAG, "MyApplication onCreate");
+        }
+        if (AppConfig.DEBUG) {
+            StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
+            StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build());
+        }
+        // 初始化网络监听
+        mNetWorkObservable = new NetWorkObservable(this);
+        initErpDB();
+    /*    try {
+            com.core.app.Constants.cleanRed(this);
         } catch (PackageManager.NameNotFoundException e) {
             e.printStackTrace();
         }*/
-		registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
-			@Override
-			public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
-			}
-
-			@Override
-			public void onActivityStarted(Activity activity) {
-			}
-
-			@Override
-			public void onActivityResumed(Activity activity) {
-				MyActivityManager.getInstance().setCurrentActivity(activity);
-			}
-
-			@Override
-			public void onActivityPaused(Activity activity) {
-			}
-
-			@Override
-			public void onActivityStopped(Activity activity) {
-			}
-
-			@Override
-			public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
-			}
-
-			@Override
-			public void onActivityDestroyed(Activity activity) {
-			}
-		});
-	}
-
-	public void destory() {
-		if (AppConfig.DEBUG) {
-			Log.d(AppConfig.TAG, "MyApplication destory");
-		}
-		// 结束百度定位
-		if (mBdLocationHelper != null) {
-			mBdLocationHelper.release();
-		}
-		// 关闭网络状态的监听
-		if (mNetWorkObservable != null) {
-			mNetWorkObservable.release();
-		}
-		// 清除图片加载
+        registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
+            @Override
+            public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
+            }
+
+            @Override
+            public void onActivityStarted(Activity activity) {
+            }
+
+            @Override
+            public void onActivityResumed(Activity activity) {
+                MyActivityManager.getInstance().setCurrentActivity(activity);
+            }
+
+            @Override
+            public void onActivityPaused(Activity activity) {
+            }
+
+            @Override
+            public void onActivityStopped(Activity activity) {
+            }
+
+            @Override
+            public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
+            }
+
+            @Override
+            public void onActivityDestroyed(Activity activity) {
+            }
+        });
+    }
+
+    public void destory() {
+        if (AppConfig.DEBUG) {
+            Log.d(AppConfig.TAG, "MyApplication destory");
+        }
+        // 结束百度定位
+        if (mBdLocationHelper != null) {
+            mBdLocationHelper.release();
+        }
+        // 关闭网络状态的监听
+        if (mNetWorkObservable != null) {
+            mNetWorkObservable.release();
+        }
+        // 清除图片加载
 //		ImageLoader.getInstance().destroy();
-		releaseFastVolley();
-		android.os.Process.killProcess(android.os.Process.myPid());
-	}
-
-	private void initErpDB() {
-		DatabaseManager.initializeInstance(DBOpenHelper.getInstance(this));
-	}
-
-
-	public void initShareAPI() {
-		PlatformConfig.setWeixin("wx2539cc96bf158e00", "b057aa3e807ba7c505a2f03cc541bbf6");
-		PlatformConfig.setSinaWeibo("493318722", "7def652c3683603b08bab87d34b1f944");
-		PlatformConfig.setQQZone("1104894295", "Nk8zMIz5YSqwRQ1F");
-		Config.IsToastTip = false;
-	}
-
-	private void initUmengStatistics() {
-		MobclickAgent.UMAnalyticsConfig config = new MobclickAgent.UMAnalyticsConfig(this, "57ea27bb67e58e088c003bbf",
-				"baidu", MobclickAgent.EScenarioType.E_UM_NORMAL);
-		MobclickAgent.startWithConfigure(config);
-		if (!CommonUtil.isReleaseVersion()) {//当前为开发版本时候不需要上传友盟
-			MobclickAgent.setCatchUncaughtExceptions(false);
-		}
-	}
-
-
-	private void configHttpUtils() {
-		mHttpUtils.configRequestThreadPoolSize(4);
-		mHttpUtils.configRequestRetryCount(3);
-		mHttpUtils.configResponseTextCharset("utf-8");
-		mHttpUtils.configTimeout(10000);
-	}
-
-	public boolean isNetworkActive() {
+        releaseFastVolley();
+        android.os.Process.killProcess(android.os.Process.myPid());
+    }
+
+    private void initErpDB() {
+        DatabaseManager.initializeInstance(DBOpenHelper.getInstance(this));
+    }
+
+
+    public void initShareAPI() {
+        PlatformConfig.setWeixin("wx2539cc96bf158e00", "b057aa3e807ba7c505a2f03cc541bbf6");
+        PlatformConfig.setSinaWeibo("493318722", "7def652c3683603b08bab87d34b1f944");
+        PlatformConfig.setQQZone("1104894295", "Nk8zMIz5YSqwRQ1F");
+        Config.IsToastTip = false;
+    }
+
+    private void initUmengStatistics() {
+        MobclickAgent.UMAnalyticsConfig config = new MobclickAgent.UMAnalyticsConfig(this, "57ea27bb67e58e088c003bbf",
+                "baidu", MobclickAgent.EScenarioType.E_UM_NORMAL);
+        MobclickAgent.startWithConfigure(config);
+        if (!CommonUtil.isReleaseVersion()) {//当前为开发版本时候不需要上传友盟
+            MobclickAgent.setCatchUncaughtExceptions(false);
+        }
+    }
+
+
+    private void configHttpUtils() {
+        mHttpUtils.configRequestThreadPoolSize(4);
+        mHttpUtils.configRequestRetryCount(3);
+        mHttpUtils.configResponseTextCharset("utf-8");
+        mHttpUtils.configTimeout(10000);
+    }
+
+    public boolean isNetworkActive() {
 //        if (mNetWorkObservable != null) {
 //            return mNetWorkObservable.isNetworkActive();
 //        }else{
 //	        return true;
 //        }
-		return NetUtils.isNetWorkConnected(BaseConfig.getContext());
-	}
-
-	public void registerNetWorkObserver(NetWorkObservable.NetWorkObserver observer) {
-		if (mNetWorkObservable != null) {
-			mNetWorkObservable.registerObserver(observer);
-		}
-	}
-
-	public void unregisterNetWorkObserver(NetWorkObservable.NetWorkObserver observer) {
-		if (mNetWorkObservable != null) {
-			mNetWorkObservable.unregisterObserver(observer);
-		}
-	}
-
-	private void initAppDir() {
-		File file = getExternalFilesDir(null);
-		if (file != null) {
-			if (!file.exists()) {
-				file.mkdirs();
-			}
-			mAppDir = file.getAbsolutePath();
-		}
-
-		file = getExternalFilesDir(Environment.DIRECTORY_PICTURES);
-		if (file != null) {
-			if (!file.exists()) {
-				file.mkdirs();
-			}
-			mPicturesDir = file.getAbsolutePath();
-		}
-
-		file = getExternalFilesDir(Environment.DIRECTORY_MUSIC);
-		if (file != null) {
-			if (!file.exists()) {
-				file.mkdirs();
-			}
-			mVoicesDir = file.getAbsolutePath();
-		}
-		file = getExternalFilesDir(Environment.DIRECTORY_MOVIES);
-		if (file != null) {
-			if (!file.exists()) {
-				file.mkdirs();
-			}
-			mVideosDir = file.getAbsolutePath();
-		}
-		file = getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS);
-		if (file != null) {
-			if (!file.exists()) {
-				file.mkdirs();
-			}
-			mFilesDir = file.getAbsolutePath();
-		}
-	}
-
-	private void initImageLoader() {
-		int memoryCacheSize = (int) (Runtime.getRuntime().maxMemory() / 5);
-		MemoryCacheAware<String, Bitmap> memoryCache;
-		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
-			memoryCache = new LruMemoryCache(memoryCacheSize);
-		} else {
-			memoryCache = new LRULimitedMemoryCache(memoryCacheSize);
-		}
-
-		mNormalImageOptions = new DisplayImageOptions.Builder()
-				.bitmapConfig(Bitmap.Config.RGB_565)
-				.cacheInMemory(true).cacheOnDisc(true)
-				.displayer(new RoundedBitmapDisplayer(10))
-				.resetViewBeforeLoading(false)
-				.showImageForEmptyUri(R.drawable.image_download_fail_icon)
-				.showImageOnFail(R.drawable.image_download_fail_icon)
-				.build();
-
-		mAvatarRoundImageOptions = new DisplayImageOptions.Builder().bitmapConfig(Bitmap.Config.RGB_565).
-				cacheInMemory(true).cacheOnDisc(true)
-				.displayer(new RoundedBitmapDisplayer(10))
-				.resetViewBeforeLoading(true)
-				.showImageForEmptyUri(R.drawable.avatar_normal)
-				.showImageOnFail(R.drawable.avatar_normal)
-				.showImageOnLoading(R.drawable.avatar_normal)
-				.build();
-
-		mAvatarNormalImageOptions = new DisplayImageOptions.Builder()
-				.bitmapConfig(Bitmap.Config.RGB_565)
-				.cacheInMemory(true)
-				.cacheOnDisc(true)
-				.resetViewBeforeLoading(true)
-				.showImageForEmptyUri(R.drawable.avatar_normal)
-				.showImageOnFail(R.drawable.avatar_normal)
-				.showImageOnLoading(R.drawable.avatar_normal).build();
-
-		if (mPicturesDir!=null) {
-			ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this)
-					.defaultDisplayImageOptions(mNormalImageOptions)
-					// .denyCacheImageMultipleSizesInMemory()
-					.discCache(new TotalSizeLimitedDiscCache(new File(mPicturesDir), 50 * 1024 * 1024))
-					// 最多缓存50M的图片
-					.discCacheFileNameGenerator(new Md5FileNameGenerator())
-					.memoryCache(memoryCache)
-					.tasksProcessingOrder(QueueProcessingType.LIFO)
-					.threadPriority(Thread.NORM_PRIORITY - 2)
-					.imageDownloader(new AuthImageDownloader(this))
-					.denyCacheImageMultipleSizesInMemory()
-					.threadPoolSize(4)
-					.build();
-			ImageLoader.getInstance().init(config);
-		}else{
-			//getCacheDir()
-			ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this)
-					.defaultDisplayImageOptions(mNormalImageOptions)
-					// .denyCacheImageMultipleSizesInMemory()
-					.discCache(new TotalSizeLimitedDiscCache(getCacheDir(), 50 * 1024 * 1024))
-					// 最多缓存50M的图片
-					.discCacheFileNameGenerator(new Md5FileNameGenerator())
-					.memoryCache(memoryCache)
-					.tasksProcessingOrder(QueueProcessingType.LIFO)
-					.threadPriority(Thread.NORM_PRIORITY - 2)
-					.imageDownloader(new AuthImageDownloader(this))
-					.denyCacheImageMultipleSizesInMemory()
-					.threadPoolSize(4)
-					.build();
-			ImageLoader.getInstance().init(config);
-		}
-
-
-	}
-
-
-	public void setConfig(AppConfig config) {
-		mConfig = config;
-	}
-
-	public AppConfig getConfig() {
-		if (mConfig == null) {
-			mConfig = AppConfig.initConfig(getApplicationContext(), new ConfigBean());
-		}
-		return mConfig;
-	}
-
-	public FastVolley getFastVolley() {
-		if (mFastVolley == null) {
-			synchronized (MyApplication.class) {
-				if (mFastVolley == null) {
-					mFastVolley = new FastVolley(this);
-					mFastVolley.start();
-				}
-			}
-		}
-		return mFastVolley;
-	}
-
-	private void releaseFastVolley() {
-		if (mFastVolley != null) {
-			mFastVolley.stop();
-		}
-	}
-
-
-	@Override
-	protected void attachBaseContext(Context base) {
-		super.attachBaseContext(base);
-		MultiDex.install(this);
-	}
-
-
-	public String getLoginUserId() {
-		return (mLoginUser != null && !TextUtils.isEmpty(mLoginUser.getUserId())) ? mLoginUser.getUserId() : "";
-	}
-
-	public static MyApplication getInstance() {
-		return INSTANCE;
-	}
+        return NetUtils.isNetWorkConnected(BaseConfig.getContext());
+    }
+
+    public void registerNetWorkObserver(NetWorkObservable.NetWorkObserver observer) {
+        if (mNetWorkObservable != null) {
+            mNetWorkObservable.registerObserver(observer);
+        }
+    }
+
+    public void unregisterNetWorkObserver(NetWorkObservable.NetWorkObserver observer) {
+        if (mNetWorkObservable != null) {
+            mNetWorkObservable.unregisterObserver(observer);
+        }
+    }
+
+    private void initAppDir() {
+        File file = getExternalFilesDir(null);
+        if (file != null) {
+            if (!file.exists()) {
+                file.mkdirs();
+            }
+            mAppDir = file.getAbsolutePath();
+        }
+
+        file = getExternalFilesDir(Environment.DIRECTORY_PICTURES);
+        if (file != null) {
+            if (!file.exists()) {
+                file.mkdirs();
+            }
+            mPicturesDir = file.getAbsolutePath();
+        }
+
+        file = getExternalFilesDir(Environment.DIRECTORY_MUSIC);
+        if (file != null) {
+            if (!file.exists()) {
+                file.mkdirs();
+            }
+            mVoicesDir = file.getAbsolutePath();
+        }
+        file = getExternalFilesDir(Environment.DIRECTORY_MOVIES);
+        if (file != null) {
+            if (!file.exists()) {
+                file.mkdirs();
+            }
+            mVideosDir = file.getAbsolutePath();
+        }
+        file = getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS);
+        if (file != null) {
+            if (!file.exists()) {
+                file.mkdirs();
+            }
+            mFilesDir = file.getAbsolutePath();
+        }
+    }
+
+    private void initImageLoader() {
+        int memoryCacheSize = (int) (Runtime.getRuntime().maxMemory() / 5);
+        MemoryCacheAware<String, Bitmap> memoryCache;
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
+            memoryCache = new LruMemoryCache(memoryCacheSize);
+        } else {
+            memoryCache = new LRULimitedMemoryCache(memoryCacheSize);
+        }
+
+        mNormalImageOptions = new DisplayImageOptions.Builder()
+                .bitmapConfig(Bitmap.Config.RGB_565)
+                .cacheInMemory(true).cacheOnDisc(true)
+                .displayer(new RoundedBitmapDisplayer(10))
+                .resetViewBeforeLoading(false)
+                .showImageForEmptyUri(R.drawable.image_download_fail_icon)
+                .showImageOnFail(R.drawable.image_download_fail_icon)
+                .build();
+
+        mAvatarRoundImageOptions = new DisplayImageOptions.Builder().bitmapConfig(Bitmap.Config.RGB_565).
+                cacheInMemory(true).cacheOnDisc(true)
+                .displayer(new RoundedBitmapDisplayer(10))
+                .resetViewBeforeLoading(true)
+                .showImageForEmptyUri(R.drawable.avatar_normal)
+                .showImageOnFail(R.drawable.avatar_normal)
+                .showImageOnLoading(R.drawable.avatar_normal)
+                .build();
+
+        mAvatarNormalImageOptions = new DisplayImageOptions.Builder()
+                .bitmapConfig(Bitmap.Config.RGB_565)
+                .cacheInMemory(true)
+                .cacheOnDisc(true)
+                .resetViewBeforeLoading(true)
+                .showImageForEmptyUri(R.drawable.avatar_normal)
+                .showImageOnFail(R.drawable.avatar_normal)
+                .showImageOnLoading(R.drawable.avatar_normal).build();
+
+        if (mPicturesDir != null) {
+            ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this)
+                    .defaultDisplayImageOptions(mNormalImageOptions)
+                    // .denyCacheImageMultipleSizesInMemory()
+                    .discCache(new TotalSizeLimitedDiscCache(new File(mPicturesDir), 50 * 1024 * 1024))
+                    // 最多缓存50M的图片
+                    .discCacheFileNameGenerator(new Md5FileNameGenerator())
+                    .memoryCache(memoryCache)
+                    .tasksProcessingOrder(QueueProcessingType.LIFO)
+                    .threadPriority(Thread.NORM_PRIORITY - 2)
+                    .imageDownloader(new AuthImageDownloader(this))
+                    .denyCacheImageMultipleSizesInMemory()
+                    .threadPoolSize(4)
+                    .build();
+            ImageLoader.getInstance().init(config);
+        } else {
+            //getCacheDir()
+            ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this)
+                    .defaultDisplayImageOptions(mNormalImageOptions)
+                    // .denyCacheImageMultipleSizesInMemory()
+                    .discCache(new TotalSizeLimitedDiscCache(getCacheDir(), 50 * 1024 * 1024))
+                    // 最多缓存50M的图片
+                    .discCacheFileNameGenerator(new Md5FileNameGenerator())
+                    .memoryCache(memoryCache)
+                    .tasksProcessingOrder(QueueProcessingType.LIFO)
+                    .threadPriority(Thread.NORM_PRIORITY - 2)
+                    .imageDownloader(new AuthImageDownloader(this))
+                    .denyCacheImageMultipleSizesInMemory()
+                    .threadPoolSize(4)
+                    .build();
+            ImageLoader.getInstance().init(config);
+        }
+
+
+    }
+
+    public void initWxPay(Context context) {
+        IWXAPI wxApi = WXAPIFactory.createWXAPI(context, Constants.WXPAY_APPID);
+        wxApi.registerApp(Constants.WXPAY_APPID);
+    }
+
+    public void setConfig(AppConfig config) {
+        mConfig = config;
+    }
+
+    public AppConfig getConfig() {
+        if (mConfig == null) {
+            mConfig = AppConfig.initConfig(getApplicationContext(), new ConfigBean());
+        }
+        return mConfig;
+    }
+
+    public FastVolley getFastVolley() {
+        if (mFastVolley == null) {
+            synchronized (MyApplication.class) {
+                if (mFastVolley == null) {
+                    mFastVolley = new FastVolley(this);
+                    mFastVolley.start();
+                }
+            }
+        }
+        return mFastVolley;
+    }
+
+    private void releaseFastVolley() {
+        if (mFastVolley != null) {
+            mFastVolley.stop();
+        }
+    }
+
+
+    @Override
+    protected void attachBaseContext(Context base) {
+        super.attachBaseContext(base);
+        MultiDex.install(this);
+    }
+
+
+    public String getLoginUserId() {
+        return (mLoginUser != null && !TextUtils.isEmpty(mLoginUser.getUserId())) ? mLoginUser.getUserId() : "";
+    }
+
+    public static MyApplication getInstance() {
+        return INSTANCE;
+    }
 }

+ 0 - 1
app_modular/apputils/build.gradle

@@ -25,5 +25,4 @@ dependencies {
     compile project(':common')
     compile project(':network')
     compile project(':imageload')
-    compile 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+'
 }

+ 3 - 6
app_modular/apputils/src/main/java/com/modular/apputils/utils/playsdk/WxPlay.java

@@ -35,13 +35,8 @@ public class WxPlay {
 
     }
 
-    public void init(Context context) {
+    public void wxPay(Context context, String orderInfo, OnPlayListener onPlayListener) {
         wxApi = WXAPIFactory.createWXAPI(context, Constants.WXPAY_APPID);
-        wxApi.registerApp(Constants.WXPAY_APPID);
-    }
-
-
-    public void wxPay(String orderInfo, OnPlayListener onPlayListener) {
         if (JSONUtil.validate(orderInfo)) {
             JSONObject orderObject = JSON.parseObject(orderInfo);
 
@@ -53,6 +48,8 @@ public class WxPlay {
             request.nonceStr = JSONUtil.getText(orderObject, "noncestr");
             request.timeStamp = JSONUtil.getText(orderObject, "timestamp");
             request.sign = JSONUtil.getText(orderObject, "sign");
+            request.extData = "app data";
+
             wxApi.sendReq(request);
         } else {
             onPlayListener.onFailure("500", "订单信息获取异常");

+ 0 - 1
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/activity/BusinessTravelActivity.java

@@ -17,7 +17,6 @@ import com.me.network.app.http.HttpClient;
 import com.me.network.app.http.Method;
 import com.me.network.app.http.rx.ResultListener;
 import com.me.network.app.http.rx.ResultSubscriber;
-import com.modular.apputils.utils.TestStr;
 import com.modular.apputils.widget.SpaceItemDecoration;
 import com.module.recyclerlibrary.ui.refresh.BaseRefreshLayout;
 import com.uas.appworks.OA.platform.adapter.BusinessTravelAdapter;

+ 67 - 69
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/activity/CharitableActivity.java

@@ -2,13 +2,11 @@ package com.uas.appworks.OA.platform.activity;
 
 import android.os.Bundle;
 import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentManager;
 import android.support.v4.app.FragmentTransaction;
 import android.widget.TextView;
 
 import com.common.LogUtil;
 import com.core.base.BaseActivity;
-import com.core.base.EasyFragment;
 import com.modular.apputils.widget.DivideRadioGroup;
 import com.uas.appworks.OA.platform.fragment.ActivityFragment;
 import com.uas.appworks.OA.platform.fragment.CharitableListFragment;
@@ -17,82 +15,82 @@ import com.uas.appworks.R;
 
 
 public class CharitableActivity extends BaseActivity {
-	private final String LIST_FRAGMENT = "listFragment";
-	private final String ACTIVITY_FRAGMENT = "activityFragment";
-	private final String USER_FRAGMENT = "userFragment";
+    private final String LIST_FRAGMENT = "listFragment";
+    private final String ACTIVITY_FRAGMENT = "activityFragment";
+    private final String USER_FRAGMENT = "userFragment";
 
 
-	private TextView listNumTv;
-	private TextView activityNumTv;
-	private TextView userNumTv;
+    private TextView listNumTv;
+    private TextView activityNumTv;
+    private TextView userNumTv;
 
-	private Fragment lastFragment;
+    private Fragment lastFragment;
 
-	@Override
-	protected void onCreate(Bundle savedInstanceState) {
-		super.onCreate(savedInstanceState);
-		setContentView(R.layout.activity_charitable);
-		initView();
-	}
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_charitable);
+        initView();
+    }
 
 
-	private void initView() {
-		DivideRadioGroup selectRg = (DivideRadioGroup) findViewById(R.id.selectRg);
-		listNumTv = (TextView) findViewById(R.id.listNumTv);
-		activityNumTv = (TextView) findViewById(R.id.activityNumTv);
-		userNumTv = (TextView) findViewById(R.id.userNumTv);
-		CharitableListFragment listFragment = new CharitableListFragment();
-		changeFragment(listFragment, LIST_FRAGMENT);
-		selectRg.setOnCheckedChangeListener(new DivideRadioGroup.OnCheckedChangeListener() {
-			@Override
-			public void onCheckedChanged(DivideRadioGroup group, int checkedId) {
-				Fragment fragment = null;
-				String tag = null;
-				if (checkedId == R.id.listRb) {
-					fragment = getSupportFragmentManager().findFragmentByTag(LIST_FRAGMENT);
-					if (fragment == null) {
-						fragment = new CharitableListFragment();
-					}
-					tag = LIST_FRAGMENT;
-				} else if (checkedId == R.id.activityRb) {
-					LogUtil.i("checkedId == R.id.activityRb");
-					fragment = getSupportFragmentManager().findFragmentByTag(ACTIVITY_FRAGMENT);
-					if (fragment == null) {
-						fragment = new ActivityFragment();
-					}
-					tag = ACTIVITY_FRAGMENT;
-				} else if (checkedId == R.id.userRb) {
-					fragment = getSupportFragmentManager().findFragmentByTag(USER_FRAGMENT);
-					if (fragment == null) {
-						fragment = new UserFragment();
-					}
-					tag = USER_FRAGMENT;
-				}
+    private void initView() {
+        DivideRadioGroup selectRg = (DivideRadioGroup) findViewById(R.id.selectRg);
+        listNumTv = (TextView) findViewById(R.id.listNumTv);
+        activityNumTv = (TextView) findViewById(R.id.activityNumTv);
+        userNumTv = (TextView) findViewById(R.id.userNumTv);
+        CharitableListFragment listFragment = new CharitableListFragment();
+        changeFragment(listFragment, LIST_FRAGMENT);
+        selectRg.setOnCheckedChangeListener(new DivideRadioGroup.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(DivideRadioGroup group, int checkedId) {
+                Fragment fragment = null;
+                String tag = null;
+                if (checkedId == R.id.listRb) {
+                    fragment = getSupportFragmentManager().findFragmentByTag(LIST_FRAGMENT);
+                    if (fragment == null) {
+                        fragment = new CharitableListFragment();
+                    }
+                    tag = LIST_FRAGMENT;
+                } else if (checkedId == R.id.activityRb) {
+                    LogUtil.i("checkedId == R.id.activityRb");
+                    fragment = getSupportFragmentManager().findFragmentByTag(ACTIVITY_FRAGMENT);
+                    if (fragment == null) {
+                        fragment = new ActivityFragment();
+                    }
+                    tag = ACTIVITY_FRAGMENT;
+                } else if (checkedId == R.id.userRb) {
+                    fragment = getSupportFragmentManager().findFragmentByTag(USER_FRAGMENT);
+                    if (fragment == null) {
+                        fragment = new UserFragment();
+                    }
+                    tag = USER_FRAGMENT;
+                }
 
-				changeFragment(fragment, tag);
+                changeFragment(fragment, tag);
 
-			}
-		});
-	}
+            }
+        });
+    }
 
-	private void changeFragment(Fragment addFragment, String tag) {
-		FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();// 开始事物
-		if (addFragment == null) {
-			return;
-		}
-		if (addFragment == lastFragment) {
-			return;
-		}
-		if (lastFragment != null && lastFragment != addFragment) {// 如果最后一次加载的不是现在要加载的Fragment,那么僵最后一次加载的移出
-			fragmentTransaction.detach(lastFragment);
-		}
-		if (!addFragment.isAdded())// 如果还没有添加,就加上
-			fragmentTransaction.add(R.id.contantFl, addFragment, tag);
-		if (addFragment.isDetached())
-			fragmentTransaction.attach(addFragment);
-		lastFragment = addFragment;
-		fragmentTransaction.commitAllowingStateLoss();
-	}
+    private void changeFragment(Fragment addFragment, String tag) {
+        FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();// 开始事物
+        if (addFragment == null) {
+            return;
+        }
+        if (addFragment == lastFragment) {
+            return;
+        }
+        if (lastFragment != null && lastFragment != addFragment) {// 如果最后一次加载的不是现在要加载的Fragment,那么僵最后一次加载的移出
+            fragmentTransaction.detach(lastFragment);
+        }
+        if (!addFragment.isAdded())// 如果还没有添加,就加上
+            fragmentTransaction.add(R.id.contantFl, addFragment, tag);
+        if (addFragment.isDetached())
+            fragmentTransaction.attach(addFragment);
+        lastFragment = addFragment;
+        fragmentTransaction.commitAllowingStateLoss();
+    }
 
 
 }

+ 42 - 14
app_modular/appworks/src/main/java/com/uas/appworks/OA/platform/fragment/CharitableListFragment.java

@@ -5,7 +5,6 @@ import android.content.Intent;
 import android.graphics.Color;
 import android.os.Bundle;
 import android.support.v7.widget.DefaultItemAnimator;
-import android.support.v7.widget.GridLayoutManager;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.OrientationHelper;
 import android.support.v7.widget.RecyclerView;
@@ -16,7 +15,6 @@ import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.View;
 import android.widget.AdapterView;
-import android.widget.GridView;
 import android.widget.LinearLayout;
 import android.widget.ListView;
 import android.widget.TextView;
@@ -41,10 +39,12 @@ import com.handmark.pulltorefresh.library.PullToRefreshBase;
 import com.handmark.pulltorefresh.library.PullToRefreshListView;
 import com.me.network.app.http.HttpClient;
 import com.me.network.app.http.Method;
+import com.me.network.app.http.rx.Result2Listener;
 import com.me.network.app.http.rx.ResultListener;
 import com.me.network.app.http.rx.ResultSubscriber;
 import com.modular.apputils.listener.OnPlayListener;
 import com.modular.apputils.utils.playsdk.AliPlay;
+import com.modular.apputils.utils.playsdk.WxPlay;
 import com.modular.apputils.widget.CustomerBanner;
 import com.uas.appworks.OA.platform.activity.CharitSearchActivity;
 import com.uas.appworks.OA.platform.adapter.AutoPlayPagerAdapter;
@@ -373,12 +373,12 @@ public class CharitableListFragment extends EasyFragment implements OnPlayListen
                     SelectPlayPop.showPlay(getActivity(), charitableAdapter.getModels(position), new SelectPlayPop.OnSureListener() {
                         @Override
                         public void sure(double num, int type, CharitModel model) {
-                            if (type == 1) {
+                            if (type == Constants.FLAG.WEIXIN_PAY) {
                                 LogUtil.i("选择了微信支付");
                             } else {
                                 LogUtil.i("选择了支付宝支付");
                             }
-                            loadOrderInfo(num, model);
+                            loadOrderInfo(num, model, type);
                         }
                     });
                 }
@@ -407,8 +407,12 @@ public class CharitableListFragment extends EasyFragment implements OnPlayListen
     }
 
 
-    private void toPlay(String orderInfo) {
-        AliPlay.api().alipay(getActivity(), orderInfo, this);
+    private void sendToPay(String orderInfo, int type) {
+        if (type == Constants.FLAG.WEIXIN_PAY) {
+            WxPlay.api().wxPay(getActivity(), orderInfo, this);
+        } else {
+            AliPlay.api().alipay(getActivity(), orderInfo, this);
+        }
     }
 
     @Override
@@ -419,16 +423,15 @@ public class CharitableListFragment extends EasyFragment implements OnPlayListen
 
     @Override
     public void onFailure(String resultStatus, String resultInfo) {
-        ToastUtil.showToast(ct, "支付失败");
+        ToastUtil.showToast(ct, "支付失败");
         playing = false;
     }
 
-    private void loadOrderInfo(Double amount, CharitModel model) {
+    private void loadOrderInfo(Double amount, CharitModel model, final int type) {
         if (!NetUtils.isNetWorkConnected(ct)) {
             ToastUtil.showToast(ct, R.string.networks_out);
             return;
         }
-        baseActivity.progressDialog.show();
         if (model == null) {
             ToastUtil.showToast(ct, "内部错误");
             return;
@@ -439,30 +442,55 @@ public class CharitableListFragment extends EasyFragment implements OnPlayListen
         }
         playing = true;
         baseActivity.progressDialog.show();
+        String payUrl = "alipay/appPay";
         Map<String, Object> map = new HashMap<>();
         map.put("projectName", model.getName());
         map.put("amount", amount);
         map.put("proId", model.getId());
         map.put("imid", MyApplication.getInstance().getLoginUserId());
+        if (type == Constants.FLAG.WEIXIN_PAY) {
+            map.put("way", "微信");
+            payUrl = "wxpay/appPay";
+        } else {
+            map.put("way", "支付宝");
+            payUrl = "alipay/appPay";
+        }
+
         String json = JSON.toJSONString(map);
         LogUtil.i("json=" + json);
-        new HttpClient.Builder("http://lj.ubtob.com/alipay/")
+        new HttpClient.Builder("http://lj.ubtob.com/")
                 .isDebug(BaseConfig.isDebug())
                 .build()
                 .Api()
                 .send(new HttpClient.Builder()
-                        .url("appPay")
+                        .url(payUrl)
                         .add("jsonStr", json)
-                        .method(Method.GET)
-                        .build(), new ResultSubscriber<>(new ResultListener<Object>() {
+                        .method(Method.POST)
+                        .build(), new ResultSubscriber<>(new Result2Listener<Object>() {
                     @Override
                     public void onResponse(Object o) {
                         String message = o.toString();
                         LogUtil.i("message=" + message);
 //						EnvUtils.setEnv(EnvUtils.EnvEnum.SANDBOX);
-                        toPlay(message);
+                        if (type == Constants.FLAG.WEIXIN_PAY) {
+                            playing = false;
+                        }
+                        sendToPay(message, type);
                         baseActivity.progressDialog.dismiss();
                     }
+
+                    @Override
+                    public void onFailure(Object t) {
+                        try {
+                            baseActivity.progressDialog.dismiss();
+                            playing = false;
+                            JSONObject failObject = JSON.parseObject(t.toString());
+                            String errorStr = JSONUtil.getText(failObject, "error");
+                            ToastUtil.showToast(ct, errorStr);
+                        } catch (Exception e) {
+
+                        }
+                    }
                 }));
     }
 }

+ 23 - 31
app_modular/appworks/src/main/java/com/uas/appworks/widget/SelectPlayPop.java

@@ -1,14 +1,8 @@
 package com.uas.appworks.widget;
 
 import android.app.Activity;
-import android.app.AlertDialog;
 import android.content.Context;
-import android.content.DialogInterface;
-import android.os.Build;
-import android.support.annotation.RequiresApi;
 import android.text.Editable;
-import android.text.TextUtils;
-import android.text.TextWatcher;
 import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -27,12 +21,10 @@ import com.afollestad.materialdialogs.MaterialDialog;
 import com.common.LogUtil;
 import com.common.data.StringUtil;
 import com.common.system.DisplayUtil;
-import com.core.app.MyApplication;
+import com.core.app.Constants;
 import com.core.utils.IntentUtils;
 import com.core.utils.ToastUtil;
 import com.core.widget.listener.EditChangeListener;
-import com.iflytek.cloud.thirdparty.V;
-import com.modular.apputils.widget.DivideRadioGroup;
 import com.uas.appworks.OA.platform.model.CharitModel;
 import com.uas.appworks.R;
 
@@ -151,17 +143,17 @@ public class SelectPlayPop {
             @Override
             public void onCheckedChanged(RadioGroup radioGroup, int i) {
                 hideKeyboard(ct, autoNumEd);
-                if (i == R.id.wxRb) {
-                    showNotLocation(ct,"暂不支持微信支付");
-                    aliPlayRb.setChecked(true);
-                    wxRb.setChecked(false);
-                }
+//                if (i == R.id.wxRb) {
+//                    showNotLocation(ct, "暂不支持微信支付");
+//                    aliPlayRb.setChecked(true);
+//                    wxRb.setChecked(false);
+//                }
             }
         });
         agreeNoteTv.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View view) {
-                IntentUtils.linkCommonWeb(ct,"http://lj.ubtob.com/mobile#/userAgreement");
+                IntentUtils.linkCommonWeb(ct, "http://lj.ubtob.com/mobile#/userAgreement");
             }
         });
         agreeCb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@@ -190,7 +182,7 @@ public class SelectPlayPop {
             public void onClick(View view) {
                 hideKeyboard(ct, autoNumEd);
                 if (StringUtil.getMessage(R.string.input_two_double).equals(payNumTv.getText().toString())) {
-                    showNotLocation(ct,StringUtil.getMessage(R.string.input_two_double));
+                    showNotLocation(ct, StringUtil.getMessage(R.string.input_two_double));
                     return;
                 }
                 if (agreeCb.isChecked()) {
@@ -224,9 +216,9 @@ public class SelectPlayPop {
             return false;
         } else {
             int typeId = typeRg.getCheckedRadioButtonId();
-            int type = 2;
+            int type = Constants.FLAG.API_PAY;
             if (typeId == R.id.wxRb) {
-                type = 1;
+                type = Constants.FLAG.WEIXIN_PAY;
             }
             if (onSureListener != null) {
                 onSureListener.sure(num, type, model);
@@ -244,7 +236,7 @@ public class SelectPlayPop {
     }
 
 
-    private static void showNotLocation(Context context,String message) {
+    private static void showNotLocation(Context context, String message) {
 
 //        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
 //            AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.dialog_not_hite_bg);
@@ -253,18 +245,18 @@ public class SelectPlayPop {
 //                    .setNegativeButton(R.string.common_sure, null).show();
 //
 //        } else {
-            MaterialDialog dialog = new MaterialDialog.Builder(context)
-                    .title(R.string.prompt_title).
-                            content(message)
-                    .positiveText(R.string.sure).
-                            autoDismiss(false).callback(new MaterialDialog.ButtonCallback() {
-                        @Override
-                        public void onPositive(MaterialDialog dialog) {
-                            super.onPositive(dialog);
-                            dialog.dismiss();
-                        }
-                    }).build();
-            dialog.show();
+        MaterialDialog dialog = new MaterialDialog.Builder(context)
+                .title(R.string.prompt_title).
+                        content(message)
+                .positiveText(R.string.sure).
+                        autoDismiss(false).callback(new MaterialDialog.ButtonCallback() {
+                    @Override
+                    public void onPositive(MaterialDialog dialog) {
+                        super.onPositive(dialog);
+                        dialog.dismiss();
+                    }
+                }).build();
+        dialog.show();
 //        }
 
     }