Commit 3acc2de9 by 宁斌

1、新增轉台

parent 57ee9e10
......@@ -28,9 +28,11 @@ import com.qmuiteam.qmui.widget.dialog.QMUIBottomSheet;
import com.qmuiteam.qmui.widget.section.QMUISection;
import com.qmuiteam.qmui.widget.section.QMUIStickySectionAdapter;
import com.qmuiteam.qmui.widget.section.QMUIStickySectionLayout;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
......@@ -278,9 +280,11 @@ public class ChooseRestaurantDialog extends Dialog {
BasTextSectiontAdapter.ViewHolder viewHolder = (BasTextSectiontAdapter.ViewHolder) holder;
if (viewHolder.getTvName().getText() != null) {
SectionTextItem item = viewHolder.getSectionTextItem(position);
if (mOnItemClickListener != null)
if (mOnItemClickListener != null) {
mOnItemClickListener.onItemClick(item, position);
}
mDialog.dismiss();
}
} else {
//點擊的頭部,折疊
}
......
......@@ -213,10 +213,10 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
});
}
public void openTable(int id) {
public void openTable(int tableId) {
RequestBody requestBody = new FormBody.Builder()
.add("id", String.valueOf(id))
.add("id", String.valueOf(tableId))
.build();
mModel.openTable(requestBody)
......@@ -232,7 +232,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
public void onNext(@NonNull BaseRespose respose) {
if (respose.isSuccess()) {
//設置當前開台數據
TableBean.DataBean openTableBean = getTableById(id);
TableBean.DataBean openTableBean = getTableById(tableId);
OpenTableManage.getDefault().setTableBean(openTableBean);
if (respose.getData() != null && respose.getData().getOrderDetails() != null) {
......@@ -270,10 +270,22 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
if (result.isSuccess()) {
TableBean.DataBean tableBean = result.getData();
if (originalTableId == 0) {
if (tableBean.getUseStatus() == 1) {
mRootView.showMessage("此檯使用中.");
return;
}
if(tableBean.getStatus() == 0){
mRootView.showMessage("此檯未開檯.");
return;
}
originalTableName = tableBean.getTableName();
originalTableId = tableBean.getId();
mRootView.setOperatContentText("由: " + originalTableName + " 轉到 ");
} else {
if (tableBean.getUseStatus() == 1) {
mRootView.showMessage("此檯使用中.");
return;
}
targetTableName = tableBean.getTableName();
targetTableId = tableBean.getId();
mRootView.setOperatContentText("由: " + originalTableName + " 轉到 " +
......
......@@ -285,6 +285,10 @@ public class TableActivity extends BaseActivity<TablePresenter> implements Table
ll_table_operat_content.setVisibility(View.INVISIBLE);
rv_bottom_function.setVisibility(View.VISIBLE);
tv_operat_hint.setText("");
tv_operat_content.setText("");
mTopBar.setTitle("餐檯模式");
mPresenter.initTableParameter();
mPresenter.filterTableByOperatType(1);
}
......
......@@ -4,30 +4,12 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.qmuiteam.qmui.widget.QMUITopBar
android:id="@+id/topbar"
android:layout_width="match_parent"
android:layout_height="?attr/qmui_topbar_height"
app:qmui_topbar_title_color="@color/theme_white_color" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/rv_bottom_function"
android:layout_marginTop="?attr/qmui_topbar_height">
<androidx.viewpager.widget.ViewPager
android:id="@+id/vp_table_type"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="?attr/qmui_topbar_height" />
<com.gingersoft.gsa.cloud.ui.view.PagerSlidingTabStrip
android:id="@+id/pts_table_type"
android:layout_width="match_parent"
android:layout_height="?attr/qmui_topbar_height"
android:background="@color/theme_white_color" />
<LinearLayout
android:id="@+id/ll_table_operat_content"
android:layout_width="match_parent"
......@@ -57,14 +39,26 @@
android:textColor="@color/theme_white_color"
android:textSize="@dimen/font_normal3" />
</LinearLayout>
<androidx.viewpager.widget.ViewPager
android:id="@+id/vp_table_type"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="?attr/qmui_topbar_height" />
<com.gingersoft.gsa.cloud.ui.view.PagerSlidingTabStrip
android:id="@+id/pts_table_type"
android:layout_width="match_parent"
android:layout_height="?attr/qmui_topbar_height"
android:background="@color/theme_white_color" />
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_bottom_function"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
android:background="@color/theme_white_color"
android:orientation="horizontal"
android:padding="1dp" />
......@@ -73,10 +67,16 @@
android:id="@+id/btn_cancel_operat"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_48"
android:textColor="@color/theme_white_color"
android:background="@color/theme_grey_color"
android:layout_alignParentBottom="true"
android:visibility="invisible"
android:text="取消" />
android:background="@color/theme_grey_color"
android:text="取消"
android:textColor="@color/theme_white_color"
android:visibility="invisible" />
<com.qmuiteam.qmui.widget.QMUITopBar
android:id="@+id/topbar"
android:layout_width="match_parent"
android:layout_height="?attr/qmui_topbar_height"
app:qmui_topbar_title_color="@color/theme_white_color" />
</RelativeLayout>
\ No newline at end of file
......@@ -157,6 +157,7 @@ public class LoginActivity extends BaseActivity<LoginPresenter> implements Login
public void onItemClick(SectionTextItem item, int position) {
GsaCloudApplication.setRestaurantId(LoginActivity.this, item.getId());
jumpActivity();
killMyself();
}
})
.build()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment