Ejemplo n.º 1
0
  @Override
  public void requestData(int reuestType) {
    RequestParam param = new RequestParam();
    HttpURL url = new HttpURL();
    Map postParams = new HashMap();

    switch (requetType) {
      case 1:
        url.setmBaseUrl(URLConstants.MSGCODE);
        postParams.put("phone", phone);
        param.setmParserClassName(VerifyCodeParse.class.getName());
        break;
      case 2: // 注册
        url.setmBaseUrl(URLConstants.REGIST);
        //				postParams.put("code",inputCode.getText().toString());

        postParams.put("phone", register_phone.getText().toString());
        postParams.put("pwd", register_pass.getText().toString());
        postParams.put(
            "city",
            BaseApplication.getInstance().mapLocation != null
                ? (TextUtils.isEmpty(BaseApplication.getInstance().mapLocation.getCity())
                    ? BaseApplication.getInstance().location[0]
                    : BaseApplication.getInstance().mapLocation.getCity())
                : BaseApplication.getInstance().location[0]);
        param.setmParserClassName(BaseParse.class.getName());
        break;
    }
    param.setmPostMap(postParams);
    param.setmHttpURL(url);
    param.setPostRequestMethod();
    RequestManager.getRequestData(
        getActivity(), createReqSuccessListener(), createMyReqErrorListener(), param);
  }
Ejemplo n.º 2
0
 public static Map getBaseParaMap(String cmd) {
   BaseApplication application = BaseApplication.getInstance();
   Map postParams = new HashMap<String, String>();
   postParams.put("cmd", cmd);
   //        postParams.put("userId", application.userId);
   //        postParams.put("mobile", application.mobile);
   postParams.put("appVersion", application.appVersion);
   postParams.put("clientType", 3);
   postParams.put("accessToken", application.getMt_token());
   postParams.put("deviceId", BaseApplication.diviceId);
   return postParams;
 }