| | |
| | | map.put("p_id", pid);
|
| | | map.put("multi_group", "true");
|
| | | map.put("generate_weapp_webview", "true");
|
| | |
|
| | | // map.put("generate_weiboapp_webview", "true");
|
| | | JSONArray array = new JSONArray();
|
| | | array.add(goodsId);
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 微信小程序转链 @Title: convertWXMP @Description: @param goodsId @param
|
| | | * pid @param customParams @return PDDPromotionUrl 返回类型 @throws
|
| | | */
|
| | | public static String convertWXMP(Long goodsId, String pid, String customParams) {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("type", "pdd.ddk.goods.promotion.url.generate");
|
| | | map.put("p_id", pid);
|
| | | map.put("multi_group", "true");
|
| | | map.put("generate_we_app", "true");
|
| | |
|
| | | JSONArray array = new JSONArray();
|
| | | array.add(goodsId);
|
| | | map.put("goods_id_list", array.toString());
|
| | | if (!StringUtil.isNullOrEmpty(customParams)) {
|
| | | map.put("custom_parameters", customParams);
|
| | | }
|
| | |
|
| | | String result = baseRequest(map);
|
| | | JSONObject root = JSONObject.fromObject(result);
|
| | | JSONObject json = root.optJSONObject("goods_promotion_url_generate_response");
|
| | | if (json == null) {
|
| | | return null;
|
| | | }
|
| | | JSONArray resultArray = json.optJSONArray("goods_promotion_url_list");
|
| | | if (resultArray != null && resultArray.size() > 0) {
|
| | | JSONObject weApp = resultArray.optJSONObject(0).optJSONObject("we_app_info");
|
| | | if (weApp != null)
|
| | | return weApp.optString("page_path");
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 商品转链
|
| | | *
|
| | | * @param goodsId
|