Ejemplo n.º 1
0
 /** 获取期号 */
 public void getIssue(TrackQueryInfo info, String issueNum, String beishu) {
   // 获取期号和截止时间
   JSONObject ssqLotnoInfo = PublicMethod.getCurrentLotnoBatchCode(info.getLotno());
   if (ssqLotnoInfo != null && ssqLotnoInfo.has(info.getLotno())) {
     // 成功获取到了期号信息
     try {
       String issueStr = ssqLotnoInfo.getString("batchCode");
       createContinueInfo(info, issueNum, issueStr, beishu);
     } catch (JSONException e) {
       e.printStackTrace();
     }
   } else {
     // 没有获取到期号信息,重新联网获取期号
     getIssue(info, issueNum, new Handler(), beishu);
   }
 }
Ejemplo n.º 2
0
 private void setContinueBtn(Button btn, final TrackQueryInfo info) {
   if (info.getIsRepeatBuy().equals("true")) {
     btn.setBackgroundResource(R.drawable.user_continue_issue_selector);
     btn.setOnClickListener(
         new OnClickListener() {
           public void onClick(View v) {
             // TODO Auto-generated method stub
             createContinueDialog(info);
           }
         });
   } else {
     btn.setBackgroundResource(R.drawable.btn_qxzq_stop);
   }
 }
Ejemplo n.º 3
0
 /** 继续追号对话框 */
 public void createContinueInfo(
     TrackQueryInfo info, String issueNum, String issue, String beishu) {
   int oneAmt =
       Integer.parseInt(info.getOneAmount())
           / 100
           * Integer.parseInt(info.getBetNum())
           * Integer.parseInt(beishu);
   int amount = oneAmt * PublicMethod.toInt(issueNum);
   StringBuffer continueStr = new StringBuffer();
   continueStr
       .append(getString(R.string.usercenter_winningCheck_lotteryCategory))
       .append(info.getLotName() + "\n\n");
   continueStr.append(getString(R.string.usercenter_trackbatchnums)).append(issueNum + "期\n\n");
   continueStr.append(getString(R.string.continue_start_issue)).append(issue + "期\n\n");
   continueStr.append(getString(R.string.continue_amt)).append(amount + "元\n\n");
   initBetPojo(
       info.getBetTouCode(),
       issueNum,
       beishu,
       info.getLotno(),
       oneAmt + "00",
       info.getOneAmount()); // 初始化投注信息
   continueInfoDialog("\n" + continueStr, issue);
 }
Ejemplo n.º 4
0
 public void encodejson(String json) {
   try {
     JSONObject winprizejsonobj = new JSONObject(json);
     allPage = Integer.parseInt(winprizejsonobj.getString("totalPage"));
     String winprizejsonstring = winprizejsonobj.getString("result");
     JSONArray winprizejson = new JSONArray(winprizejsonstring);
     for (int i = 0; i < winprizejson.length(); i++) {
       try {
         TrackQueryInfo winPrizeQueryinfo = new TrackQueryInfo();
         winPrizeQueryinfo.setBetCode(winprizejson.getJSONObject(i).getString(BETCODE));
         winPrizeQueryinfo.setAmount(winprizejson.getJSONObject(i).getString(AMOUNT));
         winPrizeQueryinfo.setState(winprizejson.getJSONObject(i).getString(STATE));
         winPrizeQueryinfo.setBatchNum(winprizejson.getJSONObject(i).getString(BATCHNUM));
         winPrizeQueryinfo.setLotName(winprizejson.getJSONObject(i).getString(LOTNAME));
         winPrizeQueryinfo.setOrderTime(winprizejson.getJSONObject(i).getString(ORDERTIME));
         winPrizeQueryinfo.setBeginBatch(winprizejson.getJSONObject(i).getString(BEGINBATCH));
         winPrizeQueryinfo.setLastNums(winprizejson.getJSONObject(i).getString(LASTNUM));
         winPrizeQueryinfo.setId(winprizejson.getJSONObject(i).getString(ID));
         winPrizeQueryinfo.setPrizeEnd(winprizejson.getJSONObject(i).getString(PRIZEEND));
         winPrizeQueryinfo.setLotno(winprizejson.getJSONObject(i).getString(LOTNO));
         winPrizeQueryinfo.setIsRepeatBuy(winprizejson.getJSONObject(i).getString(ISBUY));
         winPrizeQueryinfo.setBetTouCode(winprizejson.getJSONObject(i).getString(BET_CODE));
         winPrizeQueryinfo.setLotMulti(winprizejson.getJSONObject(i).getString(LOTMULTI));
         winPrizeQueryinfo.setOneAmount(winprizejson.getJSONObject(i).getString(ONEAMOUNT));
         winPrizeQueryinfo.setBetNum(winprizejson.getJSONObject(i).getString(BETNUM));
         winPrizeQueryinfo.setRemainderAmount(
             winprizejson.getJSONObject(i).getString("remainderAmount"));
         windatalist.add(winPrizeQueryinfo);
       } catch (Exception e) {
       }
     }
   } catch (JSONException e) {
     try {
       JSONObject winprizejson = new JSONObject(json);
     } catch (JSONException e1) {
     }
   }
 }