| | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.tejia.lijin.app.ShoppingApplication; |
| | | import com.tejia.lijin.app.ui.recommend.GoodsDetailActivity; |
| | | import com.tejia.lijin.app.util.Constant; |
| | | import com.tejia.lijin.app.util.user.UserUtil; |
| | | import com.wpc.library.util.security.MD5Utils; |
| | | import com.tejia.lijin.app.BasicTextHttpResponseHandler; |
| | | import com.tejia.lijin.app.ShoppingApi; |
| | |
| | | @Override |
| | | public void onClick(DialogInterface dialog, int which) { |
| | | MainCustomEvent.rmdTbgoodsRecommendResultClick(activity, "商品"); |
| | | Intent intent = GoodsDetailJumpUtil.getGoodsDetailIntent(activity, info.getGoods().getGoodsType()); |
| | | Intent intent = new Intent(activity, GoodsDetailActivity.class); |
| | | intent.putExtra("goodsId", info.getGoods().getGoodsId()); |
| | | intent.putExtra("goodsType", info.getGoods().getGoodsType()); |
| | | intent.putExtra("title", info.getGoods().getTitle()); |
| | | intent.putExtra("id", info.getGoods().getGoodsId()); |
| | | intent.putExtra("from", "猜你喜欢"); |
| | | activity.startActivity(intent); |
| | | dialog.dismiss(); |
| | |
| | | private static void isGiftCoupon(final GiftCoupon giftCoupon, String type, Activity context) { |
| | | CopyGiftDialogUtils utils = new CopyGiftDialogUtils(context); |
| | | dialog = new Dialog(context); |
| | | utils.showCopyGiftDialog(giftCoupon, context.getSharedPreferences("user", Context.MODE_PRIVATE).getString("uid", ""), dialog, type); |
| | | utils.showCopyGiftDialog(giftCoupon, UserUtil.getUid(ShoppingApplication.application), dialog, type); |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * @param title |
| | | */ |
| | | private static void isCopyTitle(final String title, final Activity context) { |
| | | private static void isCopyTitle(final String title, final Integer sourceType, final Activity context) { |
| | | CopyTitleDialog.Builder builder = new CopyTitleDialog.Builder(context); |
| | | builder.setMessage(title); |
| | | builder.setPositiveButton("", new DialogInterface.OnClickListener() { |
| | |
| | | Intent intent = new Intent(context, SearchResultActivity.class); |
| | | intent.putExtra("content", title); |
| | | intent.putExtra("type", "normal"); |
| | | intent.putExtra("page", (which - 1)); |
| | | intent.putExtra("page", sourceType == null ? 0 : (sourceType - 1)); |
| | | intent.putExtra("from", "recommendSearch"); |
| | | context.startActivity(intent); |
| | | dialog.dismiss(); |
| | |
| | | final String key = "clipboardRecommend-" + MD5Utils.getMD532(description); |
| | | if (!DuplicateEventFilterUtil.allowEvent(key, 2000)) |
| | | return; |
| | | if(dialog!=null&&dialog.isShowing()) |
| | | if (dialog != null && dialog.isShowing()) |
| | | return; |
| | | ShoppingApi.getNewGoodsInfo(context, description, context.getSharedPreferences("user", Context.MODE_PRIVATE).getString("uid", ""), new BasicTextHttpResponseHandler() { |
| | | ShoppingApi.getNewGoodsInfo(context, description, UserUtil.getUid(ShoppingApplication.application), new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | //防止重复弹框 |
| | |
| | | } |
| | | dialog = ToolUtil.isNotTBAlliance(new RecommendGoodsInfo(taoBaoGoodsBrief, leftJump, rightJump), type, context); |
| | | } else if (type.equalsIgnoreCase("2")) {// 智能搜索弹窗 |
| | | isCopyTitle(data.optJSONObject("data").optString("title"), context); |
| | | isCopyTitle(data.optJSONObject("data").optString("title"), data.optJSONObject("data").optInt("sourceType", Constant.GOODS_TYPE_TB), context); |
| | | } else if (type.equalsIgnoreCase("10") || |
| | | type.equalsIgnoreCase("11") || |
| | | type.equalsIgnoreCase("13")) {// 类型:10 // 类型:10-免单券 11-奖励券 13-红包 |
| | |
| | | } else if (type.equalsIgnoreCase("20")) { |
| | | data = jsonObject.optJSONObject("data").optJSONObject("data"); |
| | | ConvertLinkInfo convertLinkInfo = new Gson().fromJson(data.toString(), ConvertLinkInfo.class); |
| | | dialog= new ConvertLinkDialog.Builder(context).setConvertLinkInfo(convertLinkInfo).create(); |
| | | dialog = new ConvertLinkDialog.Builder(context).setConvertLinkInfo(convertLinkInfo).create(); |
| | | dialog.show(); |
| | | } |
| | | } else if (jsonObject.optInt("code") == 1001) {// 用户未登录提示 |