Commit 3104f3a5 by 宁斌

Merge branch 'loach'

# Conflicts:
#	base-module/src/main/java/com/gingersoft/gsa/cloud/constans/HttpsConstans.java
#	base-module/src/main/java/com/gingersoft/gsa/cloud/ui/recylcler/event/RecyItemTouchHelperCallback.java
#	config.gradle
#	main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/model/service/MainService.java
#	main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/presenter/NewMainPresenter.java
#	main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/NewMainActivity.java
#	main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/BusinessReportFragment.java
#	manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/model/bean/request/TableRequest.java
#	manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/ui/fragment/AddTableFragment.java
#	manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/ui/fragment/TableListFragment.java
#	other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/model/bean/CancelReason.kt
#	other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/model/viewModel/PageViewModel.kt
#	other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/activity/OtherOrderActivity.kt
#	other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/fragment/DeliveryFragment.kt
#	other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/fragment/HistoryFragment.kt
#	other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/fragment/PlaceholderFragment.kt
#	other_order_mode/src/main/res/layout/fragment_delivery_list.xml
#	other_order_mode/src/main/res/layout/item_delivery_layout.xml
#	other_order_mode/src/main/res/values/styles.xml
#	print-module/src/main/java/com/joe/print/mvp/print/PrinterRoot.java
#	print-module/src/main/java/com/joe/print/mvp/print/TestPrintDataMaker.java
#	print-module/src/main/java/com/joe/print/mvp/ui/activity/IpPrintActivity.java
#	table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/TablePresenter.java
#	table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/TableAdapter.java
parents a019cd85 76597c05
package com.gingersoft.gsa.cloud.manager.mvp.model.bean; package com.gingersoft.gsa.cloud.base.common.bean;
import com.gingersoft.gsa.cloud.ui.bean.view.SectionTextItem;
import com.qmuiteam.qmui.widget.section.QMUISection; import com.qmuiteam.qmui.widget.section.QMUISection;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
......
...@@ -81,6 +81,10 @@ public class TableBean { ...@@ -81,6 +81,10 @@ public class TableBean {
private Long orderId; private Long orderId;
private String qrCode; private String qrCode;
private int seatCount; private int seatCount;
/**最大就餐人數*/
private Integer maxSeatCount;
/**最小就餐人數*/
private Integer minSeatCount;
private String createTime; private String createTime;
private String createBy; private String createBy;
private String qrCodeImg; private String qrCodeImg;
...@@ -108,6 +112,12 @@ public class TableBean { ...@@ -108,6 +112,12 @@ public class TableBean {
* 排序 * 排序
*/ */
private int sort; private int sort;
/**
0#堂食
1#外賣
2#自取
*/
private int type;
public DataBean() { public DataBean() {
...@@ -120,6 +130,8 @@ public class TableBean { ...@@ -120,6 +130,8 @@ public class TableBean {
this.restaurantId = dataBean.restaurantId; this.restaurantId = dataBean.restaurantId;
this.qrCode = dataBean.qrCode; this.qrCode = dataBean.qrCode;
this.seatCount = dataBean.seatCount; this.seatCount = dataBean.seatCount;
this.maxSeatCount = dataBean.maxSeatCount;
this.minSeatCount = dataBean.minSeatCount;
this.createTime = dataBean.createTime; this.createTime = dataBean.createTime;
this.createBy = dataBean.createBy; this.createBy = dataBean.createBy;
this.qrCodeImg = dataBean.qrCodeImg; this.qrCodeImg = dataBean.qrCodeImg;
...@@ -130,6 +142,7 @@ public class TableBean { ...@@ -130,6 +142,7 @@ public class TableBean {
this.person = dataBean.person; this.person = dataBean.person;
this.useStatus = dataBean.useStatus; this.useStatus = dataBean.useStatus;
this.sort = dataBean.sort; this.sort = dataBean.sort;
this.type = dataBean.type;
} }
public int getPerson() { public int getPerson() {
...@@ -196,6 +209,22 @@ public class TableBean { ...@@ -196,6 +209,22 @@ public class TableBean {
this.seatCount = seatCount; this.seatCount = seatCount;
} }
public Integer getMaxSeatCount() {
return maxSeatCount;
}
public void setMaxSeatCount(Integer maxSeatCount) {
this.maxSeatCount = maxSeatCount;
}
public Integer getMinSeatCount() {
return minSeatCount;
}
public void setMinSeatCount(Integer minSeatCount) {
this.minSeatCount = minSeatCount;
}
public String getCreateTime() { public String getCreateTime() {
return createTime; return createTime;
} }
...@@ -259,5 +288,13 @@ public class TableBean { ...@@ -259,5 +288,13 @@ public class TableBean {
public void setSort(int sort) { public void setSort(int sort) {
this.sort = sort; this.sort = sort;
} }
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
} }
} }
package com.gingersoft.gsa.cloud.manager.mvp.model.bean; package com.gingersoft.gsa.cloud.base.common.bean;
import com.gingersoft.gsa.cloud.base.common.bean.TableBean;
import com.qmuiteam.qmui.widget.section.QMUISection; import com.qmuiteam.qmui.widget.section.QMUISection;
import java.io.Serializable; import java.io.Serializable;
...@@ -34,7 +33,7 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{ ...@@ -34,7 +33,7 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
* regionId : 1 * regionId : 1
*/ */
private int id; private long id;
/**區域ID*/ /**區域ID*/
private int regionId; private int regionId;
/**區域名稱*/ /**區域名稱*/
...@@ -43,7 +42,12 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{ ...@@ -43,7 +42,12 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
private int restaurantId; private int restaurantId;
private Long orderId; private Long orderId;
private String qrCode; private String qrCode;
/**默認就餐人數*/
private int seatCount; private int seatCount;
/**最大就餐人數*/
private int maxSeatCount;
/**最小就餐人數*/
private int minSeatCount;
private String createTime; private String createTime;
private String createBy; private String createBy;
private String qrCodeImg; private String qrCodeImg;
...@@ -71,10 +75,29 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{ ...@@ -71,10 +75,29 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
* 排序 * 排序
*/ */
private int sort; private int sort;
/**
0:堂食
1:外賣
2:自取
*/
private int type = -1;
public static final int TABLE_TYPE_CANTEEN = 0;
public static final int TABLE_TYPE_TAKEAWAY = 1;
public static final int TABLE_TYPE_SELF_FETCHING = 2;
/**
* 自定義字段
*/
/**是否選中*/ /**是否選中*/
private boolean isChecked = false; private boolean isChecked = false;
/**
* UI类型:
* 餐台 0
* 新增(+) 1
*/
private int layoutType = 0;
public TableItem() { public TableItem() {
} }
...@@ -88,6 +111,8 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{ ...@@ -88,6 +111,8 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
this.restaurantId = dataBean.restaurantId; this.restaurantId = dataBean.restaurantId;
this.qrCode = dataBean.qrCode; this.qrCode = dataBean.qrCode;
this.seatCount = dataBean.seatCount; this.seatCount = dataBean.seatCount;
this.maxSeatCount = dataBean.maxSeatCount;
this.minSeatCount = dataBean.minSeatCount;
this.createTime = dataBean.createTime; this.createTime = dataBean.createTime;
this.createBy = dataBean.createBy; this.createBy = dataBean.createBy;
this.qrCodeImg = dataBean.qrCodeImg; this.qrCodeImg = dataBean.qrCodeImg;
...@@ -98,6 +123,7 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{ ...@@ -98,6 +123,7 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
this.person = dataBean.person; this.person = dataBean.person;
this.useStatus = dataBean.useStatus; this.useStatus = dataBean.useStatus;
this.sort = dataBean.sort; this.sort = dataBean.sort;
this.type = dataBean.type;
this.isChecked = dataBean.isChecked; this.isChecked = dataBean.isChecked;
} }
...@@ -117,11 +143,11 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{ ...@@ -117,11 +143,11 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
this.useStatus = useStatus; this.useStatus = useStatus;
} }
public int getId() { public long getId() {
return id; return id;
} }
public void setId(int id) { public void setId(long id) {
this.id = id; this.id = id;
} }
...@@ -181,6 +207,30 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{ ...@@ -181,6 +207,30 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
this.seatCount = seatCount; this.seatCount = seatCount;
} }
public int getMaxSeatCount() {
return maxSeatCount;
}
public void setMaxSeatCount(int maxSeatCount) {
this.maxSeatCount = maxSeatCount;
}
public int getMinSeatCount() {
return minSeatCount;
}
public void setMinSeatCount(int minSeatCount) {
this.minSeatCount = minSeatCount;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getCreateTime() { public String getCreateTime() {
return createTime; return createTime;
} }
...@@ -253,6 +303,14 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{ ...@@ -253,6 +303,14 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
isChecked = checked; isChecked = checked;
} }
public int getLayoutType() {
return layoutType;
}
public void setLayoutType(int layoutType) {
this.layoutType = layoutType;
}
@Override @Override
public TableItem cloneForDiff() { public TableItem cloneForDiff() {
return null; return null;
......
...@@ -141,6 +141,24 @@ public class TimeUtils { ...@@ -141,6 +141,24 @@ public class TimeUtils {
return sf.format(endDate); return sf.format(endDate);
} }
/**@param beginTime 開始時間
* @param distance 差距: 昨天天傳負一,今天傳零,明天傳一
* @param type 類型: 1、天 Calendar.DATE 2、年Calendar.YEAR 3、月Calendar.MONTH
* @param sf {@link #DEFAULT_DATE_MD}
* @return 獲得從開始時間+distance(偏移時間的年月日)
*/
public static String getBeginDistanceDate(Calendar beginTime, int distance, int type, SimpleDateFormat sf) {
beginTime.set(type, beginTime.get(type) + distance);
Date endDate = null;
try {
endDate = sf.parse(sf.format(beginTime.getTime()));
} catch (ParseException e) {
e.printStackTrace();
}
return sf.format(endDate);
}
/** /**
* @param beginTime 開始時間 * @param beginTime 開始時間
* @param distance 差距: 昨天天傳負一,今天傳零,明天傳一 * @param distance 差距: 昨天天傳負一,今天傳零,明天傳一
......
...@@ -94,10 +94,10 @@ public class HttpsConstans { ...@@ -94,10 +94,10 @@ public class HttpsConstans {
//修改這個值,修改微信公眾號報表地址:首頁曲線圖數據,支付分析報表數據 //修改這個值,修改微信公眾號報表地址:首頁曲線圖數據,支付分析報表數據
public static String WECHAR_REPORT_SERVER_ADDRESS;// = (isFormal ? WECHAR_REPORT_FORMAL_ADDRESS : WECHAR_REPORT_TEST_ADDRESS) + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS public static String WECHAR_REPORT_SERVER_ADDRESS;// = (isFormal ? WECHAR_REPORT_FORMAL_ADDRESS : WECHAR_REPORT_TEST_ADDRESS) + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
public static void init(Context context, boolean isSwitchServer) { public static void init(Context context,boolean isSwitchServer) {
isFormal = (int) SPUtils.get(context, "isFormal", 1); isFormal = (int) SPUtils.get(context, "isFormal", 1);
if (!isSwitchServer) { if (!BuildConfig.DEBUG && !isSwitchServer) {
isFormal = BuildConfig.DEBUG ? 2 : 1; isFormal = 1;
} }
// _SERVER_ADDRESS = (isFormal == 1 ? HTTP_ADDRESS_URL_FORMAL : "http://a.ricepon.com:61177") + "/member-web/api/"; // _SERVER_ADDRESS = (isFormal == 1 ? HTTP_ADDRESS_URL_FORMAL : "http://a.ricepon.com:61177") + "/member-web/api/";
// ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = isFormal ==1 ? HTTP_ADDRESS_URL_FORMAL : REPORT_TEST_ADDRESS; // ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = isFormal ==1 ? HTTP_ADDRESS_URL_FORMAL : REPORT_TEST_ADDRESS;
...@@ -106,45 +106,45 @@ public class HttpsConstans { ...@@ -106,45 +106,45 @@ public class HttpsConstans {
// REPORT_SERVER_ADDRESS = (isFormal ==1 ? REPORT_FORMAL_ADDRESS : REPORT_TEST_ADDRESS) + REPORT_PATH;//測試:REPORT_FORMAL_ADDRESS 正式:REPORT_TEST_ADDRESS // REPORT_SERVER_ADDRESS = (isFormal ==1 ? REPORT_FORMAL_ADDRESS : REPORT_TEST_ADDRESS) + REPORT_PATH;//測試:REPORT_FORMAL_ADDRESS 正式:REPORT_TEST_ADDRESS
// WECHAR_REPORT_SERVER_ADDRESS = (isFormal == 1 ? WECHAR_REPORT_FORMAL_ADDRESS : WECHAR_REPORT_TEST_ADDRESS) + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS // WECHAR_REPORT_SERVER_ADDRESS = (isFormal == 1 ? WECHAR_REPORT_FORMAL_ADDRESS : WECHAR_REPORT_TEST_ADDRESS) + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
switch (isFormal) { switch (isFormal){
case 1: case 1:
_SERVER_ADDRESS = HTTP_ADDRESS_URL_FORMAL + "/member-web/api/"; _SERVER_ADDRESS = HTTP_ADDRESS_URL_FORMAL + "/member-web/api/";
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_FORMAL; ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_FORMAL ;
ROOT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_FORMAL + PATH; ROOT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_FORMAL + PATH;
ROOT_URL = ROOT_FORMAL_URL; ROOT_URL = ROOT_FORMAL_URL ;
REPORT_SERVER_ADDRESS = REPORT_FORMAL_ADDRESS + REPORT_PATH; REPORT_SERVER_ADDRESS = REPORT_FORMAL_ADDRESS +REPORT_PATH;
WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_FORMAL_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_FORMAL_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
break; break;
case 2: case 2:
_SERVER_ADDRESS = "http://a.ricepon.com:61177" + "/member-web/api/"; _SERVER_ADDRESS = "http://a.ricepon.com:61177" + "/member-web/api/";
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS; ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS ;
ROOT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_HK + PATH; ROOT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_HK + PATH;
ROOT_URL = ROOT_HK_TEST_URL; ROOT_URL = ROOT_HK_TEST_URL ;
REPORT_SERVER_ADDRESS = REPORT_TEST_ADDRESS + REPORT_PATH; REPORT_SERVER_ADDRESS = REPORT_TEST_ADDRESS +REPORT_PATH;
WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_TEST_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_TEST_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
break; break;
case 3: case 3:
_SERVER_ADDRESS = ROOT_SERVER_YOU_CHANG_HK + "/member-web/api/"; _SERVER_ADDRESS = ROOT_SERVER_YOU_CHANG_HK + "/member-web/api/";
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS; ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS ;
ROOT_SERVER_ADDRESS_FORMAL = ROOT_SERVER_YOU_CHANG_HK; ROOT_SERVER_ADDRESS_FORMAL = ROOT_SERVER_YOU_CHANG_HK;
ROOT_URL = ROOT_SZ_URL; ROOT_URL = ROOT_SZ_URL ;
REPORT_SERVER_ADDRESS = REPORT_TEST_ADDRESS + REPORT_PATH; REPORT_SERVER_ADDRESS = REPORT_TEST_ADDRESS +REPORT_PATH;
WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_TEST_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_TEST_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
break; break;
case 4: case 4:
_SERVER_ADDRESS = ROOT_SERVER_SHI_WEI_HK + "/member-web/api/"; _SERVER_ADDRESS = ROOT_SERVER_SHI_WEI_HK + "/member-web/api/";
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS; ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS ;
ROOT_SERVER_ADDRESS_FORMAL = ROOT_SERVER_SHI_WEI_HK; ROOT_SERVER_ADDRESS_FORMAL = ROOT_SERVER_SHI_WEI_HK;
ROOT_URL = ROOT_SZ_URL; ROOT_URL = ROOT_SZ_URL ;
REPORT_SERVER_ADDRESS = REPORT_TEST_ADDRESS + REPORT_PATH; REPORT_SERVER_ADDRESS = REPORT_TEST_ADDRESS +REPORT_PATH;
WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_TEST_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_TEST_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
break; break;
case 5: case 5:
_SERVER_ADDRESS = ROOT_SERVER_SHI_SHU_HK + "/member-web/api/"; _SERVER_ADDRESS = ROOT_SERVER_SHI_SHU_HK + "/member-web/api/";
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS; ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS ;
ROOT_SERVER_ADDRESS_FORMAL = ROOT_SERVER_SHI_SHU_HK; ROOT_SERVER_ADDRESS_FORMAL = ROOT_SERVER_SHI_SHU_HK;
ROOT_URL = ROOT_SZ_URL; ROOT_URL = ROOT_SZ_URL ;
REPORT_SERVER_ADDRESS = REPORT_TEST_ADDRESS + REPORT_PATH; REPORT_SERVER_ADDRESS = REPORT_TEST_ADDRESS +REPORT_PATH;
WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_TEST_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_TEST_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
break; break;
} }
......
...@@ -2,7 +2,11 @@ package com.gingersoft.gsa.cloud.ui.recylcler.event; ...@@ -2,7 +2,11 @@ package com.gingersoft.gsa.cloud.ui.recylcler.event;
import android.graphics.Color; import android.graphics.Color;
import com.gingersoft.gsa.cloud.base.common.bean.TableArea;
import com.gingersoft.gsa.cloud.base.common.bean.TableItem;
import com.gingersoft.gsa.cloud.base.utils.log.LogUtil;
import com.jess.arms.base.DefaultAdapter; import com.jess.arms.base.DefaultAdapter;
import com.jess.arms.base.delegate.IActivity;
import com.qmuiteam.qmui.widget.section.QMUIDefaultStickySectionAdapter; import com.qmuiteam.qmui.widget.section.QMUIDefaultStickySectionAdapter;
import com.qmuiteam.qmui.widget.section.QMUISection; import com.qmuiteam.qmui.widget.section.QMUISection;
import com.qmuiteam.qmui.widget.section.QMUIStickySectionAdapter; import com.qmuiteam.qmui.widget.section.QMUIStickySectionAdapter;
...@@ -23,6 +27,7 @@ import androidx.recyclerview.widget.RecyclerView; ...@@ -23,6 +27,7 @@ import androidx.recyclerview.widget.RecyclerView;
*/ */
public class RecyItemTouchHelperCallback<H extends QMUISection.Model<H>, T extends QMUISection.Model<T>> extends ItemTouchHelper.Callback { public class RecyItemTouchHelperCallback<H extends QMUISection.Model<H>, T extends QMUISection.Model<T>> extends ItemTouchHelper.Callback {
private final String TAG = getClass().getSimpleName();
RecyclerView.Adapter mAdapter; RecyclerView.Adapter mAdapter;
boolean isSwipeEnable; boolean isSwipeEnable;
boolean isFirstDragUnable; boolean isFirstDragUnable;
...@@ -60,35 +65,49 @@ public class RecyItemTouchHelperCallback<H extends QMUISection.Model<H>, T exten ...@@ -60,35 +65,49 @@ public class RecyItemTouchHelperCallback<H extends QMUISection.Model<H>, T exten
return false; return false;
} }
if (fromPosition < toPosition) { if (fromPosition < toPosition) {
for (int i = fromPosition; i < toPosition; i++) {
if (mAdapter instanceof QMUIStickySectionAdapter) { if (mAdapter instanceof QMUIStickySectionAdapter) {
QMUIStickySectionAdapter sectionAdapter = (QMUIStickySectionAdapter) mAdapter;
QMUIStickySectionAdapter.ViewHolder holder = (QMUIStickySectionAdapter.ViewHolder) viewHolder; QMUIStickySectionAdapter.ViewHolder holder = (QMUIStickySectionAdapter.ViewHolder) viewHolder;
int pos = holder.isForStickyHeader ? i : holder.getAdapterPosition(); QMUISection<H, T> qmuiSections = sectionAdapter.getSection(holder.getAdapterPosition());
int ItemIndex = ((QMUIStickySectionAdapter) mAdapter).getItemIndex(pos);
QMUISection<H, T> qmuiSections = ((QMUIStickySectionAdapter) mAdapter).getSection(ItemIndex);
List<?> list = qmuiSections.getItemList(); List<?> list = qmuiSections.getItemList();
Collections.swap(list, ItemIndex, ItemIndex + 1);
int fromIndex = sectionAdapter.getItemIndex(fromPosition);
int toIndex = sectionAdapter.getItemIndex(toPosition);
if ((fromIndex + 1) == list.size())
return false;
for (int i = fromIndex; i < toIndex; i++) {
Collections.swap(list, i, i + 1);
}
} else { } else {
for (int i = fromPosition; i < toPosition; i++) {
Collections.swap(((DefaultAdapter) mAdapter).getInfos(), i, i + 1); Collections.swap(((DefaultAdapter) mAdapter).getInfos(), i, i + 1);
} }
} }
} else { } else {
for (int i = fromPosition; i > toPosition; i--) {
if (mAdapter instanceof QMUIStickySectionAdapter) { if (mAdapter instanceof QMUIStickySectionAdapter) {
QMUIStickySectionAdapter sectionAdapter = (QMUIStickySectionAdapter) mAdapter;
QMUIStickySectionAdapter.ViewHolder holder = (QMUIStickySectionAdapter.ViewHolder) viewHolder; QMUIStickySectionAdapter.ViewHolder holder = (QMUIStickySectionAdapter.ViewHolder) viewHolder;
int pos = holder.isForStickyHeader ? i : holder.getAdapterPosition(); QMUISection<H, T> qmuiSections = sectionAdapter.getSection(holder.getAdapterPosition());
int ItemIndex = ((QMUIStickySectionAdapter) mAdapter).getItemIndex(pos);
QMUISection<H, T> qmuiSections = ((QMUIStickySectionAdapter) mAdapter).getSection(ItemIndex);
List<?> list = qmuiSections.getItemList(); List<?> list = qmuiSections.getItemList();
Collections.swap(list, ItemIndex, ItemIndex - 1);
int fromIndex = sectionAdapter.getItemIndex(fromPosition);
int toIndex = sectionAdapter.getItemIndex(toPosition);
if ((fromIndex + 1) == list.size())
return false;
for (int i = fromIndex; i > toIndex; i--) {
Collections.swap(list, i, i - 1);
}
} else { } else {
for (int i = fromPosition; i > toPosition; i--) {
Collections.swap(((DefaultAdapter) mAdapter).getInfos(), i, i - 1); Collections.swap(((DefaultAdapter) mAdapter).getInfos(), i, i - 1);
} }
} }
} }
mAdapter.notifyItemMoved(fromPosition, toPosition); mAdapter.notifyItemMoved(fromPosition, toPosition);
mAdapter.notifyItemChanged(toPosition);
mAdapter.notifyItemChanged(fromPosition);
return true; return true;
} }
...@@ -115,6 +134,50 @@ public class RecyItemTouchHelperCallback<H extends QMUISection.Model<H>, T exten ...@@ -115,6 +134,50 @@ public class RecyItemTouchHelperCallback<H extends QMUISection.Model<H>, T exten
public void clearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) { public void clearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
super.clearView(recyclerView, viewHolder); super.clearView(recyclerView, viewHolder);
viewHolder.itemView.setBackgroundColor(Color.WHITE); viewHolder.itemView.setBackgroundColor(Color.WHITE);
String ids = "";
if (mAdapter instanceof QMUIStickySectionAdapter) {
QMUIStickySectionAdapter adapter = (QMUIStickySectionAdapter) mAdapter;
List<QMUISection<H, T>> qmuiSectionList = adapter.getCurrentData();
ids = getTableIds(qmuiSectionList);
} else {
DefaultAdapter adapter = (DefaultAdapter) mAdapter;
ids = getTableAreaIds(adapter.getInfos());
}
// mAdapter.notifyDataSetChanged();
if (onMoveListener != null) {
onMoveListener.onMoveFinish(ids);
}
}
private String getTableIds(List<QMUISection<H, T>> qmuiSectionList) {
StringBuilder builder = new StringBuilder();
for (QMUISection<H, T> qmuiSections : qmuiSectionList) {
for (T t : qmuiSections.getItemList()) {
TableItem tableItem = (TableItem) t;
if (tableItem.getLayoutType() == 0) {
builder.append(tableItem.getId());
builder.append(",");
}
}
}
String str = builder.toString();
if (str.endsWith(",")) {
str = str.substring(0, str.length() - 1);
}
return str;
}
private String getTableAreaIds(List<TableArea> tableAreaList) {
StringBuilder builder = new StringBuilder();
for (TableArea tableArea : tableAreaList) {
builder.append(tableArea.getId());
builder.append(",");
}
String str = builder.toString();
if (str.endsWith(",")) {
str = str.substring(0, str.length() - 1);
}
return str;
} }
@Override @Override
...@@ -126,4 +189,14 @@ public class RecyItemTouchHelperCallback<H extends QMUISection.Model<H>, T exten ...@@ -126,4 +189,14 @@ public class RecyItemTouchHelperCallback<H extends QMUISection.Model<H>, T exten
public boolean isItemViewSwipeEnabled() { public boolean isItemViewSwipeEnabled() {
return isSwipeEnable; return isSwipeEnable;
} }
private onMoveListener onMoveListener;
public void setOnMoveListener(RecyItemTouchHelperCallback.onMoveListener onMoveListener) {
this.onMoveListener = onMoveListener;
}
public interface onMoveListener {
void onMoveFinish(String ids);
}
} }
\ No newline at end of file
/*
* Tencent is pleased to support the open source community by making QMUI_Android available.
*
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the MIT License (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
*
* http://opensource.org/licenses/MIT
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.gingersoft.gsa.cloud.ui.view.qm;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import com.gingersoft.gsa.cloud.base.R;
import com.qmuiteam.qmui.layout.QMUIFrameLayout;
import androidx.customview.widget.ViewDragHelper;
/**
* Created by cgspine on 2018/3/22.
*/
public class QDShadowAdjustLayout extends QMUIFrameLayout {
ViewDragHelper viewDragHelper;
public QDShadowAdjustLayout(Context context) {
this(context, null);
}
public QDShadowAdjustLayout(Context context, AttributeSet attrs) {
super(context, attrs);
viewDragHelper = ViewDragHelper.create(this, new ViewDragHelper.Callback() {
@Override
public boolean tryCaptureView(View child, int pointerId) {
return child.getId() == R.id.layout_for_test;
}
@Override
public int clampViewPositionHorizontal(View child, int left, int dx) {
return left;
}
@Override
public int clampViewPositionVertical(View child, int top, int dy) {
return top;
}
});
}
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
return viewDragHelper.shouldInterceptTouchEvent(event);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
viewDragHelper.processTouchEvent(event);
return true;
}
}
...@@ -54,12 +54,10 @@ public class QDSectionHeaderView extends LinearLayout { ...@@ -54,12 +54,10 @@ public class QDSectionHeaderView extends LinearLayout {
mTitleTv.setTextSize(16); mTitleTv.setTextSize(16);
mTitleTv.setTextColor(Color.BLACK); mTitleTv.setTextColor(Color.BLACK);
mTitleTv.setPadding(paddingHor, 0, paddingHor, 0); mTitleTv.setPadding(paddingHor, 0, paddingHor, 0);
addView(mTitleTv, new LinearLayout.LayoutParams( addView(mTitleTv, new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT, 1f));
0, ViewGroup.LayoutParams.WRAP_CONTENT, 1f));
mArrowView = new AppCompatImageView(context); mArrowView = new AppCompatImageView(context);
mArrowView.setImageDrawable(QMUIResHelper.getAttrDrawable(getContext(), mArrowView.setImageDrawable(QMUIResHelper.getAttrDrawable(getContext(), R.attr.qmui_common_list_item_chevron));
R.attr.qmui_common_list_item_chevron));
mArrowView.setScaleType(ImageView.ScaleType.CENTER); mArrowView.setScaleType(ImageView.ScaleType.CENTER);
addView(mArrowView, new LinearLayout.LayoutParams(headerHeight, headerHeight)); addView(mArrowView, new LinearLayout.LayoutParams(headerHeight, headerHeight));
} }
......
package com.gingersoft.gsa.cloud.ui.widget.dialog; package com.gingersoft.gsa.cloud.ui.widget.dialog;
import android.app.Activity; import android.app.Activity;
import android.text.InputType;
import android.text.TextUtils; import android.text.TextUtils;
import com.gingersoft.gsa.cloud.base.R; import com.gingersoft.gsa.cloud.base.R;
...@@ -22,6 +23,7 @@ public class CommonTipDialog { ...@@ -22,6 +23,7 @@ public class CommonTipDialog {
/** /**
* 提示dialog 確認后執行對應方法 * 提示dialog 確認后執行對應方法
*
* @param context * @param context
* @param msg * @param msg
* @param c * @param c
...@@ -30,16 +32,16 @@ public class CommonTipDialog { ...@@ -30,16 +32,16 @@ public class CommonTipDialog {
* @param parameterTypes * @param parameterTypes
* @param parameters * @param parameters
*/ */
public static void showDoubtDialog(Activity context,String msg, Class c, Object object, String methodName, Class[] parameterTypes, Object[] parameters) { public static void showDoubtDialog(Activity context, String msg, Class c, Object object, String methodName, Class[] parameterTypes, Object[] parameters) {
QMUIDialog.MessageDialogBuilder dialogBuilder = new QMUIDialog.MessageDialogBuilder(context); QMUIDialog.MessageDialogBuilder dialogBuilder = new QMUIDialog.MessageDialogBuilder(context);
dialogBuilder.setTitleIcon(R.drawable.qmui_icon_dialog_doubt); dialogBuilder.setTitleIcon(R.drawable.qmui_icon_dialog_doubt);
dialogBuilder.setMessage(msg); dialogBuilder.setMessage(msg);
if(!TextUtils.isEmpty(methodName)) { if (!TextUtils.isEmpty(methodName)) {
dialogBuilder.addAction(R.drawable.shape_3c_cancel_btn_bg,"取消", (dialog, index) -> dialog.dismiss()); dialogBuilder.addAction(R.drawable.shape_3c_cancel_btn_bg, "取消", (dialog, index) -> dialog.dismiss());
} }
dialogBuilder.addAction(R.drawable.shape_red_five_radius_bg, "確認", QMUIDialogAction.ACTION_PROP_NEGATIVE, (dialog, index) -> { dialogBuilder.addAction(R.drawable.shape_red_five_radius_bg, "確認", QMUIDialogAction.ACTION_PROP_NEGATIVE, (dialog, index) -> {
dialog.dismiss(); dialog.dismiss();
if(TextUtils.isEmpty(methodName)){ if (TextUtils.isEmpty(methodName)) {
return; return;
} }
try { try {
...@@ -59,6 +61,7 @@ public class CommonTipDialog { ...@@ -59,6 +61,7 @@ public class CommonTipDialog {
/** /**
* 危險警示dialog 確認后執行對應方法 * 危險警示dialog 確認后執行對應方法
*
* @param context * @param context
* @param msg * @param msg
* @param c * @param c
...@@ -67,16 +70,16 @@ public class CommonTipDialog { ...@@ -67,16 +70,16 @@ public class CommonTipDialog {
* @param parameterTypes * @param parameterTypes
* @param parameters * @param parameters
*/ */
public static void showSurpisedDialog(Activity context,String msg, Class c, Object object, String methodName, Class[] parameterTypes, Object[] parameters) { public static void showSurpisedDialog(Activity context, String msg, Class c, Object object, String methodName, Class[] parameterTypes, Object[] parameters) {
QMUIDialog.MessageDialogBuilder dialogBuilder = new QMUIDialog.MessageDialogBuilder(context); QMUIDialog.MessageDialogBuilder dialogBuilder = new QMUIDialog.MessageDialogBuilder(context);
dialogBuilder.setMessage(msg); dialogBuilder.setMessage(msg);
dialogBuilder.setTitleIcon(R.drawable.qmui_icon_dialog_surprised); dialogBuilder.setTitleIcon(R.drawable.qmui_icon_dialog_surprised);
if(!TextUtils.isEmpty(methodName)) { if (!TextUtils.isEmpty(methodName)) {
dialogBuilder.addAction("取消", (dialog, index) -> dialog.dismiss()); dialogBuilder.addAction("取消", (dialog, index) -> dialog.dismiss());
} }
dialogBuilder.addAction(0, "確認", QMUIDialogAction.ACTION_PROP_NEGATIVE, (dialog, index) -> { dialogBuilder.addAction(0, "確認", QMUIDialogAction.ACTION_PROP_NEGATIVE, (dialog, index) -> {
dialog.dismiss(); dialog.dismiss();
if(TextUtils.isEmpty(methodName)){ if (TextUtils.isEmpty(methodName)) {
return; return;
} }
try { try {
...@@ -96,6 +99,7 @@ public class CommonTipDialog { ...@@ -96,6 +99,7 @@ public class CommonTipDialog {
/** /**
* 警示dialog 確認后執行對應方法 * 警示dialog 確認后執行對應方法
*
* @param context * @param context
* @param msg * @param msg
* @param c * @param c
...@@ -104,16 +108,16 @@ public class CommonTipDialog { ...@@ -104,16 +108,16 @@ public class CommonTipDialog {
* @param parameterTypes * @param parameterTypes
* @param parameters * @param parameters
*/ */
public static void showWarnDialog(Activity context,String msg, Class c, Object object, String methodName, Class[] parameterTypes, Object[] parameters) { public static void showWarnDialog(Activity context, String msg, Class c, Object object, String methodName, Class[] parameterTypes, Object[] parameters) {
QMUIDialog.MessageDialogBuilder dialogBuilder = new QMUIDialog.MessageDialogBuilder(context); QMUIDialog.MessageDialogBuilder dialogBuilder = new QMUIDialog.MessageDialogBuilder(context);
dialogBuilder.setMessage(msg); dialogBuilder.setMessage(msg);
dialogBuilder.setTitleIcon(R.drawable.qmui_icon_dialog_warn); dialogBuilder.setTitleIcon(R.drawable.qmui_icon_dialog_warn);
if(!TextUtils.isEmpty(methodName)) { if (!TextUtils.isEmpty(methodName)) {
dialogBuilder.addAction("取消", (dialog, index) -> dialog.dismiss()); dialogBuilder.addAction("取消", (dialog, index) -> dialog.dismiss());
} }
dialogBuilder.addAction(0, "確認", QMUIDialogAction.ACTION_PROP_NEGATIVE, (dialog, index) -> { dialogBuilder.addAction(0, "確認", QMUIDialogAction.ACTION_PROP_NEGATIVE, (dialog, index) -> {
dialog.dismiss(); dialog.dismiss();
if(TextUtils.isEmpty(methodName)){ if (TextUtils.isEmpty(methodName)) {
return; return;
} }
try { try {
...@@ -133,6 +137,7 @@ public class CommonTipDialog { ...@@ -133,6 +137,7 @@ public class CommonTipDialog {
/** /**
* 取消 dialog 確認后執行對應方法 * 取消 dialog 確認后執行對應方法
*
* @param context * @param context
* @param msg * @param msg
* @param c * @param c
...@@ -141,16 +146,16 @@ public class CommonTipDialog { ...@@ -141,16 +146,16 @@ public class CommonTipDialog {
* @param parameterTypes * @param parameterTypes
* @param parameters * @param parameters
*/ */
public static void showCancelDialog(Activity context,String msg, Class c, Object object, String methodName, Class[] parameterTypes, Object[] parameters) { public static void showCancelDialog(Activity context, String msg, Class c, Object object, String methodName, Class[] parameterTypes, Object[] parameters) {
QMUIDialog.MessageDialogBuilder dialogBuilder = new QMUIDialog.MessageDialogBuilder(context); QMUIDialog.MessageDialogBuilder dialogBuilder = new QMUIDialog.MessageDialogBuilder(context);
dialogBuilder.setMessage(msg); dialogBuilder.setMessage(msg);
dialogBuilder.setTitleIcon(R.drawable.qmui_icon_dialog_cancel); dialogBuilder.setTitleIcon(R.drawable.qmui_icon_dialog_cancel);
if(!TextUtils.isEmpty(methodName)) { if (!TextUtils.isEmpty(methodName)) {
dialogBuilder.addAction("取消", (dialog, index) -> dialog.dismiss()); dialogBuilder.addAction("取消", (dialog, index) -> dialog.dismiss());
} }
dialogBuilder.addAction(0, "確認", QMUIDialogAction.ACTION_PROP_NEGATIVE, (dialog, index) -> { dialogBuilder.addAction(0, "確認", QMUIDialogAction.ACTION_PROP_NEGATIVE, (dialog, index) -> {
dialog.dismiss(); dialog.dismiss();
if(TextUtils.isEmpty(methodName)){ if (TextUtils.isEmpty(methodName)) {
return; return;
} }
try { try {
...@@ -177,4 +182,46 @@ public class CommonTipDialog { ...@@ -177,4 +182,46 @@ public class CommonTipDialog {
dialogBuilder.create(R.style.MyDialogTheme2).show(); dialogBuilder.create(R.style.MyDialogTheme2).show();
} }
/**
* 輸入型 dialog 確認后執行對應方法
*
* @param context
* @param title
* @param placeholder
* @param c
* @param object
* @param methodName
* @param parameterTypes
* @param parameters
*/
public static void showEditTextDialog(Activity context, String title, String placeholder, Class c, Object object, String methodName, Class[] parameterTypes, Object[] parameters) {
final QMUIDialog.EditTextDialogBuilder dialogBuilder = new QMUIDialog.EditTextDialogBuilder(context);
dialogBuilder.setTitle(title);
dialogBuilder.setPlaceholder(placeholder);
dialogBuilder.setInputType(InputType.TYPE_CLASS_TEXT);
if (!TextUtils.isEmpty(methodName)) {
dialogBuilder.addAction("取消", (dialog, index) -> dialog.dismiss());
}
dialogBuilder.addAction(0, "確認", QMUIDialogAction.ACTION_PROP_NEGATIVE, (dialog, index) -> {
dialog.dismiss();
if (TextUtils.isEmpty(methodName)) {
return;
}
try {
Method method = c.getDeclaredMethod(methodName, parameterTypes);
method.setAccessible(true);
method.invoke(object, parameters);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
});
dialogBuilder.create(R.style.MyDialogTheme2).show();
}
} }
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<!-- 倒三角 -->
<rotate
android:fromDegrees="-45"
android:pivotX="-45%"
android:pivotY="45%"
android:toDegrees="45"
>
<shape android:shape="rectangle">
<solid android:color="#f00" />
</shape>
</rotate>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/shape_id">
<!-- 正三角 -->
<rotate
android:fromDegrees="45"
android:toDegrees="45"
android:pivotX="100%"
android:pivotY="100%">
<shape android:shape="rectangle">
<solid android:color="@color/theme_white_color"/>
</shape>
</rotate>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<declare-styleable name="AvatarView">
<attr name="showLabel" format="boolean" />
<attr name="avatarSize" format="dimension" />
<attr name="avatarSrc" format="reference" />
<attr name="labelSrc" format="reference" />
</declare-styleable>
<declare-styleable name="TriangleLabelView">
<attr name="backgroundColor" format="color" />
<attr name="primaryTextColor" format="color" />
<attr name="secondaryTextColor" format="color" />
<attr name="primaryText" format="string" />
<attr name="secondaryText" format="string" />
<attr name="primaryTextSize" format="dimension" />
<attr name="secondaryTextSize" format="dimension" />
<attr name="labelTopPadding" format="dimension" />
<attr name="labelCenterPadding" format="dimension" />
<attr name="labelBottomPadding" format="dimension" />
<attr name="primaryTextStyle">
<enum name="normal" value="0" />
<enum name="italic" value="1" />
<enum name="bold" value="2" />
</attr>
<attr name="secondaryTextStyle">
<enum name="normal" value="0" />
<enum name="italic" value="1" />
<enum name="bold" value="2" />
</attr>
<attr name="corner">
<enum name="leftTop" value="1" />
<enum name="rightTop" value="2" />
<enum name="leftBottom" value="3" />
<enum name="rightBottom" value="4" />
</attr>
</declare-styleable>
<declare-styleable name="SwipeBackLayout"> <declare-styleable name="SwipeBackLayout">
<attr name="edge_flag"> <attr name="edge_flag">
<enum name="left" value="0" /> <enum name="left" value="0" />
......
...@@ -22,5 +22,5 @@ ...@@ -22,5 +22,5 @@
<item name="topbar_right_change_button" type="id"/> <item name="topbar_right_change_button" type="id"/>
<item name="layout_for_test" type="id"/>
</resources> </resources>
\ No newline at end of file
...@@ -5,8 +5,8 @@ ext { ...@@ -5,8 +5,8 @@ ext {
buildToolsVersion: '28.0.3', buildToolsVersion: '28.0.3',
minSdkVersion : 19, //N5收銀機應用安卓開發環境要求Android OS Version: 5.1Android SDK Min Version: 19 minSdkVersion : 19, //N5收銀機應用安卓開發環境要求Android OS Version: 5.1Android SDK Min Version: 19
targetSdkVersion : 28, targetSdkVersion : 28,
versionCode : 3, versionCode : 2,
versionName : "1.0.3" versionName : "1.0.2"
] ]
version = [ version = [
......
...@@ -18,10 +18,6 @@ public interface MainService { ...@@ -18,10 +18,6 @@ public interface MainService {
Observable<Object> loginOut(@Body RequestBody requestBody); Observable<Object> loginOut(@Body RequestBody requestBody);
@Headers({"Domain-Name: update_version"}) @Headers({"Domain-Name: update_version"})
@POST("restaurant/clearHeartbeat" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<Object> clearHeartbeat(@Body RequestBody requestBody);
@Headers({"Domain-Name: update_version"})
@POST("system/checkAppVersion" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2) @POST("system/checkAppVersion" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<CheckVersionRequest> checkAppVersion(@Body RequestBody requestBody); Observable<CheckVersionRequest> checkAppVersion(@Body RequestBody requestBody);
} }
...@@ -5,7 +5,6 @@ import android.content.Intent; ...@@ -5,7 +5,6 @@ import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.text.TextUtils; import android.text.TextUtils;
import com.billy.cc.core.component.CC;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication; import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.utils.LanguageUtils; import com.gingersoft.gsa.cloud.base.utils.LanguageUtils;
import com.gingersoft.gsa.cloud.main.R; import com.gingersoft.gsa.cloud.main.R;
...@@ -121,25 +120,7 @@ public class NewMainPresenter extends BasePresenter<NewMainContract.Model, NewMa ...@@ -121,25 +120,7 @@ public class NewMainPresenter extends BasePresenter<NewMainContract.Model, NewMa
public void loginOut() { public void loginOut() {
RequestBody requestBody = new FormBody.Builder() RequestBody requestBody = new FormBody.Builder()
.add("restaurantId", GsaCloudApplication.getRestaurantId(mApplication) + "")
.build(); .build();
CC.obtainBuilder("Component.OtherOrder")
.setActionName("closeHeart")
.build()
.call();
mModel.clearHeartbeat(requestBody)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(null))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<Object>(mErrorHandler) {
@Override
public void onNext(@NonNull Object info) {
mModel.loginOut(requestBody) mModel.loginOut(requestBody)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(null)) .doOnSubscribe(disposable -> mRootView.showLoading(null))
...@@ -148,6 +129,7 @@ public class NewMainPresenter extends BasePresenter<NewMainContract.Model, NewMa ...@@ -148,6 +129,7 @@ public class NewMainPresenter extends BasePresenter<NewMainContract.Model, NewMa
.doAfterTerminate(() -> mRootView.hideLoading()) .doAfterTerminate(() -> mRootView.hideLoading())
.compose(RxLifecycleUtils.bindToLifecycle(mRootView)) .compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<Object>(mErrorHandler) { .subscribe(new ErrorHandleSubscriber<Object>(mErrorHandler) {
@Override @Override
public void onNext(@NonNull Object info) { public void onNext(@NonNull Object info) {
mRootView.loginOut(); mRootView.loginOut();
...@@ -156,21 +138,19 @@ public class NewMainPresenter extends BasePresenter<NewMainContract.Model, NewMa ...@@ -156,21 +138,19 @@ public class NewMainPresenter extends BasePresenter<NewMainContract.Model, NewMa
} }
}); });
} }
});
}
public void updateAPK(int type, String downApkURL) { public void updateAPK(int type, String downApkURL) {
if (type == 4 || type == 5) { if(type == 4 || type == 5){
if (type == 4) { if(type == 4){
try { try {
DeviceUtils.launchAppDetail(IActivity, mApplication.getPackageName(), "com.android.vending"); DeviceUtils.launchAppDetail(IActivity, mApplication.getPackageName(), "com.android.vending");
} catch (Exception e) { } catch (Exception e) {
//跳转goole play下载app //跳转goole play下载app
WebActivity.startWebActivity_url(IActivity, downApkURL, WebActivity.RIGHT_TYPE_REFRESH); WebActivity.startWebActivity_url(IActivity, downApkURL, WebActivity.RIGHT_TYPE_REFRESH);
} }
} else { }else{
try { try {
DeviceUtils.launchAppDetail(IActivity, mApplication.getPackageName(), "com.android.vending"); DeviceUtils.launchAppDetail(IActivity,mApplication.getPackageName(), "com.android.vending");
} catch (Exception e) { } catch (Exception e) {
Intent intent = new Intent(); Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW"); intent.setAction("android.intent.action.VIEW");
......
...@@ -130,12 +130,7 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl ...@@ -130,12 +130,7 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
@Override @Override
public void onCreate(@Nullable Bundle savedInstanceState) { public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
} mPresenter.checkAppVersion();
@Override
protected void onResume() {
super.onResume();
// mPresenter.checkAppVersion();
} }
@Override @Override
...@@ -241,24 +236,21 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl ...@@ -241,24 +236,21 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
List<Function> functions = new ArrayList<>(); List<Function> functions = new ArrayList<>();
// if (!BuildConfig.DEBUG) { // if (!BuildConfig.DEBUG) {
// functions.addAll(FunctionManager.getDefault().getFunctionByResModule(this, ComponentMain.main.class, ComponentMain.main.order, "order"));
functions.add(new Function((long) 150, 0, 5, "點餐", 0, 0)); functions.add(new Function((long) 150, 0, 5, "點餐", 0, 0));
functions.add(new Function((long) 138, 150, 5, "餐檯模式", R.drawable.ic_dining_table_mode, 0)); functions.add(new Function((long) 138, 150, 5, "餐檯模式", R.drawable.ic_dining_table_mode, 0));
functions.add(new Function((long) 139, 150, 5, "外送模式", R.drawable.ic_delivery_mode_close, 0)); functions.add(new Function((long) 139, 150, 5, "外送模式", R.drawable.ic_delivery_mode_close, 0));
functions.add(new Function((long) 140, 150, 5, "外賣模式", R.drawable.ic_outsourcing_model_close, 0)); functions.add(new Function((long) 140, 150, 5, "外賣模式", R.drawable.ic_outsourcing_model_close, 0));
functions.add(new Function((long) 141, 150, 5, "預點餐模式", R.drawable.ic_pre_order_mode_close, 1)); functions.add(new Function((long) 141, 150, 5, "預點餐模式", R.drawable.ic_pre_order_mode_close, 1));
// functions.addAll(FunctionManager.getDefault().getFunctionByResModule(this, ComponentMain.main.class, ComponentMain.main.manager, "manager"));
functions.add(new Function((long) 151, 0, 5, "管理", 0, 0)); functions.add(new Function((long) 151, 0, 5, "管理", 0, 0));
//// functions.add(new Function((long) 142, 151, 5, "賬單管理", R.drawable.ic_meals_menu_management, 0)); functions.add(new Function((long) 142, 151, 5, "賬單管理", R.drawable.ic_meals_menu_management, 0));
functions.add(new Function((long) 142, 151, 5, "外賣接單", R.drawable.ic_takeaway_orders, 0)); functions.add(new Function((long) 142, 151, 5, "外賣接單", R.drawable.ic_takeaway_orders, 0));
// functions.add(new Function((long) 143, 151, 5, "餐臺管理", R.drawable.ic_dining_table_management, 0)); functions.add(new Function((long) 143, 151, 5, "餐檯管理", R.drawable.ic_dining_table_management, 0));
functions.add(new Function((long) 144, 151, 5, "打印管理", R.drawable.ic_print_management, 0)); functions.add(new Function((long) 144, 151, 5, "打印管理", R.drawable.ic_print_management, 0));
//// functions.add(new Function((long) 145, 151, 5, "支付管理", R.drawable.ic_pay_management_close, 1)); //// functions.add(new Function((long) 145, 151, 5, "支付管理", R.drawable.ic_pay_management_close, 1));
//// functions.add(new Function((long) 146, 151, 5, "折扣管理", R.drawable.ic_discount_management_close, 1)); //// functions.add(new Function((long) 146, 151, 5, "折扣管理", R.drawable.ic_discount_management_close, 1));
//// functions.add(new Function((long) 147, 151, 5, "沽清管理", R.drawable.ic_sell_off_manger, 0)); functions.add(new Function((long) 147, 151, 5, "沽清管理", R.drawable.ic_sell_off_manger, 0));
// functions.addAll(FunctionManager.getDefault().getFunctionByResModule(this, ComponentMain.main.class, ComponentMain.main.employee, "employee"));
functions.add(new Function((long) 152, 0, 5, "員工", 0, 0)); functions.add(new Function((long) 152, 0, 5, "員工", 0, 0));
functions.add(new Function((long) 147, 152, 5, "員工管理", R.drawable.ic_staff_management_close, 1)); functions.add(new Function((long) 147, 152, 5, "員工管理", R.drawable.ic_staff_management_close, 1));
functions.add(new Function((long) 148, 152, 5, "權限管理", R.drawable.ic_authority_management_close, 1)); functions.add(new Function((long) 148, 152, 5, "權限管理", R.drawable.ic_authority_management_close, 1));
...@@ -310,7 +302,7 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl ...@@ -310,7 +302,7 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
private void functionClick(String name, int status) { private void functionClick(String name, int status) {
// switch (status){ // switch (status){
// case STATUS_NONACTIVATED: // case STATUS_NONACTIVATED:
// ToastUtils.show(mContext, "服務暫未開通,敬請期待"); // ToastUtils.show(mContext, "服務暫未開通,請前往開通");
// return; // return;
// case STATUS_TIME_LIMIT: // case STATUS_TIME_LIMIT:
// ToastUtils.show(mContext, "服務已到期,請前往續費"); // ToastUtils.show(mContext, "服務已到期,請前往續費");
......
...@@ -38,7 +38,6 @@ import com.jess.arms.base.BaseFragment; ...@@ -38,7 +38,6 @@ import com.jess.arms.base.BaseFragment;
import com.jess.arms.di.component.AppComponent; import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils; import com.jess.arms.utils.ArmsUtils;
import java.sql.Time;
import java.text.ParseException; import java.text.ParseException;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
...@@ -76,8 +75,6 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter ...@@ -76,8 +75,6 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
TextView mRestaurantName; TextView mRestaurantName;
@BindView(R2.id.tv_start_time) @BindView(R2.id.tv_start_time)
TextView mTvStartTime; TextView mTvStartTime;
@BindView(R2.id.tv_end_time) @BindView(R2.id.tv_end_time)
TextView mTvEndTime; TextView mTvEndTime;
@BindView(R2.id.iv_start_time_triangle) @BindView(R2.id.iv_start_time_triangle)
...@@ -88,7 +85,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter ...@@ -88,7 +85,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
private BusinessInfoAdapter businessInfoAdapter; private BusinessInfoAdapter businessInfoAdapter;
//查詢多少天的數據 //查詢多少天的數據
private int manyDay = 7; private int manyDay = 6;
public static BusinessReportFragment newInstance() { public static BusinessReportFragment newInstance() {
BusinessReportFragment fragment = new BusinessReportFragment(); BusinessReportFragment fragment = new BusinessReportFragment();
...@@ -114,15 +111,14 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter ...@@ -114,15 +111,14 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
public void initData(@Nullable Bundle savedInstanceState) { public void initData(@Nullable Bundle savedInstanceState) {
//獲取一段時間內的營業信息,默認獲取七天的數據 //獲取一段時間內的營業信息,默認獲取七天的數據
String startTime = TimeUtils.getOldDate(-manyDay); String startTime = TimeUtils.getOldDate(-manyDay);
// mPresenter.getRestaurantAmount(GsaCloudApplication.getRestaurantId(mContext) + "", startTime, TimeUtils.getOldDate(-1));
// mPresenter.getRestaurantBusinessInfo(GsaCloudApplication.getRestaurantId(mContext) + "", startTime, TimeUtils.getOldDate(-1)); mPresenter.getRestaurantAmount(GsaCloudApplication.getRestaurantId(mContext) + "", startTime, TimeUtils.getOldDate(1));
mPresenter.getRestaurantBusinessInfo(GsaCloudApplication.getRestaurantId(mContext) + "", startTime, TimeUtils.getOldDate(1));
mRestaurantName.setText(GsaCloudApplication.getRestaurantName(mContext)); mRestaurantName.setText(GsaCloudApplication.getRestaurantName(mContext));
mTvStartTime.setText(startTime); mTvStartTime.setText(startTime);
mTvEndTime.setText(TimeUtils.getOldDate(0)); mTvEndTime.setText(TimeUtils.getOldDate(0));
getBetweenInfo();
} }
/** /**
...@@ -199,6 +195,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter ...@@ -199,6 +195,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
*/ */
@Override @Override
public void loadChart(List<MainBusinessBean.DataBean> data) { public void loadChart(List<MainBusinessBean.DataBean> data) {
manyDay = data.size();
Object[] chartData = new Object[manyDay]; Object[] chartData = new Object[manyDay];
String[] xData = new String[manyDay]; String[] xData = new String[manyDay];
...@@ -342,7 +339,29 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter ...@@ -342,7 +339,29 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
} else { } else {
mTvEndTime.setText(TimeUtils.DATE_FORMAT_DATE.format(date)); mTvEndTime.setText(TimeUtils.DATE_FORMAT_DATE.format(date));
} }
getBetweenInfo();
// Calendar calendar = Calendar.getInstance();
// calendar.setTime(date);
// int month = calendar.get(Calendar.MONTH);
// int day = calendar.get(Calendar.DAY_OF_MONTH);
// calendar.setTime(new Date());
// //如果不是當前月份,那麼報表最多顯示最近七天
// if (month != calendar.get(Calendar.MONTH)) {
// manyDay = 7;
// } else {
// //如果選中的是當前月份,判斷天數是否大於7
// if (calendar.get(Calendar.DAY_OF_MONTH) - day > 7) {
// manyDay = 7;
// } else {
// manyDay = calendar.get(Calendar.DAY_OF_MONTH) - day;
// if (manyDay < 0) {
// manyDay = 0;
// }
// }
// }
mPresenter.getRestaurantAmount(GsaCloudApplication.getRestaurantId(mContext) + "", mTvStartTime.getText().toString(), mTvEndTime.getText().toString());
mPresenter.getRestaurantBusinessInfo(GsaCloudApplication.getRestaurantId(mContext) + "", mTvStartTime.getText().toString(), mTvEndTime.getText().toString());
}).setOnDismissListener(o -> { }).setOnDismissListener(o -> {
if (triangleView.isOpen()) { if (triangleView.isOpen()) {
triangleView.toggle(); triangleView.toggle();
...@@ -354,24 +373,4 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter ...@@ -354,24 +373,4 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
e.printStackTrace(); e.printStackTrace();
} }
} }
private void getBetweenInfo() {
try {
//計算出兩個日期間隔的天數
Calendar startCal = Calendar.getInstance();
startCal.setTime(TimeUtils.DATE_FORMAT_DATE.parse(mTvStartTime.getText().toString()));
Calendar endCal = Calendar.getInstance();
endCal.setTime(TimeUtils.DATE_FORMAT_DATE.parse(mTvEndTime.getText().toString()));
manyDay = TimeUtils.daysBetween(startCal, endCal) - 1;
if (manyDay < 0) {
manyDay = 0;
}
} catch (ParseException e) {
e.printStackTrace();
}
mPresenter.getRestaurantAmount(GsaCloudApplication.getRestaurantId(mContext) + "", mTvStartTime.getText().toString(), mTvEndTime.getText().toString());
mPresenter.getRestaurantBusinessInfo(GsaCloudApplication.getRestaurantId(mContext) + "", mTvStartTime.getText().toString(), mTvEndTime.getText().toString());
}
} }
...@@ -237,7 +237,7 @@ ...@@ -237,7 +237,7 @@
android:layout_marginRight="@dimen/dp_10" android:layout_marginRight="@dimen/dp_10"
app:hl_cornerRadius="@dimen/dp_4" app:hl_cornerRadius="@dimen/dp_4"
app:hl_dy="@dimen/main_shadow_dy" app:hl_dy="@dimen/main_shadow_dy"
android:visibility="gone" android:visibility="visible"
app:hl_shadowBackColor="@color/white" app:hl_shadowBackColor="@color/white"
app:hl_shadowColor="@color/shadow_color" app:hl_shadowColor="@color/shadow_color"
app:hl_shadowLimit="@dimen/main_shadow_limit"> app:hl_shadowLimit="@dimen/main_shadow_limit">
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_8" android:layout_marginTop="@dimen/dp_8"
android:singleLine="true"
android:text="餐檯模式" android:text="餐檯模式"
android:textColor="@color/normal_color" android:textColor="@color/normal_color"
android:textSize="@dimen/sp_12" /> android:textSize="@dimen/sp_12" />
......
package com.gingersoft.gsa.cloud.manager.mvp.contract; package com.gingersoft.gsa.cloud.manager.mvp.contract;
import com.gingersoft.gsa.cloud.base.common.bean.TableItem;
import com.jess.arms.mvp.IView; import com.jess.arms.mvp.IView;
import com.jess.arms.mvp.IModel; import com.jess.arms.mvp.IModel;
import java.util.List;
/** /**
* ================================================ * ================================================
...@@ -20,6 +23,8 @@ public interface TableListContract { ...@@ -20,6 +23,8 @@ public interface TableListContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息 //对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView { interface View extends IView {
void showEmptyView(boolean isSuccess, int size, Throwable t); void showEmptyView(boolean isSuccess, int size, Throwable t);
List<TableItem> getTableList();
} }
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存 //Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
......
package com.gingersoft.gsa.cloud.manager.mvp.contract; package com.gingersoft.gsa.cloud.manager.mvp.contract;
import com.gingersoft.gsa.cloud.base.common.bean.BaseResult; import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.base.common.bean.FoodBean; import com.gingersoft.gsa.cloud.base.common.bean.TableItem;
import com.gingersoft.gsa.cloud.manager.mvp.model.bean.TableArea; import com.gingersoft.gsa.cloud.base.common.bean.TableArea;
import com.gingersoft.gsa.cloud.manager.mvp.model.bean.TableItem;
import com.jess.arms.mvp.IView; import com.jess.arms.mvp.IView;
import com.jess.arms.mvp.IModel; import com.jess.arms.mvp.IModel;
...@@ -34,6 +33,10 @@ public interface TableManageContract { ...@@ -34,6 +33,10 @@ public interface TableManageContract {
void queryTablesSuccess(List<TableItem> tables, int type); void queryTablesSuccess(List<TableItem> tables, int type);
void showEmptyView(boolean isSuccess, int size, Throwable t); void showEmptyView(boolean isSuccess, int size, Throwable t);
void onStartRefreshTableData();
void onPauseRefreshTableData();
} }
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存 //Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
...@@ -55,5 +58,10 @@ public interface TableManageContract { ...@@ -55,5 +58,10 @@ public interface TableManageContract {
Observable<BaseResult> queryTables(); Observable<BaseResult> queryTables();
Observable<BaseResult> changeAreaSort(RequestBody requestBody);
Observable<BaseResult> changeTableSort(RequestBody requestBody);
Observable<BaseResult> updateTableServiceCharge(RequestBody requestBody);
} }
} }
...@@ -158,4 +158,49 @@ public class TableManageModel extends BaseModel implements TableManageContract.M ...@@ -158,4 +158,49 @@ public class TableManageModel extends BaseModel implements TableManageContract.M
.queryTable(restaurantId); .queryTable(restaurantId);
} }
@Override
public Observable<BaseResult> changeAreaSort(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(TableManageService.class)
.changeAreaSort(requestBody)
.flatMap(new Function<BaseResult, Observable<BaseResult>>() {
@Override
public Observable<BaseResult> apply(BaseResult info) throws Exception {
if (info != null && info.isSuccess()) {
return queryAreas();
}
return null;
}
});
}
@Override
public Observable<BaseResult> changeTableSort(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(TableManageService.class)
.changeTableSort(requestBody)
.flatMap(new Function<BaseResult, Observable<BaseResult>>() {
@Override
public Observable<BaseResult> apply(BaseResult info) throws Exception {
if (info != null && info.isSuccess()) {
return queryTables();
}
return null;
}
});
}
@Override
public Observable<BaseResult> updateTableServiceCharge(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(TableManageService.class)
.updateTableServiceCharge(requestBody)
.flatMap(new Function<BaseResult, Observable<BaseResult>>() {
@Override
public Observable<BaseResult> apply(BaseResult info) throws Exception {
if (info != null && info.isSuccess()) {
return queryTables();
}
return null;
}
});
}
} }
\ No newline at end of file
...@@ -16,13 +16,22 @@ public class TableRequest { ...@@ -16,13 +16,22 @@ public class TableRequest {
private int regionId; private int regionId;
/**餐檯名*/ /**餐檯名*/
private String tableName; private String tableName;
/**座位数*/ /**默認就餐人數*/
private int seatCount; private Integer seatCount;
/**最大就餐人數*/
private Integer maxSeatCount;
/**最小就餐人數*/
private Integer minSeatCount;
/**服務費*/ /**服務費*/
private Double serviceCharge; private Double serviceCharge;
/**排序*/ /**排序*/
private int sort; private int sort;
/**
0#堂食
1#外賣
2#自取
*/
private int type;
public int getRestaurantId() { public int getRestaurantId() {
return restaurantId; return restaurantId;
...@@ -56,6 +65,34 @@ public class TableRequest { ...@@ -56,6 +65,34 @@ public class TableRequest {
this.seatCount = seatCount; this.seatCount = seatCount;
} }
public void setSeatCount(Integer seatCount) {
this.seatCount = seatCount;
}
public Integer getMaxSeatCount() {
return maxSeatCount;
}
public void setMaxSeatCount(Integer maxSeatCount) {
this.maxSeatCount = maxSeatCount;
}
public Integer getMinSeatCount() {
return minSeatCount;
}
public void setMinSeatCount(Integer minSeatCount) {
this.minSeatCount = minSeatCount;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public Double getServiceCharge() { public Double getServiceCharge() {
return serviceCharge; return serviceCharge;
} }
...@@ -75,26 +112,36 @@ public class TableRequest { ...@@ -75,26 +112,36 @@ public class TableRequest {
public static class Update { public static class Update {
private int id; private long id;
private int restaurantId; private int restaurantId;
/**區域ID*/ /**區域ID*/
private int regionId; private int regionId;
/**餐檯名*/ /**餐檯名*/
private String tableName; private String tableName;
/**座位数*/ /**默認就餐人數*/
private int seatCount; private Integer seatCount;
/**最大就餐人數*/
private Integer maxSeatCount;
/**最小就餐人數*/
private Integer minSeatCount;
/**服務費*/ /**服務費*/
private Double serviceCharge; private Double serviceCharge;
/**排序*/ /**排序*/
private int sort; private int sort;
/**
0:堂食
1:外賣
2:自取
*/
private int type = -1;
public int getId() { public long getId() {
return id; return id;
} }
public void setId(int id) { public void setId(long id) {
this.id = id; this.id = id;
} }
...@@ -130,6 +177,34 @@ public class TableRequest { ...@@ -130,6 +177,34 @@ public class TableRequest {
this.seatCount = seatCount; this.seatCount = seatCount;
} }
public void setSeatCount(Integer seatCount) {
this.seatCount = seatCount;
}
public Integer getMaxSeatCount() {
return maxSeatCount;
}
public void setMaxSeatCount(Integer maxSeatCount) {
this.maxSeatCount = maxSeatCount;
}
public Integer getMinSeatCount() {
return minSeatCount;
}
public void setMinSeatCount(Integer minSeatCount) {
this.minSeatCount = minSeatCount;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public Double getServiceCharge() { public Double getServiceCharge() {
return serviceCharge; return serviceCharge;
} }
...@@ -147,4 +222,28 @@ public class TableRequest { ...@@ -147,4 +222,28 @@ public class TableRequest {
} }
} }
public static class UpdateServiceCharge {
private long id;
/**服務費*/
private Double serviceCharge;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public Double getServiceCharge() {
return serviceCharge;
}
public void setServiceCharge(Double serviceCharge) {
this.serviceCharge = serviceCharge;
}
}
} }
...@@ -51,4 +51,13 @@ public interface TableManageService { ...@@ -51,4 +51,13 @@ public interface TableManageService {
@POST("restaurant/exchangeSort" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseResult> changeAreaSort(@Body RequestBody requestBody);
@POST("restaurantTable/exchangeSort" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseResult> changeTableSort(@Body RequestBody requestBody);
@POST("restaurantTable/updateRestaurantTableBatch" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseResult> updateTableServiceCharge(@Body RequestBody requestBody);
} }
...@@ -2,8 +2,8 @@ package com.gingersoft.gsa.cloud.manager.mvp.presenter; ...@@ -2,8 +2,8 @@ package com.gingersoft.gsa.cloud.manager.mvp.presenter;
import android.app.Application; import android.app.Application;
import com.gingersoft.gsa.cloud.manager.mvp.model.bean.TableArea; import com.gingersoft.gsa.cloud.base.common.bean.TableItem;
import com.gingersoft.gsa.cloud.manager.mvp.model.bean.TableItem; import com.gingersoft.gsa.cloud.base.common.bean.TableArea;
import com.gingersoft.gsa.cloud.ui.bean.view.SectionHeader; import com.gingersoft.gsa.cloud.ui.bean.view.SectionHeader;
import com.jess.arms.integration.AppManager; import com.jess.arms.integration.AppManager;
import com.jess.arms.di.scope.FragmentScope; import com.jess.arms.di.scope.FragmentScope;
...@@ -90,9 +90,22 @@ public class TableListPresenter extends BasePresenter<TableListContract.Model, T ...@@ -90,9 +90,22 @@ public class TableListPresenter extends BasePresenter<TableListContract.Model, T
/** /**
* 組合區域集合 * 組合區域集合
*/ */
public List<TableArea> assembleAreaList(List<TableItem> tableList) { public List<TableArea> assembleAreaList(List<TableArea> areaList, List<TableItem> tableList) {
removeOtherAreaItem(areaList);
if (areaList.size() > 0) {
for (TableItem table : tableList) {
if (table.getRegionId() == -1) {
//將沒有區域的檯 放到其他下面
TableArea newArea = new TableArea();
newArea.setId(-1);
newArea.setRegionName("其他");
areaList.add(newArea);
break;
}
}
return areaList;
}
boolean addOther = false; boolean addOther = false;
List<TableArea> areaList = new ArrayList<>();
for (TableItem table : tableList) { for (TableItem table : tableList) {
if (table.getRegionId() != -1) { if (table.getRegionId() != -1) {
if (!equalsAreaId(areaList, table.getRegionId())) { if (!equalsAreaId(areaList, table.getRegionId())) {
...@@ -124,6 +137,14 @@ public class TableListPresenter extends BasePresenter<TableListContract.Model, T ...@@ -124,6 +137,14 @@ public class TableListPresenter extends BasePresenter<TableListContract.Model, T
return false; return false;
} }
private void removeOtherAreaItem(List<TableArea> areaList) {
for (int i = areaList.size() - 1; i >= 0; i--) {
if (areaList.get(i).getRegionName().equals("其他")) {
areaList.remove(i);
}
}
}
public List<QMUISection<SectionHeader, TableItem>> tableAreaTransformToSection(List<TableArea> mItems) { public List<QMUISection<SectionHeader, TableItem>> tableAreaTransformToSection(List<TableArea> mItems) {
List<QMUISection<SectionHeader, TableItem>> qmuiSections = new ArrayList<>(); List<QMUISection<SectionHeader, TableItem>> qmuiSections = new ArrayList<>();
for (int i = 0; i < mItems.size(); i++) { for (int i = 0; i < mItems.size(); i++) {
...@@ -139,6 +160,23 @@ public class TableListPresenter extends BasePresenter<TableListContract.Model, T ...@@ -139,6 +160,23 @@ public class TableListPresenter extends BasePresenter<TableListContract.Model, T
if (Objects.requireNonNull(tableArea.getTableItemList().size()) > 0) { if (Objects.requireNonNull(tableArea.getTableItemList().size()) > 0) {
contents.addAll(tableArea.getTableItemList()); contents.addAll(tableArea.getTableItemList());
} }
contents.add(createAddTableItem(tableArea));
return new QMUISection(header, contents, false); return new QMUISection(header, contents, false);
} }
/**
* 创建+按钮
*
* @return
*/
private TableItem createAddTableItem(TableArea tableArea) {
TableItem item = new TableItem();
item.setLayoutType(1);
item.setStatus(0);
item.setRegionId(tableArea.getId());
item.setRegionName(tableArea.getRegionName());
return item;
}
} }
...@@ -2,28 +2,15 @@ package com.gingersoft.gsa.cloud.manager.mvp.ui.activity; ...@@ -2,28 +2,15 @@ package com.gingersoft.gsa.cloud.manager.mvp.ui.activity;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View;
import android.view.animation.AnimationUtils; import com.gingersoft.gsa.cloud.base.common.bean.TableItem;
import android.widget.Button; import com.gingersoft.gsa.cloud.base.common.bean.TableArea;
import android.widget.FrameLayout;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils;
import com.gingersoft.gsa.cloud.constans.MealConstant;
import com.gingersoft.gsa.cloud.manager.R2;
import com.gingersoft.gsa.cloud.manager.mvp.model.bean.TableArea;
import com.gingersoft.gsa.cloud.manager.mvp.model.bean.TableItem;
import com.gingersoft.gsa.cloud.manager.mvp.model.bean.request.AreaRequest; import com.gingersoft.gsa.cloud.manager.mvp.model.bean.request.AreaRequest;
import com.gingersoft.gsa.cloud.manager.mvp.model.bean.request.TableRequest; import com.gingersoft.gsa.cloud.manager.mvp.model.bean.request.TableRequest;
import com.gingersoft.gsa.cloud.manager.mvp.ui.fragment.AddAreaFragment;
import com.gingersoft.gsa.cloud.manager.mvp.ui.fragment.AddTableFragment; import com.gingersoft.gsa.cloud.manager.mvp.ui.fragment.AddTableFragment;
import com.gingersoft.gsa.cloud.manager.mvp.ui.fragment.AreaListFragment; import com.gingersoft.gsa.cloud.manager.mvp.ui.fragment.AreaListFragment;
import com.gingersoft.gsa.cloud.manager.mvp.ui.fragment.TableListFragment; import com.gingersoft.gsa.cloud.manager.mvp.ui.fragment.TableListFragment;
import com.gingersoft.gsa.cloud.ui.utils.AnimateUtils;
import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog; import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog;
import com.jess.arms.base.BaseActivity;
import com.jess.arms.base.BaseFragment;
import com.jess.arms.base.BaseFragmentActivity; import com.jess.arms.base.BaseFragmentActivity;
import com.jess.arms.di.component.AppComponent; import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils; import com.jess.arms.utils.ArmsUtils;
...@@ -32,35 +19,17 @@ import com.gingersoft.gsa.cloud.manager.mvp.contract.TableManageContract; ...@@ -32,35 +19,17 @@ import com.gingersoft.gsa.cloud.manager.mvp.contract.TableManageContract;
import com.gingersoft.gsa.cloud.manager.mvp.presenter.TableManagePresenter; import com.gingersoft.gsa.cloud.manager.mvp.presenter.TableManagePresenter;
import com.gingersoft.gsa.cloud.manager.R; import com.gingersoft.gsa.cloud.manager.R;
import com.jess.arms.utils.RxLifecycleUtils;
import com.qmuiteam.qmui.alpha.QMUIAlphaTextView;
import com.qmuiteam.qmui.widget.QMUITopBar;
import com.qmuiteam.qmui.widget.dialog.QMUIBottomSheet;
import com.qmuiteam.qmui.widget.section.QMUIStickySectionLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.layout.api.RefreshLayout;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Stack;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import butterknife.BindView;
import butterknife.OnClick;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber;
import me.yokeyword.fragmentation.ISupportFragment; import me.yokeyword.fragmentation.ISupportFragment;
import me.yokeyword.fragmentation.anim.DefaultHorizontalAnimator; import me.yokeyword.fragmentation.anim.DefaultHorizontalAnimator;
import me.yokeyword.fragmentation.anim.FragmentAnimator; import me.yokeyword.fragmentation.anim.FragmentAnimator;
import okhttp3.FormBody;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import static com.jess.arms.utils.Preconditions.checkNotNull; import static com.jess.arms.utils.Preconditions.checkNotNull;
...@@ -79,6 +48,11 @@ import static com.jess.arms.utils.Preconditions.checkNotNull; ...@@ -79,6 +48,11 @@ import static com.jess.arms.utils.Preconditions.checkNotNull;
*/ */
public class TableManageActivity extends BaseFragmentActivity<TableManagePresenter> implements TableManageContract.View { public class TableManageActivity extends BaseFragmentActivity<TableManagePresenter> implements TableManageContract.View {
/**
* 輪訓刷新餐檯數據
*/
public static boolean isRefreshData = true;
public static final int ADD_TABLE_RESULT_SUCCESS = 100; public static final int ADD_TABLE_RESULT_SUCCESS = 100;
public static final int ADD_AREA_RESULT_SUCCESS = 200; public static final int ADD_AREA_RESULT_SUCCESS = 200;
...@@ -92,7 +66,14 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent ...@@ -92,7 +66,14 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
public static final byte UPDATE_TABLE_SUCCESS = 22; public static final byte UPDATE_TABLE_SUCCESS = 22;
public static final byte QUERY_TABLE_SUCCESS = 23; public static final byte QUERY_TABLE_SUCCESS = 23;
public static final byte CHANGE_AREA_SORT = 30;
public static final byte CHANGE_TABLE_SORT = 31;
public static final byte UPDATE_TABLE_SERVICE_CHARGE = 32;
private List<TableArea> mTableAreaList = new ArrayList<>(); private List<TableArea> mTableAreaList = new ArrayList<>();
private List<TableItem> mTableList = new ArrayList<>();
@Override @Override
public void setupActivityComponent(@NonNull AppComponent appComponent) { public void setupActivityComponent(@NonNull AppComponent appComponent) {
...@@ -115,6 +96,11 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent ...@@ -115,6 +96,11 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
if (findFragment(TableListFragment.class) == null) { if (findFragment(TableListFragment.class) == null) {
loadRootFragment(R.id.fl_container, TableListFragment.newInstance()); loadRootFragment(R.id.fl_container, TableListFragment.newInstance());
} }
}
public void initGetTableTimer() {
mPresenter.initGetTableTimer();
} }
@Override @Override
...@@ -142,7 +128,7 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent ...@@ -142,7 +128,7 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
} }
public void queryAreas(RefreshLayout refreshLayout) { public void queryAreas(RefreshLayout refreshLayout) {
mPresenter.queryAreas(refreshLayout); mPresenter.queryAreas(refreshLayout, true);
} }
public void addTable(TableRequest.Add request) { public void addTable(TableRequest.Add request) {
...@@ -158,7 +144,19 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent ...@@ -158,7 +144,19 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
} }
public void queryTables(RefreshLayout refreshLayout) { public void queryTables(RefreshLayout refreshLayout) {
mPresenter.queryTables(refreshLayout); mPresenter.queryTables(refreshLayout, true);
}
public void changeAreaSort(String ids) {
mPresenter.changeAreaSort(ids);
}
public void changeTableSort(String ids) {
mPresenter.changeTableSort(ids);
}
public void updateTableServiceCharge(List<TableRequest.UpdateServiceCharge> request) {
mPresenter.updateTableServiceCharge(request);
} }
@Override @Override
...@@ -233,11 +231,15 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent ...@@ -233,11 +231,15 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
switch (type) { switch (type) {
case ADD_AREA_SUCCESS: case ADD_AREA_SUCCESS:
case UPDATE_AREA_SUCCESS: case UPDATE_AREA_SUCCESS:
AddAreaFragment addAreaFragment = (AddAreaFragment) fragment; AreaListFragment areaListFragment = (AreaListFragment) fragment;
addAreaFragment.pop();
AreaListFragment areaListFragment = findFragment(AreaListFragment.class);
if (areaListFragment != null) { if (areaListFragment != null) {
areaListFragment.updateAreaData(areas); if (type == ADD_AREA_SUCCESS) {
areaListFragment.addSuccess();
}
}
TableListFragment tableListFragment = findFragment(TableListFragment.class);
if(tableListFragment != null){
tableListFragment.updateTableData(mTableAreaList, mTableList);
} }
break; break;
case DELETE_AREA_SUCCESS: case DELETE_AREA_SUCCESS:
...@@ -246,29 +248,43 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent ...@@ -246,29 +248,43 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
case QUERY_AREA_SUCCESS: case QUERY_AREA_SUCCESS:
break; break;
case CHANGE_AREA_SORT:
break;
} }
} }
} }
@Override @Override
public void queryTablesSuccess(List<TableItem> tables, int type) { public void queryTablesSuccess(List<TableItem> tables, int type) {
if (mTableList.size() > 0) {
mTableList.clear();
}
this.mTableList.addAll(tables);
ISupportFragment fragment = getTopFragment(); ISupportFragment fragment = getTopFragment();
if (fragment != null) { if (fragment != null) {
if (fragment instanceof TableListFragment) { if (fragment instanceof TableListFragment) {
TableListFragment tableListFragment = (TableListFragment) fragment; TableListFragment tableListFragment = (TableListFragment) fragment;
tableListFragment.updateTableData(tables); tableListFragment.updateTableData(mTableAreaList, tables);
} }
TableListFragment tableListFragment = findFragment(TableListFragment.class);
switch (type) { switch (type) {
case ADD_TABLE_SUCCESS: case ADD_TABLE_SUCCESS:
case UPDATE_TABLE_SUCCESS: case UPDATE_TABLE_SUCCESS:
AddTableFragment addTableFragment = (AddTableFragment) fragment; AddTableFragment addTableFragment = (AddTableFragment) fragment;
addTableFragment.pop(); addTableFragment.pop();
TableListFragment tableListFragment = findFragment(TableListFragment.class);
if (tableListFragment != null) { if (tableListFragment != null) {
tableListFragment.updateTableData(tables); tableListFragment.updateTableData(mTableAreaList, tables);
} }
break; break;
case DELETE_TABLE_SUCCESS: case DELETE_TABLE_SUCCESS:
case UPDATE_TABLE_SERVICE_CHARGE:
if (fragment instanceof TableListFragment) {
tableListFragment.backEdit();
}
break;
case CHANGE_TABLE_SORT:
break; break;
case QUERY_TABLE_SUCCESS: case QUERY_TABLE_SUCCESS:
...@@ -290,8 +306,28 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent ...@@ -290,8 +306,28 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
} }
} }
@Override
public void onStartRefreshTableData() {
isRefreshData = true;
mPresenter.startTableTimer();
mPresenter.queryTables(null, false);
}
@Override
public void onPauseRefreshTableData() {
isRefreshData = false;
mPresenter.cancelTableTimer();
//立刻停止獲取餐檯接口
if (mPresenter.getGetTablesDataDisposable() != null && !mPresenter.getGetTablesDataDisposable().isDisposed()) {
mPresenter.getGetTablesDataDisposable().dispose();
}
}
public List<TableArea> getTableAreaList() { public List<TableArea> getTableAreaList() {
return mTableAreaList; return mTableAreaList;
} }
public List<TableItem> getTableList() {
return mTableList;
}
} }
package com.gingersoft.gsa.cloud.manager.mvp.ui.adapter; package com.gingersoft.gsa.cloud.manager.mvp.ui.adapter;
import android.content.Context; import android.content.Context;
import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.widget.CheckBox; import android.widget.CheckBox;
import android.widget.CompoundButton; import android.widget.CompoundButton;
import android.widget.RadioButton; import android.widget.EditText;
import android.widget.TextView;
import com.gingersoft.gsa.cloud.manager.R; import com.gingersoft.gsa.cloud.manager.R;
import com.gingersoft.gsa.cloud.manager.R2; import com.gingersoft.gsa.cloud.manager.R2;
import com.gingersoft.gsa.cloud.manager.mvp.model.bean.TableArea; import com.gingersoft.gsa.cloud.base.common.bean.TableArea;
import com.jess.arms.base.BaseHolder; import com.jess.arms.base.BaseHolder;
import com.jess.arms.base.DefaultAdapter; import com.jess.arms.base.DefaultAdapter;
...@@ -50,12 +50,12 @@ public class AreaManageAdapter extends DefaultAdapter<TableArea> { ...@@ -50,12 +50,12 @@ public class AreaManageAdapter extends DefaultAdapter<TableArea> {
return R.layout.manager_item_manage_area; return R.layout.manager_item_manage_area;
} }
class TopTableAreaItemHolder extends BaseHolder<TableArea> { public class TopTableAreaItemHolder extends BaseHolder<TableArea> {
@BindView(R2.id.tv_name) @BindView(R2.id.ed_name)
TextView tv_name; EditText ed_name;
// @BindView(R2.id.tv_edit) // @BindView(R2.id.ed_input_name)
// TextView tv_edit; // TextView ed_input_name;
@BindView(R2.id.cb_checked) @BindView(R2.id.cb_checked)
CheckBox cb_checked; CheckBox cb_checked;
...@@ -65,7 +65,18 @@ public class AreaManageAdapter extends DefaultAdapter<TableArea> { ...@@ -65,7 +65,18 @@ public class AreaManageAdapter extends DefaultAdapter<TableArea> {
@Override @Override
public void setData(TableArea datasBean, int position) { public void setData(TableArea datasBean, int position) {
tv_name.setText(datasBean.getRegionName()); ed_name.setText(datasBean.getRegionName());
ed_name.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (!hasFocus) {
String name = ed_name.getText().toString();
if (onTextChangedListener != null && !name.equals(datasBean.getRegionName())) {
onTextChangedListener.afterTextChanged(datasBean, name);
}
}
}
});
// tv_edit.setOnClickListener(new View.OnClickListener() { // tv_edit.setOnClickListener(new View.OnClickListener() {
// @Override // @Override
// public void onClick(View v) { // public void onClick(View v) {
...@@ -82,8 +93,14 @@ public class AreaManageAdapter extends DefaultAdapter<TableArea> { ...@@ -82,8 +93,14 @@ public class AreaManageAdapter extends DefaultAdapter<TableArea> {
datasBean.setChecked(isChecked); datasBean.setChecked(isChecked);
} }
}); });
ed_name.setCursorVisible(true);
ed_name.setFocusable(true);
ed_name.setFocusableInTouchMode(true);
} else { } else {
cb_checked.setVisibility(View.GONE); cb_checked.setVisibility(View.GONE);
ed_name.setCursorVisible(false);
ed_name.setFocusable(false);
ed_name.setFocusableInTouchMode(false);
} }
} }
} }
...@@ -92,15 +109,15 @@ public class AreaManageAdapter extends DefaultAdapter<TableArea> { ...@@ -92,15 +109,15 @@ public class AreaManageAdapter extends DefaultAdapter<TableArea> {
isRadioEdit = radioEdit; isRadioEdit = radioEdit;
} }
private OnClickListener onClickListener; private OnTextChangedListener onTextChangedListener;
public void setOnClickListener(OnClickListener onClickListener) { public void addTextChangedListener(OnTextChangedListener onTextChangedListener) {
this.onClickListener = onClickListener; this.onTextChangedListener = onTextChangedListener;
} }
public interface OnClickListener { public interface OnTextChangedListener {
void onItemClick(View v, TableArea function); void afterTextChanged(TableArea datasBean, String s);
} }
} }
...@@ -13,7 +13,7 @@ import android.widget.TextView; ...@@ -13,7 +13,7 @@ import android.widget.TextView;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication; import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.manager.R2; import com.gingersoft.gsa.cloud.manager.R2;
import com.gingersoft.gsa.cloud.manager.mvp.model.bean.TableArea; import com.gingersoft.gsa.cloud.base.common.bean.TableArea;
import com.gingersoft.gsa.cloud.manager.mvp.model.bean.request.AreaRequest; import com.gingersoft.gsa.cloud.manager.mvp.model.bean.request.AreaRequest;
import com.gingersoft.gsa.cloud.manager.mvp.ui.activity.TableManageActivity; import com.gingersoft.gsa.cloud.manager.mvp.ui.activity.TableManageActivity;
import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog; import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog;
......
...@@ -5,6 +5,6 @@ ...@@ -5,6 +5,6 @@
android:thicknessRatio="20" android:thicknessRatio="20"
android:useLevel="false"> android:useLevel="false">
<solid android:color="#FF3333" /> <solid android:color="#1196DB" />
</shape> </shape>
\ No newline at end of file
...@@ -5,57 +5,3 @@ ...@@ -5,57 +5,3 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"/> android:layout_height="match_parent"/>
<!--<?xml version="1.0" encoding="utf-8"?>-->
<!--<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"-->
<!-- xmlns:app="http://schemas.android.com/apk/res-auto"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:orientation="vertical">-->
<!-- <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" />-->
<!-- <com.qmuiteam.qmui.widget.section.QMUIStickySectionLayout-->
<!-- android:id="@+id/section_layout"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:layout_marginTop="?attr/qmui_topbar_height"/>-->
<!-- <com.qmuiteam.qmui.alpha.QMUIAlphaTextView-->
<!-- android:id="@+id/tv_area_list"-->
<!-- android:layout_width="@dimen/dp_65"-->
<!-- android:layout_height="@dimen/dp_65"-->
<!-- android:layout_toLeftOf="@+id/tv_add_table"-->
<!-- android:layout_marginRight="@dimen/dp_15"-->
<!-- android:layout_marginBottom="@dimen/dp_20"-->
<!-- android:layout_alignParentBottom="true"-->
<!-- android:text="@string/manager_area"-->
<!-- android:textSize="@dimen/sp_14"-->
<!-- android:textColor="@color/theme_white_color"-->
<!-- android:gravity="center"-->
<!-- android:background="@drawable/ui_shape_theme_oval"/>-->
<!-- <com.qmuiteam.qmui.alpha.QMUIAlphaTextView-->
<!-- android:id="@+id/tv_add_table"-->
<!-- android:layout_width="@dimen/dp_65"-->
<!-- android:layout_height="@dimen/dp_65"-->
<!-- android:layout_marginBottom="@dimen/dp_20"-->
<!-- android:layout_marginRight="@dimen/dp_20"-->
<!-- android:layout_alignParentBottom="true"-->
<!-- android:layout_alignParentRight="true"-->
<!-- android:text="@string/manager_add"-->
<!-- android:textColor="@color/theme_white_color"-->
<!-- android:textSize="@dimen/sp_14"-->
<!-- android:gravity="center"-->
<!-- android:background="@drawable/manage_shape_add_btn_oval"/>-->
<!-- <FrameLayout-->
<!-- android:id="@+id/frameLayout"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:layout_marginTop="?attr/qmui_topbar_height" />-->
<!--</RelativeLayout>-->
...@@ -10,90 +10,127 @@ ...@@ -10,90 +10,127 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginTop="?attr/qmui_topbar_height"> android:layout_marginTop="?attr/qmui_topbar_height">
<com.qmuiteam.qmui.widget.QMUIEmptyView
android:id="@+id/emptyView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true" />
<com.scwang.smartrefresh.layout.SmartRefreshLayout <com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/refreshLayout" android:id="@+id/refreshLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:srlEnableLoadMore="false"> app:srlEnableLoadMore="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@color/theme_white_color">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_area" android:id="@+id/recycler_area"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:spanCount="1" /> app:spanCount="1" />
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
<com.qmuiteam.qmui.widget.QMUIEmptyView <LinearLayout
android:id="@+id/emptyView" android:id="@+id/ll_add_area_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:fitsSystemWindows="true" /> android:orientation="horizontal"
android:visibility="gone">
<EditText
android:id="@+id/ed_area_name"
android:layout_width="0dp"
android:layout_height="@dimen/dp_48"
android:layout_weight="1"
android:background="@null"
android:hint="請輸入打區域名稱"
android:maxLength="20"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10"
android:singleLine="true"
android:textColor="@color/normal_color"
android:textColorHint="@color/hint_color"
android:textSize="@dimen/sp_16"
android:visibility="visible"/>
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/btn_save_area"
android:layout_width="@dimen/dp_60"
android:layout_height="@dimen/dp_38"
android:layout_marginRight="@dimen/dp_10"
android:layout_marginLeft="@dimen/dp_10"
android:layout_gravity="right|center_vertical"
android:background="@color/theme_red_color"
android:text="保存"
android:textColor="@color/theme_white_color"
android:textSize="@dimen/sp_14"
app:qmui_backgroundColor="@color/theme_color"
app:qmui_radius="@dimen/dp_5" />
</LinearLayout>
</LinearLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</FrameLayout> </FrameLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_bottom_operat" android:id="@+id/ll_bottom_operat"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_40" android:layout_height="@dimen/dp_45"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:background="@color/theme_white_color"
android:orientation="horizontal" android:orientation="horizontal"
android:visibility="gone" android:paddingLeft="@dimen/dp_15"
android:weightSum="3"> android:paddingRight="@dimen/dp_15"
android:visibility="gone">
<com.qmuiteam.qmui.alpha.QMUIAlphaButton <CheckBox
android:id="@+id/btn_all_select" android:id="@+id/cb_all_select"
android:layout_width="@dimen/dp_0" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:background="@color/theme_color"
android:text="全選" android:text="全選"
android:textColor="@color/theme_white_color" android:textColor="@color/theme_black"
android:textSize="@dimen/sp_14" /> android:textSize="@dimen/sp_14" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/btn_anti_select"
android:layout_width="@dimen/dp_0"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_1"
android:layout_weight="1"
android:background="@color/theme_color"
android:text="反選"
android:textColor="@color/theme_white_color"
android:textSize="@dimen/sp_14" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_sure" android:id="@+id/btn_sure"
android:layout_width="@dimen/dp_0" android:layout_width="@dimen/dp_60"
android:layout_height="match_parent" android:layout_height="@dimen/dp_38"
android:layout_marginLeft="@dimen/dp_1" android:layout_gravity="right|center_vertical"
android:layout_weight="1"
android:background="@color/theme_red_color" android:background="@color/theme_red_color"
android:text="刪除" android:text="刪除"
android:textColor="@color/theme_white_color" android:textColor="@color/theme_white_color"
android:textSize="@dimen/sp_14" /> android:textSize="@dimen/sp_14"
app:qmui_backgroundColor="@color/theme_color"
app:qmui_radius="@dimen/dp_5" />
</LinearLayout> </LinearLayout>
<!-- <com.qmuiteam.qmui.alpha.QMUIAlphaTextView--> <!-- <com.qmuiteam.qmui.alpha.QMUIAlphaTextView-->
<!-- android:id="@+id/tv_add_area"--> <!-- android:id="@+id/tv_add_area"-->
<!-- android:layout_width="@dimen/dp_65"--> <!-- android:layout_width="@dimen/dp_65"-->
<!-- android:layout_height="@dimen/dp_65"--> <!-- android:layout_height="@dimen/dp_65"-->
<!-- android:layout_gravity="bottom|right"--> <!-- android:layout_gravity="bottom|right"-->
<!-- android:layout_marginBottom="@dimen/dp_20"--> <!-- android:layout_marginBottom="@dimen/dp_20"-->
<!-- android:layout_marginRight="@dimen/dp_20"--> <!-- android:layout_marginRight="@dimen/dp_20"-->
<!-- android:background="@drawable/manage_shape_add_btn_oval"--> <!-- android:background="@drawable/manage_shape_add_btn_oval"-->
<!-- android:gravity="center"--> <!-- android:gravity="center"-->
<!-- android:text="+"--> <!-- android:text="+"-->
<!-- android:textColor="@color/theme_white_color"--> <!-- android:textColor="@color/theme_white_color"-->
<!-- android:textSize="@dimen/sp_14" />--> <!-- android:textSize="@dimen/sp_14" />-->
<com.qmuiteam.qmui.alpha.QMUIAlphaFrameLayout <com.qmuiteam.qmui.alpha.QMUIAlphaFrameLayout
android:id="@+id/fl_add_area" android:id="@+id/fl_add_area"
android:layout_width="@dimen/dp_65" android:layout_width="@dimen/dp_65"
android:layout_height="@dimen/dp_65" android:layout_height="@dimen/dp_65"
android:layout_gravity="bottom|right" android:layout_gravity="bottom|right"
android:layout_marginBottom="@dimen/dp_20" android:layout_marginBottom="@dimen/dp_45"
android:layout_marginRight="@dimen/dp_20" android:layout_marginRight="@dimen/dp_20"
android:background="@drawable/manage_shape_add_btn_oval"> android:background="@drawable/manage_shape_add_btn_oval">
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
...@@ -23,13 +23,13 @@ ...@@ -23,13 +23,13 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:srlEnableLoadMore="false" app:srlEnableLoadMore="false"
app:srlEnableRefresh="false"
android:layout_marginBottom="@dimen/dp_10"> android:layout_marginBottom="@dimen/dp_10">
<com.qmuiteam.qmui.widget.section.QMUIStickySectionLayout <com.qmuiteam.qmui.widget.section.QMUIStickySectionLayout
android:id="@+id/section_table" android:id="@+id/section_table"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content" />
android:layout_marginBottom="@dimen/dp_10"/>
</com.scwang.smartrefresh.layout.SmartRefreshLayout> </com.scwang.smartrefresh.layout.SmartRefreshLayout>
</FrameLayout> </FrameLayout>
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
android:layout_marginBottom="@dimen/dp_15" android:layout_marginBottom="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_20" android:layout_marginRight="@dimen/dp_20"
android:background="@drawable/manage_shape_add_btn_oval"> android:background="@drawable/manage_shape_add_btn_oval">
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -55,60 +56,53 @@ ...@@ -55,60 +56,53 @@
android:src="@drawable/add_white" /> android:src="@drawable/add_white" />
</com.qmuiteam.qmui.alpha.QMUIAlphaFrameLayout> </com.qmuiteam.qmui.alpha.QMUIAlphaFrameLayout>
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/tv_area"
android:layout_width="@dimen/dp_65"
android:layout_height="@dimen/dp_65"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_15"
android:layout_toLeftOf="@+id/fl_add_table"
android:background="@drawable/ui_shape_theme_oval"
android:gravity="center"
android:text="@string/manager_area"
android:textColor="@color/theme_white_color"
android:textSize="@dimen/sp_14" />
<LinearLayout <LinearLayout
android:id="@+id/ll_bottom_operat" android:id="@+id/ll_bottom_operat"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_40" android:layout_height="@dimen/dp_45"
android:weightSum="3"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:visibility="gone"> android:gravity="center_vertical"
android:paddingLeft="@dimen/dp_15"
android:paddingRight="@dimen/dp_15"
android:visibility="gone"
android:background="@color/theme_white_color">
<com.qmuiteam.qmui.alpha.QMUIAlphaButton <CheckBox
android:id="@+id/btn_all_select" android:id="@+id/cb_all_select"
android:layout_width="@dimen/dp_0" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:textColor="@color/theme_white_color"
android:textSize="@dimen/sp_14"
android:text="全選" android:text="全選"
android:background="@color/theme_color"/> android:textColor="@color/theme_black"
android:textSize="@dimen/sp_14" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/btn_anti_select" android:id="@+id/btn_modify_serviceCharge"
android:layout_width="@dimen/dp_0" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="@dimen/dp_38"
android:layout_weight="1" android:layout_gravity="right|center_vertical"
android:layout_marginLeft="@dimen/dp_1" android:background="@color/theme_red_color"
android:text="批量修改服務費"
android:textColor="@color/theme_white_color" android:textColor="@color/theme_white_color"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
android:background="@color/theme_color" android:layout_marginRight="@dimen/dp_10"
android:text="反選"/> android:paddingRight="@dimen/dp_8"
android:paddingLeft="@dimen/dp_8"
app:qmui_backgroundColor="@color/theme_color"
app:qmui_radius="@dimen/dp_5" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id="@+id/btn_sure" android:id="@+id/btn_delete"
android:layout_width="@dimen/dp_0" android:layout_width="@dimen/dp_60"
android:layout_height="match_parent" android:layout_height="@dimen/dp_38"
android:layout_weight="1" android:layout_gravity="right|center_vertical"
android:layout_marginLeft="@dimen/dp_1" android:background="@color/theme_red_color"
android:text="刪除"
android:textColor="@color/theme_white_color" android:textColor="@color/theme_white_color"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
android:background="@color/theme_red_color" app:qmui_backgroundColor="@color/theme_color"
android:text="刪除"/> app:qmui_radius="@dimen/dp_5" />
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <!--<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"-->
android:orientation="horizontal" <!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:orientation="vertical"-->
<!--&gt;-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_48" android:layout_height="@dimen/dp_48"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="@dimen/dp_10" android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10"> android:paddingRight="@dimen/dp_10">
<TextView <EditText
android:id="@+id/tv_name" android:id="@+id/ed_name"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:maxLength="20"
android:singleLine="true"
android:text="大廳"
android:textColor="@color/theme_black" android:textColor="@color/theme_black"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_16" />
android:text="大廳"/>
<CheckBox <CheckBox
android:id="@+id/cb_checked" android:id="@+id/cb_checked"
...@@ -22,13 +32,33 @@ ...@@ -22,13 +32,33 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_20" android:layout_marginRight="@dimen/dp_20"
android:visibility="gone" /> android:visibility="gone" />
<!-- <com.qmuiteam.qmui.alpha.QMUIAlphaTextView--> <!-- <com.qmuiteam.qmui.alpha.QMUIAlphaTextView-->
<!-- android:id="@+id/tv_edit"--> <!-- android:id="@+id/tv_edit"-->
<!-- android:layout_width="wrap_content"--> <!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"--> <!-- android:layout_height="wrap_content"-->
<!-- android:text="編輯"-->
<!-- android:textColor="@color/theme_color"--> <!-- android:textColor="@color/theme_color"-->
<!-- android:textSize="@dimen/sp_14"--> <!-- android:textSize="@dimen/sp_14" />-->
<!-- android:text="編輯"/>--> </LinearLayout>
<!-- <View-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="@dimen/dp_1"-->
<!-- android:background="@color/theme_hint_color"/>-->
</LinearLayout> <!-- <EditText-->
\ No newline at end of file <!-- android:id="@+id/ed_input_name"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="@dimen/dp_48"-->
<!-- android:paddingLeft="@dimen/dp_10"-->
<!-- android:paddingRight="@dimen/dp_10"-->
<!-- android:background="@null"-->
<!-- android:hint="請輸入打區域名稱"-->
<!-- android:maxLength="20"-->
<!-- android:singleLine="true"-->
<!-- android:textColor="@color/normal_color"-->
<!-- android:textColorHint="@color/hint_color"-->
<!-- android:textSize="@dimen/sp_16"-->
<!-- android:visibility="gone">-->
<!-- </EditText>-->
<!--</LinearLayout>-->
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <com.qmuiteam.qmui.layout.QMUIRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ll_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/theme_background_color">
<LinearLayout
android:layout_width="@dimen/dp_100"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/ui_selector_item_background"
android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
android:padding="@dimen/dp_10" android:background="@color/theme_white_color">
android:layout_margin="@dimen/dp_10">
<com.qmuiteam.qmui.alpha.QMUIAlphaRelativeLayout
android:id="@+id/rl_table"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView <TextView
android:id="@+id/tv_name" android:id="@+id/tv_table"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:text="Button"
android:textColor="#FF000000"
android:textSize="@dimen/dp_22" />
<TextView
android:id="@+id/tv_people"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_table"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_3"
android:text="" android:text=""
android:textColor="@color/theme_black" android:textColor="@color/theme_white_color"
android:textSize="@dimen/sp_16" /> android:textSize="@dimen/sp_13"
android:visibility="visible" />
<TextView <TextView
android:id="@+id/tv_service_fee" android:id="@+id/tv_service_fee"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_2" android:layout_marginTop="@dimen/dp_2"
android:layout_below="@+id/tv_people"
android:text="" android:text=""
android:textColor="@color/theme_text_pice_color" android:textColor="@color/theme_black"
android:textSize="@dimen/sp_16" /> android:textSize="@dimen/sp_13" />
<!-- <com.qmuiteam.qmui.alpha.QMUIAlphaButton-->
<!-- android:id="@+id/btn_showMain"-->
<!-- style="@style/ButtonBorderless"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="96dp"-->
<!-- android:layout_alignParentLeft="true"-->
<!-- android:layout_alignParentRight="true"-->
<!-- android:layout_alignParentBottom="true"-->
<!-- android:layout_marginLeft="0dp"-->
<!-- android:layout_marginTop="0dp"-->
<!-- android:text="Button"-->
<!-- android:textSize="@dimen/dp_16"-->
<!-- android:visibility="gone" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_vip"-->
<!-- android:layout_width="50dp"-->
<!-- android:layout_height="50dp"-->
<!-- android:layout_alignParentLeft="true"-->
<!-- android:layout_alignParentTop="true"-->
<!-- android:scaleType="fitXY"-->
<!-- android:src="@drawable/qmui_icon_tip_new"-->
<!-- android:visibility="gone" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_scan_flag"-->
<!-- android:layout_width="25dp"-->
<!-- android:layout_height="25dp"-->
<!-- android:layout_alignParentTop="true"-->
<!-- android:layout_alignParentRight="true"-->
<!-- android:text="S"-->
<!-- android:background="@color/orange_700"-->
<!-- android:textColor="@color/theme_white_color"-->
<!-- android:gravity="center"-->
<!-- android:visibility="gone"-->
<!-- android:textSize="@dimen/font_normal2" />-->
<CheckBox <CheckBox
android:id="@+id/cb_checked" android:id="@+id/cb_checked"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_2" android:layout_centerHorizontal="true"
android:visibility="gone" /> android:layout_below="@+id/tv_service_fee"
</LinearLayout> android:visibility="invisible" />
</FrameLayout> </com.qmuiteam.qmui.alpha.QMUIAlphaRelativeLayout>
<FrameLayout
android:id="@+id/fl_table_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:visibility="gone">
<com.gingersoft.gsa.cloud.ui.view.TriangleLabelView
android:id="@+id/tlv_table_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:backgroundColor="@color/theme_white_color"
app:corner="rightBottom"
app:primaryText="堂"
app:primaryTextColor="#249B65"
app:primaryTextSize="10sp" />
<TextView
android:id="@+id/tv_type_labe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
android:text="堂"
android:textColor="#249B65"
android:textSize="10sp"
android:padding="@dimen/dp_5"/>
</FrameLayout>
<FrameLayout
android:id="@+id/fl_add_table"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="+"
android:textColor="#ff3c3c3c"
android:textSize="31sp"/>
</FrameLayout>
</com.qmuiteam.qmui.layout.QMUIRelativeLayout>
...@@ -145,6 +145,14 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw ...@@ -145,6 +145,14 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
network.getCancelReason(requestBody) network.getCancelReason(requestBody)
} }
suspend fun getCancelReason(restaurantId: String, type: String) = withContext(Dispatchers.IO) {
val requestBody = FormBody.Builder()
.add("restaurantId", restaurantId)
.add("type", type)//取消原因類型,1食品取消,2,物流取消,3,訂單取消
.build()
network.getCancelReason(requestBody)
}
fun getBody(vararg pair: Pair1<String, String>): RequestBody { fun getBody(vararg pair: Pair1<String, String>): RequestBody {
val requestBody = FormBody.Builder() val requestBody = FormBody.Builder()
......
...@@ -10,12 +10,12 @@ data class CancelReason( ...@@ -10,12 +10,12 @@ data class CancelReason(
val content: String, val content: String,
val content2: String, val content2: String,
val content3: String, val content3: String,
val createTime: Long, val createTime: Int,
val id: Int, val id: Int,
val restaurantId: Int, val restaurantId: Int,
val sort: Int, val sort: Int,
val type: Int, val type: Int,
val uid: Int, val uid: Int,
val updateTime: Long val updateTime: Int
) )
} }
\ No newline at end of file
...@@ -102,6 +102,7 @@ class OtherOrderActivity : BaseActivity() { ...@@ -102,6 +102,7 @@ class OtherOrderActivity : BaseActivity() {
btnHeight = btn_open_or_close_info.height.toFloat() btnHeight = btn_open_or_close_info.height.toFloat()
} }
pageViewModel.getDeliveryInfo(this) pageViewModel.getDeliveryInfo(this)
pageViewModel.getDeliveryConfigDTO(this)
} }
/** /**
...@@ -256,14 +257,13 @@ class OtherOrderActivity : BaseActivity() { ...@@ -256,14 +257,13 @@ class OtherOrderActivity : BaseActivity() {
private fun initWebsocket() { private fun initWebsocket() {
//開啟websocket //開啟websocket
val intent = Intent(this, GetInfoUpdateService::class.java) val intent = Intent(this, GetInfoUpdateService::class.java)
startService(intent)
bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE) bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE)
} }
// override fun onDestroy() { override fun onDestroy() {
// super.onDestroy() super.onDestroy()
// unbindService(serviceConnection) unbindService(serviceConnection)
// } }
private var serviceConnection = object : ServiceConnection { private var serviceConnection = object : ServiceConnection {
override fun onServiceConnected(name: ComponentName, service: IBinder) { override fun onServiceConnected(name: ComponentName, service: IBinder) {
...@@ -274,12 +274,12 @@ class OtherOrderActivity : BaseActivity() { ...@@ -274,12 +274,12 @@ class OtherOrderActivity : BaseActivity() {
Log.e("message", "消息類型$type") Log.e("message", "消息類型$type")
if (type == 3 || type == 4 || type == 5 if (type == 3 || type == 4 || type == 5
|| type == 6 || type == 7) { || type == 6 || type == 7) {
// if (type == 6 || type == 7) { if (type == 6 || type == 7) {
//
// } else { } else {
// //播放提示音 //播放提示音
// initSoundPool() initSoundPool()
// } }
pageViewModel.refreshState.postValue(selectPosition) pageViewModel.refreshState.postValue(selectPosition)
} }
} }
...@@ -420,11 +420,6 @@ class OtherOrderActivity : BaseActivity() { ...@@ -420,11 +420,6 @@ class OtherOrderActivity : BaseActivity() {
startActivity(Intent(this, HistoryOrderActivity::class.java)) startActivity(Intent(this, HistoryOrderActivity::class.java))
pop!!.dismiss() pop!!.dismiss()
} }
view.findViewById<QMUIAlphaTextView>(R.id.tv_open_cash_box).setOnClickListener {
//開錢箱
pageViewModel.openCashBox()
pop!!.dismiss()
}
} else { } else {
pop!!.show(it) pop!!.show(it)
} }
......
...@@ -5,7 +5,6 @@ import android.util.Log ...@@ -5,7 +5,6 @@ import android.util.Log
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.Button
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
...@@ -19,6 +18,7 @@ import com.gingersoft.gsa.other_order_mode.ui.adapter.DeliveryListAdapter ...@@ -19,6 +18,7 @@ import com.gingersoft.gsa.other_order_mode.ui.adapter.DeliveryListAdapter
import com.gingersoft.gsa.other_order_mode.ui.base.BaseFragment import com.gingersoft.gsa.other_order_mode.ui.base.BaseFragment
import com.gingersoft.gsa.other_order_mode.util.InjectorUtil import com.gingersoft.gsa.other_order_mode.util.InjectorUtil
import kotlinx.android.synthetic.main.fragment_delivery_list.* import kotlinx.android.synthetic.main.fragment_delivery_list.*
import kotlin.math.max
class DeliveryFragment : BaseFragment() { class DeliveryFragment : BaseFragment() {
...@@ -30,21 +30,15 @@ class DeliveryFragment : BaseFragment() { ...@@ -30,21 +30,15 @@ class DeliveryFragment : BaseFragment() {
private lateinit var viewModel: DeliveryViewModel private lateinit var viewModel: DeliveryViewModel
private lateinit var contentView:View
private lateinit var addBtn: Button
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? { savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.fragment_delivery_list, container, false)
contentView = inflater.inflate(R.layout.fragment_delivery_list, container, false)
addBtn = contentView.findViewById(R.id.btn_default)
return contentView
} }
override fun onActivityCreated(savedInstanceState: Bundle?) { override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState) super.onActivityCreated(savedInstanceState)
viewModel = ViewModelProvider(activity?.viewModelStore!!, InjectorUtil.getDeliveryFactory())[DeliveryViewModel::class.java] viewModel = ViewModelProvider(activity?.viewModelStore!!, InjectorUtil.getDeliveryFactory())[DeliveryViewModel::class.java]
addBtn.text = "+添加配送方式" tv_add_delivery.setOnClickListener{
addBtn.setOnClickListener{
(activity as DeliverySettingActivity).editDelivery(null) (activity as DeliverySettingActivity).editDelivery(null)
} }
viewModel.otherInfo.observe(viewLifecycleOwner, Observer { it -> viewModel.otherInfo.observe(viewLifecycleOwner, Observer { it ->
...@@ -59,7 +53,7 @@ class DeliveryFragment : BaseFragment() { ...@@ -59,7 +53,7 @@ class DeliveryFragment : BaseFragment() {
deliveryListAdapter!!.setOnItemChildClickListener { adapter, view, position -> deliveryListAdapter!!.setOnItemChildClickListener { adapter, view, position ->
when (view.id) { when (view.id) {
R.id.iv_delete -> { R.id.iv_delete -> {
AppDialog().showWaringDialog(context, "是否確認刪除") { _, dialog -> AppDialog.showWaringDialog(context, "是否確認刪除") { _, dialog ->
showLoading() showLoading()
it.data.list[position].apply { it.data.list[position].apply {
viewModel.updateDeliveryConfig(distributionFeeMin.toString(), distributionFeeMax.toString(), distributionFee.toString(), deliveryCost.toString(), distributionType, type, desc, id, GsaCloudApplication.getRestaurantId(context), GsaCloudApplication.getMemberId(context), lackPrice.toString(), 1) { viewModel.updateDeliveryConfig(distributionFeeMin.toString(), distributionFeeMax.toString(), distributionFee.toString(), deliveryCost.toString(), distributionType, type, desc, id, GsaCloudApplication.getRestaurantId(context), GsaCloudApplication.getMemberId(context), lackPrice.toString(), 1) {
......
...@@ -39,7 +39,6 @@ class HistoryFragment : BaseFragment() { ...@@ -39,7 +39,6 @@ class HistoryFragment : BaseFragment() {
override fun onActivityCreated(savedInstanceState: Bundle?) { override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState) super.onActivityCreated(savedInstanceState)
viewModel = ViewModelProvider(activity!!.viewModelStore, InjectorUtil.getHistoryModelFactory())[HistoryOrderViewModel::class.java].apply { viewModel = ViewModelProvider(activity!!.viewModelStore, InjectorUtil.getHistoryModelFactory())[HistoryOrderViewModel::class.java].apply {
historyData.observe(viewLifecycleOwner, Observer{ it -> historyData.observe(viewLifecycleOwner, Observer{ it ->
cancelDialogForLoading() cancelDialogForLoading()
refresh_layout.finishRefresh() refresh_layout.finishRefresh()
...@@ -48,7 +47,7 @@ class HistoryFragment : BaseFragment() { ...@@ -48,7 +47,7 @@ class HistoryFragment : BaseFragment() {
it?.let { _ -> it?.let { _ ->
refresh_layout.setEnableLoadMore((it.data != null && it.data!!.size > 0)) refresh_layout.setEnableLoadMore((it.data != null && it.data!!.size > 0))
if (mHistoryOrderAdapter == null) { if (mHistoryOrderAdapter == null) {
mHistoryOrderAdapter = it.data.let { it1 -> context?.let { it2 -> HistoryOrderAdapter(status.value, it2, it1) } } mHistoryOrderAdapter = it.data.let { it1 -> context?.let { it2 -> HistoryOrderAdapter(it2, it1) } }
rv_other_order.layoutManager = LinearLayoutManager(context) rv_other_order.layoutManager = LinearLayoutManager(context)
rv_other_order.adapter = mHistoryOrderAdapter rv_other_order.adapter = mHistoryOrderAdapter
mHistoryOrderAdapter!!.setOnItemClickListenter { it -> mHistoryOrderAdapter!!.setOnItemClickListenter { it ->
...@@ -78,7 +77,6 @@ class HistoryFragment : BaseFragment() { ...@@ -78,7 +77,6 @@ class HistoryFragment : BaseFragment() {
} }
} else { } else {
mHistoryOrderAdapter!!.data = it.data mHistoryOrderAdapter!!.data = it.data
mHistoryOrderAdapter!!.stauts = status.value
mHistoryOrderAdapter!!.notifyDataSetChanged() mHistoryOrderAdapter!!.notifyDataSetChanged()
} }
} }
......
package com.gingersoft.gsa.other_order_mode.ui.fragment package com.gingersoft.gsa.other_order_mode.ui.fragment
import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.util.Log import android.util.Log
import android.view.LayoutInflater import android.view.LayoutInflater
...@@ -15,7 +14,6 @@ import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils ...@@ -15,7 +14,6 @@ import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
import com.gingersoft.gsa.cloud.ui.utils.AppDialog import com.gingersoft.gsa.cloud.ui.utils.AppDialog
import com.gingersoft.gsa.other_order_mode.R import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.model.viewModel.PageViewModel import com.gingersoft.gsa.other_order_mode.model.viewModel.PageViewModel
import com.gingersoft.gsa.other_order_mode.ui.activity.OrderDetailsActivity
import com.gingersoft.gsa.other_order_mode.ui.adapter.OtherOrdersAdapter import com.gingersoft.gsa.other_order_mode.ui.adapter.OtherOrdersAdapter
import com.gingersoft.gsa.other_order_mode.ui.base.BaseFragment import com.gingersoft.gsa.other_order_mode.ui.base.BaseFragment
import com.gingersoft.gsa.other_order_mode.util.InjectorUtil import com.gingersoft.gsa.other_order_mode.util.InjectorUtil
...@@ -37,8 +35,18 @@ class PlaceholderFragment : BaseFragment() { ...@@ -37,8 +35,18 @@ class PlaceholderFragment : BaseFragment() {
override fun onActivityCreated(savedInstanceState: Bundle?) { override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState) super.onActivityCreated(savedInstanceState)
pageViewModel = ViewModelProvider(activity?.viewModelStore!!, InjectorUtil.getWeatherModelFactory())[PageViewModel::class.java].apply { pageViewModel = ViewModelProvider(activity?.viewModelStore!!, InjectorUtil.getWeatherModelFactory())[PageViewModel::class.java].apply {
// 第一次進入獲取數據
// getOrderList(this, false)
// 綁定狀態,如果這個值發生變化 // 綁定狀態,如果這個值發生變化
refreshState.observe(viewLifecycleOwner, Observer { refreshState.observe(viewLifecycleOwner, Observer {
// 觸發刷新,判斷是否更新
// 並且type一致
//如果當前fragment的狀態中包含需要刷新的狀態,獲取數據
// if (PageViewModel.fragmentStatus[arguments?.getInt(INDEX)!!].contains(it.toString())) {
// page = 1
// getOrderList(this, false)
// }
Log.e("eee", "$it 當前:" + arguments?.getInt(INDEX))
if (arguments?.getInt(INDEX) == it) { if (arguments?.getInt(INDEX) == it) {
page = 1 page = 1
getOrderList(this, false) getOrderList(this, false)
...@@ -52,71 +60,63 @@ class PlaceholderFragment : BaseFragment() { ...@@ -52,71 +60,63 @@ class PlaceholderFragment : BaseFragment() {
adapter.setOnItemClickListenter { data -> adapter.setOnItemClickListenter { data ->
// 點擊查詢食品詳情 // 點擊查詢食品詳情
val intent = Intent(activity, OrderDetailsActivity::class.java) showLoading()
intent.putExtra("orderId", data.Id.toString()) pageViewModel.getShipanyAndOrderInfo(data.curStat, GsaCloudApplication.getRestaurantId(context).toString(), data.Id.toString()) { it1 ->
intent.putExtra("orderType", data.order_type) cancelDialogForLoading()
intent.putExtra("orderStatus", data.STATUS) //顯示彈窗
intent.putExtra("orderPayType", data.orderPayType) if (this@PlaceholderFragment.context != null && it1 != null) {
startActivity(intent) OtherOrderUtils.showOrderDetailsDialog(this@PlaceholderFragment.context!!, it1, data.STATUS, data.order_type) { view, _, dialog ->
when (view.id) {
R.id.btn_assign_shipping -> {
// showLoading() //修改訂單狀態
// pageViewModel.getShipanyAndOrderInfo(data.curStat, GsaCloudApplication.getRestaurantId(context).toString(), data.Id.toString()) { it1 -> pageViewModel.updateOrderStatus(this@PlaceholderFragment.context!!, data, it1) {
// cancelDialogForLoading() dialog.dismiss()
// //顯示彈窗 if (it) {
// if (this@PlaceholderFragment.context != null && it1 != null) { // 關閉彈窗,並刷新當前頁面
// OtherOrderUtils.showOrderDetailsDialog(this@PlaceholderFragment.context!!, it1, data.STATUS, data.order_type) { view, _, dialog -> refresh()
// when (view.id) { }
// R.id.btn_assign_shipping -> { }
// //修改訂單狀態 }
// pageViewModel.updateOrderStatus(this@PlaceholderFragment.context!!, data, it1) { R.id.btn_cancel_order -> {
// dialog.dismiss() //取消訂單,先判斷有沒有物流
// if (it) { if (it1.data!![0].isDelete == 0) {
// // 關閉彈窗,並刷新當前頁面 //第三方物流單
// refresh() //彈出彈窗詢問是否確認取消
// } AppDialog.showWaringDialog(context, "是否確認取消第三方派送?") { v, dialog ->
// } when (v.id) {
// } R.id.tv_dialog_confirm -> {
// R.id.btn_cancel_order -> { //取消物流
// //取消訂單,先判斷有沒有物流 showLoading()
// if (it1.data!![0].isDelete == 0) { pageViewModel.cancelLogistics(GsaCloudApplication.getRestaurantId(context).toString(), data.Id.toString()) {
// //第三方物流單 ToastUtils.show(context, it)
// //彈出彈窗詢問是否確認取消 cancelDialogForLoading()
// AppDialog.showWaringDialog(context, "是否確認取消第三方派送?") { v, dialog -> refresh()//刷新當前頁面
// when (v.id) { }
// R.id.tv_dialog_confirm -> { dialog.dismiss()
// //取消物流 }
// showLoading() R.id.tv_dialog_cancel -> dialog.dismiss()
// pageViewModel.cancelLogistics(GsaCloudApplication.getRestaurantId(context).toString(), data.Id.toString()) { }
// ToastUtils.show(context, it) }
// cancelDialogForLoading() } else {
// refresh()//刷新當前頁面 //本店配送的單
// } pageViewModel.cancelOrder(context!!, data.Id.toString()) {
// dialog.dismiss() ToastUtils.show(context, if (it) {
// } "取消訂單成功"
// R.id.tv_dialog_cancel -> dialog.dismiss() } else {
// } "取消訂單失敗"
// } })
// } else { cancelDialogForLoading()
// //本店配送的單 refresh()//刷新當前頁面
// pageViewModel.cancelOrder(context!!, data.Id.toString()) { }
// ToastUtils.show(context, if (it) { }
// "取消訂單成功" dialog.dismiss()
// } else { }
// "取消訂單失敗" }
// }) }
// cancelDialogForLoading() } else {
// refresh()//刷新當前頁面 ToastUtils.show(context, "獲取訂單詳情失敗")
// } }
// } }
// dialog.dismiss()
// }
// }
// }
// } else {
// ToastUtils.show(context, "獲取訂單詳情失敗")
// }
// }
} }
rv_other_order.adapter = adapter rv_other_order.adapter = adapter
...@@ -136,6 +136,7 @@ class PlaceholderFragment : BaseFragment() { ...@@ -136,6 +136,7 @@ class PlaceholderFragment : BaseFragment() {
refresh() refresh()
//重新拉取一遍送貨員和第三方派送信息 //重新拉取一遍送貨員和第三方派送信息
pageViewModel.getDeliveryInfo(context!!) pageViewModel.getDeliveryInfo(context!!)
pageViewModel.getDeliveryConfigDTO(context!!)
} }
refresh_layout.setOnLoadMoreListener { refresh_layout.setOnLoadMoreListener {
page++ page++
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke
android:width="@dimen/dp_1"
android:color="@color/black" />
</shape>
\ No newline at end of file
...@@ -10,5 +10,12 @@ ...@@ -10,5 +10,12 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
<include layout="@layout/layout_default" /> <com.qmuiteam.qmui.layout.QMUIButton
android:id="@+id/tv_add_delivery"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_border_bg"
android:text="添加配送方式"
android:padding="@dimen/dp_10"
android:textColor="@color/theme_color" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
<ImageView <ImageView
android:id="@+id/iv_edit" android:id="@+id/iv_edit"
android:layout_width="@dimen/dp_30" android:layout_width="wrap_content"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginRight="@dimen/dp_10" android:layout_marginRight="@dimen/dp_10"
android:gravity="center" android:gravity="center"
...@@ -169,15 +169,15 @@ ...@@ -169,15 +169,15 @@
app:layout_constraintRight_toLeftOf="@id/iv_delete" app:layout_constraintRight_toLeftOf="@id/iv_delete"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<com.qmuiteam.qmui.alpha.QMUIAlphaImageButton <ImageView
android:id="@+id/iv_delete" android:id="@+id/iv_delete"
android:layout_width="@dimen/dp_30" android:layout_width="wrap_content"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginRight="@dimen/dp_10" android:layout_marginRight="@dimen/dp_10"
android:gravity="center" android:gravity="center"
android:paddingLeft="@dimen/dp_5" android:paddingLeft="@dimen/dp_5"
android:paddingRight="@dimen/dp_5" android:paddingRight="@dimen/dp_5"
android:src="@drawable/ic_delete" android:src="@drawable/ic_delete_bill_method"
android:text="刪除" android:text="刪除"
android:textColor="@color/theme_333_color" android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_12" android:textSize="@dimen/dp_12"
......
...@@ -95,14 +95,4 @@ ...@@ -95,14 +95,4 @@
<style name="otherOrder_delivery_setting_layout_style"> <style name="otherOrder_delivery_setting_layout_style">
<item name="android:paddingRight">@dimen/dp_20</item> <item name="android:paddingRight">@dimen/dp_20</item>
</style> </style>
<style name="otherOrder_details_sixteen_text_Style">
<item name="android:textSize">@dimen/dp_16</item>
<item name="android:textColor">@color/theme_333_color</item>
<item name="android:textStyle">bold</item>
</style>
<style name="otherOrder_details_twelve_text_Style">
<item name="android:textSize">@dimen/dp_12</item>
<item name="android:textColor">@color/color_3c</item>
</style>
</resources> </resources>
...@@ -31,6 +31,13 @@ public class IpPrintMaker implements PrintDataMaker { ...@@ -31,6 +31,13 @@ public class IpPrintMaker implements PrintDataMaker {
this.bitmaps = new ArrayList<>(); this.bitmaps = new ArrayList<>();
this.bitmaps.add(bitmap); this.bitmaps.add(bitmap);
} }
public IpPrintMaker(Context context, int width, Bitmap bitmap) {
this.mContext = context;
this.width = width;
this.bitmaps = new ArrayList<>();
this.bitmaps.add(bitmap);
}
@Override @Override
public List<byte[]> getPrintData() { public List<byte[]> getPrintData() {
......
...@@ -59,7 +59,6 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis ...@@ -59,7 +59,6 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
public final static int PRINT_KITCHEN = 3;//送單,廚房單 public final static int PRINT_KITCHEN = 3;//送單,廚房單
public final static int PRINT_CLEAN_MACHINE = 4;//清機報表 public final static int PRINT_CLEAN_MACHINE = 4;//清機報表
public final static int PRINT_OTHER_ORDER = 5;//接單內容打印 public final static int PRINT_OTHER_ORDER = 5;//接單內容打印
public final static int PRINT_INSTRUCTION = 6;//開錢箱
private final static int SUNMI_PAPER_WIDTH = 360;//商米打印機紙張寬度 private final static int SUNMI_PAPER_WIDTH = 360;//商米打印機紙張寬度
private final static int N5_PAPER_WIDTH = 500;//N5打印機紙張寬度 private final static int N5_PAPER_WIDTH = 500;//N5打印機紙張寬度
...@@ -87,8 +86,6 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis ...@@ -87,8 +86,6 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
return new PrintCleanMachine(); return new PrintCleanMachine();
} else if (type == PRINT_OTHER_ORDER) { } else if (type == PRINT_OTHER_ORDER) {
return new PrintOtherOrder(); return new PrintOtherOrder();
} else if (type == PRINT_INSTRUCTION) {
return new PrintInstruction();
} }
return null; return null;
} }
...@@ -137,11 +134,6 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis ...@@ -137,11 +134,6 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
public abstract int getPrintCount(Context context); public abstract int getPrintCount(Context context);
public void print(List<PrinterDeviceBean> deviceBeans) { public void print(List<PrinterDeviceBean> deviceBeans) {
if (this instanceof PrintInstruction) {
//開錢箱
PrintExecutor executor = new PrintExecutor(getDefaultPrintInList(deviceBeans));
executor.doPrinterRequestAsync(new OpenCashBoxMaker());
} else {
listMap = getPrintBitmap(mContext); listMap = getPrintBitmap(mContext);
printSize = listMap.size(); printSize = listMap.size();
printCount = getPrintCount(mContext); printCount = getPrintCount(mContext);
...@@ -149,6 +141,13 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis ...@@ -149,6 +141,13 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
printListener.printFile(); printListener.printFile();
return; return;
} }
//當配置打印多張時執行
// int x = 2;
// for (int i = 0; i < x; i++) {
// for (Map.Entry<String, List<Bitmap>> entry : listMap.entrySet()) {
// merge2ResultMap(listMap, entry.getKey(), entry.getValue());
// }
// }
// 先不管有沒有默認打印位置 // 先不管有沒有默認打印位置
// 第一步先查看map中的key是不是空的"",有key就要獲取打印機列表,找到對應打印機打印。如果沒有找到打印機再去找默認打印機 // 第一步先查看map中的key是不是空的"",有key就要獲取打印機列表,找到對應打印機打印。如果沒有找到打印機再去找默認打印機
// 如果沒有key,則是走默認打印機流程 // 如果沒有key,則是走默認打印機流程
...@@ -162,7 +161,6 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis ...@@ -162,7 +161,6 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
} }
} }
} }
}
/** /**
...@@ -345,7 +343,6 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis ...@@ -345,7 +343,6 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
} }
private void defaultPrint(List<PrinterDeviceBean> printerDeviceBeans, List<Bitmap> bitmaps) { private void defaultPrint(List<PrinterDeviceBean> printerDeviceBeans, List<Bitmap> bitmaps) {
//獲取默認打印方式,本機、IP
String deftultPrint = (String) SPUtils.get(mContext, PrintConstans.DEFAULT_PRINT_METHOD, ""); String deftultPrint = (String) SPUtils.get(mContext, PrintConstans.DEFAULT_PRINT_METHOD, "");
if (deftultPrint.equals("")) { if (deftultPrint.equals("")) {
// 如果沒有默認打印位置,彈出彈窗讓用戶選擇是本機打印還是ip打印 // 如果沒有默認打印位置,彈出彈窗讓用戶選擇是本機打印還是ip打印
...@@ -404,30 +401,25 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis ...@@ -404,30 +401,25 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
}); });
} else if (deftultPrint.equals(PrintConstans.IP_PRINT)) { } else if (deftultPrint.equals(PrintConstans.IP_PRINT)) {
// 默認打印方式為ip打印,調用ip打印方法 // 默認打印方式為ip打印,調用ip打印方法
// 獲取默認ip打印機 // 獲取默認ip打印機
if (printerDeviceBeans != null && printerDeviceBeans.size() > 0) { if (printerDeviceBeans != null && printerDeviceBeans.size() > 0) {
ipDevicePrint(getDefaultPrintInList(printerDeviceBeans), bitmaps); //有默認打印機
} else { for (PrinterDeviceBean printerDeviceBean : printerDeviceBeans) {
if (printerDeviceBean.getStatus() == 2) {
//默認打印機
ipDevicePrint(printerDeviceBeans.get(0), bitmaps);
return;
}
}
//沒有默認打印機,彈出彈窗,讓用戶選擇ip打印機 //沒有默認打印機,彈出彈窗,讓用戶選擇ip打印機
showIpPrintDeviceList(printerDeviceBeans, bitmaps); showIpPrintDeviceList(printerDeviceBeans, bitmaps);
}
} else { } else {
//沒有打印機,讓用戶去添加 //沒有打印機,讓用戶去添加
setPrintState(PrintActivity.ADD_PRINT_DEVICE); setPrintState(PrintActivity.ADD_PRINT_DEVICE);
} }
} }
private PrinterDeviceBean getDefaultPrintInList(List<PrinterDeviceBean> printerDeviceBeans) {
for (PrinterDeviceBean printerDeviceBean : printerDeviceBeans) {
if (printerDeviceBean.getStatus() == 2) {
//默認打印機
return printerDeviceBean;
}
}
return null;
} }
private void showIpPrintDeviceList private void showIpPrintDeviceList
(List<PrinterDeviceBean> printerDeviceBeans, List<Bitmap> bitmaps) { (List<PrinterDeviceBean> printerDeviceBeans, List<Bitmap> bitmaps) {
if (printerDeviceBeans != null && printerDeviceBeans.size() > 0) { if (printerDeviceBeans != null && printerDeviceBeans.size() > 0) {
...@@ -473,26 +465,32 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis ...@@ -473,26 +465,32 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
public void ipDevicePrint(PrinterDeviceBean public void ipDevicePrint(PrinterDeviceBean
printerDeviceBean, List<Bitmap> bitmaps, PrintSocketHolder.OnStateChangedListener printerDeviceBean, List<Bitmap> bitmaps, PrintSocketHolder.OnStateChangedListener
stateChangedListener, PrintExecutor.OnPrintResultListener resultListener) { stateChangedListener, PrintExecutor.OnPrintResultListener resultListener) {
int paperType = printerDeviceBean.getType();//打印紙類型 1:58mm,2::80mm
int printWidth;//打印出來的內容寬度 int printWidth;//打印出來的內容寬度
if (printerDeviceBean.getPaperSpecification() != null) { if (paperType == 1) {
printWidth = Double.valueOf(printerDeviceBean.getPaperSpecification()).intValue(); paperType = PrinterWriter58mm.TYPE_58;
printWidth = 580 - 20;//兩邊留20的空隙
} else { } else {
printWidth = 540; paperType = PrinterWriter80mm.TYPE_80;
printWidth = 800 - 20;//兩邊留20的空隙
} }
PrintExecutor executor = new PrintExecutor(printerDeviceBean); PrintExecutor executor = new PrintExecutor(printerDeviceBean, paperType);
executor.setOnStateChangedListener(stateChangedListener); executor.setOnStateChangedListener(stateChangedListener);
executor.setOnPrintResultListener(resultListener); executor.setOnPrintResultListener(resultListener);
// List<Bitmap> zoomBitmaps = new ArrayList<>();
if (bitmaps != null) { if (bitmaps != null) {
for (int j = 0; j < printCount; j++) { for (int j = 0; j < printCount; j++) {
for (int i = 0; i < bitmaps.size(); i++) { for (int i = 0; i < bitmaps.size(); i++) {
// zoomBitmaps.add(ImageUtils.zoomDrawable(bitmaps.get(i), printWidth));
IpPrintMaker maker = new IpPrintMaker(mContext, printWidth, ImageUtils.zoomDrawable(bitmaps.get(i), printWidth)); IpPrintMaker maker = new IpPrintMaker(mContext, printWidth, ImageUtils.zoomDrawable(bitmaps.get(i), printWidth));
executor.doPrinterRequestAsync(maker); executor.doPrinterRequestAsync(maker);
} }
} }
} }
// IpPrintMaker maker = new IpPrintMaker(mContext, printWidth, zoomBitmaps);
// executor.doPrinterRequestAsync(maker);
} }
/** /**
* view轉bitmap * view轉bitmap
* *
......
package com.joe.print.mvp.print;
import android.content.Context;
import android.graphics.Bitmap;
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.print.PrintDataMaker;
import com.gingersoft.gsa.cloud.print.PrinterWriter;
import com.gingersoft.gsa.cloud.print.PrinterWriter58mm;
import com.gingersoft.gsa.cloud.print.PrinterWriter80mm;
import com.joe.print.R;
import java.util.ArrayList;
import java.util.List;
/**
* 打印測試
* 測試數據生成
*/
public class TestPrintDataMaker implements PrintDataMaker {
private Context context;
// private String qr;
private int width;
private int height;
public TestPrintDataMaker(Context context, int width, int height) {
this.context = context;
// this.qr = qr;
this.width = width;
this.height = height;
}
@Override
public List<byte[]> getPrintData(int type) {
ArrayList<byte[]> data = new ArrayList<>();
try {
PrinterWriter printer;
printer = type == PrinterWriter58mm.TYPE_58 ? new PrinterWriter58mm(height, width) : new PrinterWriter80mm(height, width);
printer.setAlignCenter();
data.add(printer.getDataAndReset());
ArrayList<byte[]> image = printer.getImageByte(context.getResources(), R.mipmap.ic_launcher);
data.addAll(image);
List<Bitmap> bitmaps = PrintUtils.getPrintBitmap(context, -1, width);//根據打印類型獲得不同的bitmap
if (bitmaps.size() <= 0) {
ToastUtils.show(context, "打印失敗");
return null;
}
for (int i = 0; i < bitmaps.size(); i++) {
ArrayList<byte[]> image1 = printer.getImageByte(bitmaps.get(i));
data.addAll(image1);//draw2PxPoint2(bitmaps.get(i)
printer.printLineFeed();
printer.printLineFeed();
printer.printLineFeed();
printer.printLineFeed();
printer.printLineFeed();
printer.feedPaperCutPartial();
}
data.add(printer.getDataAndReset());
// printer.setAlignLeft();
// printer.printLine();
// printer.printLineFeed();
//
// printer.printLineFeed();
// printer.setAlignCenter();
// printer.setEmphasizedOn();
// printer.setFontSize(1);
// printer.print("Selftest");
// printer.printLineFeed();
// printer.setFontSize(0);
// printer.setEmphasizedOff();
// printer.printLineFeed();
//
// printer.print("Gingersoft");
// printer.printLineFeed();
// printer.print("客服电话:××××××××");
// printer.printLineFeed();
//
// printer.setAlignLeft();
// printer.printLineFeed();
//
// printer.print("订单号:88888888888888888");
// printer.printLineFeed();
//
// printer.print("预计送达:" +
// new SimpleDateFormat("yyyy/MM/dd HH:mm", Locale.getDefault())
// .format(new Date(System.currentTimeMillis())));
// printer.printLineFeed();
//
// printer.setEmphasizedOn();
// printer.print("#8(已付款)");
// printer.printLineFeed();
// printer.print("××区××路×××大厦××楼×××室");
// printer.printLineFeed();
// printer.setEmphasizedOff();
// printer.printLineFeed();
// printer.print("备注:多加点辣椒,多加点香菜,多加点酸萝卜,多送点一次性手套");
// printer.printLineFeed();
//
// printer.printLine();
// printer.printLineFeed();
// printer.printLineFeed();
// printer.printLineFeed();
data.add(printer.getDataAndClose());
return data;
} catch (Exception e) {
return new ArrayList<>();
}
}
}
package com.joe.print.mvp.ui.activity;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.billy.cc.core.component.CC;
import com.billy.cc.core.component.CCResult;
import com.gingersoft.gsa.cloud.constans.PrintConstans;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.gingersoft.gsa.cloud.print.PrintExecutor;
import com.gingersoft.gsa.cloud.print.PrintSocketHolder;
import com.gingersoft.gsa.cloud.print.PrinterWriter58mm;
import com.gingersoft.gsa.cloud.print.PrinterWriter80mm;
import com.joe.print.R;
import com.joe.print.mvp.print.SendPrint;
import com.joe.print.mvp.print.TestPrintDataMaker;
import static com.billy.cc.core.component.CCUtil.EXTRA_KEY_CALL_ID;
/**
* Created by Wyh on 2020/1/7.
*/
public class IpPrintActivity extends Activity implements PrintSocketHolder.OnStateChangedListener, PrintExecutor.OnPrintResultListener, DialogInterface.OnDismissListener {
private Context mContext;
private PrintExecutor executor;
private SendPrint maker;
private String callId;
/**
* -
* 是否打印成功 true:成功
*/
private boolean printStatus = false;
private String ip;
private Integer port;
private int paperType = 1;//打印紙類型 1:58mm,2::80mm
private int printWidth = 560;//打印出來的內容寬度
/**
* -1:打印測試
* 0:上菜紙
* 1:印單
* 2:結賬單
* 3:廚房單
*/
private int type = -1;
private TextView mTvLoadingTip;
private Dialog mLoadingDialog;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
| WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH);
super.onCreate(savedInstanceState);
mContext = this;
getWindow().setBackgroundDrawable(null);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
initDialog();
initIntent();
callId = getIntent().getStringExtra(EXTRA_KEY_CALL_ID);
printOrder(this);
}
private void initDialog() {
try {
View view = LayoutInflater.from(mContext).inflate(R.layout.ui_dialog_loading, null);
mTvLoadingTip = view.findViewById(R.id.tv_loading_dialog_text);
mLoadingDialog = new Dialog(mContext, R.style.ui_loading_dialog);
mLoadingDialog.setCancelable(true);
mLoadingDialog.setCanceledOnTouchOutside(false);
Window window = mLoadingDialog.getWindow();
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
// window.getDecorView().setBackgroundResource(android.R.color.transparent);
mLoadingDialog.setContentView(view, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
mLoadingDialog.show();
mLoadingDialog.setOnDismissListener(dialog -> dismiss());
setLoadingText("加載中...");
} catch (Exception e) {
e.printStackTrace();
}
}
private void setLoadingText(String tip) {
if (mLoadingDialog != null && mLoadingDialog.isShowing()) {
mTvLoadingTip.setText(tip);
}
}
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
//點擊當前頁面任意地方自動關閉
finish();
return true;
}
private void initIntent() {
Intent intent = getIntent();
ip = intent.getStringExtra("ip");
port = intent.getIntExtra("port", 0);
paperType = intent.getIntExtra("paperType", 1);
type = intent.getIntExtra(PrintConstans.PRINT_TYPE, -1);
if (ip == null || ip.equals("")) {
ip = "192.168.1.217";
}
if (paperType == 1) {
paperType = PrinterWriter58mm.TYPE_58;
printWidth = 580 - 20;//兩邊留20的空隙
} else {
paperType = PrinterWriter80mm.TYPE_80;
printWidth = 800 - 20;//兩邊留20的空隙
}
}
public void printOrder(Context context) {
PrinterDeviceBean printerDeviceBean = new PrinterDeviceBean("", null, ip, port, type);
if (executor == null) {
executor = new PrintExecutor(printerDeviceBean, paperType);
executor.setOnStateChangedListener(this);
executor.setOnPrintResultListener(this);
}
if (maker == null) {
maker = new SendPrint(context, 255, printWidth, type);
}
executor.setIp(printerDeviceBean);
if (type == -1) {
executor.doPrinterRequestAsync(new TestPrintDataMaker(context, 380, 255));
} else {
executor.doPrinterRequestAsync(maker);
}
}
@Override
public void onResult(int errorCode, PrinterDeviceBean printerDeviceBean) {
String tip;
switch (errorCode) {
case PrintSocketHolder.ERROR_0:
tip = "打印成功";
printStatus = true;
setLoadingText(tip);
dismiss();
break;
case PrintSocketHolder.ERROR_1:
tip = "生成打印數據失敗";
printStatus = false;
setLoadingText(tip);
dismiss();
break;
case PrintSocketHolder.ERROR_2:
case PrintSocketHolder.ERROR_3:
tip = "連接打印機失敗";
printStatus = false;
setLoadingText(tip);
dismiss();
break;
case PrintSocketHolder.ERROR_4:
tip = "寫入測試頁面數據失敗";
setLoadingText(tip);
break;
case PrintSocketHolder.ERROR_5:
tip = "必要的參數不能為空";
setLoadingText(tip);
break;
}
}
@Override
public void onStateChanged(int state, PrinterDeviceBean printerDeviceBean) {
String tip = "打印中...";
switch (state) {
case PrintSocketHolder.STATE_0:
case PrintSocketHolder.STATE_1:
tip = "開始創建連接";
break;
case PrintSocketHolder.STATE_2:
tip = "創建連接成功,開始發送數據";
break;
case PrintSocketHolder.STATE_3:
tip = "開始寫入數據";
break;
case PrintSocketHolder.STATE_4:
tip = "關閉中";
break;
}
setLoadingText(tip);
}
private void dismiss() {
//延遲一秒
new Handler().postDelayed(() -> {
if (mLoadingDialog != null) {
mLoadingDialog.dismiss();
//判断是否为CC调用打开本页面
if (callId != null) {
CCResult result;
if (printStatus) {
result = CCResult.success();
} else {
result = CCResult.error("print error");
}
//为确保不管登录成功与否都会调用CC.sendCCResult,在onDestroy方法中调用
CC.sendCCResult(callId, result);
}
}
finish();
}, 1500);
}
@Override
public void onDismiss(DialogInterface dialog) {
finish();
}
@Override
protected void onDestroy() {
super.onDestroy();
if (executor != null)
executor.closeSocket();
}
}
...@@ -113,7 +113,7 @@ public abstract class QMUIStickySectionAdapter<H extends QMUISection.Model<H>, T ...@@ -113,7 +113,7 @@ public abstract class QMUIStickySectionAdapter<H extends QMUISection.Model<H>, T
* @param newData new section list * @param newData new section list
*/ */
protected void beforeDiffInSet(List<QMUISection<H, T>> oldData, List<QMUISection<H, T>> newData) { protected void beforeDiffInSet(List<QMUISection<H, T>> oldData, List<QMUISection<H, T>> newData) {
notifyDataSetChanged();
} }
/** /**
......
...@@ -382,6 +382,8 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont ...@@ -382,6 +382,8 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
openTableBean = new TableBean.DataBean(dataBean); openTableBean = new TableBean.DataBean(dataBean);
} }
OpenTableManage.getDefault().setPeopleNumber(dataBean.getSeatCount());
OrderBean orderBean = respose.getData(); OrderBean orderBean = respose.getData();
if (orderBean != null && respose.getData().getOrderDetails() != null) { if (orderBean != null && respose.getData().getOrderDetails() != null) {
if (respose.getData().getCreateTime() != null && openTableBean != null) { if (respose.getData().getCreateTime() != null && openTableBean != null) {
......
...@@ -93,7 +93,6 @@ public class StateTableFragment extends BaseFragment<StateTablePresenter> implem ...@@ -93,7 +93,6 @@ public class StateTableFragment extends BaseFragment<StateTablePresenter> implem
} else if(mContext instanceof OrderContentActivity){ } else if(mContext instanceof OrderContentActivity){
mOrderContentActivity = (OrderContentActivity) mContext; mOrderContentActivity = (OrderContentActivity) mContext;
} }
initRecycleScrollListener(); initRecycleScrollListener();
} }
......
...@@ -12,11 +12,9 @@ ...@@ -12,11 +12,9 @@
android:id="@+id/recycle_all_table" android:id="@+id/recycle_all_table"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/theme_background_color" android:background="@color/theme_background_color" />
android:overScrollMode="never" />
</com.scwang.smartrefresh.layout.SmartRefreshLayout> </com.scwang.smartrefresh.layout.SmartRefreshLayout>
<com.qmuiteam.qmui.widget.QMUIEmptyView <com.qmuiteam.qmui.widget.QMUIEmptyView
android:id="@+id/emptyView" android:id="@+id/emptyView"
android:layout_width="match_parent" android:layout_width="match_parent"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <com.qmuiteam.qmui.layout.QMUIRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ll_container" android:id="@+id/ll_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
android:layout_margin="@dimen/dp_2"> android:layout_margin="@dimen/dp_2"
android:background="@color/theme_white_color">
<com.qmuiteam.qmui.alpha.QMUIAlphaRelativeLayout <com.qmuiteam.qmui.alpha.QMUIAlphaRelativeLayout
android:id="@+id/rl_table" android:id="@+id/rl_table"
...@@ -36,11 +38,22 @@ ...@@ -36,11 +38,22 @@
android:visibility="gone"/> android:visibility="gone"/>
<TextView <TextView
android:id="@+id/tv_service_fee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_2"
android:layout_below="@+id/tv_people"
android:text=""
android:textColor="@color/theme_text_pice_color"
android:textSize="@dimen/sp_13" />
<TextView
android:id="@+id/tv_open_duration" android:id="@+id/tv_open_duration"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="30:00" android:text="30:00"
android:layout_below="@+id/tv_people" android:layout_below="@+id/tv_service_fee"
android:textSize="@dimen/sp_12" android:textSize="@dimen/sp_12"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:drawableLeft="@mipmap/ic_table_open_time" android:drawableLeft="@mipmap/ic_table_open_time"
...@@ -64,6 +77,34 @@ ...@@ -64,6 +77,34 @@
<!-- android:visibility="gone" />--> <!-- android:visibility="gone" />-->
</com.qmuiteam.qmui.alpha.QMUIAlphaRelativeLayout> </com.qmuiteam.qmui.alpha.QMUIAlphaRelativeLayout>
<FrameLayout
android:id="@+id/fl_table_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:visibility="gone">
<com.gingersoft.gsa.cloud.ui.view.TriangleLabelView
android:id="@+id/tlv_table_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:backgroundColor="@color/theme_white_color"
app:corner="rightBottom"
app:primaryText="堂"
app:primaryTextColor="#249B65"
app:primaryTextSize="10sp" />
<TextView
android:id="@+id/tv_type_labe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
android:text="堂"
android:textColor="#249B65"
android:textSize="10sp"
android:padding="@dimen/dp_5"/>
</FrameLayout>
<!-- <ImageView--> <!-- <ImageView-->
<!-- android:id="@+id/iv_vip"--> <!-- android:id="@+id/iv_vip"-->
<!-- android:layout_width="50dp"--> <!-- android:layout_width="50dp"-->
...@@ -86,4 +127,4 @@ ...@@ -86,4 +127,4 @@
<!-- android:gravity="center"--> <!-- android:gravity="center"-->
<!-- android:visibility="gone"--> <!-- android:visibility="gone"-->
<!-- android:textSize="@dimen/font_normal2" />--> <!-- android:textSize="@dimen/font_normal2" />-->
</LinearLayout> </com.qmuiteam.qmui.layout.QMUIRelativeLayout>
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