Beispiel #1
0
 private void init() {
   final String lotno = (String) info.getLotNo();
   final String prizeqihao = (String) info.getBatchCode();
   final String amount = (String) info.getAmount();
   final String fPayMoney = PublicMethod.formatMoney(amount);
   final String lotName = (String) info.getLotName();
   final String betNum = (String) info.getBetNum();
   final String lotMulti = (String) info.getLotMulti();
   final String prizemoney = (String) info.getPrizeAmt();
   final String ordertime = (String) info.getOrdertime();
   final String betcode = (String) info.getBetCode();
   final String prize_State = (String) info.getPrizeState();
   final String win_code = (String) info.getWin_code();
   final String orderId = (String) info.getOrderId();
   final String stateMo = (String) info.getStateMemo();
   final String betcodehtml = (String) info.getBetCodeHtml();
   TextView lotkind = (TextView) findViewById(R.id.bet_detail_text_lotno);
   TextView batchcode = (TextView) findViewById(R.id.bet_detail_text_batchcode);
   TextView dingdanno = (TextView) findViewById(R.id.bet_detail_text_dingdan);
   TextView beishu = (TextView) findViewById(R.id.join_detail_text_beishu);
   TextView zhushu = (TextView) findViewById(R.id.bet_detail_text_zhushu);
   TextView atm = (TextView) findViewById(R.id.bet_detail_text_atm);
   TextView state = (TextView) findViewById(R.id.bet_detail_text_state);
   TextView bettime = (TextView) findViewById(R.id.bet_detail_tex_bettime);
   TextView content = (TextView) findViewById(R.id.bet_detail_text_content);
   TextView kaijianghao = (TextView) findViewById(R.id.bet_detail_text_kaijianghao);
   LinearLayout layoutMain = (LinearLayout) findViewById(R.id.bet_detail_layout_content);
   lotkind.append(lotName);
   dingdanno.append(orderId);
   beishu.append(lotMulti);
   zhushu.append(betNum);
   atm.append(fPayMoney);
   state.append(stateMo);
   bettime.append(ordertime);
   //		content.setText(Html.fromHtml("方案内容:<br>"+betcodehtml));
   JSONObject josn = null;
   try {
     josn = new JSONObject(info.getJson());
   } catch (JSONException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
   contentListView.createListContent(
       layoutMain, content, info.getLotNo(), info.getBetCodeHtml(), josn);
   if (lotno.equals("J00001")
       || lotno.equals("J00002")
       || lotno.equals("J00003")
       || lotno.equals("J00004")
       || lotno.equals(Constants.LOTNO_JCLQ)
       || lotno.equals(Constants.LOTNO_JCLQ_DXF)
       || lotno.equals(Constants.LOTNO_JCLQ_RF)
       || lotno.equals(Constants.LOTNO_JCLQ_SFC)
       || lotno.equals(Constants.LOTNO_JCZQ_HUN)
       || lotno.equals(Constants.LOTNO_JCLQ_HUN)) {
     kaijianghao.setVisibility(View.GONE);
   } else {
     if (prize_State.equals("0")) {
       kaijianghao.append("未开奖");
     } else {
       kaijianghao.append(win_code);
     }
   }
   Button cancleLook = (Button) findViewById(R.id.bet_detail_img_cannle);
   cancleLook.setOnClickListener(
       new OnClickListener() {
         public void onClick(View v) {
           finish();
         }
       });
   if (lotno.equals("J00001")
       || lotno.equals("J00002")
       || lotno.equals("J00003")
       || lotno.equals("J00004")
       || lotno.equals(Constants.LOTNO_JCLQ)
       || lotno.equals(Constants.LOTNO_JCLQ_DXF)
       || lotno.equals(Constants.LOTNO_JCLQ_RF)
       || lotno.equals(Constants.LOTNO_JCLQ_SFC)
       || lotno.equals(Constants.LOTNO_JCZQ_HUN)
       || lotno.equals(Constants.LOTNO_JCLQ_HUN)) {
     batchcode.setVisibility(View.GONE);
   } else {
     batchcode.append(prizeqihao);
     Button touzhu = (Button) findViewById(R.id.bet_detail_img_ok);
     touzhu.setVisibility(View.VISIBLE);
     touzhu.setOnClickListener(
         new OnClickListener() {
           public void onClick(View v) {
             showagaindialog(info);
           }
         });
   }
 }
Beispiel #2
0
  /** 再买一次 */
  private void showagaindialog(final BetQueryInfo info) {
    LayoutInflater factory = LayoutInflater.from(this);
    /*中奖查询的查看详情使用余额查询的布局*/
    View view = factory.inflate(R.layout.usercenter_bugagain, null);
    final Dialog dialog = new Dialog(this, R.style.dialog);
    dialog.setContentView(view);
    TextView title = (TextView) view.findViewById(R.id.usercenter_bindphonetitle);
    TextView label = (TextView) view.findViewById(R.id.usercenter_bindphonelabel);
    final EditText context =
        (EditText) view.findViewById(R.id.usercenter_edittext_bindphoneContext);
    Button submit = (Button) view.findViewById(R.id.usercenter_bindphone_ok);
    Button cancle = (Button) view.findViewById(R.id.usercenter_bindphone_back);
    context.setKeyListener(new DigitsKeyListener());
    title.setText("再买一次");
    label.setText("请输入购买倍数");
    submit.setText("确定");
    final String lotno = (String) info.getLotNo();
    final String prizeqihao = (String) info.getBatchCode();
    final String amount = (String) info.getAmount();
    final String lotName = (String) info.getLotName();
    final String betcode = (String) info.getBetCodeHtml();
    final String bet_code = (String) info.getBet_code();
    final String lotMulti = (String) info.getLotMulti();
    final String omeAmount = (String) info.getOneAmount();
    submit.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            String beishu = context.getText().toString();

            if (beishu.equals("")) {
              Toast.makeText(Betdetail.this, "请输入倍数", Toast.LENGTH_SHORT).show();
            } else if (!PublicMethod.isNumeric(beishu)) {
              Toast.makeText(Betdetail.this, "请输入数字", Toast.LENGTH_SHORT).show();
            } else if (beishu.length() > 5 || Integer.valueOf(beishu) > 2000) {
              Toast.makeText(Betdetail.this, "不能超过2000倍", Toast.LENGTH_SHORT).show();
            } else {
              int allAmount =
                  Integer.valueOf(amount)
                      / Integer.valueOf(lotMulti)
                      * Integer.valueOf(beishu)
                      / 100;
              if (allAmount > 0) {
                initBetPojo(bet_code, lotno, amount, beishu, lotMulti, omeAmount);
                buyAgainMessage = new StringBuffer();
                if (lotno.equals("J00001")
                    || lotno.equals("J00002")
                    || lotno.equals("J00003")
                    || lotno.equals("J00004")
                    || lotno.equals(Constants.LOTNO_JCLQ)
                    || lotno.equals(Constants.LOTNO_JCLQ_DXF)
                    || lotno.equals(Constants.LOTNO_JCLQ_RF)
                    || lotno.equals(Constants.LOTNO_JCLQ_SFC)
                    || lotno.equals(Constants.LOTNO_JCZQ_HUN)
                    || lotno.equals(Constants.LOTNO_JCLQ_HUN)) {
                  alert(lotno, lotName, allAmount, beishu, betcode);
                } else {
                  getNetIssue(lotno, lotName, allAmount, beishu, betcode);
                }
                dialog.dismiss();
              } else {
                Toast.makeText(
                        Betdetail.this,
                        getString(R.string.usercenter_max_amount),
                        Toast.LENGTH_SHORT)
                    .show();
              }
            }
          }
        });
    cancle.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            dialog.dismiss();
          }
        });

    dialog.show();
  }