| | |
| | | import android.app.Dialog; |
| | | import android.content.Intent; |
| | | import android.content.pm.PackageManager; |
| | | import android.support.v4.content.ContextCompat; |
| | | |
| | | import androidx.core.content.ContextCompat; |
| | | |
| | | import android.webkit.JavascriptInterface; |
| | | import android.widget.ImageView; |
| | | import android.widget.TextView; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.google.gson.Gson; |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.tencent.smtt.sdk.WebView; |
| | | import com.weikou.beibeivideo.entity.JumpDetail; |
| | |
| | | import com.weikou.beibeivideo.ui.login.PhoneLoginActivity; |
| | | import com.weikou.beibeivideo.util.AlibcTradeUtil; |
| | | import com.weikou.beibeivideo.util.JumpActivityUtil; |
| | | import com.weikou.beibeivideo.util.UserUtil; |
| | | |
| | | import org.json.JSONException; |
| | | import org.json.JSONObject; |
| | |
| | | this.iv_right = iv_right; |
| | | this.webview = webview; |
| | | loadingDialog = LoadingDialogUtil.getLoadingDialog(activity, ""); |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public void jumpAPPPage(String jumpDetailStr, String params) { |
| | | JumpDetail jumpDetail = new Gson().fromJson(jumpDetailStr, JumpDetail.class); |
| | | |
| | | com.alibaba.fastjson.JSONObject paramsJson = null; |
| | | if (!StringUtils.isEmpty(params)) { |
| | | paramsJson = com.alibaba.fastjson.JSONObject.parseObject(params); |
| | | } |
| | | JumpActivityUtil.jumpPage(mContext, jumpDetail, paramsJson); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | @JavascriptInterface |
| | | public void login() { |
| | | Intent intent = new Intent(mContext, LoginActivity.class); |
| | | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| | | mContext.startActivity(intent); |
| | | UserUtil.toLogin(mContext); |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public void logout() { |
| | | UserUtil.logout(mContext); |
| | | } |
| | | |
| | | |
| | | @JavascriptInterface |
| | | public void jumpWeb() { |
| | | Intent intent = new Intent(mContext, LoginActivity.class); |
| | | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| | | mContext.startActivity(intent); |
| | | |
| | | } |
| | | |
| | | /** |