Commit 5a9abff9 by 宁斌

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	base-module/src/main/java/com/gingersoft/gsa/cloud/constans/HttpsConstans.java
parents f09f1d03 fa4aa8f8
...@@ -56,6 +56,6 @@ public class SwitchPrintAspect { ...@@ -56,6 +56,6 @@ public class SwitchPrintAspect {
dialog.dismiss(); dialog.dismiss();
}); });
} }
}.createDialogView().show(); }.show();
} }
} }
...@@ -4,6 +4,8 @@ import android.graphics.Color; ...@@ -4,6 +4,8 @@ import android.graphics.Color;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import java.util.List;
/** /**
* 作者:ELEGANT_BIN * 作者:ELEGANT_BIN
* 版本:1.6.0 * 版本:1.6.0
...@@ -18,7 +20,6 @@ public class PayMethod { ...@@ -18,7 +20,6 @@ public class PayMethod {
* sysTime : 1582865195628 * sysTime : 1582865195628
* data : [{"id":11,"payName":"服務員確認","createTime":"May 7, 2018 11:47:27 AM"},{"id":1019,"payName":"轉數快支付","remarks":"","createTime":"Jul 10, 2019 4:56:21 PM"},{"id":9,"payName":"微信","createTime":"Jun 29, 2018 4:34:26 PM"},{"id":10,"payName":"Apple pay","createTime":"Aug 9, 2018 3:59:05 PM"},{"id":1010,"payName":"YedPay支付宝"},{"id":6,"payName":"支付寶HK","createTime":"Sep 12, 2017 2:45:12 PM"},{"id":8,"payName":"支付寶","createTime":"Jan 5, 2018 10:55:06 AM"},{"id":1020,"payName":"PayMe","createTime":"Nov 29, 2019 6:07:56 PM"}] * data : [{"id":11,"payName":"服務員確認","createTime":"May 7, 2018 11:47:27 AM"},{"id":1019,"payName":"轉數快支付","remarks":"","createTime":"Jul 10, 2019 4:56:21 PM"},{"id":9,"payName":"微信","createTime":"Jun 29, 2018 4:34:26 PM"},{"id":10,"payName":"Apple pay","createTime":"Aug 9, 2018 3:59:05 PM"},{"id":1010,"payName":"YedPay支付宝"},{"id":6,"payName":"支付寶HK","createTime":"Sep 12, 2017 2:45:12 PM"},{"id":8,"payName":"支付寶","createTime":"Jan 5, 2018 10:55:06 AM"},{"id":1020,"payName":"PayMe","createTime":"Nov 29, 2019 6:07:56 PM"}]
*/ */
private int id; private int id;
private String payName; private String payName;
private String createTime; private String createTime;
...@@ -36,9 +37,22 @@ public class PayMethod { ...@@ -36,9 +37,22 @@ public class PayMethod {
private int payMoneyTextColor = Color.parseColor("#000000"); private int payMoneyTextColor = Color.parseColor("#000000");
private int payModeTextSelectColor = Color.parseColor("#000000"); private int payModeTextSelectColor = Color.parseColor("#000000");
private int payMoneyTextSelectColor = Color.parseColor("#000000"); private int payMoneyTextSelectColor = Color.parseColor("#000000");
private int payModeSize = 18; private int payModeSize = 14;
private int payMoneySize = 18; private int payMoneySize = 14;
public PayMethod(int id, String payName, String createTime, String remarks, String NAME, String NAME2, String NAME3, String PAYWAY) {
this.id = id;
this.payName = payName;
this.createTime = createTime;
this.remarks = remarks;
this.NAME = NAME;
this.NAME2 = NAME2;
this.NAME3 = NAME3;
this.PAYWAY = PAYWAY;
}
public PayMethod() {
}
public int getId() { public int getId() {
return id; return id;
...@@ -167,4 +181,5 @@ public class PayMethod { ...@@ -167,4 +181,5 @@ public class PayMethod {
public void setPayMoneySize(int payMoneySize) { public void setPayMoneySize(int payMoneySize) {
this.payMoneySize = payMoneySize; this.payMoneySize = payMoneySize;
} }
} }
...@@ -6,6 +6,7 @@ import android.content.DialogInterface; ...@@ -6,6 +6,7 @@ import android.content.DialogInterface;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.util.Log; import android.util.Log;
import android.util.SparseArray; import android.util.SparseArray;
...@@ -29,82 +30,122 @@ import com.gingersoft.gsa.cloud.base.R; ...@@ -29,82 +30,122 @@ import com.gingersoft.gsa.cloud.base.R;
* Created by Wyh on 2019/11/1. * Created by Wyh on 2019/11/1.
*/ */
public abstract class DialogUtils { public abstract class DialogUtils {
private Context mContext; // private Context mContext;
private static Dialog dialog; private static Dialog dialog;
private View view; private View view;
private int style = R.style.PhotoDialog; private int style = R.style.PhotoDialog;
private int mWidth = WindowManager.LayoutParams.WRAP_CONTENT; // private int mWidth = WindowManager.LayoutParams.WRAP_CONTENT;
private int mHeight = WindowManager.LayoutParams.WRAP_CONTENT; // private int mHeight = WindowManager.LayoutParams.WRAP_CONTENT;
private int mMaxHeight;
private ViewHepler viewHepler; private ViewHepler viewHepler;
public DialogUtils(Context mContext, int xmlLayout) { public DialogUtils(Context mContext, int xmlLayout) {
this.mContext = mContext;
view = LayoutInflater.from(mContext).inflate(xmlLayout, null); view = LayoutInflater.from(mContext).inflate(xmlLayout, null);
init(mContext);
} }
private void init(Context context) {
if (dialog != null) {
dialog.dismiss();
}
dialog = new Dialog(context);
viewHepler = getViewHepler(context);
initLayout(viewHepler, dialog);
dialog.setContentView(viewHepler.getContentView());
public DialogUtils(Context mContext, View view) { Window dialogWindow = dialog.getWindow();
this.mContext = mContext; if (dialogWindow != null) {
this.view = view; setGravity(Gravity.CENTER);
setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
//将对话框的大小按屏幕大小的百分比设置
WindowManager.LayoutParams p = dialogWindow.getAttributes(); // 获取对话框当前的参数值
p.height = WindowManager.LayoutParams.WRAP_CONTENT;
p.width = WindowManager.LayoutParams.WRAP_CONTENT;
dialogWindow.setAttributes(p);
}
dialog.setCanceledOnTouchOutside(true);
dialog.setCancelable(true);
} }
public DialogUtils setWidth(int width) { public DialogUtils setWidth(int width) {
mWidth = width; if (dialog != null) {
Window window = dialog.getWindow();
if(window != null) {
WindowManager.LayoutParams p = window.getAttributes(); // 获取对话框当前的参数值
p.width = width;
window.setAttributes(p);
}
}
return this; return this;
} }
public DialogUtils setHeight(int height) { public DialogUtils setHeight(int height) {
mHeight = height; if (dialog != null) {
Window window = dialog.getWindow();
if(window != null) {
WindowManager.LayoutParams p = window.getAttributes(); // 获取对话框当前的参数值
p.height = height;
window.setAttributes(p);
}
}
return this; return this;
} }
public DialogUtils setMaxHeight(int maxHeight) { public DialogUtils setBackgroundDrawable(Drawable drawable) {
mMaxHeight = maxHeight; if (dialog != null) {
Window window = dialog.getWindow();
if (window != null) {
window.setBackgroundDrawable(drawable);
window.getDecorView().setBackgroundResource(android.R.color.transparent);
}
}
return this; return this;
} }
public DialogUtils createDialogView() { public DialogUtils setBackgroundResource(int resid){
if(dialog != null) { if (dialog != null) {
dialog.dismiss(); Window window = dialog.getWindow();
} if (window != null) {
dialog = new Dialog(mContext); window.getDecorView().setBackgroundResource(resid);
viewHepler = getViewHepler(); }
initLayout(viewHepler, dialog);
dialog.setContentView(viewHepler.getContentView());
Window dialogWindow = dialog.getWindow();
// WindowManager.LayoutParams lp = dialogWindow.getAttributes();
dialogWindow.setGravity(Gravity.CENTER);
//将对话框的大小按屏幕大小的百分比设置
// WindowManager m = activity.getWindowManager();
// Display d = m.getDefaultDisplay(); // 获取屏幕宽、高用
WindowManager.LayoutParams p = dialogWindow.getAttributes(); // 获取对话框当前的参数值
Window window = dialog.getWindow();
if (window != null) {
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
window.getDecorView().setBackgroundResource(android.R.color.transparent);
} }
p.height = mHeight; return this;
p.width = mWidth; }
// WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); // public DialogUtils createDialogView() {
// DisplayMetrics metrics = new DisplayMetrics(); // Window dialogWindow = dialog.getWindow();
// wm.getDefaultDisplay().getMetrics(metrics); //// WindowManager.LayoutParams lp = dialogWindow.getAttributes();
// // dialogWindow.setGravity(Gravity.CENTER);
// if (metrics.heightPixels < mMaxHeight) { // //将对话框的大小按屏幕大小的百分比设置
// dialog.getWindow().setLayout(mWidth, mHeight); //// WindowManager m = activity.getWindowManager();
// } else { //// Display d = m.getDefaultDisplay(); // 获取屏幕宽、高用
// dialog.getWindow().setLayout(mWidth, mMaxHeight); // WindowManager.LayoutParams p = dialogWindow.getAttributes(); // 获取对话框当前的参数值
// Window window = dialog.getWindow();
// if (window != null) {
// window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
// window.getDecorView().setBackgroundResource(android.R.color.transparent);
// } // }
// p.height = mHeight;
dialogWindow.setAttributes(p); // p.width = mWidth;
// android Activity改成dialog样式后 怎设置点击空白处关闭窗体,点击窗体以外的地方关闭窗体 //
dialog.setCanceledOnTouchOutside(true); //
dialog.setCancelable(true); //// WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
// dialog.show(); //// DisplayMetrics metrics = new DisplayMetrics();
return this; //// wm.getDefaultDisplay().getMetrics(metrics);
} ////
//// if (metrics.heightPixels < mMaxHeight) {
//// dialog.getWindow().setLayout(mWidth, mHeight);
//// } else {
//// dialog.getWindow().setLayout(mWidth, mMaxHeight);
//// }
//
// dialogWindow.setAttributes(p);
//// android Activity改成dialog样式后 怎设置点击空白处关闭窗体,点击窗体以外的地方关闭窗体
// dialog.setCanceledOnTouchOutside(true);
// dialog.setCancelable(true);
//// dialog.show();
// return this;
// }
public Dialog getDialog() { public Dialog getDialog() {
...@@ -118,7 +159,7 @@ public abstract class DialogUtils { ...@@ -118,7 +159,7 @@ public abstract class DialogUtils {
} }
public DialogUtils setGravity(int gravity) { public DialogUtils setGravity(int gravity) {
if (dialog.getWindow() != null) { if (dialog != null && dialog.getWindow() != null) {
dialog.getWindow().setGravity(gravity); dialog.getWindow().setGravity(gravity);
} }
return this; return this;
...@@ -149,8 +190,8 @@ public abstract class DialogUtils { ...@@ -149,8 +190,8 @@ public abstract class DialogUtils {
public abstract void initLayout(ViewHepler hepler, Dialog dialog); public abstract void initLayout(ViewHepler hepler, Dialog dialog);
private ViewHepler getViewHepler() { private ViewHepler getViewHepler(Context context) {
return ViewHepler.get(mContext, view); return ViewHepler.get(context, view);
} }
......
...@@ -94,11 +94,13 @@ public class HttpsConstans { ...@@ -94,11 +94,13 @@ 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 = BuildConfig.DEBUG ? 2 : 1;
isFormal = (int) SPUtils.get(context, "isFormal", 1); isFormal = (int) SPUtils.get(context, "isFormal", 1);
if (!BuildConfig.DEBUG && !isSwitchServer) { // if (!isSwitchServer) {
isFormal = 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;
// ROOT_SERVER_ADDRESS_FORMAL = (isFormal == 1 ? HTTP_ADDRESS_URL_FORMAL : HTTP_ADDRESS_URL_HK) + PATH; // ROOT_SERVER_ADDRESS_FORMAL = (isFormal == 1 ? HTTP_ADDRESS_URL_FORMAL : HTTP_ADDRESS_URL_HK) + PATH;
...@@ -106,46 +108,46 @@ public class HttpsConstans { ...@@ -106,46 +108,46 @@ 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;
} }
......
...@@ -28,9 +28,10 @@ public class PrinterDeviceDaoUtils { ...@@ -28,9 +28,10 @@ public class PrinterDeviceDaoUtils {
/** /**
* 完成PrinterDeviceBean记录的插入,如果表未创建,先创建PrinterDeviceBean表 * 完成PrinterDeviceBean记录的插入,如果表未创建,先创建PrinterDeviceBean表
*
* @return * @return
*/ */
public boolean insertPrinterDeviceBean(PrinterDeviceBean printerDevice){ public boolean insertPrinterDeviceBean(PrinterDeviceBean printerDevice) {
boolean flag = false; boolean flag = false;
flag = mManager.getDaoSession().getPrinterDeviceBeanDao().insert(printerDevice) == -1 ? false : true; flag = mManager.getDaoSession().getPrinterDeviceBeanDao().insert(printerDevice) == -1 ? false : true;
Log.i(TAG, "insert printerDevice :" + flag + "-->" + printerDevice.toString()); Log.i(TAG, "insert printerDevice :" + flag + "-->" + printerDevice.toString());
...@@ -39,6 +40,7 @@ public class PrinterDeviceDaoUtils { ...@@ -39,6 +40,7 @@ public class PrinterDeviceDaoUtils {
/** /**
* 插入多条数据,在子线程操作 * 插入多条数据,在子线程操作
*
* @param printerDeviceList * @param printerDeviceList
* @return * @return
*/ */
...@@ -62,15 +64,16 @@ public class PrinterDeviceDaoUtils { ...@@ -62,15 +64,16 @@ public class PrinterDeviceDaoUtils {
/** /**
* 修改一条数据 * 修改一条数据
*
* @param printerDevice * @param printerDevice
* @return * @return
*/ */
public boolean updatePrinterDeviceBean(PrinterDeviceBean printerDevice){ public boolean updatePrinterDeviceBean(PrinterDeviceBean printerDevice) {
boolean flag = false; boolean flag = false;
try { try {
mManager.getDaoSession().update(printerDevice); mManager.getDaoSession().update(printerDevice);
flag = true; flag = true;
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return flag; return flag;
...@@ -78,16 +81,17 @@ public class PrinterDeviceDaoUtils { ...@@ -78,16 +81,17 @@ public class PrinterDeviceDaoUtils {
/** /**
* 删除单条记录 * 删除单条记录
*
* @param printerDevice * @param printerDevice
* @return * @return
*/ */
public boolean deletePrinterDeviceBean(PrinterDeviceBean printerDevice){ public boolean deletePrinterDeviceBean(PrinterDeviceBean printerDevice) {
boolean flag = false; boolean flag = false;
try { try {
//按照id删除 //按照id删除
mManager.getDaoSession().delete(printerDevice); mManager.getDaoSession().delete(printerDevice);
flag = true; flag = true;
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return flag; return flag;
...@@ -95,15 +99,16 @@ public class PrinterDeviceDaoUtils { ...@@ -95,15 +99,16 @@ public class PrinterDeviceDaoUtils {
/** /**
* 删除所有记录 * 删除所有记录
*
* @return * @return
*/ */
public boolean deleteAll(){ public boolean deleteAll() {
boolean flag = false; boolean flag = false;
try { try {
//按照id删除 //按照id删除
mManager.getDaoSession().deleteAll(PrinterDeviceBean.class); mManager.getDaoSession().deleteAll(PrinterDeviceBean.class);
flag = true; flag = true;
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return flag; return flag;
...@@ -111,36 +116,42 @@ public class PrinterDeviceDaoUtils { ...@@ -111,36 +116,42 @@ public class PrinterDeviceDaoUtils {
/** /**
* 查询所有记录 * 查询所有记录
*
* @return * @return
*/ */
public List<PrinterDeviceBean> queryAllPrinterDeviceBean(){ public List<PrinterDeviceBean> queryAllPrinterDeviceBean() {
return mManager.getDaoSession().loadAll(PrinterDeviceBean.class); return mManager.getDaoSession().loadAll(PrinterDeviceBean.class);
} }
/** /**
* 根据主键id查询记录 * 根据主键id查询记录
*
* @param key * @param key
* @return * @return
*/ */
public PrinterDeviceBean queryPrinterDeviceBeanById(long key){ public PrinterDeviceBean queryPrinterDeviceBeanById(long key) {
return mManager.getDaoSession().load(PrinterDeviceBean.class, key); return mManager.getDaoSession().load(PrinterDeviceBean.class, key);
} }
/** /**
* 使用native sql进行查询操作 * 使用native sql进行查询操作
*/ */
public List<PrinterDeviceBean> queryPrinterDeviceBeanByNativeSql(String sql, String[] conditions){ public List<PrinterDeviceBean> queryPrinterDeviceBeanByNativeSql(String sql, String[] conditions) {
return mManager.getDaoSession().queryRaw(PrinterDeviceBean.class, sql, conditions); return mManager.getDaoSession().queryRaw(PrinterDeviceBean.class, sql, conditions);
} }
/** /**
* 使用queryBuilder进行查询 * 使用queryBuilder进行查询
*
* @return * @return
*/ */
public List<PrinterDeviceBean> queryPrinterDeviceBeanByQueryBuilder(long PrinterDeviceBeanId){ public List<PrinterDeviceBean> queryPrinterDeviceBeanByQueryBuilder(long PrinterDeviceBeanId) {
QueryBuilder<PrinterDeviceBean> queryBuilder = mManager.getDaoSession().queryBuilder(PrinterDeviceBean.class); QueryBuilder<PrinterDeviceBean> queryBuilder = mManager.getDaoSession().queryBuilder(PrinterDeviceBean.class);
return queryBuilder.where(PrinterDeviceBeanDao.Properties.Id.eq(PrinterDeviceBeanId)).list(); return queryBuilder.where(PrinterDeviceBeanDao.Properties.Id.eq(PrinterDeviceBeanId)).list();
} }
public void closeConnection() {
mManager.closeConnection();
}
} }
...@@ -18,6 +18,7 @@ package com.gingersoft.gsa.cloud.print; ...@@ -18,6 +18,7 @@ package com.gingersoft.gsa.cloud.print;
import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothDevice;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.util.Log;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean; import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
...@@ -183,6 +184,7 @@ public class PrintExecutor { ...@@ -183,6 +184,7 @@ public class PrintExecutor {
protected Integer doInBackground(PrintDataMaker... makers) { protected Integer doInBackground(PrintDataMaker... makers) {
if (makers == null || makers.length < 1) if (makers == null || makers.length < 1)
return PrintSocketHolder.ERROR_0; return PrintSocketHolder.ERROR_0;
Log.e("eee", "個數:" + makers.length);
return doRequest(makers[0]); return doRequest(makers[0]);
} }
......
...@@ -481,6 +481,6 @@ public class PrinterUtils { ...@@ -481,6 +481,6 @@ public class PrinterUtils {
dialog.dismiss(); dialog.dismiss();
}); });
} }
}.createDialogView().show(); }.show();
} }
} }
...@@ -19,7 +19,7 @@ package com.gingersoft.gsa.cloud.print; ...@@ -19,7 +19,7 @@ package com.gingersoft.gsa.cloud.print;
import java.io.IOException; import java.io.IOException;
/** /**
* 纸宽58mm的打印机 * 打印机
*/ */
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class PrinterWriterExecutor extends PrinterWriter { public class PrinterWriterExecutor extends PrinterWriter {
......
package com.gingersoft.gsa.cloud.print.bean package com.gingersoft.gsa.cloud.print.bean
import java.io.Serializable
class OrderDetails { class OrderDetails {
/** /**
...@@ -12,7 +14,7 @@ class OrderDetails { ...@@ -12,7 +14,7 @@ class OrderDetails {
var sysTime: Long = 0 var sysTime: Long = 0
var data: List<DataBean>? = null var data: List<DataBean>? = null
class DataBean { class DataBean : Serializable {
/** /**
* Order_ID : 50349 * Order_ID : 50349
* NUMBER : 1 * NUMBER : 1
...@@ -89,7 +91,7 @@ class OrderDetails { ...@@ -89,7 +91,7 @@ class OrderDetails {
// * * Order Cancelled After Collection - 訂單已取消 - 取餐后 9 // * * Order Cancelled After Collection - 訂單已取消 - 取餐后 9
// * * Order Assigned To Another Delivery Man - 已指派另一位配送員 10 // * * Order Assigned To Another Delivery Man - 已指派另一位配送員 10
class PRODUCTNAMEBean { class PRODUCTNAMEBean : Serializable{
/** /**
* odsId : 1654481 * odsId : 1654481
* PRICE : 760.0 * PRICE : 760.0
...@@ -106,7 +108,7 @@ class OrderDetails { ...@@ -106,7 +108,7 @@ class OrderDetails {
var child: List<ChildBeanX>? = null var child: List<ChildBeanX>? = null
var printseting: String? = null var printseting: String? = null
class ChildBeanX { class ChildBeanX : Serializable{
/** /**
* odsId : 1654482 * odsId : 1654482
* PRICE : 0.0 * PRICE : 0.0
...@@ -123,7 +125,7 @@ class OrderDetails { ...@@ -123,7 +125,7 @@ class OrderDetails {
var child: List<ChildBean>? = null var child: List<ChildBean>? = null
var printseting: String? = null var printseting: String? = null
class ChildBean { class ChildBean : Serializable{
/** /**
* odsId : 1654488 * odsId : 1654488
* PRICE : 0.0 * PRICE : 0.0
...@@ -141,6 +143,6 @@ class OrderDetails { ...@@ -141,6 +143,6 @@ class OrderDetails {
} }
} }
data class CouponBean(val couponName: String, val discount_amount: Float) data class CouponBean(val couponName: String, val discount_amount: Float) : Serializable
} }
} }
\ No newline at end of file
package com.gingersoft.gsa.cloud.table.mvp.ui.adapter; package com.gingersoft.gsa.cloud.ui.adapter;
import android.widget.TextView; import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder; import com.chad.library.adapter.base.BaseViewHolder;
import com.gingersoft.gsa.cloud.table.R; import com.gingersoft.gsa.cloud.base.R;
import com.gingersoft.gsa.cloud.base.common.bean.PayMethod; import com.gingersoft.gsa.cloud.base.common.bean.PayMethod;
import com.qmuiteam.qmui.alpha.QMUIAlphaTextView;
import java.util.List; import java.util.List;
import androidx.annotation.Nullable;
/** /**
* Created by Wyh on 2020/1/17. * Created by Wyh on 2020/1/17.
*/ */
...@@ -22,7 +21,7 @@ public class BillMethodAdapter extends BaseQuickAdapter<PayMethod, BaseViewHolde ...@@ -22,7 +21,7 @@ public class BillMethodAdapter extends BaseQuickAdapter<PayMethod, BaseViewHolde
@Override @Override
protected void convert(BaseViewHolder helper, PayMethod item) { protected void convert(BaseViewHolder helper, PayMethod item) {
TextView tv_bill_method_name = helper.getView(R.id.tv_bill_method_name); QMUIAlphaTextView tv_bill_method_name = helper.getView(R.id.tv_bill_method_name);
tv_bill_method_name.setText(item.getPayName()); tv_bill_method_name.setText(item.getPayName());
tv_bill_method_name.setTextSize(item.getPayModeSize()); tv_bill_method_name.setTextSize(item.getPayModeSize());
tv_bill_method_name.setTextColor(item.getPayModeTextColor()); tv_bill_method_name.setTextColor(item.getPayModeTextColor());
......
package com.gingersoft.gsa.cloud.table.mvp.ui.adapter; package com.gingersoft.gsa.cloud.ui.adapter;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
...@@ -6,7 +6,7 @@ import android.widget.TextView; ...@@ -6,7 +6,7 @@ import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder; import com.chad.library.adapter.base.BaseViewHolder;
import com.gingersoft.gsa.cloud.table.R; import com.gingersoft.gsa.cloud.base.R;
import com.gingersoft.gsa.cloud.base.common.bean.PayMethod; import com.gingersoft.gsa.cloud.base.common.bean.PayMethod;
import java.util.List; import java.util.List;
......
...@@ -36,7 +36,7 @@ public class AppDialog { ...@@ -36,7 +36,7 @@ public class AppDialog {
else else
hepler.getView(R.id.tv_dialog_cancel).setOnClickListener(v -> dialog.dismiss()); hepler.getView(R.id.tv_dialog_cancel).setOnClickListener(v -> dialog.dismiss());
} }
}.createDialogView().show(); }.show();
} }
......
package com.gingersoft.gsa.cloud.table.mvp.ui.widget; package com.gingersoft.gsa.cloud.ui.view;
import android.app.Activity; import android.app.Activity;
import android.app.Dialog; import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.text.Editable; import android.text.Editable;
import android.text.InputType;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -16,9 +14,8 @@ import android.widget.FrameLayout; ...@@ -16,9 +14,8 @@ import android.widget.FrameLayout;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import com.gingersoft.gsa.cloud.base.utils.log.LogUtil; import com.gingersoft.gsa.cloud.base.R;
import com.gingersoft.gsa.cloud.table.R; import com.gingersoft.gsa.cloud.base.R2;
import com.gingersoft.gsa.cloud.table.R2;
import com.jess.arms.utils.ArmsUtils; import com.jess.arms.utils.ArmsUtils;
import com.jess.arms.utils.ThirdViewUtil; import com.jess.arms.utils.ThirdViewUtil;
...@@ -35,7 +32,7 @@ import butterknife.OnClick; ...@@ -35,7 +32,7 @@ import butterknife.OnClick;
public class PayKeypadDialog { public class PayKeypadDialog {
private Activity mContext; private Context mContext;
private Dialog dialog; private Dialog dialog;
@BindView(R2.id.lLayout_bg) @BindView(R2.id.lLayout_bg)
...@@ -46,7 +43,7 @@ public class PayKeypadDialog { ...@@ -46,7 +43,7 @@ public class PayKeypadDialog {
@BindView(R2.id.ed_value) @BindView(R2.id.ed_value)
EditText ed_value; EditText ed_value;
public PayKeypadDialog(Activity context) { public PayKeypadDialog(Context context) {
this.mContext = context; this.mContext = context;
initView(); initView();
} }
......
<?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="#868686" />
</shape>
\ No newline at end of file
...@@ -3,12 +3,14 @@ ...@@ -3,12 +3,14 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center" android:gravity="center"
android:background="@drawable/shape_white_eight_corners_bg"
android:paddingTop="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10"
android:orientation="vertical"> android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_select_print" android:id="@+id/rv_select_print"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent" />
android:background="@drawable/shape_white_eight_corners_bg" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -221,7 +221,7 @@ ...@@ -221,7 +221,7 @@
android:background="@drawable/selector_input_number_keyboard" android:background="@drawable/selector_input_number_keyboard"
android:focusable="true" android:focusable="true"
android:tag="0" android:tag="0"
android:src="@mipmap/table_input_money_delete" android:src="@drawable/table_input_money_delete"
android:text="@string/Key_0" android:text="@string/Key_0"
android:textColor="@color/theme_white_color" android:textColor="@color/theme_white_color"
android:textSize="@dimen/sp_30" android:textSize="@dimen/sp_30"
...@@ -252,6 +252,6 @@ ...@@ -252,6 +252,6 @@
android:background="@drawable/selector_paybill_keyboard" android:background="@drawable/selector_paybill_keyboard"
android:focusable="true" android:focusable="true"
android:tag="98" android:tag="98"
android:src="@mipmap/table_input_money_sure" /> android:src="@drawable/table_input_money_sure" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android" <com.qmuiteam.qmui.alpha.QMUIAlphaTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tv_bill_method_name" android:id="@+id/tv_bill_method_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_4"
android:layout_marginBottom="@dimen/dp_4"
android:background="@drawable/shape_pay_item_normal"
android:ellipsize="marquee"
android:gravity="center" android:gravity="center"
android:maxLines="2"
android:paddingTop="@dimen/dp_10" android:paddingTop="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10" android:paddingBottom="@dimen/dp_10"
android:background="@drawable/selector_item_background"
android:text="現金結賬" android:text="現金結賬"
android:textColor="@color/black" android:textColor="@color/color_3c"
android:textSize="@dimen/dp_18" /> android:textSize="@dimen/dp_12" />
<?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"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_45"
android:background="#006666"
android:orientation="horizontal"
android:padding="@dimen/dp_5">
<LinearLayout
android:id="@+id/fl_order_content"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<FrameLayout
android:layout_width="@dimen/dp_40"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10">
<ImageView
android:id="@+id/iv_shop_car"
android:layout_width="@dimen/dp_32"
android:layout_height="@dimen/dp_32"
android:src="@drawable/ic_shoping_car" />
<Button
android:id="@+id/btn_order_count"
android:layout_width="@dimen/dp_16"
android:layout_height="@dimen/dp_16"
android:layout_gravity="end"
android:background="@drawable/ui_shape_red_oval"
android:gravity="center"
android:singleLine="true"
android:text="10"
android:textColor="@color/theme_white_color"
android:textSize="@dimen/dp_12"
android:visibility="invisible" />
</FrameLayout>
<TextView
android:id="@+id/tv_total_text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="left"
android:layout_marginLeft="@dimen/dp_5"
android:gravity="right|center_vertical"
android:paddingRight="@dimen/dp_10"
android:text="Total:"
android:textColor="@color/theme_white_color"
android:textSize="@dimen/sp_22"
android:textStyle="bold"
android:visibility="visible" />
</LinearLayout>
<TextView
android:id="@+id/tv_total"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="right"
android:layout_weight="1"
android:gravity="right|center_vertical"
android:paddingRight="@dimen/dp_8"
android:text="$1328.0"
android:textColor="@color/theme_white_color"
android:textSize="@dimen/sp_22"
android:textStyle="bold" />
</LinearLayout>
<com.gingersoft.gsa.cloud.ui.view.MaxHeightRecyclerView <com.gingersoft.gsa.cloud.ui.view.MaxHeightRecyclerView
android:id="@+id/rv_bill_money" android:id="@+id/rv_bill_money"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/theme_background_color"
android:divider="@null" android:divider="@null"
android:fadeScrollbars="false" android:fadeScrollbars="false"
android:orientation="vertical" android:orientation="vertical"
android:background="@color/theme_background_color" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:maxHeight="@dimen/dp_80" app:maxHeight="@dimen/dp_80" />
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/yellow" android:background="#FBF261"
android:padding="@dimen/dp_5"> android:padding="@dimen/dp_5">
<TextView <TextView
android:id="@+id/tv_difference_name" android:id="@+id/tv_difference_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="尚欠:" android:text="尚欠金額:"
android:textSize="@dimen/sp_20" android:textSize="@dimen/sp_20"
android:textStyle="bold" /> android:textStyle="bold" />
...@@ -37,52 +107,73 @@ ...@@ -37,52 +107,73 @@
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:textColor="@color/red" android:textColor="@color/red"
android:textSize="@dimen/sp_20" android:textSize="@dimen/sp_20"
android:textStyle="bold" /> android:textStyle="bold"
tools:text="-$140" />
</RelativeLayout> </RelativeLayout>
<com.gingersoft.gsa.cloud.ui.view.MaxHeightRecyclerView <com.gingersoft.gsa.cloud.ui.view.MaxHeightRecyclerView
android:id="@+id/rv_bill_method" android:id="@+id/rv_bill_method"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="@dimen/dp_120"
android:divider="@null" android:divider="@null"
android:fadeScrollbars="false" android:fadeScrollbars="false"
android:scrollbars="vertical"
android:orientation="vertical" android:orientation="vertical"
app:maxHeight="@dimen/dp_100" android:layout_marginTop="@dimen/dp_4"
android:layout_marginLeft="@dimen/dp_4"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="4"/> app:maxHeight="@dimen/dp_120"
app:spanCount="4" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="@dimen/dp_42"
android:padding="@dimen/dp_1" android:orientation="horizontal"
android:orientation="horizontal"> android:padding="@dimen/dp_1">
<com.qmuiteam.qmui.alpha.QMUIAlphaButton <LinearLayout
android:id="@+id/btn_keypad" android:id="@+id/layout_keypad"
android:layout_width="@dimen/dp_100" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"
android:background="#2F6666" android:background="#2F6666"
android:text="Keypad" android:gravity="center"
android:textColor="@color/theme_white_color"/> android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_keyboard" />
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_4"
android:text="Keypad"
android:textColor="@color/theme_white_color" />
</LinearLayout>
<com.qmuiteam.qmui.alpha.QMUIAlphaButton <com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_exact" android:id="@+id/btn_exact"
android:layout_width="@dimen/dp_100" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#315FC5"
android:layout_marginLeft="@dimen/dp_1" android:layout_marginLeft="@dimen/dp_1"
android:layout_weight="1"
android:background="#315FC5"
android:gravity="center"
android:text="Exact" android:text="Exact"
android:textColor="@color/theme_white_color"/> android:textColor="@color/theme_white_color" />
<com.qmuiteam.qmui.alpha.QMUIAlphaButton <com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_sure_pay" android:id="@+id/btn_sure_pay"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_marginLeft="@dimen/dp_1"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_1"
android:layout_weight="1.2"
android:background="@color/Grass_green" android:background="@color/Grass_green"
android:gravity="center"
android:text="確認" android:text="確認"
android:textColor="@color/theme_white_color"/> android:textColor="@color/theme_white_color" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
<?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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/lLayout_bg" android:id="@+id/lLayout_bg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<color name="theme_color">#398BED</color> <color name="theme_color">#398BED</color>
<color name="transparent_sixty_theme_color">#99398BED</color> <color name="transparent_sixty_theme_color">#99398BED</color>
<color name="discount_red">#E74E40</color>
<color name="normal_color">#333333</color> <color name="normal_color">#333333</color>
<!-- 統一頁面背景色--> <!-- 統一頁面背景色-->
......
<resources> <resources>
<string name="base_app_name">public-base</string> <string name="base_app_name">public-base</string>
<string name="base_loading">加載中...</string>
<string name="ui_loading">加載中...</string>
<string name="currency_unit">$</string>
<string name="Key_0">0</string> <string name="Key_0">0</string>
<string name="Key_00">00</string> <string name="Key_00">00</string>
<string name="Key_1">1</string> <string name="Key_1">1</string>
...@@ -16,7 +12,10 @@ ...@@ -16,7 +12,10 @@
<string name="Key_7">7</string> <string name="Key_7">7</string>
<string name="Key_8">8</string> <string name="Key_8">8</string>
<string name="Key_9">9</string> <string name="Key_9">9</string>
<string name="Key_100">100</string>
<string name="Key_200">200</string>
<string name="Key_500">500</string>
<string name="Key_1000">1000</string>
<string name="Key_add_5">+5</string> <string name="Key_add_5">+5</string>
<string name="Key_add_10">+10</string> <string name="Key_add_10">+10</string>
<string name="Key_add_20">+20</string> <string name="Key_add_20">+20</string>
...@@ -26,7 +25,12 @@ ...@@ -26,7 +25,12 @@
<string name="Key_clear">clr</string> <string name="Key_clear">clr</string>
<string name="Key_s">numkey</string> <string name="Key_s">numkey</string>
<string name="btnOK">OK</string> <string name="btnOK">OK</string>
<string name="input_pay_money">請輸入支付金額</string>
<string name="base_loading">加載中...</string>
<string name="ui_loading">加載中...</string>
<string name="currency_unit">$</string>
<string name="loading">加載中...</string> <string name="loading">加載中...</string>
<string name="meal_return">返回</string> <string name="meal_return">返回</string>
......
...@@ -269,6 +269,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter ...@@ -269,6 +269,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
.categories(xData) .categories(xData)
.yAxisLineWidth(0.5f) .yAxisLineWidth(0.5f)
.xAxisLineWidth(0.5f) .xAxisLineWidth(0.5f)
.yAxisAllowDecimals(false)
.yAxisTickInterval(yAxisTickInterval) .yAxisTickInterval(yAxisTickInterval)
.gridLineColor("#8CA0B3") .gridLineColor("#8CA0B3")
.yAxisMin(0f) .yAxisMin(0f)
......
...@@ -307,6 +307,7 @@ public class MainTopFragment extends BaseFragment<MainTopPresenter> implements M ...@@ -307,6 +307,7 @@ public class MainTopFragment extends BaseFragment<MainTopPresenter> implements M
.yAxisLineWidth(0.5f) .yAxisLineWidth(0.5f)
.xAxisLineWidth(0.5f) .xAxisLineWidth(0.5f)
.xAxisTickInterval(4) .xAxisTickInterval(4)
.yAxisAllowDecimals(false)
.yAxisTickInterval(yAxisTickInterval) .yAxisTickInterval(yAxisTickInterval)
.markerRadius(0f) .markerRadius(0f)
.yAxisMin(0f) .yAxisMin(0f)
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
android:value="ConfigModule" /> android:value="ConfigModule" />
<activity android:name=".ui.activity.DeliverySettingActivity"/> <activity android:name=".ui.activity.DeliverySettingActivity"/>
<activity android:name=".ui.activity.OrderDetailsActivity"/> <activity android:name=".ui.activity.OrderDetailsActivity"/>
<activity android:name=".ui.activity.PayActivity"/>
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -77,7 +77,7 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw ...@@ -77,7 +77,7 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
suspend fun gsUpdateOrderStatus(orderId: String, status: Int, orderType: Int, type: Int, sendDate: String?, suspend fun gsUpdateOrderStatus(orderId: String, status: Int, orderType: Int, type: Int, sendDate: String?,
sender: String, sendmobile: String, reasonId: String, reasonDesc: String, sender: String, sendmobile: String, reasonId: String, reasonDesc: String,
confirmationType: Int, orderFrom: Int) = withContext(Dispatchers.IO) { confirmationType: Int, orderFrom: Int,payTypeId:Int = 0) = withContext(Dispatchers.IO) {
val requestBody = FormBody.Builder() val requestBody = FormBody.Builder()
.add("orderId", orderId)//訂單id .add("orderId", orderId)//訂單id
.add("status", status.toString())//订单状态#0:未支付;1:待確認(已支付, 待餐廳確認);2:制作中(餐廳确認);3:派送中;4:确認收貨(完成);5:是否評論;6:取消; .add("status", status.toString())//订单状态#0:未支付;1:待確認(已支付, 待餐廳確認);2:制作中(餐廳确認);3:派送中;4:确認收貨(完成);5:是否評論;6:取消;
...@@ -88,6 +88,7 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw ...@@ -88,6 +88,7 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
.add("sendmobile", sendmobile)//送餐員電話 .add("sendmobile", sendmobile)//送餐員電話
.add("reasonId", reasonId)//原因id .add("reasonId", reasonId)//原因id
.add("reasonDesc", reasonDesc)//原因描敘 .add("reasonDesc", reasonDesc)//原因描敘
.add("payTypeId", payTypeId.toString())
.add("confirmationType", confirmationType.toString())//接單類型,1 手動接單 2,自動接單 .add("confirmationType", confirmationType.toString())//接單類型,1 手動接單 2,自動接單
.add("orderFrom", orderFrom.toString())//订单来源#1:ios;2:安卓;3:gspos;4:web;5:第三方POS A;6:第三方POS B; .add("orderFrom", orderFrom.toString())//订单来源#1:ios;2:安卓;3:gspos;4:web;5:第三方POS A;6:第三方POS B;
.build() .build()
...@@ -145,6 +146,13 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw ...@@ -145,6 +146,13 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
network.getCancelReason(requestBody) network.getCancelReason(requestBody)
} }
suspend fun getPayMethod(orderId: String) = withContext(Dispatchers.IO) {
val requestBody = FormBody.Builder()
.add("orderId", orderId)
.build()
network.getPayMethod(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()
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
class BillBean(var name: String = "", var amount: Double = 0.0, var isRed: Int = 0)
//isRed0默認顏色黑色,1為紅色
package com.gingersoft.gsa.other_order_mode.data.model.bean;
import com.gingersoft.gsa.cloud.base.common.bean.PayMethod;
import java.util.ArrayList;
import java.util.List;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2018/7/10
* 修订历史:2018/7/10
* 描述:
*/
public class PayTypeInfo {
/**
* code : 1
* data : {"id":15558,"amount":0.05,"remain":161457,"status":0,"orderType":2,"payType":[{"id":6,"payName":"支付宝HK","isdefault":1,"remarks":null},{"id":11,"payName":"服务员确认","isdefault":0,"remarks":null},{"id":5,"payName":"TNG","isdefault":0,"remarks":null},{"id":8,"payName":"支付宝","isdefault":0,"remarks":null},{"id":9,"payName":"微信","isdefault":0,"remarks":null}],"restaurantId":26,"restaurantName":"Gingersoft"}
* errorMsg : 成功
* page : null
*/
private String code;
private DataBean data;
private String errorMsg;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public DataBean getData() {
return data;
}
public void setData(DataBean data) {
this.data = data;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
public static class DataBean {
/**
* id : 15558
* amount : 0.05
* remain : 161457
* status : 0
* orderType : 2
* payType : [{"id":6,"payName":"支付宝HK","isdefault":1,"remarks":null},{"id":11,"payName":"服务员确认","isdefault":0,"remarks":null},{"id":5,"payName":"TNG","isdefault":0,"remarks":null},{"id":8,"payName":"支付宝","isdefault":0,"remarks":null},{"id":9,"payName":"微信","isdefault":0,"remarks":null}]
* restaurantId : 26
* restaurantName : Gingersoft
*/
private int id;
private double amount;
private int remain;
private String appleToken;
private int status;
private int orderType;
private int restaurantId;
private String restaurantName;
private List<PayTypeBean> payType;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public double getAmount() {
return amount;
}
public void setAmount(double amount) {
this.amount = amount;
}
public int getRemain() {
return remain;
}
public void setRemain(int remain) {
this.remain = remain;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public int getOrderType() {
return orderType;
}
public void setOrderType(int orderType) {
this.orderType = orderType;
}
public int getRestaurantId() {
return restaurantId;
}
public void setRestaurantId(int restaurantId) {
this.restaurantId = restaurantId;
}
public String getRestaurantName() {
return restaurantName;
}
public void setRestaurantName(String restaurantName) {
this.restaurantName = restaurantName;
}
public List<PayTypeBean> getPayType() {
return payType;
}
public void setPayType(List<PayTypeBean> payType) {
this.payType = payType;
}
public String getAppleToken() {
return appleToken;
}
public void setAppleToken(String appleToken) {
this.appleToken = appleToken;
}
public static class PayTypeBean {
/**
* id : 6
* payName : 支付宝HK
* isdefault : 1
* remarks : null
*/
private int id;
private long isdefault;
private String payName;
private String remarks;
private String payName3;
private String payName2;
private boolean checked;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public long getIsdefault() {
return isdefault;
}
public void setIsdefault(long isdefault) {
this.isdefault = isdefault;
}
public String getPayName() {
return payName;
}
public void setPayName(String payName) {
this.payName = payName;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public boolean isChecked() {
return checked;
}
public void setChecked(boolean checked) {
this.checked = checked;
}
public String getPayName3() {
return payName3;
}
public void setPayName3(String payName3) {
this.payName3 = payName3;
}
public String getPayName2() {
return payName2;
}
public void setPayName2(String payName2) {
this.payName2 = payName2;
}
}
}
public static List<PayMethod> getPayMethodByPayType(PayTypeInfo.DataBean payTypes) {
List<PayMethod> payMethods = new ArrayList<>();
if (payTypes == null) {
return payMethods;
}
if (payTypes.payType == null) {
return payMethods;
}
for (PayTypeInfo.DataBean.PayTypeBean payType : payTypes.payType) {
PayMethod payMethod = new PayMethod(payType.id, payType.payName, "", payType.remarks, payType.payName, payType.payName2, payType.payName3, "");
payMethods.add(payMethod);
}
return payMethods;
}
}
...@@ -62,6 +62,10 @@ class CoolWeatherNetwork { ...@@ -62,6 +62,10 @@ class CoolWeatherNetwork {
//獲取商家配置的取消訂單的原因 //獲取商家配置的取消訂單的原因
suspend fun getCancelReason(requestBody: RequestBody) = service.getCancelReason(requestBody).await() suspend fun getCancelReason(requestBody: RequestBody) = service.getCancelReason(requestBody).await()
//獲取商家配置的支付方式
suspend fun getPayMethod(requestBody: RequestBody) = service.getPayMethod(requestBody).await()
private suspend fun <T> Call<T>.await(): T { private suspend fun <T> Call<T>.await(): T {
return suspendCoroutine { continuation -> return suspendCoroutine { continuation ->
enqueue(object : Callback<T> { enqueue(object : Callback<T> {
......
...@@ -54,5 +54,6 @@ interface WeatherService { ...@@ -54,5 +54,6 @@ interface WeatherService {
@POST("restaurantFoodReason/config/list") @POST("restaurantFoodReason/config/list")
fun getCancelReason(@Body requestBody: RequestBody): Call<CancelReason> fun getCancelReason(@Body requestBody: RequestBody): Call<CancelReason>
@POST("order/confirmPay")
fun getPayMethod(@Body requestBody: RequestBody): Call<PayTypeInfo>
} }
\ No newline at end of file
...@@ -31,7 +31,6 @@ import kotlinx.coroutines.withContext ...@@ -31,7 +31,6 @@ import kotlinx.coroutines.withContext
class PageViewModel(private val repository: WeatherRepository) : ViewModel() { class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
companion object { companion object {
var fragmentStatus = arrayOf("0,1,2,3", "0,1", "2", "3", "3") var fragmentStatus = arrayOf("0,1,2,3", "0,1", "2", "3", "3")
var fragmentType = arrayOf("0", "0", "0", "2", "7") var fragmentType = arrayOf("0", "0", "0", "2", "7")
...@@ -129,7 +128,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -129,7 +128,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
} }
}, { }, {
//出錯 //出錯
listener.invoke(0)
}) })
} }
...@@ -196,7 +195,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -196,7 +195,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
dialog.dismiss() dialog.dismiss()
} }
} }
}.createDialogView().show() }.show()
} }
}, { }, {
...@@ -339,13 +338,13 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -339,13 +338,13 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
} }
}, { }, {
listener.invoke(0, false)
}) })
} }
fun gsUpdateOrderStatus(orderId: String, orderType: Int, listener: (Int, Boolean) -> Unit) { fun gsUpdateOrderStatus(orderId: String, orderType: Int, payTypeId: Int = 0, listener: (Int, Boolean) -> Unit) {
launch({ launch({
repository.gsUpdateOrderStatus(orderId, 4, orderType, 3, "", "", "", "0", "", 1, 0).apply { repository.gsUpdateOrderStatus(orderId, 4, orderType, 3, "", "", "", "0", "", 1, 0, payTypeId).apply {
listener.invoke(OrderDelivery, code == "1") listener.invoke(OrderDelivery, code == "1")
} }
}, { }, {
...@@ -592,7 +591,6 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -592,7 +591,6 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
} }
}.setWidth(WindowManager.LayoutParams.MATCH_PARENT) }.setWidth(WindowManager.LayoutParams.MATCH_PARENT)
.setHeight((ArmsUtils.getScreenHeidth(context) * 0.5).toInt()) .setHeight((ArmsUtils.getScreenHeidth(context) * 0.5).toInt())
.createDialogView()
.setGravity(Gravity.BOTTOM) .setGravity(Gravity.BOTTOM)
.show() .show()
} }
...@@ -649,7 +647,6 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -649,7 +647,6 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
} }
}.setWidth(WindowManager.LayoutParams.MATCH_PARENT) }.setWidth(WindowManager.LayoutParams.MATCH_PARENT)
.setHeight((ArmsUtils.getScreenHeidth(context) * 0.5).toInt()) .setHeight((ArmsUtils.getScreenHeidth(context) * 0.5).toInt())
.createDialogView()
.setGravity(Gravity.BOTTOM) .setGravity(Gravity.BOTTOM)
.show() .show()
} }
...@@ -723,6 +720,26 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -723,6 +720,26 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
}) })
} }
var payTypeBean = MutableLiveData<PayTypeInfo.DataBean>()
/**
* 獲取支付方式
*/
fun getPayMethod(orderId: String) {
launch({
repository.getPayMethod(orderId).apply {
Log.e("eee", "獲取支付方式$this")
if (this.code == "1" && this.data != null) {
payTypeBean.postValue(this.data)
} else {
payTypeBean.postValue(null)
}
}
}, {
Log.e("eee", "獲取支付方式報錯${it.message}")
payTypeBean.postValue(null)
})
}
private fun launch(block: suspend () -> Unit, error: suspend (Throwable) -> Unit) = viewModelScope.launch { private fun launch(block: suspend () -> Unit, error: suspend (Throwable) -> Unit) = viewModelScope.launch {
try { try {
......
package com.gingersoft.gsa.other_order_mode.ui.activity package com.gingersoft.gsa.other_order_mode.ui.activity
import android.app.Dialog import android.app.Dialog
import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.widget.TextView import android.widget.TextView
...@@ -173,22 +174,27 @@ class OrderDetailsActivity : BaseActivity() { ...@@ -173,22 +174,27 @@ class OrderDetailsActivity : BaseActivity() {
BtnBuilder.closingBtn -> BtnBuilder.closingBtn ->
//結賬,彈窗確認是否結賬 //結賬,彈窗確認是否結賬
// 自取結賬,外賣結賬,第三方物流沒有結賬 // 自取結賬,外賣結賬,第三方物流沒有結賬
object : DialogUtils(this@OrderDetailsActivity, R.layout.other_order_pause_orders) { // object : DialogUtils(this@OrderDetailsActivity, R.layout.other_order_pause_orders) {
override fun initLayout(hepler: ViewHepler, dialog: Dialog) { // override fun initLayout(hepler: ViewHepler, dialog: Dialog) {
hepler.setText(R.id.tv_warning_title, "是否確認結賬?") // hepler.setText(R.id.tv_warning_title, "是否確認結賬?")
hepler.getView<TextView>(R.id.tv_dialog_confirm).setOnClickListener { // hepler.getView<TextView>(R.id.tv_dialog_confirm).setOnClickListener {
dialog.dismiss() // dialog.dismiss()
showLoading() // showLoading()
gsUpdateOrderStatus(orderDetails.ID.toString(), orderDetails.order_type) { status, isSuccess -> // gsUpdateOrderStatus(orderDetails.ID.toString(), orderDetails.order_type) { status, isSuccess ->
cancelDialogForLoading() // cancelDialogForLoading()
finish() // finish()
} // }
} // }
hepler.getView<TextView>(R.id.tv_dialog_cancel).setOnClickListener { // hepler.getView<TextView>(R.id.tv_dialog_cancel).setOnClickListener {
dialog.dismiss() // dialog.dismiss()
} // }
} // }
}.createDialogView().show() // }.show()
{
val intent = Intent(this@OrderDetailsActivity, PayActivity::class.java)
intent.putExtra("orderDetails", orderDetails)
startActivityForResult(intent, 1001)
}
else -> { else -> {
showLoading() showLoading()
updateOrderStatusByBtn(btnList[position].type, orderDetails, GsaCloudApplication.getRestaurantId(this@OrderDetailsActivity).toString()) { status, isSuccess -> updateOrderStatusByBtn(btnList[position].type, orderDetails, GsaCloudApplication.getRestaurantId(this@OrderDetailsActivity).toString()) { status, isSuccess ->
...@@ -232,6 +238,10 @@ class OrderDetailsActivity : BaseActivity() { ...@@ -232,6 +238,10 @@ class OrderDetailsActivity : BaseActivity() {
}) })
getOrderDetails(orderId, binding) getOrderDetails(orderId, binding)
} }
else -> {
cancelDialogForLoading()
ToastUtils.show(this@OrderDetailsActivity, "修改訂單狀態失敗")
}
} }
} }
} }
...@@ -330,4 +340,14 @@ class OrderDetailsActivity : BaseActivity() { ...@@ -330,4 +340,14 @@ class OrderDetailsActivity : BaseActivity() {
} }
} }
} }
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if(requestCode == 1001){
//結賬頁面
if(resultCode == RESULT_OK){
finish()
}
}
}
} }
...@@ -260,10 +260,10 @@ class OtherOrderActivity : BaseActivity() { ...@@ -260,10 +260,10 @@ class OtherOrderActivity : BaseActivity() {
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) {
......
package com.gingersoft.gsa.other_order_mode.ui.activity
import android.app.Dialog
import android.os.Bundle
import android.widget.TextView
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import com.gingersoft.gsa.cloud.base.common.bean.PayMethod
import com.gingersoft.gsa.cloud.base.utils.MoneyUtil
import com.gingersoft.gsa.cloud.base.widget.DialogUtils
import com.gingersoft.gsa.cloud.print.bean.OrderDetails.DataBean
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.model.bean.BillBean
import com.gingersoft.gsa.other_order_mode.data.model.bean.PayTypeInfo
import com.gingersoft.gsa.other_order_mode.model.viewModel.PageViewModel
import com.gingersoft.gsa.other_order_mode.ui.adapter.FoodListAdapter
import com.gingersoft.gsa.other_order_mode.ui.adapter.PayBillAdapter
import com.gingersoft.gsa.other_order_mode.ui.base.BaseActivity
import com.gingersoft.gsa.other_order_mode.util.InjectorUtil
import kotlinx.android.synthetic.main.activity_pay.*
class PayActivity : BaseActivity() {
private lateinit var pageViewModel: PageViewModel
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_pay)
qm_order_pay_bar.setTitle("結賬")
qm_order_pay_bar.addLeftImageButton(R.drawable.icon_return, R.id.iv_left_back).setOnClickListener { finish() }
qm_order_pay_bar.setBackgroundColor(resources.getColor(R.color.theme_color))
val orderDetails: DataBean = intent.getSerializableExtra("orderDetails") as DataBean
pageViewModel = ViewModelProvider(this, InjectorUtil.getWeatherModelFactory())[PageViewModel::class.java]
var foodCount = 0
orderDetails.PRODUCT_NAME?.let { it ->
rv_order_pay_food.layoutManager = LinearLayoutManager(this)
rv_order_pay_food.adapter = FoodListAdapter(this, it)
for (bean in it) {
bean.child?.let { it ->
for (child in it) {
child.child?.let {
for (childBean in it) {
foodCount += childBean.num!!.toInt()
}
}
foodCount += child.num!!.toInt()
}
}
foodCount += bean.num!!.toInt()
}
}
other_pay_view.loadInfo(this, ArrayList<PayMethod>(), MoneyUtil.sub(orderDetails.TOTAL_AMOUNT!!.toDouble(), orderDetails.discount_amount), foodCount)
pageViewModel.getPayMethod(orderDetails.ID.toString())
pageViewModel.payTypeBean.observe(this, Observer {
//獲取支付方式
// other_pay_view.loadInfo(this, PayTypeInfo.getPayMethodByPayType(it), MoneyUtil.sub(orderDetails.TOTAL_AMOUNT!!.toDouble(), orderDetails.discount_amount), foodCount)
other_pay_view.notifyBillMethodAdapter(PayTypeInfo.getPayMethodByPayType(it))
})
other_pay_view.setmOnSureClickLisenter {payMethods->
//確認結賬,調用結賬接口
object : DialogUtils(this, R.layout.other_order_pause_orders) {
override fun initLayout(hepler: ViewHepler, dialog: Dialog) {
hepler.setText(R.id.tv_warning_title, "是否確認結賬?")
hepler.getView<TextView>(R.id.tv_dialog_confirm).setOnClickListener {
dialog.dismiss()
showLoading()
pageViewModel.gsUpdateOrderStatus(orderDetails.ID.toString(), orderDetails.order_type, payMethods[0].id) { status, isSuccess ->
cancelDialogForLoading()
setResult(RESULT_OK)
finish()
}
}
hepler.getView<TextView>(R.id.tv_dialog_cancel).setOnClickListener {
dialog.dismiss()
}
}
}.show()
}
val billBeans = ArrayList<BillBean>()
billBeans.add(BillBean("合計:", MoneyUtil.sub(MoneyUtil.sub(orderDetails.TOTAL_AMOUNT!!.toDouble(), orderDetails.Lunchbox), orderDetails.DELIVERY_CHARGE)))
if (orderDetails.Lunchbox > 0) {
billBeans.add(BillBean("餐盒費:", orderDetails.Lunchbox))
}
if (orderDetails.DELIVERY_CHARGE > 0) {
billBeans.add(BillBean("送貨費:", orderDetails.DELIVERY_CHARGE))
}
if (orderDetails.discount_amount > 0) {
billBeans.add(BillBean("折扣:", orderDetails.discount_amount, 1))
}
billBeans.add(BillBean("支付金額:", MoneyUtil.sub(orderDetails.TOTAL_AMOUNT!!.toDouble(), orderDetails.discount_amount)))
rv_order_pay_bill.layoutManager = LinearLayoutManager(this)
rv_order_pay_bill.adapter = PayBillAdapter(billBeans)
}
}
\ No newline at end of file
...@@ -15,6 +15,7 @@ import androidx.recyclerview.widget.RecyclerView.Adapter ...@@ -15,6 +15,7 @@ import androidx.recyclerview.widget.RecyclerView.Adapter
import com.gingersoft.gsa.other_order_mode.R import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.model.bean.OrderList import com.gingersoft.gsa.other_order_mode.data.model.bean.OrderList
import com.gingersoft.gsa.other_order_mode.databinding.LayoutOtherOrderItemBinding import com.gingersoft.gsa.other_order_mode.databinding.LayoutOtherOrderItemBinding
import com.gingersoft.gsa.other_order_mode.databinding.LayoutOtherOrderItemNewBinding
import com.scwang.smartrefresh.layout.util.SmartUtil.dp2px import com.scwang.smartrefresh.layout.util.SmartUtil.dp2px
class OtherOrdersAdapter(var context: Context) : Adapter<OtherOrdersAdapter.ViewHolder>() { class OtherOrdersAdapter(var context: Context) : Adapter<OtherOrdersAdapter.ViewHolder>() {
...@@ -34,7 +35,7 @@ class OtherOrdersAdapter(var context: Context) : Adapter<OtherOrdersAdapter.View ...@@ -34,7 +35,7 @@ class OtherOrdersAdapter(var context: Context) : Adapter<OtherOrdersAdapter.View
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.layout_other_order_item, parent, false)) return ViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.layout_other_order_item_new, parent, false))
} }
...@@ -168,7 +169,7 @@ class OtherOrdersAdapter(var context: Context) : Adapter<OtherOrdersAdapter.View ...@@ -168,7 +169,7 @@ class OtherOrdersAdapter(var context: Context) : Adapter<OtherOrdersAdapter.View
} }
class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
var binding: LayoutOtherOrderItemBinding = DataBindingUtil.bind(itemView)!! var binding: LayoutOtherOrderItemNewBinding = DataBindingUtil.bind(itemView)!!
var flBorder: FrameLayout = itemView.findViewById(R.id.fl_border) var flBorder: FrameLayout = itemView.findViewById(R.id.fl_border)
} }
......
package com.gingersoft.gsa.other_order_mode.ui.adapter
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.model.bean.BillBean
class PayBillAdapter(billBeans: List<BillBean>) : BaseQuickAdapter<BillBean, BaseViewHolder>(R.layout.item_pay_bill, billBeans) {
override fun convert(helper: BaseViewHolder, item: BillBean) {
helper.setText(R.id.tv_item_pay_name, item.name)
helper.setText(R.id.tv_item_pay_amount, item.amount.toString())
if(item.isRed == 0){
helper.setTextColor(R.id.tv_item_pay_name, helper.itemView.context.resources.getColor(R.color.color_3c))
helper.setTextColor(R.id.tv_item_pay_name, helper.itemView.context.resources.getColor(R.color.color_3c))
} else {
helper.setTextColor(R.id.tv_item_pay_name, helper.itemView.context.resources.getColor(R.color.discount_red))
helper.setTextColor(R.id.tv_item_pay_name, helper.itemView.context.resources.getColor(R.color.discount_red))
}
}
}
\ No newline at end of file
...@@ -116,7 +116,6 @@ object OtherOrderUtils { ...@@ -116,7 +116,6 @@ object OtherOrderUtils {
} }
}.setWidth((ArmsUtils.getScreenWidth(context) * 0.9).toInt()) }.setWidth((ArmsUtils.getScreenWidth(context) * 0.9).toInt())
.setHeight((ArmsUtils.getScreenHeidth(context) * 0.9).toInt()) .setHeight((ArmsUtils.getScreenHeidth(context) * 0.9).toInt())
.createDialogView()
.show() .show()
} }
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke
android:width="@dimen/dp_1"
android:color="#AAAAAA"
android:dashWidth="@dimen/dp_10"
android:dashGap="@dimen/dp_5" />
</shape>
\ No newline at end of file
<?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/qm_order_pay_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/head_height"
android:fitsSystemWindows="true"
app:qmui_topbar_text_btn_color_state_list="@color/theme_white_color"
app:qmui_topbar_title_color="@color/theme_white_color" />
<com.gingersoft.gsa.cloud.ui.view.OrderPayView
android:id="@+id/other_pay_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" />
<!-- 訂單金額詳情view-->
<com.gingersoft.gsa.cloud.ui.view.MaxHeightRecyclerView
android:id="@+id/rv_order_pay_bill"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/other_pay_view"
android:layout_marginBottom="@dimen/dp_10" />
<!-- 食品view-->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_order_pay_food"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/line_food"
android:layout_below="@id/qm_order_pay_bar"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10" />
<View
android:id="@+id/line_food"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_3"
android:layout_above="@id/rv_order_pay_bill"
android:background="@drawable/shape_dash_line"
android:layerType="software" />
</RelativeLayout>
\ No newline at end of file
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
android:id="@+id/layout_btn_item" android:id="@+id/layout_btn_item"
android:layout_height="@dimen/dp_40" android:layout_height="@dimen/dp_40"
android:gravity="center" android:gravity="center"
android:layout_marginStart="@dimen/dp_1"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:paddingLeft="@dimen/other_order_info_dialog_content_marginLeft"
android:paddingRight="@dimen/other_order_info_dialog_content_marginLeft">
<TextView
android:id="@+id/tv_item_pay_name"
style="@style/otherOrder_bill_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="餐盒費:" />
<TextView
android:id="@+id/tv_item_pay_amount"
style="@style/otherOrder_bill_info_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:layout_alignParentRight="true"
android:layout_toRightOf="@id/tv_item_pay_name"
android:gravity="right" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data> <data>
...@@ -70,6 +71,8 @@ ...@@ -70,6 +71,8 @@
android:background="@{orderingMethodBg}" android:background="@{orderingMethodBg}"
android:gravity="center" android:gravity="center"
android:text="@{orderingMethod}" android:text="@{orderingMethod}"
tools:text="外送"
tools:textColor="@color/theme_333_color"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/dp_14" android:textSize="@dimen/dp_14"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
...@@ -85,6 +88,8 @@ ...@@ -85,6 +88,8 @@
android:paddingLeft="@dimen/dp_10" android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_2" android:paddingTop="@dimen/dp_2"
android:paddingRight="@dimen/dp_10" android:paddingRight="@dimen/dp_10"
tools:text="支付方式案發生的阿斯蒂芬阿薩德發送發送"
tools:textColor="@color/theme_333_color"
android:paddingBottom="@dimen/dp_2" android:paddingBottom="@dimen/dp_2"
android:text="@{payMethod}" android:text="@{payMethod}"
android:textColor="@color/white" android:textColor="@color/white"
...@@ -100,6 +105,8 @@ ...@@ -100,6 +105,8 @@
android:layout_marginRight="@dimen/dp_10" android:layout_marginRight="@dimen/dp_10"
android:gravity="right" android:gravity="right"
android:textSize="@dimen/dp_10" android:textSize="@dimen/dp_10"
tools:text="訂單時間水電費垃圾撒旦法阿斯蒂芬阿斯蒂芬"
tools:textColor="@color/theme_333_color"
android:text="@{TimeUtils.parseTimeRepeat(data.cREATE_TIME,TimeUtils.DEFAULT_DATE_FORMAT)}" android:text="@{TimeUtils.parseTimeRepeat(data.cREATE_TIME,TimeUtils.DEFAULT_DATE_FORMAT)}"
app:layout_constraintLeft_toRightOf="@id/tv_payment_method" app:layout_constraintLeft_toRightOf="@id/tv_payment_method"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
...@@ -108,11 +115,13 @@ ...@@ -108,11 +115,13 @@
<TextView <TextView
android:id="@+id/tv_order_user_name" android:id="@+id/tv_order_user_name"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_4" android:layout_marginLeft="@dimen/dp_4"
android:layout_marginTop="@dimen/dp_6" android:layout_marginTop="@dimen/dp_6"
android:layout_marginRight="@dimen/dp_10" android:layout_marginRight="@dimen/dp_10"
tools:text="用戶名+手機號啊實打實啊實打實大阿達"
tools:textColor="@color/theme_333_color"
android:textColor="@color/theme_text_color" android:textColor="@color/theme_text_color"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
android:text="@{data.rECEIVER + @string/left_parenthesis+data.pHONE + @string/right_parenthesis}" android:text="@{data.rECEIVER + @string/left_parenthesis+data.pHONE + @string/right_parenthesis}"
...@@ -129,8 +138,9 @@ ...@@ -129,8 +138,9 @@
android:layout_marginTop="@dimen/dp_18" android:layout_marginTop="@dimen/dp_18"
android:gravity="right" android:gravity="right"
android:text="@{delivery_state}" android:text="@{delivery_state}"
tools:text="用戶名+手"
tools:textColor="@color/theme_333_color"
android:textColor="@color/color_3c" android:textColor="@color/color_3c"
app:layout_constraintLeft_toRightOf="@id/tv_order_user_name"
app:layout_constraintRight_toRightOf="@id/tv_order_time" app:layout_constraintRight_toRightOf="@id/tv_order_time"
app:layout_constraintTop_toBottomOf="@id/tv_order_time" /> app:layout_constraintTop_toBottomOf="@id/tv_order_time" />
...@@ -140,7 +150,7 @@ ...@@ -140,7 +150,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
app:barrierDirection="left" app:barrierDirection="left"
app:constraint_referenced_ids="tv_order_amount,tv_delivery_state,tv_order_state" /> app:constraint_referenced_ids="tv_order_time,tv_order_amount,tv_delivery_state,tv_order_state" />
<androidx.constraintlayout.widget.Barrier <androidx.constraintlayout.widget.Barrier
...@@ -158,8 +168,11 @@ ...@@ -158,8 +168,11 @@
android:layout_marginTop="@dimen/dp_9" android:layout_marginTop="@dimen/dp_9"
android:text="@{data.sendTime}" android:text="@{data.sendTime}"
android:textColor="#EC2D2D" android:textColor="#EC2D2D"
tools:text="送達時間Adasd奧術大師大所多啊實打實大啊實打實大阿薩德"
tools:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_12" android:textSize="@dimen/dp_12"
android:visibility="visible" android:visibility="visible"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintRight_toLeftOf="@id/barrier_order_right_line" app:layout_constraintRight_toLeftOf="@id/barrier_order_right_line"
app:layout_constraintLeft_toLeftOf="@id/tv_order_user_name" app:layout_constraintLeft_toLeftOf="@id/tv_order_user_name"
app:layout_constraintTop_toBottomOf="@id/tv_order_user_name" /> app:layout_constraintTop_toBottomOf="@id/tv_order_user_name" />
...@@ -177,13 +190,17 @@ ...@@ -177,13 +190,17 @@
<TextView <TextView
android:id="@+id/tv_order_num" android:id="@+id/tv_order_num"
style="@style/otherOrder_item_info_title_textStyle" style="@style/otherOrder_item_info_title_textStyle"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text='@{data.takeFoodCode.equals("0")? @string/take_food_code_omit:data.takeFoodCode}' android:text='@{data.takeFoodCode.equals("0")? @string/take_food_code_omit:data.takeFoodCode}'
android:textSize="@dimen/dp_14" android:textSize="@dimen/dp_14"
tools:text="012121201阿達as244342313154446455443434242"
tools:textColor="@color/theme_333_color"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintBottom_toBottomOf="@id/tv_order_num_text" app:layout_constraintBottom_toBottomOf="@id/tv_order_num_text"
app:layout_constraintLeft_toRightOf="@id/barrier_order_info" app:layout_constraintLeft_toRightOf="@id/barrier_order_info"
app:layout_constraintRight_toLeftOf="@id/barrier_order_right_line"
app:layout_constraintTop_toTopOf="@id/tv_order_num_text" /> app:layout_constraintTop_toTopOf="@id/tv_order_num_text" />
...@@ -195,6 +212,8 @@ ...@@ -195,6 +212,8 @@
android:background="@{stateBg}" android:background="@{stateBg}"
android:padding="@dimen/dp_5" android:padding="@dimen/dp_5"
android:text="@{state}" android:text="@{state}"
tools:text="訂單狀態"
tools:textColor="@color/theme_333_color"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/dp_14" android:textSize="@dimen/dp_14"
app:layout_constraintRight_toRightOf="@id/tv_order_time" app:layout_constraintRight_toRightOf="@id/tv_order_time"
...@@ -206,6 +225,8 @@ ...@@ -206,6 +225,8 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginTop="@dimen/dp_9" android:layout_marginTop="@dimen/dp_9"
tools:text="地址"
tools:textColor="@color/theme_333_color"
android:text="@{@string/address}" android:text="@{@string/address}"
android:visibility="@{isSelf?View.GONE:View.VISIBLE}" android:visibility="@{isSelf?View.GONE:View.VISIBLE}"
app:layout_constraintBottom_toBottomOf="@id/tv_address" app:layout_constraintBottom_toBottomOf="@id/tv_address"
...@@ -215,17 +236,19 @@ ...@@ -215,17 +236,19 @@
<TextView <TextView
android:id="@+id/tv_address" android:id="@+id/tv_address"
style="@style/otherOrder_item_info_textStyle" style="@style/otherOrder_item_info_textStyle"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_5" android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_10" android:layout_marginBottom="@dimen/dp_10"
android:text="@{data.aDDRESS_DETAIL}" android:text="@{data.aDDRESS_DETAIL}"
app:layout_constraintHorizontal_bias="0"
tools:text="地址安居客收到貨卡和山東傻了發哈連接阿斯蒂芬"
tools:textColor="@color/theme_333_color"
android:visibility="@{isSelf?View.GONE:View.VISIBLE}" android:visibility="@{isSelf?View.GONE:View.VISIBLE}"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/barrier_order_info" app:layout_constraintLeft_toRightOf="@id/barrier_order_info"
app:layout_constraintRight_toLeftOf="@id/barrier_order_right_line" app:layout_constraintRight_toLeftOf="@id/barrier_order_right_line"
app:layout_constraintTop_toTopOf="@id/tv_address_text" app:layout_constraintTop_toTopOf="@id/tv_address_text"/>
app:layout_constraintVertical_chainStyle="packed" />
<TextView <TextView
android:id="@+id/tv_order_amount" android:id="@+id/tv_order_amount"
...@@ -236,6 +259,8 @@ ...@@ -236,6 +259,8 @@
android:text="@{@string/amount_unit + data.pAY_AMOUNT}" android:text="@{@string/amount_unit + data.pAY_AMOUNT}"
android:textColor="@color/red_600" android:textColor="@color/red_600"
android:textSize="@dimen/sp_16" android:textSize="@dimen/sp_16"
tools:text="$1412121331345643"
tools:textColor="@color/theme_333_color"
app:layout_constraintTop_toBottomOf="@id/tv_delivery_state" app:layout_constraintTop_toBottomOf="@id/tv_delivery_state"
app:layout_constraintRight_toRightOf="@id/tv_order_time" app:layout_constraintRight_toRightOf="@id/tv_order_time"
app:layout_constraintTop_toTopOf="@id/tv_address_text"/> app:layout_constraintTop_toTopOf="@id/tv_address_text"/>
......
<?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:layout_width="match_parent"
android:id="@+id/layout_delivery_item" android:id="@+id/layout_delivery_item"
android:layout_height="match_parent" android:layout_width="match_parent"
android:layout_marginStart="@dimen/dp_5" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:background="@drawable/shape_delivery_item_btn_normal" android:background="@drawable/shape_delivery_item_btn_normal"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical"
android:padding="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_2"
android:layout_marginRight="@dimen/dp_2">
<TextView <TextView
android:id="@+id/tv_delivery_name" android:id="@+id/tv_delivery_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="@dimen/dp_8"
android:paddingBottom="@dimen/dp_8"
android:paddingLeft="@dimen/dp_5"
android:paddingRight="@dimen/dp_5"
android:textColor="@color/color_c8" android:textColor="@color/color_c8"
android:textSize="@dimen/dp_17" /> android:textSize="@dimen/dp_17" />
......
...@@ -7,13 +7,14 @@ ...@@ -7,13 +7,14 @@
android:paddingRight="@dimen/dp_10" android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_20"> android:paddingBottom="@dimen/dp_20">
<LinearLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/shape_dialog_bg" android:background="@drawable/shape_dialog_bg"
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <FrameLayout
android:id="@+id/layout_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="@dimen/dp_10"> android:padding="@dimen/dp_10">
...@@ -37,23 +38,11 @@ ...@@ -37,23 +38,11 @@
android:textSize="@dimen/dp_17" /> android:textSize="@dimen/dp_17" />
</FrameLayout> </FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_delivery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_10" />
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView <TextView
android:id="@+id/tv_delivery_confirm" android:id="@+id/tv_delivery_confirm"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="@dimen/dp_16" android:layout_marginLeft="@dimen/dp_16"
android:layout_marginRight="@dimen/dp_16" android:layout_marginRight="@dimen/dp_16"
android:layout_marginBottom="@dimen/dp_10" android:layout_marginBottom="@dimen/dp_10"
...@@ -65,5 +54,16 @@ ...@@ -65,5 +54,16 @@
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/dp_16" /> android:textSize="@dimen/dp_16" />
</LinearLayout> <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_delivery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/tv_delivery_confirm"
android:layout_below="@id/layout_title"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10" />
</RelativeLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -25,11 +25,10 @@ public class IpPrintMaker implements PrintDataMaker { ...@@ -25,11 +25,10 @@ public class IpPrintMaker implements PrintDataMaker {
private int width; // 打印的圖片寬度,紙張寬度 private int width; // 打印的圖片寬度,紙張寬度
private List<Bitmap> bitmaps; private List<Bitmap> bitmaps;
public IpPrintMaker(Context context, int width, Bitmap bitmap) { public IpPrintMaker(Context context, int width, List<Bitmap> bitmaps) {
this.mContext = context; this.mContext = context;
this.width = width; this.width = width;
this.bitmaps = new ArrayList<>(); this.bitmaps = bitmaps;
this.bitmaps.add(bitmap);
} }
@Override @Override
...@@ -55,7 +54,6 @@ public class IpPrintMaker implements PrintDataMaker { ...@@ -55,7 +54,6 @@ public class IpPrintMaker implements PrintDataMaker {
printer.feedPaperCutPartial(); printer.feedPaperCutPartial();
data.add(printer.getDataAndReset()); data.add(printer.getDataAndReset());
} }
// printer.openCashBox();
data.add(printer.getDataAndClose()); data.add(printer.getDataAndClose());
return data; return data;
} catch (Exception e) { } catch (Exception e) {
......
...@@ -383,7 +383,7 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis ...@@ -383,7 +383,7 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
showIpPrintDeviceList(printerDeviceBeans, bitmaps); showIpPrintDeviceList(printerDeviceBeans, bitmaps);
}); });
} }
}.createDialogView().show(); }.show();
} else if (deftultPrint.equals(PrintConstans.LOCAL_PRINT)) { } else if (deftultPrint.equals(PrintConstans.LOCAL_PRINT)) {
// 默認打印方式為本地,進行本地打印 // 默認打印方式為本地,進行本地打印
locationPrint(bitmaps, new PrintListener() { locationPrint(bitmaps, new PrintListener() {
...@@ -452,7 +452,6 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis ...@@ -452,7 +452,6 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
} }
} }
.setHeight(ArmsUtils.getScreenHeidth(mContext) / 2) .setHeight(ArmsUtils.getScreenHeidth(mContext) / 2)
.createDialogView()
.setOnDismissListener(dialog -> setPrintState(PrintActivity.DIMISS_LOADING)) .setOnDismissListener(dialog -> setPrintState(PrintActivity.DIMISS_LOADING))
.show(); .show();
} }
...@@ -477,17 +476,20 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis ...@@ -477,17 +476,20 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
if (printerDeviceBean.getPaperSpecification() != null) { if (printerDeviceBean.getPaperSpecification() != null) {
printWidth = Double.valueOf(printerDeviceBean.getPaperSpecification()).intValue(); printWidth = Double.valueOf(printerDeviceBean.getPaperSpecification()).intValue();
} else { } else {
printWidth = 540; printWidth = 480;
printerDeviceBean.setPaperSpecification(printWidth + "");
} }
PrintExecutor executor = new PrintExecutor(printerDeviceBean); PrintExecutor executor = new PrintExecutor(printerDeviceBean);
executor.setOnStateChangedListener(stateChangedListener); executor.setOnStateChangedListener(stateChangedListener);
executor.setOnPrintResultListener(resultListener); executor.setOnPrintResultListener(resultListener);
if (bitmaps != null) { if (bitmaps != null) {
List<Bitmap> zoomBitmap = new ArrayList<>();
for (int i = 0; i < bitmaps.size(); i++) {
zoomBitmap.add(ImageUtils.zoomDrawable(bitmaps.get(i), printWidth));
}
for (int j = 0; j < printCount; j++) { for (int j = 0; j < printCount; j++) {
for (int i = 0; i < bitmaps.size(); i++) { IpPrintMaker maker = new IpPrintMaker(mContext, printWidth, zoomBitmap);
IpPrintMaker maker = new IpPrintMaker(mContext, printWidth, ImageUtils.zoomDrawable(bitmaps.get(i), printWidth)); executor.doPrinterRequestAsync(maker);
executor.doPrinterRequestAsync(maker);
}
} }
} }
} }
......
...@@ -123,6 +123,7 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print ...@@ -123,6 +123,7 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
} }
PrinterDeviceDaoUtils printerDeviceDaoUtils = new PrinterDeviceDaoUtils(this); PrinterDeviceDaoUtils printerDeviceDaoUtils = new PrinterDeviceDaoUtils(this);
printerDeviceBeans = printerDeviceDaoUtils.queryAllPrinterDeviceBean(); printerDeviceBeans = printerDeviceDaoUtils.queryAllPrinterDeviceBean();
printerDeviceDaoUtils.closeConnection();
if (type == PrinterRoot.PRINT_TEST) { if (type == PrinterRoot.PRINT_TEST) {
if (deviceBean != null) { if (deviceBean != null) {
printerInIt.ipDevicePrint(deviceBean, printerInIt.getPrintBitmap(mContext).get("")); printerInIt.ipDevicePrint(deviceBean, printerInIt.getPrintBitmap(mContext).get(""));
......
...@@ -269,7 +269,6 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem ...@@ -269,7 +269,6 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
} }
} }
.setWidth(WindowManager.LayoutParams.MATCH_PARENT) .setWidth(WindowManager.LayoutParams.MATCH_PARENT)
.createDialogView()
.setGravity(Gravity.BOTTOM) .setGravity(Gravity.BOTTOM)
.show(); .show();
} }
...@@ -295,9 +294,8 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem ...@@ -295,9 +294,8 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
rv.setLayoutManager(new LinearLayoutManager(mContext)); rv.setLayoutManager(new LinearLayoutManager(mContext));
rv.setAdapter(adapter); rv.setAdapter(adapter);
} }
}.setWidth((int) (ArmsUtils.getScreenWidth(this) * 0.6)) }.setWidth((int) (ArmsUtils.getScreenWidth(this) * 0.8))
.setHeight((int) (ArmsUtils.getScreenHeidth(this) * 0.4)) .setHeight((int) (ArmsUtils.getScreenHeidth(this) * 0.6))
.createDialogView()
.setOnDismissListener(dialog -> { .setOnDismissListener(dialog -> {
if (viewId == R.id.layout_select_fail_one) { if (viewId == R.id.layout_select_fail_one) {
if (oneFailPosition < devicess.size() && oneFailPosition >= 0) { if (oneFailPosition < devicess.size() && oneFailPosition >= 0) {
......
...@@ -3,11 +3,13 @@ package com.gingersoft.gsa.cloud.table.mvp.contract; ...@@ -3,11 +3,13 @@ package com.gingersoft.gsa.cloud.table.mvp.contract;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
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.PayMethod;
import com.gingersoft.gsa.cloud.table.app.payment.bean.RefundRespose; import com.gingersoft.gsa.cloud.table.app.payment.bean.RefundRespose;
import com.gingersoft.gsa.cloud.table.app.payment.bean.SaleRespose; import com.gingersoft.gsa.cloud.table.app.payment.bean.SaleRespose;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.BaseRespose;
import com.gingersoft.gsa.cloud.ui.widget.dialog.StatusLoadingDialog; import com.gingersoft.gsa.cloud.ui.widget.dialog.StatusLoadingDialog;
import java.util.List;
import io.reactivex.Observable; import io.reactivex.Observable;
import okhttp3.RequestBody; import okhttp3.RequestBody;
...@@ -48,7 +50,9 @@ public interface OrderPayContract { ...@@ -48,7 +50,9 @@ public interface OrderPayContract {
void paySuccess(); void paySuccess();
void onPayFailure(String status); void onPayFailure(String status);
void loadPayMethodsSuccess(List<PayMethod> payMethods);
} }
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存 //Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
......
...@@ -46,10 +46,11 @@ public interface MealService { ...@@ -46,10 +46,11 @@ public interface MealService {
@POST("food/updateInvisible" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2) @POST("food/updateInvisible" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseResult> updateInvisible(@Body RequestBody requestBody); Observable<BaseResult> updateInvisible(@Body RequestBody requestBody);
// @Headers({"Domain-Name: yc_location"})
@POST("order/send" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2) @POST("order/send" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseResult> createOrder(@Body RequestBody requestBody); Observable<BaseResult> createOrder(@Body RequestBody requestBody);
// @Headers({"Domain-Name: yc_location"})
@POST("orderDetails/add" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2) @POST("orderDetails/add" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseResult> addFood(@Body RequestBody requestBody); Observable<BaseResult> addFood(@Body RequestBody requestBody);
......
...@@ -2,31 +2,6 @@ ...@@ -2,31 +2,6 @@
<string name="table_app_name">Component-table</string> <string name="table_app_name">Component-table</string>
<string name="Key_0">0</string>
<string name="Key_00">00</string>
<string name="Key_1">1</string>
<string name="Key_2">2</string>
<string name="Key_3">3</string>
<string name="Key_4">4</string>
<string name="Key_5">5</string>
<string name="Key_6">6</string>
<string name="Key_7">7</string>
<string name="Key_8">8</string>
<string name="Key_9">9</string>
<string name="Key_100">100</string>
<string name="Key_200">200</string>
<string name="Key_500">500</string>
<string name="Key_1000">1000</string>
<string name="Key_add_5">+5</string>
<string name="Key_add_10">+10</string>
<string name="Key_add_20">+20</string>
<string name="Key_add_50">+50</string>
<string name="Key_right"></string>
<string name="Key_clear">clr</string>
<string name="Key_s">numkey</string>
<string name="btnOK">OK</string>
<string name="loading">加載中...</string> <string name="loading">加載中...</string>
<string name="meal_return">返回</string> <string name="meal_return">返回</string>
<string name="meal_discount">折扣</string> <string name="meal_discount">折扣</string>
...@@ -85,7 +60,6 @@ ...@@ -85,7 +60,6 @@
<string name="standmode">一般模式</string> <string name="standmode">一般模式</string>
<string name="detailmode">细微模式</string> <string name="detailmode">细微模式</string>
<string name="malnumber">請選擇按鍵錄入數量</string> <string name="malnumber">請選擇按鍵錄入數量</string>
<string name="input_pay_money">請輸入支付金額</string>
<string name="please_input_table_number">請輸入檯號</string> <string name="please_input_table_number">請輸入檯號</string>
<string name="please_input_cancel_number">請輸入取消數量</string> <string name="please_input_cancel_number">請輸入取消數量</string>
<string name="please_select_table_number">請選擇檯號</string> <string name="please_select_table_number">請選擇檯號</string>
......
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