JSONObject jsonParams = new JSONObject();
int strRatingbar_fast = ratingbar_fast.getProgress();
int strRatingbar_attitude = ratingbar_attitude.getProgress();
int strRatingbar_quality = ratingbar_quality.getProgress();
int orderId = Integer.valueOf(localOrderArrayList.get(0).getOrder_id());
// jsonParams.put("key", EShopApplication.getLoginKey());
jsonParams.put("order_id", orderId);
jsonParams.put("store_desccredit", strRatingbar_quality);
jsonParams.put("store_servicecredit", strRatingbar_attitude);
jsonParams.put("store_deliverycredit", strRatingbar_fast);
jsonParams.put("geval_isanonymous", isSelect);
// 针对每个商品的评价
JSONObject servRatings = new JSONObject();
for (int i = 0; i < layout_goods_comment.getChildCount(); i++) {
View servView = layout_goods_comment.getChildAt(i);
String goodsId = (String) servView.getTag();
RatingBar rating = (RatingBar) servView
.findViewById(R.id.ratingbar_synthesize);
EditText content = (EditText) servView
.findViewById(R.id.comment_message);
JSONObject servRating = new JSONObject();
servRating.put("geval_scores", rating.getProgress());
servRating.put("geval_content", content.getText().toString()); servRatings.put(goodsId, servRating);
}
jsonParams.put("goods", servRatings);

解决方案 »

  1.   

    在ios 中可以使用字典NSDictionary来描述
    NSDictionary *dict = @{@"order_id": orderId,@"store_desccredit": strRatingbar_quality,@"store_servicecredit": strRatingbar_attitude,@"store_deliverycredit": strRatingbar_fast};  
      

  2.   

    这是最基本的json处理了...
    看下json吧:
    http://www.baidu.com/link?url=gqATduXpBXWKjnTdS1s-EeWOEVpXTtz1cl-KPlYq3pOZxv0ybkTLidq3ffV8y_0_RgEx2RmWqXd4ApO4Q4jJAa