private void getAdv() {
    CellComAjaxParams cellComAjaxParams = new CellComAjaxParams();
    cellComAjaxParams.put("uid", uid);
    cellComAjaxParams.put("pos", "4");
    HttpHelper.getInstances(PreMainActivity.this)
        .send(
            FlowConsts.YYW_GETGG,
            cellComAjaxParams,
            CellComAjaxHttp.HttpWayMode.POST,
            new CellComHttpInterface.NetCallBack<CellComAjaxResult>() {

              @Override
              public void onSuccess(CellComAjaxResult cellComAjaxResult) {
                // TODO Auto-generated method stub
                AdvComm advComm =
                    cellComAjaxResult.read(AdvComm.class, CellComAjaxResult.ParseType.GSON);
                if (!FlowConsts.STATUE_1.equals(advComm.getReturnCode())) {
                  Toast.makeText(
                          PreMainActivity.this, advComm.getReturnMessage(), Toast.LENGTH_SHORT)
                      .show();
                  return;
                }
                advs = advComm.getBody();
                initJazzViewPager();
              }
            });
  }
  private void getCompanyAdv() {
    CellComAjaxParams cellComAjaxParams = new CellComAjaxParams();
    cellComAjaxParams.put("uid", uid);
    cellComAjaxParams.put("pageid", "1");
    cellComAjaxParams.put("dpitype", dpitype);
    HttpHelper.getInstances(PreMainActivity.this)
        .send(
            FlowConsts.YYW_GETAD_NAEMED,
            cellComAjaxParams,
            CellComAjaxHttp.HttpWayMode.POST,
            new CellComHttpInterface.NetCallBack<CellComAjaxResult>() {

              @Override
              public void onSuccess(CellComAjaxResult cellComAjaxResult) {
                // TODO Auto-generated method stub
                CompanyAdvComm companyAdvComm =
                    cellComAjaxResult.read(CompanyAdvComm.class, CellComAjaxResult.ParseType.GSON);
                if (!FlowConsts.STATUE_1.equals(companyAdvComm.getReturnCode())) {
                  Toast.makeText(
                          PreMainActivity.this,
                          companyAdvComm.getReturnMessage(),
                          Toast.LENGTH_SHORT)
                      .show();
                  return;
                }
                companies = companyAdvComm.getBody();
                initAdapter();
              }
            });
  }
Exemplo n.º 3
0
  // 播放广告
  private void playAdv(final String account, String type) {
    // 无网络拨打系统电话
    if (NetUtils.isConnected(MainActivity.this)) {
      CellComAjaxParams cellComAjaxParams = new CellComAjaxParams();
      cellComAjaxParams.put("uid", account);
      cellComAjaxParams.put("type", type);
      HttpHelper.getInstances(MainActivity.this)
          .send(
              FlowConsts.YYW_HOMETIME,
              cellComAjaxParams,
              CellComAjaxHttp.HttpWayMode.POST,
              new CellComHttpInterface.NetCallBack<CellComAjaxResult>() {

                @Override
                public void onSuccess(CellComAjaxResult arg0) {
                  // TODO Auto-generated method stub
                  AdvShowComm advShowComm =
                      arg0.read(AdvShowComm.class, CellComAjaxResult.ParseType.GSON);
                  String state = advShowComm.getReturnCode();
                  String msg = advShowComm.getReturnMessage();
                  if (!FlowConsts.STATUE_1.equals(state)) {
                    DismissProgressDialog();
                    ShowMsg(msg);
                    return;
                  }
                  myCount.start();
                  if ("Y".equalsIgnoreCase(advShowComm.getBody().getIfshow())) {
                    initAdv(advShowComm.getBody().getImgurl());
                  }
                  //							initAdv(advShowComm.getBody().getImgurl());
                }
              });
    }
  }
Exemplo n.º 4
0
  // 获取个人资料
  protected void getGrzl() {
    final String uid =
        SharepreferenceUtil.readString(MainActivity.this, SharepreferenceUtil.fileName, "uid");
    CellComAjaxParams cellComAjaxParams = new CellComAjaxParams();
    cellComAjaxParams.put("uid", uid);
    HttpHelper.getInstances(MainActivity.this)
        .send(
            FlowConsts.YYW_USERINFO,
            cellComAjaxParams,
            CellComAjaxHttp.HttpWayMode.POST,
            new CellComHttpInterface.NetCallBack<CellComAjaxResult>() {

              @Override
              public void onStart() {
                // TODO Auto-generated method stub
                super.onStart();
              }

              @Override
              public void onFailure(Throwable t, String strMsg) {
                // TODO Auto-generated method stub
                super.onFailure(t, strMsg);
              }

              @Override
              public void onSuccess(CellComAjaxResult arg0) {
                // TODO Auto-generated method stub
                UserInfoComm userInfoComm =
                    arg0.read(UserInfoComm.class, CellComAjaxResult.ParseType.GSON);
                String state = userInfoComm.getReturnCode();
                String msg = userInfoComm.getReturnMessage();
                if (!FlowConsts.STATUE_1.equals(state)) {
                  ShowMsg(msg);
                  return;
                }
                initValue(userInfoComm.getBody(), uid);
                if (SharepreferenceUtil.readString(
                        MainActivity.this, SharepreferenceUtil.fileName, "huafei", "")
                    .equals("")) {
                  tv_kyhf.setText("¥0");
                } else {
                  tv_kyhf.setText(
                      "¥"
                          + SharepreferenceUtil.readString(
                              MainActivity.this, SharepreferenceUtil.fileName, "huafei", ""));
                }
              }
            });
  }