| | |
| | | import com.alibaba.baichuan.trade.biz.login.AlibcLogin; |
| | | import com.alibaba.baichuan.trade.biz.login.AlibcLoginCallback; |
| | | import com.bumptech.glide.Glide; |
| | | import com.tejia.lijin.app.ShoppingApplication; |
| | | import com.tejia.lijin.app.util.JumpActivityUtil; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | |
| | | pd = new ShapeLoadingDialog.Builder(this).build(); |
| | | if (!pd.isShowing()) |
| | | pd.show(); |
| | | String uid = getSharedPreferences("user", MODE_PRIVATE) |
| | | .getString("uid", ""); |
| | | ShoppingApi.getGoodsCouponList(this, uid, Constant.GOODS_TYPE_TB, goodsId, new BasicTextHttpResponseHandler() { |
| | | |
| | | ShoppingApi.getGoodsCouponList(this, UserUtil.getUid(ShoppingApplication.application), Constant.GOODS_TYPE_TB, goodsId, new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | if (jsonObject.optString("code").equalsIgnoreCase("0")) { |
| | |
| | | |
| | | @Override |
| | | public void buy() { |
| | | getTBLinkInfo(UserUtil.getUid(getApplicationContext())+""); |
| | | getTBLinkInfo(UserUtil.getUid(getApplicationContext())); |
| | | // buyOrGainCoupon(true); |
| | | } |
| | | }); |
| | |
| | | |
| | | private void getGoodsDetail() { |
| | | isQuestDetail = true; |
| | | String uid = getSharedPreferences("user", MODE_PRIVATE).getString("uid", "0"); |
| | | ShoppingApi.getGoodsInfoTB(this, goodsId, uid, from, new BasicTextHttpResponseHandler() { |
| | | ShoppingApi.getGoodsInfoTB(this, goodsId, UserUtil.getUid(ShoppingApplication.application), from, new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | if (jsonObject.optString("code").equalsIgnoreCase("0")) { |
| | |
| | | /** |
| | | * 获取PID 信息 |
| | | */ |
| | | private void getTBLinkInfo(String uid) { |
| | | private void getTBLinkInfo(Long uid) { |
| | | if (pd == null) |
| | | pd = new ShapeLoadingDialog.Builder(this).build(); |
| | | if (!pd.isShowing()) |
| | |
| | | if (!isLogin) { |
| | | receiveCouponHint(couponInfo.getLink()); |
| | | } else { |
| | | if (!LoginAndInviteStatusUtil.acessNext(getApplicationContext(), UserUtil.getUid(getApplicationContext()) + "", true)) |
| | | if (!LoginAndInviteStatusUtil.acessNext(getApplicationContext(), UserUtil.getUid(getApplicationContext()) , true)) |
| | | return; |
| | | if (couponInfo.isShopCoupon()) { |
| | | receiveCoupon(couponInfo.getLink()); |
| | |
| | | } |
| | | |
| | | private void buyOrGainCoupon(boolean isLogin) { |
| | | getTBLinkInfo(UserUtil.getUid(getApplicationContext())+""); |
| | | getTBLinkInfo(UserUtil.getUid(getApplicationContext())); |
| | | } |
| | | |
| | | private void goBuy() { |
| | |
| | | final ShapeLoadingDialog pb = new ShapeLoadingDialog.Builder(this).build(); |
| | | pb.show(); |
| | | Log.e("mResult", "getTaobaoShareLink()"); |
| | | String uid = getSharedPreferences("user", MODE_PRIVATE).getString("uid", "0"); |
| | | ShoppingApi.createShareLink(this, uid, mInfo.getGoods().getGoodsId(), mInfo.getGoods().getGoodsType() + "", from, null, null, new BasicTextHttpResponseHandler() { |
| | | ShoppingApi.createShareLink(this, UserUtil.getUid(ShoppingApplication.application), mInfo.getGoods().getGoodsId(), mInfo.getGoods().getGoodsType() + "", from, null, null, new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | |
| | |
| | | } |
| | | |
| | | private void bindInfo2() { |
| | | SharedPreferences sp = getSharedPreferences("user", MODE_PRIVATE); |
| | | String uid = sp.getString("uid", ""); |
| | | getTBLinkInfo(uid); |
| | | getTBLinkInfo(UserUtil.getUid(ShoppingApplication.application)); |
| | | isTBStartBind = false; |
| | | } |
| | | |
| | |
| | | if (!pd.isShowing()) |
| | | pd.show(); |
| | | Log.e("detail", "getTaoBaoH5AuthInfo--" + source); |
| | | String uid = getSharedPreferences("user", MODE_PRIVATE).getString("uid", null); |
| | | ShoppingApi.getTaoBaoAuthInfo(GoodsDetailActivityTB.this, uid, goodsId, source, true, new BasicTextHttpResponseHandler() { |
| | | ShoppingApi.getTaoBaoAuthInfo(GoodsDetailActivityTB.this, UserUtil.getUid(ShoppingApplication.application), goodsId, source, true, new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | if (jsonObject.optInt("code") == 0) { |
| | |
| | | getTaobaoShareLink(); |
| | | pd.dismiss(); |
| | | } else if (source.equalsIgnoreCase("zigou")) { |
| | | getTBLinkInfo(getSharedPreferences("user", MODE_PRIVATE).getString("uid", "")); |
| | | getTBLinkInfo(UserUtil.getUid(ShoppingApplication.application)); |
| | | } |
| | | } else { |
| | | pd.dismiss(); |
| | |
| | | } |
| | | |
| | | private void getTaoBaoH5AuthInfo2(final String source) { |
| | | String uid = getSharedPreferences("user", MODE_PRIVATE).getString("uid", null); |
| | | ShoppingApi.getTaoBaoAuthInfo(GoodsDetailActivityTB.this, uid, goodsId, source, false, new BasicTextHttpResponseHandler() { |
| | | ShoppingApi.getTaoBaoAuthInfo(GoodsDetailActivityTB.this, UserUtil.getUid(ShoppingApplication.application), goodsId, source, false, new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, final JSONObject jsonObject) throws Exception { |
| | | // Log.e("mResult", "getTaoBaoH5AuthInfo2:code:" + jsonObject.optInt("code")); |
| | |
| | | } else if (source.equalsIgnoreCase("zigou")) { |
| | | // Log.e("mResult", "getTaoBaoH5AuthInfo2():isLogin---" + AlibcLogin.getInstance().isLogin()); |
| | | if (AlibcLogin.getInstance().isLogin()) { |
| | | getTBLinkInfo(getSharedPreferences("user", MODE_PRIVATE).getString("uid", "")); |
| | | getTBLinkInfo(UserUtil.getUid(ShoppingApplication.application)); |
| | | } else { |
| | | tbBuyLogin(); |
| | | } |
| | |
| | | * @param info |
| | | */ |
| | | private void useFreeSingleTicket(FreeSingleTicket info) { |
| | | String uid = getSharedPreferences("user", MODE_PRIVATE).getString("uid", ""); |
| | | ShoppingApi.useFreeSingleTicket(GoodsDetailActivityTB.this, uid, info.getId(), goodsId, new BasicTextHttpResponseHandler() { |
| | | ShoppingApi.useFreeSingleTicket(GoodsDetailActivityTB.this, UserUtil.getUid(ShoppingApplication.application), info.getId(), goodsId, new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | if (jsonObject.optInt("code") == 0) { |