| | |
| | | import com.tejia.lijin.app.ui.BaseActivity; |
| | | import com.tejia.lijin.app.ui.dialog.GoodsDetailHongBaoAndCouponSelectDialog; |
| | | import com.tejia.lijin.app.ui.dialog.GoodsDetailJumpLoaingDialog; |
| | | import com.tejia.lijin.app.ui.dialog.GoodsDetailNoLoginFailiDialog; |
| | | import com.tejia.lijin.app.ui.dialog.GoodsDetailNotifyDialog; |
| | | import com.tejia.lijin.app.ui.dialog.JumpTaoBaoDialog; |
| | | import com.tejia.lijin.app.ui.goods.GoodsDetailHongBaoListAdapter; |
| | |
| | | import com.tejia.lijin.app.util.umengCustomEvent.GoodsCustomEvent; |
| | | import com.tejia.lijin.app.util.user.LoginAndInviteStatusUtil; |
| | | import com.tejia.lijin.app.util.user.UserUtil; |
| | | import com.tejia.lijin.app.util.web.RebateJavaInterfaceBS; |
| | | import com.wang.avi.AVLoadingIndicatorView; |
| | | import com.wpc.library.content.ConnectivityChangeHelper; |
| | | import com.wpc.library.recyclerviewhelper.DividerItemDecoration; |
| | |
| | | import androidx.recyclerview.widget.RecyclerView; |
| | | import androidx.viewpager.widget.PagerAdapter; |
| | | import androidx.viewpager.widget.ViewPager; |
| | | import wendu.dsbridge.DWebView; |
| | | |
| | | /** |
| | | * Created by weikou2015 on 2018/5/11. |
| | |
| | | //图文详情 |
| | | private FrameLayout fl_goods_detail; |
| | | private ImageView iv_imgtext_status; |
| | | private WebView webView; |
| | | private DWebView webView; |
| | | private LinearLayout ll_loading; |
| | | private ImageView iv_loading; |
| | | private TextView tv_loading; |
| | |
| | | animationDrawable.start(); |
| | | webView.setWebViewClient(new MWebviewClient()); |
| | | WebSettings settings = webView.getSettings(); |
| | | settings.setUserAgentString("Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1"); |
| | | settings.setJavaScriptEnabled(true); |
| | | settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); |
| | | settings.setUseWideViewPort(true); |
| | | webView.setInitialScale(100); |
| | | RebateJavaInterfaceBS javaInterface1 = new RebateJavaInterfaceBS(GoodsDetailActivity.this, |
| | | null, null, new TextView(this), null, webView, null); |
| | | webView.addJavascriptObject(javaInterface1, "yestv"); |
| | | |
| | | ll_loading.setVisibility(View.VISIBLE); |
| | | |
| | | avLoadingIndicatorView.setVisibility(View.VISIBLE); |
| | |
| | | initData(); |
| | | getAppPageNotification(); |
| | | |
| | | // new GoodsDetailJumpLoaingDialog.Builder(this).setHasAd(true).setAdPid("").setNotify("铂金会员免广告,礼金提高100%", "http://www.baidu.com").setPlatform(Constant.GOODS_TYPE_TB).setOnCloseListener(new GoodsDetailJumpLoaingDialog.Builder.IDialogClose() { |
| | | |
| | | // notifyDialog = new GoodsDetailNotifyDialog.Builder(GoodsDetailActivity.this).setMessage("测试12123123").setOnButtonClickListener(new GoodsDetailNotifyDialog.Builder.IDialogButtonClick() { |
| | | // @Override |
| | | // public void onClose(boolean auto) { |
| | | // public void onLeftClick() { |
| | | // } |
| | | // }).create().show(); |
| | | // |
| | | // @Override |
| | | // public void onRightClick() { |
| | | // DialogUtil.dismiss(notifyDialog); |
| | | // goFanli(); |
| | | // } |
| | | // }).create(); |
| | | // |
| | | // DialogUtil.show(notifyDialog); |
| | | |
| | | } |
| | | |
| | | public void showNotifyDialog(String btnName, String link) { |
| | | DialogUtil.dismiss(notifyDialog); |
| | | |
| | | notifyDialog = new GoodsDetailNotifyDialog.Builder(this).setLeftBtnInfo(btnName, link).setOnButtonClickListener(new GoodsDetailNotifyDialog.Builder.IDialogButtonClick() { |
| | | notifyDialog = new GoodsDetailNotifyDialog.Builder(this).setIconResource(R.drawable.icon_goods_detail_notify).setLeftBtnInfo(btnName, link).setOnButtonClickListener(new GoodsDetailNotifyDialog.Builder.IDialogButtonClick() { |
| | | @Override |
| | | public void onLeftClick() { |
| | | DialogUtil.dismiss(notifyDialog); |
| | |
| | | //判断是否有多张券情况 |
| | | } |
| | | |
| | | private GoodsDetailNoLoginFailiDialog mGoodsDetailNoLoginFailiDialog; |
| | | |
| | | private void goFanli(final CouponInfo couponInfo) { |
| | | goodsDetailPreEventManager.startClick(0, new GoodsDetailPreEventManager.IPreEventListener() { |
| | | @Override |
| | | public void onPreSuccess() { |
| | | fanliRequest(couponInfo); |
| | | } |
| | | }); |
| | | |
| | | if (UserUtil.isLogin(getApplicationContext())) { |
| | | goodsDetailPreEventManager.startClick(0, true, new GoodsDetailPreEventManager.IPreEventListener() { |
| | | @Override |
| | | public void onPreSuccess() { |
| | | fanliRequest(couponInfo); |
| | | } |
| | | }); |
| | | } else { |
| | | DialogUtil.dismiss(mGoodsDetailNoLoginFailiDialog); |
| | | mGoodsDetailNoLoginFailiDialog = new GoodsDetailNoLoginFailiDialog.Builder(this).setOnButtonClickListener(new GoodsDetailNoLoginFailiDialog.Builder.IDialogButtonClick() { |
| | | @Override |
| | | public void onLeftClick() { |
| | | DialogUtil.dismiss(mGoodsDetailNoLoginFailiDialog); |
| | | fanliRequest(couponInfo); |
| | | } |
| | | |
| | | @Override |
| | | public void onRightClick() { |
| | | DialogUtil.dismiss(mGoodsDetailNoLoginFailiDialog); |
| | | goodsDetailPreEventManager.startClick(0, true, new GoodsDetailPreEventManager.IPreEventListener() { |
| | | @Override |
| | | public void onPreSuccess() { |
| | | fanliRequest(couponInfo); |
| | | } |
| | | }); |
| | | } |
| | | }).create(); |
| | | mGoodsDetailNoLoginFailiDialog.show(); |
| | | } |
| | | } |
| | | |
| | | private void goBuy() { |
| | |
| | | } |
| | | |
| | | private void goBuy(final GoodsDetailVO.GoodsHongBaoListVO lijinVO) { |
| | | goodsDetailPreEventManager.startClick(1, new GoodsDetailPreEventManager.IPreEventListener() { |
| | | goodsDetailPreEventManager.startClick(1, false, new GoodsDetailPreEventManager.IPreEventListener() { |
| | | @Override |
| | | public void onPreSuccess() { |
| | | buyRequest(lijinVO); |
| | |
| | | final String linkUrl = link.optString("clickUrl"); |
| | | GoodsBuyJumpUtil.jumpTB(GoodsDetailActivity.this, null, linkUrl, linkUrl, userLevel, null); |
| | | } |
| | | String todayLeftCount = data.optString("todayLeftCount"); |
| | | if (!StringUtils.isNullOrEmpty(todayLeftCount)) { |
| | | Toast.makeText(GoodsDetailActivity.this, todayLeftCount, Toast.LENGTH_SHORT).show(); |
| | | } |
| | | |
| | | |
| | | } else { |
| | | if (code == 2001) { |
| | | //用户机会已经用完了 |
| | | getBuyChanceInfoRequest(); |
| | | } else |
| | | Toast.makeText(GoodsDetailActivity.this, jsonObject.optString("msg"), Toast.LENGTH_SHORT).show(); |
| | | } else { |
| | | notifyDialog = new GoodsDetailNotifyDialog.Builder(GoodsDetailActivity.this).setMessage(jsonObject.optString("msg")).setOnButtonClickListener(new GoodsDetailNotifyDialog.Builder.IDialogButtonClick() { |
| | | @Override |
| | | public void onLeftClick() { |
| | | } |
| | | |
| | | @Override |
| | | public void onRightClick() { |
| | | DialogUtil.dismiss(notifyDialog); |
| | | goFanli(); |
| | | } |
| | | }).create(); |
| | | DialogUtil.show(notifyDialog); |
| | | } |
| | | } |
| | | } |
| | | |