|
|
@@ -14,8 +14,12 @@ import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.SpUtils;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
|
|
|
+import com.tencent.mm.opensdk.constants.ConstantsAPI;
|
|
|
+import com.tencent.mm.opensdk.modelpay.PayResp;
|
|
|
import com.umeng.socialize.bean.SHARE_MEDIA;
|
|
|
|
|
|
+import org.greenrobot.eventbus.Subscribe;
|
|
|
+
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Locale;
|
|
|
import java.util.Map;
|
|
|
@@ -123,4 +127,18 @@ public abstract class BaseActWeb extends BaseUMActivity {
|
|
|
protected void webViewLoadUrl(WebView webView, String url){
|
|
|
WebViewCacheInterceptorInst.getInstance().loadUrl(webView,url);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected boolean needRegisterEventBus() {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Subscribe
|
|
|
+ public void onEventMainThread(PayResp resp) {
|
|
|
+ String result = "";
|
|
|
+ if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
|
|
|
+ result = String.valueOf(resp.errCode + 9000);//微信支付 0 为支付成功;支付宝为 "9000" 代表支付成功
|
|
|
+ }
|
|
|
+ loadJs(String.format(Locale.CHINA, "onAlipayResult('%s')", result));
|
|
|
+ }
|
|
|
}
|