修改了代码的绝大部分错误,同时完成了一半的顺序图。
This commit is contained in:
parent
4c019c61c0
commit
6000e93f28
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,6 +1,6 @@
|
|||
package com.stone.shop.adapter;
|
||||
|
||||
import android.R.integer;
|
||||
//import android.R.integer;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -83,7 +83,6 @@ public class GridAdapter extends BaseAdapter {
|
|||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
View view = View.inflate(mContext, R.layout.shop_grid_item, null);
|
||||
// RelativeLayout rl = (RelativeLayout)
|
||||
// view.findViewById(R.id.relaGrid);
|
||||
|
||||
ImageView image = (ImageView) view.findViewById(R.id.img_chooseImage);
|
||||
TextView text = (TextView) view.findViewById(R.id.tv_chooseText);
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
package com.stone.shop.model;
|
||||
|
||||
import cn.bmob.v3.BmobObject;
|
||||
|
||||
public class Library {
|
||||
private String name;
|
||||
private String type;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Library [name= " + name + "tpye= " + type + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -72,7 +72,7 @@ public class LibraryReservationActivity extends Activity {
|
|||
btnLogin.setText("已经预定" + (TextUtils.isEmpty(dateTime) ? "" : (" " + dateTime)));
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
// TODO Auto-generated catch block
|
||||
// TODO
|
||||
//e.printStackTrace();
|
||||
logger.log(Level.SEVERE, "something may be wrong", e);
|
||||
}
|
||||
|
@ -86,12 +86,13 @@ public class LibraryReservationActivity extends Activity {
|
|||
btnLogin.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO Auto-generated method stub
|
||||
// TODO
|
||||
DateTimePickDialogUtil dateTimePicKDialog = new DateTimePickDialogUtil(LibraryReservationActivity.this,
|
||||
dateFormat.format(new Date()));
|
||||
dateTimePicKDialog.dateTimePicKDialog(new DateTimeListener() {
|
||||
@Override
|
||||
public void onDateTimeChane(final String dateTime) {
|
||||
//TODO
|
||||
Reservation libreservation = new Reservation();
|
||||
libreservation.setRoomId(roomId);
|
||||
libreservation.setRoomName(roomName);
|
||||
|
@ -100,14 +101,14 @@ public class LibraryReservationActivity extends Activity {
|
|||
libreservation.save(LibraryReservationActivity.this, new SaveListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
// TODO Auto-generated method stub
|
||||
// TODO
|
||||
toast("预定成功");
|
||||
btnLogin.setEnabled(false);
|
||||
btnLogin.setText("已经预定 " + dateTime);
|
||||
}
|
||||
@Override
|
||||
public void onFailure(int arg0, String arg1) {
|
||||
// TODO Auto-generated method stub
|
||||
// TODO
|
||||
toast("预定失败");
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package com.stone.shop.view;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
@ -13,8 +12,7 @@ import android.content.Intent;
|
|||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.Editor;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Color;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
@ -68,7 +66,7 @@ public class LoginActivity extends Activity implements OnClickListener {
|
|||
|
||||
// QQ登陆
|
||||
private static Tencent mTencent;
|
||||
// private QQAuth mQQAuth;
|
||||
|
||||
|
||||
Handler mHandler = new Handler() {
|
||||
|
||||
|
@ -76,12 +74,15 @@ public class LoginActivity extends Activity implements OnClickListener {
|
|||
public void handleMessage(Message msg) {
|
||||
if (msg.what == 0) {
|
||||
JSONObject response = (JSONObject) msg.obj;
|
||||
if (response.has("nickname")) {
|
||||
if (response.has("nickname"))
|
||||
{
|
||||
Logger logger = Logger.getLogger("lavasoft");
|
||||
try {
|
||||
mUserInfo.setVisibility(android.view.View.VISIBLE);
|
||||
mUserInfo.setText(response.getString("nickname"));
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
//e.printStackTrace();
|
||||
logger.log(Level.SEVERE, "something may be wrong", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -226,22 +227,28 @@ public class LoginActivity extends Activity implements OnClickListener {
|
|||
|
||||
@Override
|
||||
public void onComplete(Object response) {
|
||||
if (null == response) {
|
||||
if (response == null) {
|
||||
Util.showResultDialog(LoginActivity.this, "返回为空", "登录失败");
|
||||
return;
|
||||
}
|
||||
JSONObject jsonResponse = (JSONObject) response;
|
||||
if (null != jsonResponse && jsonResponse.length() == 0) {
|
||||
if (jsonResponse!=null && jsonResponse.length() == 0)
|
||||
{
|
||||
Util.showResultDialog(LoginActivity.this, "返回为空", "登录失败");
|
||||
return;
|
||||
}
|
||||
// Util.showResultDialog(LoginActivity.this, response.toString(), "登录成功");
|
||||
doComplete((JSONObject) response);
|
||||
try {
|
||||
Logger logger = Logger.getLogger("lavasoft");
|
||||
try
|
||||
{
|
||||
User.userId = jsonResponse.getString("openid");
|
||||
} catch (JSONException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch (JSONException e)
|
||||
{
|
||||
// TODO
|
||||
//e.printStackTrace();
|
||||
logger.log(Level.SEVERE, "something may be wrong", e);
|
||||
}
|
||||
|
||||
Intent toHome = new Intent(LoginActivity.this, BaseActivity.class);
|
||||
|
@ -288,10 +295,12 @@ public class LoginActivity extends Activity implements OnClickListener {
|
|||
JSONObject json = (JSONObject) response;
|
||||
if (json.has("figureurl")) {
|
||||
Bitmap bitmap = null;
|
||||
Logger logger = Logger.getLogger("lavasoft");
|
||||
try {
|
||||
bitmap = Util.getbitmap(json.getString("figureurl_qq_2"));
|
||||
} catch (JSONException e) {
|
||||
|
||||
} catch (JSONException e)
|
||||
{
|
||||
logger.log(Level.SEVERE, "something may be wrong", e);
|
||||
}
|
||||
Message msg = new Message();
|
||||
msg.obj = bitmap;
|
||||
|
@ -318,7 +327,9 @@ public class LoginActivity extends Activity implements OnClickListener {
|
|||
}
|
||||
}
|
||||
|
||||
public static void initOpenidAndToken(JSONObject jsonObject) {
|
||||
public static void initOpenidAndToken(JSONObject jsonObject)
|
||||
{
|
||||
Logger logger = Logger.getLogger("lavasoft");
|
||||
try {
|
||||
String token = jsonObject.getString(Constants.PARAM_ACCESS_TOKEN);
|
||||
String expires = jsonObject.getString(Constants.PARAM_EXPIRES_IN);
|
||||
|
@ -327,7 +338,11 @@ public class LoginActivity extends Activity implements OnClickListener {
|
|||
mTencent.setAccessToken(token, expires);
|
||||
mTencent.setOpenId(openId);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
catch (Exception e)
|
||||
{
|
||||
logger.log(Level.SEVERE, "something may be wrong", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,10 +43,9 @@ public class OrderActivity extends Activity implements OnClickListener{
|
|||
private Button btnOrderCountLess; // 减少数量
|
||||
|
||||
private Button btnOrderSetTime; // 设置时间
|
||||
private Button btnDlgOk; // 设置时间完成
|
||||
// private Button btnDlgOk; // 设置时间完成
|
||||
private Button btnOrderSubmit; // 提交订单
|
||||
|
||||
// private DialogOrder dlgSetOrderTime;
|
||||
// private View dlgOrderView;
|
||||
private int mHour;
|
||||
private int mMinute;
|
||||
|
@ -77,7 +76,6 @@ public class OrderActivity extends Activity implements OnClickListener{
|
|||
shopID = getIntent().getStringExtra("shopID");
|
||||
|
||||
initView();
|
||||
//initDlgView();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
|
@ -104,14 +102,7 @@ public class OrderActivity extends Activity implements OnClickListener{
|
|||
|
||||
}
|
||||
|
||||
// private void initDlgView() {
|
||||
// LayoutInflater inflater = LayoutInflater.from(this);
|
||||
// dlgOrderView = inflater.inflate(R.layout.dlg_order_settime, null);
|
||||
// tpOrderTime = (TimePicker) dlgOrderView.findViewById(R.id.tp_dlg_time);
|
||||
// tpOrderTime.setIs24HourView(true);
|
||||
// btnDlgOk = (Button) dlgOrderView.findViewById(R.id.btn_dlg_ok);
|
||||
// btnDlgOk.setOnClickListener(this);
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -146,10 +137,8 @@ public class OrderActivity extends Activity implements OnClickListener{
|
|||
time = tpOrderTime.getCurrentHour()+ " : " + tpOrderTime.getCurrentMinute();
|
||||
dlgSetOrderTime.dismiss();
|
||||
case R.id.btn_order_submit:
|
||||
//toast("小菜订单提交成功");
|
||||
postOrder();
|
||||
finish();
|
||||
//back();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -73,7 +73,7 @@ public class ReservationActivity extends Activity {
|
|||
btnLogin.setText("已经预定" + (TextUtils.isEmpty(dateTime) ? "" : (" " + dateTime)));
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
// TODO Auto-generated catch block
|
||||
// TODO
|
||||
//e.printStackTrace();
|
||||
logger.log(Level.SEVERE, "something may be wrong", e);
|
||||
|
||||
|
@ -90,13 +90,14 @@ public class ReservationActivity extends Activity {
|
|||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO
|
||||
DateTimePickDialogUtil dateTimePicKDialog = new DateTimePickDialogUtil(ReservationActivity.this,
|
||||
dateFormat.format(new Date()));
|
||||
dateTimePicKDialog.dateTimePicKDialog(new DateTimeListener() {
|
||||
|
||||
@Override
|
||||
public void onDateTimeChane(final String dateTime) {
|
||||
// TODO Auto-generated method stub
|
||||
// TODO
|
||||
Reservation reservation = new Reservation();
|
||||
reservation.setRoomId(roomId);
|
||||
reservation.setRoomName(roomName);
|
||||
|
@ -106,6 +107,7 @@ public class ReservationActivity extends Activity {
|
|||
reservation.save(ReservationActivity.this, new SaveListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
// TODO
|
||||
toast("预定成功");
|
||||
btnLogin.setEnabled(false);
|
||||
btnLogin.setText("已经预定 " + dateTime);
|
||||
|
@ -113,6 +115,7 @@ public class ReservationActivity extends Activity {
|
|||
|
||||
@Override
|
||||
public void onFailure(int arg0, String arg1) {
|
||||
// TODO
|
||||
toast("预定失败");
|
||||
}
|
||||
});
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue