| | |
| | | import com.tejia.lijin.app.util.clipboard.ClipboardUtil; |
| | | import com.tejia.lijin.app.util.user.LoginAndInviteStatusUtil; |
| | | import com.tejia.lijin.app.util.user.UserUtil; |
| | | import com.yeshi.push.entity.PushRomType; |
| | | |
| | | import org.apache.http.Header; |
| | | import org.json.JSONArray; |
| | |
| | | |
| | | public static OkHttpClient mOkHttpClientSoon;//okHttpClient 实例 |
| | | |
| | | private final static String API_PACKAGE_NAME = "com.youhuiquan.android"; |
| | | public final static String API_PACKAGE_NAME = "com.youhuiquan.android"; |
| | | |
| | | static { |
| | | mOkHttpClient = new OkHttpClient.Builder() |
| | |
| | | commonPost(context, BASE_URL2 + "brand/getShopInfoV2", params, handler); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 用户协议按钮监听 |
| | | * |
| | | * @param context |
| | | * @param uid |
| | | * @param type 0-不同意 1-同意 2-同意-窗口关闭 |
| | | * @param handler |
| | | */ |
| | | public static void userProtocolListener(Context context, Long uid, int type, BasicTextHttpResponseHandler handler) { |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); |
| | | params.put("type", type + ""); |
| | | if (uid != null) { |
| | | params.put("uid", uid + ""); |
| | | } |
| | | commonPost(context, BASE_URL2 + "config/userProtocolListen", params, handler); |
| | | } |
| | | |
| | | /** |
| | | * 获取店铺 足迹 /足迹列表 |
| | |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<>(); |
| | | if (uid != null) |
| | | params.put("uid", uid + ""); |
| | | commonPostWithFailture(context, BASE_URL2 + "recommend/getRecommendIndex", params, handler); |
| | | commonPostWithFailture(context, BASE_URL2 + "recommend/getRecommendIndexTJ", params, handler); |
| | | } |
| | | |
| | | /** |
| | |
| | | public static void sendCircle(Context context, Long uid, String id, |
| | | BasicTextHttpResponseHandler handler) { |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<>(); |
| | | params.put("uid", uid + ""); |
| | | if (uid != null) |
| | | params.put("uid", uid + ""); |
| | | params.put("id", id + ""); |
| | | commonPostWithFailture(context, BASE_URL2 + "user/cloud/sendCircle", params, handler); |
| | | } |
| | |
| | | if (!LoginAndInviteStatusUtil.acessNext(context, uid, true)) |
| | | return; |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<>(); |
| | | params.put("uid", uid + ""); |
| | | if (uid != null) |
| | | params.put("uid", uid + ""); |
| | | params.put("type", type + ""); |
| | | params.put("id", id); |
| | | if (goodsId != null) |
| | |
| | | */ |
| | | public static void evaluateCopyComment(Context context, Long uid, String id, String cid, BasicTextHttpResponseHandler handler) { |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<>(); |
| | | params.put("uid", uid + ""); |
| | | if (uid != null) |
| | | params.put("uid", uid + ""); |
| | | params.put("cid", cid); |
| | | params.put("id", id); |
| | | commonPostWithFailture(context, BASE_URL2 + "dynamic/evaluateComment", params, handler); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 复制推荐语 |
| | | * |
| | | * @param context |
| | | * @param uid |
| | | * @param id |
| | | * @param handler |
| | | */ |
| | | public static void evaluateCopyRecommend(Context context, Long uid, String id, BasicTextHttpResponseHandler handler) { |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<>(); |
| | | if (uid != null) |
| | | params.put("uid", uid + ""); |
| | | params.put("id", id); |
| | | commonPostWithFailture(context, BASE_URL2 + "dynamic/evaluateCopyRecommend", params, handler); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 转链 |
| | | * |
| | | * @param context |
| | | * @param uid |
| | | * @param link |
| | | * @param handler |
| | | */ |
| | | public static void evaluateConvertLink(Context context, Long uid, String link, BasicTextHttpResponseHandler handler) { |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<>(); |
| | | if (uid != null) |
| | | params.put("uid", uid + ""); |
| | | params.put("link", link); |
| | | commonPostWithFailture(context, BASE_URL2 + "dynamic/convertLink", params, handler); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 首页顶部分类分类数据 |
| | |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); |
| | | params.put("orderId", orderId); |
| | | params.put("userInfo.id", uid + ""); |
| | | params.put("type", type + ""); |
| | | commonPostWithFailture(context, BASE_URL2 + "lostOrder/findLostOrder", params, handler); |
| | | } |
| | | |
| | |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<>(); |
| | | params.put("text", text); |
| | | if (uid != null) params.put("uid", uid + ""); |
| | | commonPost(context, BASE_URL2 + "search/getRecommendInfo", params, handler); |
| | | commonPost(context, BASE_URL2 + "search/getRecommendInfoTJ", params, handler); |
| | | } |
| | | |
| | | |
| | |
| | | if (notifyType != null) |
| | | params.put("notifyType", notifyType); |
| | | if (uid != null) params.put("uid", uid + ""); |
| | | commonPost(context, BASE_URL2 + "search/searchGoods", params, handler); |
| | | commonPost(context, BASE_URL2 + "search/searchGoodsTJ", params, handler); |
| | | } |
| | | |
| | | /** |
| | |
| | | commonPost1(context, BASE_URL + "customer/saveInfo", params, paramsFiles, handler); |
| | | } |
| | | |
| | | /** |
| | | * 绑定OPPO推送 |
| | | * |
| | | * @param context |
| | | */ |
| | | public static void bindOPPOPush(Context context, Long uid, String registerId, BasicTextHttpResponseHandler handler) { |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<>(); |
| | | params.put("registerId", registerId); |
| | | if (uid != null) params.put("uid", uid + ""); |
| | | commonPostWithFailture(context, BASE_URL + "push/registerOppo", params, handler); |
| | | } |
| | | |
| | | /** |
| | | * 绑定VIVO推送 |
| | | * |
| | | * @param context |
| | | */ |
| | | public static void bindVIVOPush(Context context, Long uid, String registerId, BasicTextHttpResponseHandler handler) { |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<>(); |
| | | params.put("regId", registerId); |
| | | if (uid != null) params.put("uid", uid + ""); |
| | | commonPostWithFailture(context, BASE_URL + "push/registerVivo", params, handler); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 绑定XM推送 |
| | | * |
| | | * @param context |
| | | */ |
| | | public static void bindXMPush(Context context, Long uid, String regId, BasicTextHttpResponseHandler handler) { |
| | | public static void bindPushToken(Context context, Long uid, PushRomType pushRomType, String token, BasicTextHttpResponseHandler handler) { |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<>(); |
| | | params.put("regId", regId); |
| | | params.put("type", pushRomType.name()); |
| | | params.put("token", token); |
| | | if (uid != null) |
| | | params.put("uid", uid + ""); |
| | | commonPostWithFailture(context, BASE_URL + "push/registerXM", params, handler); |
| | | commonPostWithFailture(context, BASE_URL + "push/bindToken", params, handler); |
| | | } |
| | | |
| | | |
| | |
| | | commonPostWithFailture(context, BASE_URL + "customer/getextractprocess", params, handler); |
| | | } |
| | | |
| | | /** |
| | | * 绑定华为推送 |
| | | * |
| | | * @param context |
| | | */ |
| | | public static void bindHMPush(Context context, String token, Long uid, |
| | | BasicTextHttpResponseHandler handler) { |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); |
| | | params.put("token", token); |
| | | if (uid != null) params.put("uid", uid + ""); |
| | | commonPostWithFailture(context, BASE_URL + "push/bindHWPush", params, handler); |
| | | } |
| | | |
| | | /** |
| | | * 获取网页配置信息 |
| | |
| | | commonPostWithFailture(context, BASE_URL2 + "goods/listSimpleGoods", params, handler); |
| | | } |
| | | |
| | | |
| | | public static void getSendingHongBao(Context context, |
| | | BasicTextHttpResponseHandler handler) { |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); |
| | | Long uid = UserUtil.getUid(context); |
| | | if (uid != null) |
| | | params.put("uid", uid + ""); |
| | | commonPostWithFailture(context, BASE_URL2 + "lijin/hongbao/getSendingHongBao", params, handler); |
| | | } |
| | | |
| | | public static void getHongBaoBalance(Context context, |
| | | BasicTextHttpResponseHandler handler) { |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); |
| | | Long uid = UserUtil.getUid(context); |
| | | if (uid != null) |
| | | params.put("uid", uid + ""); |
| | | commonPostWithFailture(context, BASE_URL2 + "lijin/hongbao/getHongBaoBalance", params, handler); |
| | | } |
| | | |
| | | public static void recieveHongBao(Context context, String id, |
| | | BasicTextHttpResponseHandler handler) { |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); |
| | | Long uid = UserUtil.getUid(context); |
| | | if (uid != null) |
| | | params.put("uid", uid + ""); |
| | | params.put("id", id); |
| | | commonPostWithFailture(context, BASE_URL2 + "lijin/hongbao/recieveHongBao", params, handler); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 团队资金统计 |
| | | * |