|
@@ -14,6 +14,7 @@ import android.widget.Button;
|
|
|
import android.widget.EditText;
|
|
import android.widget.EditText;
|
|
|
import android.widget.ImageView;
|
|
import android.widget.ImageView;
|
|
|
import android.widget.LinearLayout;
|
|
import android.widget.LinearLayout;
|
|
|
|
|
+import android.widget.ListView;
|
|
|
import android.widget.RadioButton;
|
|
import android.widget.RadioButton;
|
|
|
import android.widget.RadioGroup;
|
|
import android.widget.RadioGroup;
|
|
|
import android.widget.RelativeLayout;
|
|
import android.widget.RelativeLayout;
|
|
@@ -47,6 +48,7 @@ import com.core.utils.ToastUtil;
|
|
|
import com.core.utils.helper.AvatarHelper;
|
|
import com.core.utils.helper.AvatarHelper;
|
|
|
import com.core.widget.NScrollerGridView;
|
|
import com.core.widget.NScrollerGridView;
|
|
|
import com.core.widget.view.Activity.SelectActivity;
|
|
import com.core.widget.view.Activity.SelectActivity;
|
|
|
|
|
+import com.core.widget.view.ListViewInScroller;
|
|
|
import com.core.widget.view.SwitchView;
|
|
import com.core.widget.view.SwitchView;
|
|
|
import com.core.widget.view.selectcalendar.SelectCalendarActivity;
|
|
import com.core.widget.view.selectcalendar.SelectCalendarActivity;
|
|
|
import com.core.xmpp.model.AddAttentionResult;
|
|
import com.core.xmpp.model.AddAttentionResult;
|
|
@@ -57,10 +59,13 @@ import com.me.network.app.http.rx.ResultSubscriber;
|
|
|
import com.modular.booking.R;
|
|
import com.modular.booking.R;
|
|
|
import com.modular.booking.activity.utils.GridSelectActivity;
|
|
import com.modular.booking.activity.utils.GridSelectActivity;
|
|
|
import com.modular.booking.activity.utils.GridSelectDateActivity;
|
|
import com.modular.booking.activity.utils.GridSelectDateActivity;
|
|
|
|
|
+import com.modular.booking.activity.utils.ShoppingCart;
|
|
|
import com.modular.booking.adapter.ItemFoodStateAdapter;
|
|
import com.modular.booking.adapter.ItemFoodStateAdapter;
|
|
|
|
|
+import com.modular.booking.adapter.ItemFoodsDishlistAdapter;
|
|
|
import com.modular.booking.model.SBListModel;
|
|
import com.modular.booking.model.SBListModel;
|
|
|
import com.modular.booking.model.SBMenuModel;
|
|
import com.modular.booking.model.SBMenuModel;
|
|
|
import com.modular.booking.model.SeatsStateModel;
|
|
import com.modular.booking.model.SeatsStateModel;
|
|
|
|
|
+import com.modular.booking.model.ShoppingEntity;
|
|
|
import com.modular.booking.widget.AddSubUtils;
|
|
import com.modular.booking.widget.AddSubUtils;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -74,19 +79,21 @@ import de.hdodenhof.circleimageview.CircleImageView;
|
|
|
import static com.common.data.JSONUtil.getJSONArray;
|
|
import static com.common.data.JSONUtil.getJSONArray;
|
|
|
|
|
|
|
|
public class BServiceAddActivity extends OABaseActivity implements View.OnClickListener {
|
|
public class BServiceAddActivity extends OABaseActivity implements View.OnClickListener {
|
|
|
|
|
+
|
|
|
private Button submit_btn;
|
|
private Button submit_btn;
|
|
|
|
|
+
|
|
|
private EditText et_book_notes, et_book_phone, et_book_name;//预约人的备注、电话、姓名
|
|
private EditText et_book_notes, et_book_phone, et_book_name;//预约人的备注、电话、姓名
|
|
|
//餐饮
|
|
//餐饮
|
|
|
private TextView tv_food_times, tv_food_rooms, tv_food_peoples;//用餐时间、需要包厢、用餐人数
|
|
private TextView tv_food_times, tv_food_rooms, tv_food_peoples;//用餐时间、需要包厢、用餐人数
|
|
|
- // 美容美发
|
|
|
|
|
|
|
+ //美容美发
|
|
|
private TextView tv_hair_times, tv_hair_rooms;//服务时间、服务项目
|
|
private TextView tv_hair_times, tv_hair_rooms;//服务时间、服务项目
|
|
|
- // 运动
|
|
|
|
|
|
|
+ //运动
|
|
|
private TextView tv_sport_time, tv_sport_rooms, tv_sport_peoples;//运动时间、运动项目、运动人数
|
|
private TextView tv_sport_time, tv_sport_rooms, tv_sport_peoples;//运动时间、运动项目、运动人数
|
|
|
- // 医院挂号
|
|
|
|
|
|
|
+ //医院挂号
|
|
|
private TextView tv_hospital_rooms, tag_hospital_doctor, tv_hospital_time;//科室、医生、时段
|
|
private TextView tv_hospital_rooms, tag_hospital_doctor, tv_hospital_time;//科室、医生、时段
|
|
|
- // 会所
|
|
|
|
|
|
|
+ //会所
|
|
|
private TextView tv_club_technician, tv_club_time, tv_club_peoples;//技师、时间、人数
|
|
private TextView tv_club_technician, tv_club_time, tv_club_peoples;//技师、时间、人数
|
|
|
- // KTV
|
|
|
|
|
|
|
+ //KTV
|
|
|
private TextView tv_ktv_times, tv_ktv_rooms, tv_ktv_peoples;//时间、房间、人数
|
|
private TextView tv_ktv_times, tv_ktv_rooms, tv_ktv_peoples;//时间、房间、人数
|
|
|
//抬头信息
|
|
//抬头信息
|
|
|
private CircleImageView iv_header;
|
|
private CircleImageView iv_header;
|
|
@@ -116,6 +123,11 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
|
|
|
private RelativeLayout notes_rl;
|
|
private RelativeLayout notes_rl;
|
|
|
private LinearLayout ll_seats_panel;
|
|
private LinearLayout ll_seats_panel;
|
|
|
private RelativeLayout food_seats_rl;
|
|
private RelativeLayout food_seats_rl;
|
|
|
|
|
+ private RelativeLayout food_dishs_rl;
|
|
|
|
|
+
|
|
|
|
|
+ ItemFoodsDishlistAdapter itemFoodsDishlistAdapter;
|
|
|
|
|
+ ListViewInScroller mDishList;
|
|
|
|
|
+ private TextView tv_food_dishs;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
@@ -182,6 +194,10 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
|
|
|
gvZSeats=(NScrollerGridView)findViewById(R.id.gvZSeats);
|
|
gvZSeats=(NScrollerGridView)findViewById(R.id.gvZSeats);
|
|
|
tvDSeatsTitle=(TextView)findViewById(R.id.tvDSeatsTitle);
|
|
tvDSeatsTitle=(TextView)findViewById(R.id.tvDSeatsTitle);
|
|
|
gvDSeats=(NScrollerGridView)findViewById(R.id.gvDSeats);
|
|
gvDSeats=(NScrollerGridView)findViewById(R.id.gvDSeats);
|
|
|
|
|
+ food_dishs_rl=findViewById(R.id.food_dishs_rl);
|
|
|
|
|
+
|
|
|
|
|
+ mDishList=findViewById(R.id.lv_dish);
|
|
|
|
|
+ tv_food_dishs=findViewById(R.id.tv_food_dishs);
|
|
|
|
|
|
|
|
tvSeatsLeft=findViewById(R.id.tvSeatsLeft);
|
|
tvSeatsLeft=findViewById(R.id.tvSeatsLeft);
|
|
|
tvSeatsRight=findViewById(R.id.tvSeatsRight);
|
|
tvSeatsRight=findViewById(R.id.tvSeatsRight);
|
|
@@ -194,12 +210,12 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
|
|
|
submit_btn.setOnClickListener(this);
|
|
submit_btn.setOnClickListener(this);
|
|
|
et_book_name.setText(CommonUtil.getName());
|
|
et_book_name.setText(CommonUtil.getName());
|
|
|
et_book_phone.setText(MyApplication.getInstance().mLoginUser.getTelephone());
|
|
et_book_phone.setText(MyApplication.getInstance().mLoginUser.getTelephone());
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
tv_sub.setOnClickListener(this);
|
|
tv_sub.setOnClickListener(this);
|
|
|
tv_title.setOnClickListener(this);
|
|
tv_title.setOnClickListener(this);
|
|
|
|
|
+ food_dishs_rl.setOnClickListener(this);
|
|
|
|
|
|
|
|
- addSubUtils = (AddSubUtils) findViewById(R.id.add_sub);
|
|
|
|
|
|
|
+ addSubUtils = findViewById(R.id.add_sub);
|
|
|
addSubUtils.setBuyMax(999) // 最大购买数,默认为int的最大值
|
|
addSubUtils.setBuyMax(999) // 最大购买数,默认为int的最大值
|
|
|
.setInventory(999) // 库存,默认为int的最大值
|
|
.setInventory(999) // 库存,默认为int的最大值
|
|
|
.setCurrentNumber(1) // 设置当前数,默认为1
|
|
.setCurrentNumber(1) // 设置当前数,默认为1
|
|
@@ -446,17 +462,21 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
|
|
|
|
|
|
|
|
|
|
|
|
|
private final int FOOD_ROOMS = 1;
|
|
private final int FOOD_ROOMS = 1;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
private final int TIME_SELECT = 11//时间选择(包含时间段、时间点)
|
|
private final int TIME_SELECT = 11//时间选择(包含时间段、时间点)
|
|
|
, NUMBER_SELECT = 12//人数选择(1~10以上)
|
|
, NUMBER_SELECT = 12//人数选择(1~10以上)
|
|
|
, SERVICE_SELECT = 13//服务项目
|
|
, SERVICE_SELECT = 13//服务项目
|
|
|
, MAN_SELECT = 14//医生选择
|
|
, MAN_SELECT = 14//医生选择
|
|
|
|
|
+ ,DISHS_SELECT=15//菜品选择
|
|
|
;
|
|
;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
|
int id = v.getId();
|
|
int id = v.getId();
|
|
|
- if (id == R.id.tv_title) {
|
|
|
|
|
|
|
+ if(id==R.id. food_dishs_rl){
|
|
|
|
|
+ startActivityForResult(new Intent(BServiceAddActivity.this,DishSelectActivity.class),DISHS_SELECT);
|
|
|
|
|
+
|
|
|
|
|
+ }else if (id == R.id.tv_title) {
|
|
|
//简介
|
|
//简介
|
|
|
// ToastMessage("简介");
|
|
// ToastMessage("简介");
|
|
|
try {
|
|
try {
|
|
@@ -760,6 +780,14 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case DISHS_SELECT:
|
|
|
|
|
+ List<ShoppingEntity> shoppingEntities= ShoppingCart.getInstance().getShoppingList();
|
|
|
|
|
+ LogUtil.d(TAG,"data:"+JSON.toJSONString(shoppingEntities));
|
|
|
|
|
+ itemFoodsDishlistAdapter=new ItemFoodsDishlistAdapter(mContext,shoppingEntities);
|
|
|
|
|
+ mDishList.setAdapter(itemFoodsDishlistAdapter);
|
|
|
|
|
+
|
|
|
|
|
+ CommonUtil.textSpanForStyle(tv_food_dishs,"合计: "+ShoppingCart.getInstance().getTotalQuantity()+"份 ¥"+ShoppingCart.getInstance().getTotalPrice(),ShoppingCart.getInstance().getTotalQuantity()+"份 ¥"+ShoppingCart.getInstance().getTotalPrice(),ct.getResources().getColor(R.color.blue_seats_num));
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
if (tvMessage != null && tv != null) {
|
|
if (tvMessage != null && tv != null) {
|
|
|
if (tv == tv_hospital_rooms) {
|
|
if (tv == tv_hospital_rooms) {
|