Commit 1c6d730d by Wyh

5.30 提交

parent 04c3d010
...@@ -146,13 +146,15 @@ public class GsaCloudApplication extends BaseApplication { ...@@ -146,13 +146,15 @@ public class GsaCloudApplication extends BaseApplication {
ClassicsFooter.REFRESH_FOOTER_NOTHING = getString(R.string.srl_footer_nothing);//"全部加载完成"; ClassicsFooter.REFRESH_FOOTER_NOTHING = getString(R.string.srl_footer_nothing);//"全部加载完成";
} }
private void initDomainUrl() { public static void initDomainUrl() {
HttpsConstans.isFormal = (boolean) SPUtils.get(getAppContext(), "isFormal", true);
HttpsConstans.init();
//需要單獨配置域名URL的,在接口上添加@Headers({"Domain-Name: settlement_report_server"}),不添加則是使用默認域名 //需要單獨配置域名URL的,在接口上添加@Headers({"Domain-Name: settlement_report_server"}),不添加則是使用默認域名
setGlobalDomain(); setGlobalDomain();
//清機報表請求地址 //清機報表請求地址
RetrofitUrlManager.getInstance().putDomain("settlement_report_server", HttpsConstans.ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL); RetrofitUrlManager.getInstance().putDomain("settlement_report_server", HttpsConstans.ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL);
//gsa報表請求地址 //gsa報表請求地址
RetrofitUrlManager.getInstance().putDomain("gsa_report", HttpsConstans.REPORT_SERVER_ADDRESS); RetrofitUrlManager.getInstance().putDomain("gsa_report", HttpsConstans.REPORT_SERVER_ADDRESS);//DEFAULT_REPORT_ADDRESS
//微信報表請求地址 //微信報表請求地址
RetrofitUrlManager.getInstance().putDomain("wechat_report", HttpsConstans.WECHAR_REPORT_SERVER_ADDRESS); RetrofitUrlManager.getInstance().putDomain("wechat_report", HttpsConstans.WECHAR_REPORT_SERVER_ADDRESS);
//沽清控制請求地址 //沽清控制請求地址
......
...@@ -30,7 +30,7 @@ import com.gingersoft.gsa.cloud.base.R; ...@@ -30,7 +30,7 @@ import com.gingersoft.gsa.cloud.base.R;
*/ */
public abstract class DialogUtils { public abstract class DialogUtils {
private Context mContext; private Context mContext;
private Dialog dialog2 = null; 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;
...@@ -43,14 +43,6 @@ public abstract class DialogUtils { ...@@ -43,14 +43,6 @@ public abstract class DialogUtils {
view = LayoutInflater.from(mContext).inflate(xmlLayout, null); view = LayoutInflater.from(mContext).inflate(xmlLayout, null);
} }
private Dialog getInstance() {
synchronized (this) {
if (dialog2 == null) {
dialog2 = new Dialog(mContext, style);
}
return dialog2;
}
}
public DialogUtils(Context mContext, View view) { public DialogUtils(Context mContext, View view) {
this.mContext = mContext; this.mContext = mContext;
...@@ -73,18 +65,21 @@ public abstract class DialogUtils { ...@@ -73,18 +65,21 @@ public abstract class DialogUtils {
} }
public DialogUtils createDialogView() { public DialogUtils createDialogView() {
if(dialog != null) {
dialog.dismiss();
}
dialog = new Dialog(mContext);
viewHepler = getViewHepler(); viewHepler = getViewHepler();
initLayout(viewHepler, getInstance()); initLayout(viewHepler, dialog);
dialog.setContentView(viewHepler.getContentView());
getInstance().setContentView(viewHepler.getContentView()); Window dialogWindow = dialog.getWindow();
Window dialogWindow = getInstance().getWindow();
// WindowManager.LayoutParams lp = dialogWindow.getAttributes(); // WindowManager.LayoutParams lp = dialogWindow.getAttributes();
dialogWindow.setGravity(Gravity.CENTER); dialogWindow.setGravity(Gravity.CENTER);
//将对话框的大小按屏幕大小的百分比设置 //将对话框的大小按屏幕大小的百分比设置
// WindowManager m = activity.getWindowManager(); // WindowManager m = activity.getWindowManager();
// Display d = m.getDefaultDisplay(); // 获取屏幕宽、高用 // Display d = m.getDefaultDisplay(); // 获取屏幕宽、高用
WindowManager.LayoutParams p = dialogWindow.getAttributes(); // 获取对话框当前的参数值 WindowManager.LayoutParams p = dialogWindow.getAttributes(); // 获取对话框当前的参数值
Window window = getInstance().getWindow(); Window window = dialog.getWindow();
if (window != null) { if (window != null) {
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
window.getDecorView().setBackgroundResource(android.R.color.transparent); window.getDecorView().setBackgroundResource(android.R.color.transparent);
...@@ -105,32 +100,33 @@ public abstract class DialogUtils { ...@@ -105,32 +100,33 @@ public abstract class DialogUtils {
dialogWindow.setAttributes(p); dialogWindow.setAttributes(p);
// android Activity改成dialog样式后 怎设置点击空白处关闭窗体,点击窗体以外的地方关闭窗体 // android Activity改成dialog样式后 怎设置点击空白处关闭窗体,点击窗体以外的地方关闭窗体
getInstance().setCanceledOnTouchOutside(true); dialog.setCanceledOnTouchOutside(true);
getInstance().setCancelable(true); dialog.setCancelable(true);
// dialog.show(); // dialog.show();
return this; return this;
} }
public Dialog getDialog() { public Dialog getDialog() {
return getInstance(); return dialog;
} }
public DialogUtils dismiss() { public DialogUtils dismiss() {
getInstance().dismiss(); if (dialog != null)
dialog.dismiss();
return this; return this;
} }
public DialogUtils setGravity(int gravity) { public DialogUtils setGravity(int gravity) {
if (getInstance().getWindow() != null) { if (dialog.getWindow() != null) {
getInstance().getWindow().setGravity(gravity); dialog.getWindow().setGravity(gravity);
} }
return this; return this;
} }
public DialogUtils show() { public DialogUtils show() {
dismiss(); dismiss();
getInstance().show(); dialog.show();
return this; return this;
} }
...@@ -143,11 +139,11 @@ public abstract class DialogUtils { ...@@ -143,11 +139,11 @@ public abstract class DialogUtils {
} }
public boolean isShowing() { public boolean isShowing() {
return getInstance() != null && getInstance().isShowing(); return dialog != null && dialog.isShowing();
} }
public DialogUtils setOnDismissListener(DialogInterface.OnDismissListener dismissListener) { public DialogUtils setOnDismissListener(DialogInterface.OnDismissListener dismissListener) {
getInstance().setOnDismissListener(dismissListener); dialog.setOnDismissListener(dismissListener);
return this; return this;
} }
...@@ -159,7 +155,7 @@ public abstract class DialogUtils { ...@@ -159,7 +155,7 @@ public abstract class DialogUtils {
public DialogUtils setCanceledOnTouchOutside(boolean cancel) { public DialogUtils setCanceledOnTouchOutside(boolean cancel) {
getInstance().setCanceledOnTouchOutside(cancel); dialog.setCanceledOnTouchOutside(cancel);
return this; return this;
} }
......
...@@ -5,26 +5,88 @@ package com.gingersoft.gsa.cloud.constans; ...@@ -5,26 +5,88 @@ package com.gingersoft.gsa.cloud.constans;
*/ */
public class HttpsConstans { public class HttpsConstans {
public static String ROOT_ADDRESS_FORMAL = "https://m.ricepon.com:8444/ricepon-cloud-gsa/api/";//正式服務器 // public static String ROOT_ADDRESS_FORMAL = "https://m.ricepon.com:8444/ricepon-cloud-gsa/api/";//正式服務器
public static final String ROOT_SERVER_ADDRESS_FORMAL_SZ = "http://gingersoft.tpddns.cn:58201/ricepon-cloud-gsa/api/";//深圳服务器 // public static final String ROOT_SERVER_ADDRESS_FORMAL_SZ = "http://gingersoft.tpddns.cn:58201/ricepon-cloud-gsa/api/";//深圳服务器
public static final String ROOT_SERVER_ADDRESS_FORMAL_HK = "http://a.ricepon.com:58201/ricepon-cloud-gsa/api/";//香港服务器 // public static final String ROOT_SERVER_ADDRESS_FORMAL_HK = "http://a.ricepon.com:58201/ricepon-cloud-gsa/api/";//香港服务器
// public static String ROOT_SERVER_YOU_CHANG_HK = "http://192.168.1.142:9012/api/"; //友常本地
// public static String ROOT_SERVER_SHI_WEI_HK = "http://192.168.1.154:9012/api/"; //世維本地
// //默認為正式
// public static String ROOT_SERVER_ADDRESS_FORMAL = ROOT_SERVER_ADDRESS_FORMAL_HK;
//
// //外賣接單
// public static final String ROOT_SZ_URL = "http://192.168.1.74:6060";//友常本地
// public static final String ROOT_HK_TEST_URL = "https://hktest.ricepon.com:64377";//香港測試
// public static final String ROOT_FORMAL_URL = "https://m.ricepon.com";//正式
// public static String ROOT_URL = HttpsConstans.ROOT_HK_TEST_URL;
//
// //清機接口地址
// public static String ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = "http://a.ricepon.com:58201/";
// //報表地址
// public static String REPORT_SERVER_ADDRESS = "http://a.ricepon.com:58201/ricepon-report/api/";
// //微信公眾號報表地址:首頁曲線圖數據,支付分析報表數據
// public static String WECHAR_REPORT_SERVER_ADDRESS = "http://a.ricepon.com:61177/member-web/api/";
// //報表地址
// public static String _SERVER_ADDRESS = "http://a.ricepon.com:61177/member-web/api/";
//--------------------------------------------其他全局----------------------------------------------------------------------------
private static String HTTP_ADDRESS_URL_FORMAL = "https://m.ricepon.com:8444";//正式服務器
private static String HTTP_ADDRESS_URL_SZ = "http://gingersoft.tpddns.cn:58201";//深圳測試
private static String HTTP_ADDRESS_URL_HK = "http://a.ricepon.com:58201";//香港測試
private static String PATH = "/ricepon-cloud-gsa/api/";//路徑
public static String ROOT_SERVER_YOU_CHANG_HK = "http://192.168.1.142:9012/api/"; //友常本地 public static String ROOT_SERVER_YOU_CHANG_HK = "http://192.168.1.142:9012/api/"; //友常本地
public static String ROOT_SERVER_SHI_WEI_HK = "http://192.168.1.154:9012/api/"; //世維本地 public static String ROOT_SERVER_SHI_WEI_HK = "http://192.168.1.154:9012/api/"; //世維本地
//默認為正式
public static String ROOT_SERVER_ADDRESS_FORMAL = ROOT_ADDRESS_FORMAL;
//外賣接單 //------------------------------------------外賣接單---------------------------------------------------------------------------
public static final String ROOT_SZ_URL = "http://192.168.1.74:6060";//友常本地 public static final String ROOT_SZ_URL = "http://192.168.1.74:6060";//友常本地
public static final String ROOT_HK_TEST_URL = "https://hktest.ricepon.com:64377";//香港測試 public static final String ROOT_HK_TEST_URL = "https://hktest.ricepon.com:64377";//香港測試
public static final String ROOT_FORMAL_URL = "https://m.ricepon.com";//正式 public static final String ROOT_FORMAL_URL = "https://m.ricepon.com";//正式
public static String ROOT_URL = HttpsConstans.ROOT_FORMAL_URL;
//-------------------------------------------報表-------------------------------------------------------------------------------
private static String REPORT_TEST_ADDRESS = "http://a.ricepon.com:58201";//報表測試地址
private static String REPORT_FORMAL_ADDRESS = HTTP_ADDRESS_URL_FORMAL;//報表正式地址
//報表路徑
private static String REPORT_PATH = "/ricepon-report/api/";
//----------------------------------微信公眾號報表地址------------------------------------------------------------------------------------------
private static String WECHAR_REPORT_TEST_ADDRESS = "http://a.ricepon.com:61177";//微信公眾號報表測試地址
private static String WECHAR_REPORT_FORMAL_ADDRESS = HTTP_ADDRESS_URL_FORMAL;//微信公眾號報表正式地址
private static String WECHAR_REPORT_PATH = "/member-web/api/";//微信公眾號報表路徑
//--------------------------------------配置-----------------------------------------------------------------------------------
/**
* 修改這個值控制是否是正式
*/
public static boolean isFormal = true;
//沽清控制地址
public static String _SERVER_ADDRESS = (isFormal ? HTTP_ADDRESS_URL_FORMAL : "http://a.ricepon.com:61177") + "/member-web/api/";
//清機接口地址 //清機接口地址
public static String ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = "http://a.ricepon.com:58201/"; public static String ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = isFormal ? HTTP_ADDRESS_URL_FORMAL : REPORT_TEST_ADDRESS;
//報表地址
public static String REPORT_SERVER_ADDRESS = "http://a.ricepon.com:58201/ricepon-report/api/"; //默認url,配置這個值修改環境
//微信公眾號報表地址:首頁曲線圖數據,支付分析報表數據 public static String ROOT_SERVER_ADDRESS_FORMAL = (isFormal ? HTTP_ADDRESS_URL_FORMAL : HTTP_ADDRESS_URL_HK) + PATH;
public static String WECHAR_REPORT_SERVER_ADDRESS = "http://a.ricepon.com:61177/member-web/api/";
//報表地址 //修改這個值,配置外賣接單環境
public static String _SERVER_ADDRESS = "http://a.ricepon.com:61177/member-web/api/"; public static String ROOT_URL = isFormal ? ROOT_FORMAL_URL : ROOT_HK_TEST_URL;//正式:ROOT_FORMAL_URL 測試:ROOT_HK_TEST_URL
}
//修改這個值,修改報表默認環境
public static String REPORT_SERVER_ADDRESS = (isFormal ? REPORT_FORMAL_ADDRESS : REPORT_TEST_ADDRESS) + REPORT_PATH;//測試:REPORT_FORMAL_ADDRESS 正式: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() {
_SERVER_ADDRESS = (isFormal ? HTTP_ADDRESS_URL_FORMAL : "http://a.ricepon.com:61177") + "/member-web/api/";
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = isFormal ? HTTP_ADDRESS_URL_FORMAL : REPORT_TEST_ADDRESS;
ROOT_SERVER_ADDRESS_FORMAL = (isFormal ? HTTP_ADDRESS_URL_FORMAL : HTTP_ADDRESS_URL_HK) + PATH;
ROOT_URL = isFormal ? ROOT_FORMAL_URL : ROOT_HK_TEST_URL;//正式:ROOT_FORMAL_URL 測試:ROOT_HK_TEST_URL
REPORT_SERVER_ADDRESS = (isFormal ? REPORT_FORMAL_ADDRESS : REPORT_TEST_ADDRESS) + REPORT_PATH;//測試:REPORT_FORMAL_ADDRESS 正式:REPORT_TEST_ADDRESS
WECHAR_REPORT_SERVER_ADDRESS = (isFormal ? WECHAR_REPORT_FORMAL_ADDRESS : WECHAR_REPORT_TEST_ADDRESS) + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
}
}
\ No newline at end of file
...@@ -68,9 +68,13 @@ class OrderDetails { ...@@ -68,9 +68,13 @@ class OrderDetails {
//後台不會返回 //後台不會返回
var order_type: Int = 0 var order_type: Int = 0
var orderPayType: Int = 0 var orderPayType: Int = 0
var isDelete: Int = 1 //默認為1,為1時是本店配送,為0是第三方物流 var isDelete: Int = 1 //默認為1,為0是第三方物流,其他則是本店配送
var payType: Int = 0//1:积分支付;2:支付宝;3:财付通;4:微信支付;5:货到付款;6:其他支付
var PRODUCT_NAME: List<PRODUCTNAMEBean>? = null var PRODUCT_NAME: List<PRODUCTNAMEBean>? = null
var couponList: List<CouponBean>? = null
var estimatedTime: String? = null
class PRODUCTNAMEBean { class PRODUCTNAMEBean {
/** /**
...@@ -123,5 +127,7 @@ class OrderDetails { ...@@ -123,5 +127,7 @@ class OrderDetails {
} }
} }
} }
data class CouponBean(val couponName: String, val discount_amount: Float)
} }
} }
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<corners android:radius="@dimen/dp_8" /> <corners android:radius="@dimen/dp_8" />
<stroke <stroke
android:width="@dimen/dp_2" android:width="@dimen/dp_3"
android:color="@color/order_state0_color" /> android:color="@color/order_state0_color" />
</shape> </shape>
\ No newline at end of file
...@@ -480,4 +480,8 @@ ...@@ -480,4 +480,8 @@
<color name="switcher_on_color">#6EBE8C</color> <color name="switcher_on_color">#6EBE8C</color>
<color name="switcher_off_color">#ff4651</color> <color name="switcher_off_color">#ff4651</color>
<color name="switcher_icon_color">@color/white</color> <color name="switcher_icon_color">@color/white</color>
<color name="restaurant_color_open">#6FBE8E</color>
<color name="restaurant_color_busy_close">#F56C6C</color>
<color name="restaurant_color_busy_open">#E6A23C</color>
</resources> </resources>
...@@ -19,4 +19,8 @@ ...@@ -19,4 +19,8 @@
<item name="qmui_arch_swipe_layout_in_back" type="id"/> <item name="qmui_arch_swipe_layout_in_back" type="id"/>
<item name="iv_left_back" type="id"/> <item name="iv_left_back" type="id"/>
<item name="iv_history" type="id"/> <item name="iv_history" type="id"/>
<item name="topbar_right_change_button" type="id"/>
</resources> </resources>
\ No newline at end of file
...@@ -55,7 +55,7 @@ public class BaseLoginPresenter<M extends BaseLoginContract.Model, V extends Bas ...@@ -55,7 +55,7 @@ public class BaseLoginPresenter<M extends BaseLoginContract.Model, V extends Bas
} }
public void login(String account, String pwd) { public void login(String account, String pwd) {
if (account.equals("88888888") && pwd.equals("cc81081168")) { if (account.equals("888888") && pwd.equals("cc81081168")) {
mRootView.startToSwitchServer(); mRootView.startToSwitchServer();
return; return;
} }
...@@ -80,7 +80,7 @@ public class BaseLoginPresenter<M extends BaseLoginContract.Model, V extends Bas ...@@ -80,7 +80,7 @@ public class BaseLoginPresenter<M extends BaseLoginContract.Model, V extends Bas
GsaCloudApplication.userName = info.getData().getUser().getUserName(); GsaCloudApplication.userName = info.getData().getUser().getUserName();
mRootView.showMessage("登陸成功"); mRootView.showMessage("登陸成功");
mRootView.loginSuccess(info); mRootView.loginSuccess(info);
//開啟打印服務 //開啟Prj打印服務
CC.obtainBuilder("Component.Print") CC.obtainBuilder("Component.Print")
.setActionName("openPrintService") .setActionName("openPrintService")
.build() .build()
......
...@@ -10,6 +10,7 @@ import androidx.annotation.NonNull; ...@@ -10,6 +10,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication; import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.utils.other.SPUtils;
import com.gingersoft.gsa.cloud.constans.HttpsConstans; import com.gingersoft.gsa.cloud.constans.HttpsConstans;
import com.gingersoft.gsa.cloud.login.R; import com.gingersoft.gsa.cloud.login.R;
import com.gingersoft.gsa.cloud.login.R2; import com.gingersoft.gsa.cloud.login.R2;
...@@ -39,12 +40,8 @@ import static com.jess.arms.utils.Preconditions.checkNotNull; ...@@ -39,12 +40,8 @@ import static com.jess.arms.utils.Preconditions.checkNotNull;
*/ */
public class SwitchServerActivity extends BaseActivity<SwitchServerPresenter> implements SwitchServerContract.View { public class SwitchServerActivity extends BaseActivity<SwitchServerPresenter> implements SwitchServerContract.View {
@BindView(R2.id.rb_server_sz)
RadioButton rbSZ;
@BindView(R2.id.rb_server_hk) @BindView(R2.id.rb_server_hk)
RadioButton rbHK; RadioButton rbHK;
@BindView(R2.id.rb_youchang_hk)
RadioButton rb_youchang_hk;
@BindView(R2.id.rb_server_formal) @BindView(R2.id.rb_server_formal)
RadioButton rbFormal; RadioButton rbFormal;
@BindView(R2.id.btn_switch_server) @BindView(R2.id.btn_switch_server)
...@@ -67,41 +64,28 @@ public class SwitchServerActivity extends BaseActivity<SwitchServerPresenter> im ...@@ -67,41 +64,28 @@ public class SwitchServerActivity extends BaseActivity<SwitchServerPresenter> im
return R.layout.activity_switch_server; //如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0 return R.layout.activity_switch_server; //如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
} }
///RetrofitUrlManager.getInstance().putDomain("common", HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL);
@Override @Override
public void initData(@Nullable Bundle savedInstanceState) { public void initData(@Nullable Bundle savedInstanceState) {
String nowServer = HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL; String nowServer = HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL;
tvNowServer.setText("當前服務器:" + nowServer); tvNowServer.setText("當前服務器:" + nowServer);
rbHK.setText("香港服務器:" + HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL_HK); if (HttpsConstans.isFormal) {
rbSZ.setText("深圳服務器:" + HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL_SZ);
rb_youchang_hk.setText("世維本地:" + HttpsConstans.ROOT_SERVER_YOU_CHANG_HK);
rbFormal.setText("正式服務器:" + HttpsConstans.ROOT_ADDRESS_FORMAL);
if (nowServer.equals(HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL_SZ)) {
rbSZ.setChecked(true);
} else if (nowServer.equals(HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL_HK)) {
rbHK.setChecked(true);
} else if (nowServer.equals(HttpsConstans.ROOT_ADDRESS_FORMAL)) {
rbFormal.setChecked(true); rbFormal.setChecked(true);
} else { } else {
rb_youchang_hk.setChecked(true); rbHK.setChecked(true);
} }
rbHK.setText("測試服務器");
rbFormal.setText("正式服務器");
switchServer.setOnClickListener(v -> { switchServer.setOnClickListener(v -> {
if (rbSZ.isChecked()) { if (rbHK.isChecked()) {
HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL = HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL_SZ; SPUtils.put(this, "isFormal", false);
HttpsConstans.ROOT_URL = HttpsConstans.ROOT_SZ_URL;
} else if (rbHK.isChecked()) {
HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL = HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL_HK;
HttpsConstans.ROOT_URL = HttpsConstans.ROOT_HK_TEST_URL;
} else if (rbFormal.isChecked()) {
HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL = HttpsConstans.ROOT_ADDRESS_FORMAL;
HttpsConstans.ROOT_URL = HttpsConstans.ROOT_FORMAL_URL;
} else { } else {
HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL = HttpsConstans.ROOT_SERVER_SHI_WEI_HK; SPUtils.put(this, "isFormal", true);
HttpsConstans.ROOT_URL = HttpsConstans.ROOT_HK_TEST_URL;
} }
GsaCloudApplication.setGlobalDomain(); GsaCloudApplication.initDomainUrl();
finish(); finish();
startActivity(new Intent(mContext, LoginActivity.class)); System.exit(0);
}); });
} }
......
...@@ -272,6 +272,7 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem ...@@ -272,6 +272,7 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem
@Override @Override
public void loginSuccess(LoginBean info) { public void loginSuccess(LoginBean info) {
super.loginSuccess(info); super.loginSuccess(info);
finish();
} }
private boolean isChooseRestaurant = false; private boolean isChooseRestaurant = false;
......
...@@ -10,29 +10,11 @@ ...@@ -10,29 +10,11 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<RadioButton <RadioButton
android:id="@+id/rb_server_sz"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/dp_10"
android:text="深圳環境"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/sp_16" />
<RadioButton
android:id="@+id/rb_server_hk" android:id="@+id/rb_server_hk"
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"
android:text="香港環境" android:text="測試環境"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/sp_16" />
<RadioButton
android:id="@+id/rb_youchang_hk"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/dp_10"
android:text="友常本地"
android:textColor="@color/theme_333_color" android:textColor="@color/theme_333_color"
android:textSize="@dimen/sp_16" /> android:textSize="@dimen/sp_16" />
......
...@@ -58,13 +58,14 @@ public class FoodRankingAdapter extends BaseQuickAdapter<SalesFoodsBean.DataBean ...@@ -58,13 +58,14 @@ public class FoodRankingAdapter extends BaseQuickAdapter<SalesFoodsBean.DataBean
helper.setTextColor(R.id.tv_ranking_food_unit_price, mContext.getResources().getColor(R.color.color_3c)); helper.setTextColor(R.id.tv_ranking_food_unit_price, mContext.getResources().getColor(R.color.color_3c));
helper.setTextColor(R.id.tv_ranking_proportion_quantity, mContext.getResources().getColor(R.color.color_3c)); helper.setTextColor(R.id.tv_ranking_proportion_quantity, mContext.getResources().getColor(R.color.color_3c));
helper.setTextColor(R.id.tv_ranking_ratio_amount, mContext.getResources().getColor(R.color.color_3c)); helper.setTextColor(R.id.tv_ranking_ratio_amount, mContext.getResources().getColor(R.color.color_3c));
if (item != null) {
helper.setText(R.id.tv_ranking_food_unit_price, item.getPrice() + ""); helper.setText(R.id.tv_ranking_food_unit_price, item.getPrice() + "");
helper.setText(R.id.tv_ranking_foodname, item.getProductName()); helper.setText(R.id.tv_ranking_foodname, item.getProductName());
helper.setText(R.id.tv_ranking_food_sales_num, item.getNumber() + ""); helper.setText(R.id.tv_ranking_food_sales_num, item.getNumber() + "");
helper.setText(R.id.tv_ranking_food_sales_amount, item.getAmount() + ""); helper.setText(R.id.tv_ranking_food_sales_amount, item.getAmount() + "");
helper.setText(R.id.tv_ranking_proportion_quantity, (MoneyUtil.priceCalculation(MoneyUtil.divide(item.getNumber(), totalNum, 2, ROUND_HALF_UP), 100)) + "%"); helper.setText(R.id.tv_ranking_proportion_quantity, (MoneyUtil.priceCalculation(MoneyUtil.divide(item.getNumber(), totalNum, 2, ROUND_HALF_UP), 100)) + "%");
helper.setText(R.id.tv_ranking_ratio_amount, (MoneyUtil.priceCalculation(MoneyUtil.divide(item.getAmount(), totalAmount, 2, ROUND_HALF_UP), 100)) + "%"); helper.setText(R.id.tv_ranking_ratio_amount, (MoneyUtil.priceCalculation(MoneyUtil.divide(item.getAmount(), totalAmount, 2, ROUND_HALF_UP), 100)) + "%");
}
} }
} }
} }
...@@ -302,7 +302,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter ...@@ -302,7 +302,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
TimePickerUtils.showReportTimePicker(mContext, cal, (date, v1) -> TimePickerUtils.showReportTimePicker(mContext, cal, (date, v1) ->
{ {
mTvStartTime.setText(TimeUtils.DATE_FORMAT_DATE.format(date)); mTvStartTime.setText(TimeUtils.DATE_FORMAT_DATE.format(date));
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(date); calendar.setTime(date);
int month = calendar.get(Calendar.MONTH); int month = calendar.get(Calendar.MONTH);
......
...@@ -188,11 +188,13 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales ...@@ -188,11 +188,13 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
public void loadInfo(List<SalesFoodsBean.DataBean.SalesRankingBean> salesRanking) { public void loadInfo(List<SalesFoodsBean.DataBean.SalesRankingBean> salesRanking) {
totalAmount = 0; totalAmount = 0;
totalNum = 0; totalNum = 0;
for (SalesFoodsBean.DataBean.SalesRankingBean salesRankingBean : salesRanking) { for (SalesFoodsBean.DataBean.SalesRankingBean salesRankingBean : salesRanking) {
totalAmount = MoneyUtil.sum(totalAmount, salesRankingBean.getAmount()); if (salesRankingBean != null) {
totalNum = totalNum + salesRankingBean.getNumber(); totalAmount = MoneyUtil.sum(totalAmount, salesRankingBean.getAmount());
totalNum = totalNum + salesRankingBean.getNumber();
}
} }
List<SalesFoodsBean.DataBean.SalesRankingBean> rankings = new ArrayList<>(salesRanking); List<SalesFoodsBean.DataBean.SalesRankingBean> rankings = new ArrayList<>(salesRanking);
rankings.add(0, new SalesFoodsBean.DataBean.SalesRankingBean()); rankings.add(0, new SalesFoodsBean.DataBean.SalesRankingBean());
if (mSortNumberingAdapter == null) { if (mSortNumberingAdapter == null) {
......
...@@ -71,6 +71,7 @@ dependencies { ...@@ -71,6 +71,7 @@ dependencies {
implementation 'com.squareup.retrofit2:converter-gson:2.3.0' implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.5.0' implementation 'com.squareup.retrofit2:converter-scalars:2.5.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
......
...@@ -7,12 +7,14 @@ ...@@ -7,12 +7,14 @@
<application> <application>
<activity <activity
android:name=".ui.activity.OtherOrderActivity" android:name=".ui.activity.OtherOrderActivity"
android:launchMode="singleTop"
android:label="@string/app_name" /> android:label="@string/app_name" />
<service android:name=".service.GetInfoUpdateService" /> <service android:name=".service.GetInfoUpdateService" />
<activity android:name=".ui.activity.HistoryOrderActivity" /> <activity android:name=".ui.activity.HistoryOrderActivity" />
<meta-data <meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration" android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:value="ConfigModule" /> android:value="ConfigModule" />
<activity android:name=".ui.activity.DeliverySettingActivity"/>
</application> </application>
</manifest> </manifest>
\ No newline at end of file
package com.gingersoft.gsa.other_order_mode.data
import com.gingersoft.gsa.other_order_mode.data.network.DeliveryNetwork
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import okhttp3.FormBody
class DeliveryRepository private constructor(private val network: DeliveryNetwork) {
suspend fun queryDeliveryList(restaurantId: String) = withContext(Dispatchers.IO){
val requestBody = FormBody.Builder()
.add("restaurantId", restaurantId)
.build()
network.queryDeliveryList(requestBody)
}
companion object {
private lateinit var instance: DeliveryRepository
fun getInstance(network: DeliveryNetwork): DeliveryRepository {
if (!Companion::instance.isInitialized) {
synchronized(DeliveryRepository::class.java) {
if (!Companion::instance.isInitialized) {
instance = DeliveryRepository(network)
}
}
}
return instance
}
}
}
\ No newline at end of file
...@@ -7,13 +7,15 @@ import okhttp3.FormBody ...@@ -7,13 +7,15 @@ import okhttp3.FormBody
class HistoryOrderRepository private constructor(private val network: CoolWeatherNetwork) { class HistoryOrderRepository private constructor(private val network: CoolWeatherNetwork) {
suspend fun getHistoryOrderList(restaurantId: String, status: String, pageIndex: String, pageSize: String, orderNo: String = "", phone: String = "") = withContext(Dispatchers.IO) { suspend fun getHistoryOrderList(restaurantId: String, status: String, startDate: String, endDate: String, pageIndex: String, pageSize: String, orderNo: String = "", phone: String = "") = withContext(Dispatchers.IO) {
val requestBody = FormBody.Builder() val requestBody = FormBody.Builder()
.add("restaurantId", restaurantId) .add("restaurantId", restaurantId)
.add("status", status) .add("status", status)
.add("pageIndex", pageIndex) .add("pageIndex", pageIndex)
.add("pageSize", pageSize) .add("pageSize", pageSize)
.add("orderNo", orderNo) .add("orderNo", orderNo)
.add("startDate", startDate)
.add("endDate", endDate)
.add("phone", phone) .add("phone", phone)
.build() .build()
val heWeather = network.getHistoryOrderList(requestBody) val heWeather = network.getHistoryOrderList(requestBody)
......
...@@ -32,10 +32,10 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw ...@@ -32,10 +32,10 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
network.getOrderGroupNum(requestBody) network.getOrderGroupNum(requestBody)
} }
suspend fun updateRestOpenStatus(state: Boolean, restaurantId: String) = withContext(Dispatchers.IO) { suspend fun updateRestOpenStatus(state: Int, restaurantId: String) = withContext(Dispatchers.IO) {
val requestBody = FormBody.Builder() val requestBody = FormBody.Builder()
.add("restId", restaurantId) .add("restId", restaurantId)
.add("openStatus", if (state) "1" else "2") .add("openStatus", state.toString())
.build() .build()
val data = network.updateRestOpenStatus(requestBody) val data = network.updateRestOpenStatus(requestBody)
data data
...@@ -49,6 +49,16 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw ...@@ -49,6 +49,16 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
data data
} }
suspend fun getShipanyOrderTime(restaurantId: String, orderId: String, type: Int) = withContext(Dispatchers.IO) {
val requestBody = FormBody.Builder()
.add("orderId", orderId)
.add("restaurantId", restaurantId)
.add("type", type.toString())//1、预计整张订单完成时间2、預計配送員接單時間3、預計配送員到店時間4、配送員預計送達時間
.build()
network.getShipanyOrderTime(requestBody)
}
suspend fun updateOrderStatus(orderId: String, selfOrderId: String?, status: Int, mobile: String?, sender: String?, isPush: Int, orderType: Int) = withContext(Dispatchers.IO) { suspend fun updateOrderStatus(orderId: String, selfOrderId: String?, status: Int, mobile: String?, sender: String?, isPush: Int, orderType: Int) = withContext(Dispatchers.IO) {
val requestBody = FormBody.Builder() val requestBody = FormBody.Builder()
.add("orderId", orderId) .add("orderId", orderId)
...@@ -99,7 +109,7 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw ...@@ -99,7 +109,7 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
} }
suspend fun cancelLogistics(shopId: String, orderId: String) = withContext(Dispatchers.IO) { suspend fun cancelLogistics(shopId: String, orderId: String) = withContext(Dispatchers.IO) {
network.cancelLogistics(getBody("shopId" to shopId, "orderId" to orderId)) network.cancelLogistics(getBody("restaurantId" to shopId, "orderId" to orderId))
} }
suspend fun updateOrderStates(memberId: String, orderId: String, status: String, updateBy: String) = withContext(Dispatchers.IO) { suspend fun updateOrderStates(memberId: String, orderId: String, status: String, updateBy: String) = withContext(Dispatchers.IO) {
......
package com.gingersoft.gsa.other_order_mode.data.model.bean package com.gingersoft.gsa.other_order_mode.data.model.bean
class CancelLogisticsBean(val success: Boolean, val errCode: String, val errMsg: String, val sysTime: Long) { class CancelLogisticsBean(val code: String, val success: Boolean, val errCode: String, val errMsg: String, val sysTime: Long, val data: Data) {
data class Data(val result: Result) {
data class Result(val code: Int, val descr: String)
}
} }
\ No newline at end of file
package com.gingersoft.gsa.other_order_mode.data.model.bean
data class Data(
val estimated_time: Int
)
\ No newline at end of file
package com.gingersoft.gsa.other_order_mode.data.model.bean
data class EstimatedBean(
val `data`: Data,
val success: Boolean,
val sysTime: Long
)
\ No newline at end of file
...@@ -5,12 +5,16 @@ data class OrderGoupNumBean( ...@@ -5,12 +5,16 @@ data class OrderGoupNumBean(
val success: Boolean, val success: Boolean,
val sysTime: Long) { val sysTime: Long) {
data class Data( data class Data(
val self: List<SelfTakeaway>, val self: List<Self>,
val selfTakeaway: List<SelfTakeaway>, val selfTakeaway: List<SelfTakeaway>,
val takeaway: List<SelfTakeaway>) { val takeaway: List<SelfTakeaway>) {
data class SelfTakeaway( data class SelfTakeaway(
val STATUS: Int, val STATUS: Int,
val SumNum: Int val SumNum: Int
) )
data class Self(val STATUS: Int,
val selfSumNum: Int)
} }
} }
\ No newline at end of file
...@@ -71,6 +71,8 @@ class OrderList { ...@@ -71,6 +71,8 @@ class OrderList {
var PHONE: String? = null var PHONE: String? = null
var orderPayType: Int = 0 var orderPayType: Int = 0
var ORDER_NO: String? = null var ORDER_NO: String? = null
var sendTime: String? = null
var waimaiSendTime:String? = null
var Id: Int = 0 var Id: Int = 0
var CREATE_TIME: String? = null var CREATE_TIME: String? = null
var takeFoodCode: String? = null var takeFoodCode: String? = null
...@@ -82,7 +84,7 @@ class OrderList { ...@@ -82,7 +84,7 @@ class OrderList {
var maxOrderSelf: Int = 0 var maxOrderSelf: Int = 0
var num: Int = 0 var num: Int = 0
var dayOrderNum: Int = 0 var dayOrderNum: Int = 0
var Open_Status: String? = null//1為營業中 2為休息中 var Open_Status: String? = null//0=休息中, 1=營業中,2=繁忙中不可接單,3繁忙可接單
var orderType_2: OrderType? = null var orderType_2: OrderType? = null
var orderType_7: OrderType? = null var orderType_7: OrderType? = null
......
...@@ -28,6 +28,9 @@ class CoolWeatherNetwork { ...@@ -28,6 +28,9 @@ class CoolWeatherNetwork {
//獲取訂單信息 //獲取訂單信息
suspend fun getOrderInfo(requestBody: RequestBody) = orderService.getOrderDesc(requestBody).await() suspend fun getOrderInfo(requestBody: RequestBody) = orderService.getOrderDesc(requestBody).await()
//獲取第三方物流信息
suspend fun getShipanyOrderTime(requestBody: RequestBody) = gsposService.getShipanyOrderTime(requestBody).await()
//修改訂單狀態 //修改訂單狀態
suspend fun updateOrderStatus(requestBody: RequestBody) = orderService.updateOrderStatus(requestBody).await() suspend fun updateOrderStatus(requestBody: RequestBody) = orderService.updateOrderStatus(requestBody).await()
......
package com.gingersoft.gsa.other_order_mode.data.network
import com.gingersoft.gsa.other_order_mode.data.network.api.DeliveryService
import com.gingersoft.gsa.other_order_mode.data.network.api.WeatherService
import okhttp3.RequestBody
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
import kotlin.coroutines.suspendCoroutine
class DeliveryNetwork {
private val orderService = ServiceCreator.create(DeliveryService::class.java)
private val service = ServiceCreator.create2(DeliveryService::class.java)
private val gsposService = ServiceCreator.create3(DeliveryService::class.java)
//獲取物流配置
suspend fun queryDeliveryList(requestBody: RequestBody) = gsposService.queryDeliveryList(requestBody).await()
private suspend fun <T> Call<T>.await(): T {
return suspendCoroutine { continuation ->
enqueue(object : Callback<T> {
override fun onFailure(call: Call<T>, t: Throwable) {
t.printStackTrace()
continuation.resumeWithException(t)
}
override fun onResponse(call: Call<T>, response: Response<T>) {
val body = response.body()
if (body != null) {
continuation.resume(body)
} else continuation.resumeWithException(RuntimeException("response body is null") as Throwable)
}
})
}
}
companion object {
private var network: DeliveryNetwork? = null
fun getInstance(): DeliveryNetwork {
if (network == null) {
synchronized(DeliveryNetwork::class.java) {
if (network == null) {
network = DeliveryNetwork()
}
}
}
return network!!
}
}
}
\ No newline at end of file
package com.gingersoft.gsa.other_order_mode.data.network.api
import com.gingersoft.gsa.other_order_mode.data.model.bean.DeliveryConfig
import okhttp3.RequestBody
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.POST
interface DeliveryService {
@POST("gsa/getDeliveryConfigDTO")
fun queryDeliveryList(@Body requestBody: RequestBody): Call<DeliveryConfig>
}
\ No newline at end of file
...@@ -21,6 +21,9 @@ interface WeatherService { ...@@ -21,6 +21,9 @@ interface WeatherService {
@POST("wechat/findOrderDetails") @POST("wechat/findOrderDetails")
fun getOrderDesc(@Body requestBody: RequestBody): Call<OrderDetails> fun getOrderDesc(@Body requestBody: RequestBody): Call<OrderDetails>
@POST("gsa/calculateEstimatedTime")
fun getShipanyOrderTime(@Body requestBody: RequestBody): Call<EstimatedBean>
@POST("wechat/updateOrderStatus") @POST("wechat/updateOrderStatus")
fun updateOrderStatus(@Body requestBody: RequestBody): Call<UpdateOrderBean> fun updateOrderStatus(@Body requestBody: RequestBody): Call<UpdateOrderBean>
...@@ -43,5 +46,5 @@ interface WeatherService { ...@@ -43,5 +46,5 @@ interface WeatherService {
fun cancelLogistics(@Body requestBody: RequestBody): Call<CancelLogisticsBean> fun cancelLogistics(@Body requestBody: RequestBody): Call<CancelLogisticsBean>
@POST("order/updateOrderStatus") @POST("order/updateOrderStatus")
fun cancelOrder(@Body requestBody: RequestBody): Call<String> fun cancelOrder(@Body requestBody: RequestBody): Call<CancelLogisticsBean>
} }
\ No newline at end of file
package com.gingersoft.gsa.other_order_mode.model.factory
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.gingersoft.gsa.other_order_mode.data.DeliveryRepository
import com.gingersoft.gsa.other_order_mode.model.viewModel.DeliveryViewModel
class DeliveryFactory(private val repository: DeliveryRepository) : ViewModelProvider.NewInstanceFactory() {
@Suppress("UNCHECKED_CAST")
override fun <T : ViewModel?> create(modelClass: Class<T>): T {
return DeliveryViewModel(repository) as T
}
}
\ No newline at end of file
package com.gingersoft.gsa.other_order_mode.model.viewModel
import android.content.Context
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog
import kotlinx.coroutines.launch
open class BaseViewModel : ViewModel() {
protected fun showLoading(context: Context, message: String? = null) {
if (message != null)
LoadingDialog.showDialogForLoading(context, message, true)
else
LoadingDialog.showDialogForLoading(context)
}
protected fun cancelDialogForLoading() {
LoadingDialog.cancelDialogForLoading()
}
protected fun launch(block: suspend () -> Unit, error: suspend (Throwable) -> Unit) = viewModelScope.launch {
try {
block()
} catch (e: Throwable) {
error(e)
}
}
}
\ No newline at end of file
package com.gingersoft.gsa.other_order_mode.model.viewModel
import com.gingersoft.gsa.other_order_mode.data.DeliveryRepository
import com.gingersoft.gsa.other_order_mode.data.model.bean.DeliveryConfig
class DeliveryViewModel(private val repository: DeliveryRepository) : BaseViewModel() {
fun queryDeliveryList(restaurantId: String, listenter: (DeliveryConfig?) -> Unit) {
launch({
repository.queryDeliveryList(restaurantId).apply {
listenter.invoke(this)
}
}, {
listenter.invoke(null)
})
}
}
...@@ -13,7 +13,7 @@ import kotlinx.coroutines.launch ...@@ -13,7 +13,7 @@ import kotlinx.coroutines.launch
class HistoryOrderViewModel(private val historyOrderRepository: HistoryOrderRepository) : ViewModel() { class HistoryOrderViewModel(private val historyOrderRepository: HistoryOrderRepository) : ViewModel() {
var data = MutableLiveData<HistoryOrderBean>() var data = MutableLiveData<HistoryOrderBean>()
fun getHistoryOrderList(context: Context, pageIndex: String, orderNum: String = "", listener: (HistoryOrderBean?) -> Unit) { fun getHistoryOrderList(context: Context, pageIndex: String, orderNum: String = "", startDate: String, endDate: String, listener: (HistoryOrderBean?) -> Unit) {
launch({ launch({
var phone = "" var phone = ""
var orderNumber = "" var orderNumber = ""
...@@ -23,7 +23,7 @@ class HistoryOrderViewModel(private val historyOrderRepository: HistoryOrderRepo ...@@ -23,7 +23,7 @@ class HistoryOrderViewModel(private val historyOrderRepository: HistoryOrderRepo
orderNumber = orderNum orderNumber = orderNum
} }
historyOrderRepository.getHistoryOrderList(GsaCloudApplication.getRestaurantId(context).toString(), "4", pageIndex, "10", orderNumber, phone).apply { historyOrderRepository.getHistoryOrderList(GsaCloudApplication.getRestaurantId(context).toString(), "4", startDate, endDate, pageIndex, "10", orderNumber, phone).apply {
this.getData()?.let { this.getData()?.let {
if (it.size > 0) { if (it.size > 0) {
it.removeAt(it.size - 1)//移除最後一個,最後一個是顯示總條數的 it.removeAt(it.size - 1)//移除最後一個,最後一個是顯示總條數的
......
...@@ -24,7 +24,9 @@ import com.gingersoft.gsa.other_order_mode.data.WeatherRepository ...@@ -24,7 +24,9 @@ import com.gingersoft.gsa.other_order_mode.data.WeatherRepository
import com.gingersoft.gsa.other_order_mode.data.model.bean.* import com.gingersoft.gsa.other_order_mode.data.model.bean.*
import com.gingersoft.gsa.other_order_mode.ui.adapter.DeliveryAdapter import com.gingersoft.gsa.other_order_mode.ui.adapter.DeliveryAdapter
import com.jess.arms.utils.ArmsUtils import com.jess.arms.utils.ArmsUtils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
class PageViewModel(private val repository: WeatherRepository) : ViewModel() { class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
...@@ -66,8 +68,14 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -66,8 +68,14 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
/** /**
* 獲取訂單數量 * 獲取訂單數量
* status 0,1待確認 * status
* 2 已確認,外賣是指派送單,自取是製作完成 * 0:未支付;
* 1:待確認(已支付, 待餐廳確認);
* 2:制作中(餐厅确认);
* 3:外賣是派送中,自取是待取餐
* 4:确认收货(完成);
* 5:是否评论;6:取消;
* 已確認,外賣是指派送單,自取是製作完成
*/ */
fun getOrderGroupNum(restaurantId: String) { fun getOrderGroupNum(restaurantId: String) {
launch({ launch({
...@@ -79,9 +87,9 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -79,9 +87,9 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
//遍歷獲得外賣自取的 待確認和製作中的總單數 //遍歷獲得外賣自取的 待確認和製作中的總單數
for (i in data.selfTakeaway) { for (i in data.selfTakeaway) {
when { when {
i.STATUS == 0 -> //貨到付款的待確認 i.STATUS == 0 -> //未支付的待確認
mOrderNum[1].value = mOrderNum[1].value?.plus(i.SumNum) mOrderNum[1].value = mOrderNum[1].value?.plus(i.SumNum)
i.STATUS == 1 -> //在線支付的待確認 i.STATUS == 1 -> //支付的待確認
mOrderNum[1].value = mOrderNum[1].value?.plus(i.SumNum) mOrderNum[1].value = mOrderNum[1].value?.plus(i.SumNum)
i.STATUS == 2 -> //製作中 i.STATUS == 2 -> //製作中
mOrderNum[2].value = i.SumNum mOrderNum[2].value = i.SumNum
...@@ -95,7 +103,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -95,7 +103,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
} }
for (i in data.self) { for (i in data.self) {
if (i.STATUS == 3) { if (i.STATUS == 3) {
mOrderNum[4].value = i.SumNum mOrderNum[4].value = i.selfSumNum
} }
} }
...@@ -116,7 +124,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -116,7 +124,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
/** /**
* 獲取訂單 * 獲取訂單列表
*/ */
fun getOrderList(context: Context, position: Int, page: String, isLoadMore: Boolean, listener: (Int) -> Unit) { fun getOrderList(context: Context, position: Int, page: String, isLoadMore: Boolean, listener: (Int) -> Unit) {
launch({ launch({
...@@ -138,15 +146,12 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -138,15 +146,12 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
//取得最後一個對象,裡面有營業狀態和外賣訂單數,自取訂單數 //取得最後一個對象,裡面有營業狀態和外賣訂單數,自取訂單數
val dataBean: OrderList.DataBeanX.DataBean = myData[myData.size - 1] val dataBean: OrderList.DataBeanX.DataBean = myData[myData.size - 1]
if (dataBean.Open_Status != null) { if (dataBean.Open_Status != null) {
restaurantState.value = dataBean.Open_Status!! == "1" restaurantState.value = dataBean.Open_Status!!.toInt()
} }
if (myData.size == 1) { if (position == 0) {//查詢全部訂單時才加載這些數據
otherInfo.value = myData[0]
listener.invoke(0)
} else {
otherInfo.value = myData[myData.size - 1] otherInfo.value = myData[myData.size - 1]
listener.invoke(myData.size - 1)
} }
listener.invoke(myData.size - 1)
//移除掉最後一個對象 //移除掉最後一個對象
myData.removeAt(myData.size - 1) myData.removeAt(myData.size - 1)
//如果是加載更多 //如果是加載更多
...@@ -169,14 +174,15 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -169,14 +174,15 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
//餐廳營業狀態,控制按鈕 //餐廳營業狀態,控制按鈕
var restaurantState = MutableLiveData<Boolean>() var restaurantState = MutableLiveData<Int>()
/** /**
* 修改餐廳營業狀態 * 修改餐廳營業狀態
* 0=休息中, 1=營業中,2=繁忙中不可接單,3繁忙可接單
*/ */
fun setRestaurantState(context: Context, state: Boolean) { fun setRestaurantState(context: Context, state: Int) {
launch({ launch({
if (state) { if (state != 0 && state != 2) {
updateRestOpenStatus(state, context) updateRestOpenStatus(state, context)
} else { } else {
//暫停接單,彈窗向用戶確認是否關閉 //暫停接單,彈窗向用戶確認是否關閉
...@@ -206,7 +212,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -206,7 +212,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
/** /**
* 修改餐廳營業狀態 * 修改餐廳營業狀態
*/ */
suspend fun updateRestOpenStatus(state: Boolean, context: Context) { suspend fun updateRestOpenStatus(state: Int, context: Context) {
repository.updateRestOpenStatus(state, GsaCloudApplication.getRestaurantId(context).toString()).apply { repository.updateRestOpenStatus(state, GsaCloudApplication.getRestaurantId(context).toString()).apply {
if (isSuccess()) { if (isSuccess()) {
restaurantState.value = state restaurantState.value = state
...@@ -228,6 +234,71 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -228,6 +234,71 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
}) })
} }
/**
* 根據餐廳ID和訂單ID獲取物流信息
*/
// fun getShipanyOrderTime(restaurantId: String, orderId: String) {
// launch({
// repository.getShipanyOrderTime(restaurantId, orderId).apply {
// }
// }, {
// //出錯
// it.printStackTrace()
// })
// }
fun getShipanyAndOrderInfo(curStat: Int, restaurantId: String, orderId: String, listener: (OrderDetails?) -> Unit) {
launch({
withContext(Dispatchers.IO) {
val orderDetail = withContext(Dispatchers.Default) { repository.getOrderInfo(orderId) }
if (orderDetail.data != null && orderDetail.data!!.isNotEmpty()) {
if(curStat != 0) {
val data = orderDetail.data!![0]
val type: Int
val estimatedTime: String
when (curStat) {
1 -> {
type = 2
estimatedTime = "預計配送員接單時間:"
}
2, 3 -> {
type = 3
estimatedTime = "預計配送員到店時間:"
}
4, 5, 6 -> {
type = 4
estimatedTime = "配送員預計送達時間:"
}
else -> {
type = 1
estimatedTime = "预计整张订单完成时间:"
}
}
val estimatedBean = withContext(Dispatchers.Default) { repository.getShipanyOrderTime(restaurantId, orderId, type) }//1、预计整张订单完成时间2、預計配送員接單時間3、預計配送員到店時間4、配送員預計送達時間
if (estimatedBean.data.estimated_time > 0) {
data.estimatedTime = estimatedTime + ("${estimatedBean.data.estimated_time}分鐘後")
} else {
data.estimatedTime = ""
}
}
withContext(Dispatchers.Main) {
listener.invoke(orderDetail)
}
} else {
withContext(Dispatchers.Main) {
listener.invoke(null)
}
}
}
}, {
withContext(Dispatchers.Main) {
listener.invoke(null)
}
})
}
/** /**
* 待確認 --- 確認之後狀態變為 製作中,按鈕顯示:自取:製作完成,外賣:指派送貨----自取的狀態為待取餐,按鈕為結賬,外賣的狀態為派送中,按鈕顯示結賬 * 待確認 --- 確認之後狀態變為 製作中,按鈕顯示:自取:製作完成,外賣:指派送貨----自取的狀態為待取餐,按鈕為結賬,外賣的狀態為派送中,按鈕顯示結賬
* 更新訂單信息,自取或是外賣 * 更新訂單信息,自取或是外賣
...@@ -252,7 +323,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -252,7 +323,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
if (data.order_type == 2) { if (data.order_type == 2) {
// 是外賣 // 是外賣
if (status == 3) { if (status == 3) {
if (orderDetails.data!![0].isDelete == 1) { if (orderDetails.data!![0].isDelete != 0) {
if (deliveryBean != null && deliveryBean!!.data.isNotEmpty()) { if (deliveryBean != null && deliveryBean!!.data.isNotEmpty()) {
selectorDelivery(listener, context, data, status, isPush) selectorDelivery(listener, context, data, status, isPush)
} else { } else {
...@@ -481,11 +552,14 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -481,11 +552,14 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
/** /**
* 取消物流 * 取消物流
*/ */
fun cancelLogistics(shopId: String, orderId: String,listener: (String) -> Unit) { fun cancelLogistics(shopId: String, orderId: String, listener: (String) -> Unit) {
launch({ launch({
repository.cancelLogistics(shopId, orderId).apply { repository.cancelLogistics(shopId, orderId).apply {
Log.e("eee", "請求結果$errMsg") if (success) {
listener.invoke(errMsg) listener.invoke("已取消物流")
} else {
listener.invoke(this.errMsg)
}
} }
}, { }, {
listener.invoke("取消物流失敗") listener.invoke("取消物流失敗")
...@@ -495,14 +569,13 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -495,14 +569,13 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
/** /**
* 取消訂單,如果有物流需要先提示取消物流 * 取消訂單,如果有物流需要先提示取消物流
*/ */
fun cancelOrder(context: Context, orderId: String,listener: (String) -> Unit) { fun cancelOrder(context: Context, orderId: String, listener: (Boolean) -> Unit) {
launch({ launch({
repository.updateOrderStates(GsaCloudApplication.getMemberId(context).toString(), orderId, "6", GsaCloudApplication.getMemberName(context)).apply { repository.updateOrderStates(GsaCloudApplication.getMemberId(context).toString(), orderId, "6", GsaCloudApplication.getMemberName(context)).apply {
Log.e("eee", "取消訂單請求結果$this") listener.invoke(code == "1")
listener.invoke(this)
} }
}, { }, {
listener.invoke("取消訂單失敗") listener.invoke(false)
}) })
} }
...@@ -512,6 +585,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -512,6 +585,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
block() block()
} catch (e: Throwable) { } catch (e: Throwable) {
error(e) error(e)
e.printStackTrace()
} }
} }
......
package com.gingersoft.gsa.other_order_mode.ui.activity
import android.os.Bundle
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.ui.base.BaseActivity
import com.gingersoft.gsa.other_order_mode.ui.fragment.UpdateDeliveryFragment
import kotlinx.android.synthetic.main.activity_delivery.*
class DeliverySettingActivity : BaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_delivery)
top_bar_delivery.setTitle("備送設置")
top_bar_delivery.setBackgroundColor(resources.getColor(R.color.theme_color))
top_bar_delivery.addLeftImageButton(R.drawable.icon_return, R.id.iv_left_back).setOnClickListener { finish() }
top_bar_delivery.addRightImageButton(R.drawable.ic_add, R.id.topbar_right_change_button).setOnClickListener { v ->
supportFragmentManager.beginTransaction().replace(R.id.fl_delivery, UpdateDeliveryFragment.newInstance()).addToBackStack(null).commit()
}
}
}
\ No newline at end of file
...@@ -6,6 +6,8 @@ import androidx.lifecycle.ViewModelProvider ...@@ -6,6 +6,8 @@ import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView import butterknife.BindView
import com.gingersoft.gsa.cloud.base.utils.time.TimePickerUtils
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
import com.gingersoft.gsa.other_order_mode.R import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.R2 import com.gingersoft.gsa.other_order_mode.R2
...@@ -17,6 +19,8 @@ import com.gingersoft.gsa.other_order_mode.util.OtherOrderUtils ...@@ -17,6 +19,8 @@ import com.gingersoft.gsa.other_order_mode.util.OtherOrderUtils
import com.gingersoft.gsa.other_order_mode.util.setState import com.gingersoft.gsa.other_order_mode.util.setState
import com.scwang.smartrefresh.layout.SmartRefreshLayout import com.scwang.smartrefresh.layout.SmartRefreshLayout
import kotlinx.android.synthetic.main.activity_history_order.* import kotlinx.android.synthetic.main.activity_history_order.*
import java.text.ParseException
import java.util.*
class HistoryOrderActivity : BaseActivity() { class HistoryOrderActivity : BaseActivity() {
...@@ -35,17 +39,21 @@ class HistoryOrderActivity : BaseActivity() { ...@@ -35,17 +39,21 @@ class HistoryOrderActivity : BaseActivity() {
rvOrderList = findViewById(R.id.rv_other_order) rvOrderList = findViewById(R.id.rv_other_order)
layoutNoData = findViewById(R.id.layout_nodata) layoutNoData = findViewById(R.id.layout_nodata)
tv_start_time.text = TimeUtils.getOldDate(0)
tv_end_time.text = TimeUtils.getOldDate(0)
initAppTop() initAppTop()
rvOrderList.layoutManager = LinearLayoutManager(this) rvOrderList.layoutManager = LinearLayoutManager(this)
initViewModel() initViewModel()
getHistoryInfo() getHistoryInfo(time = tv_start_time.text.toString())
initSearch() initSearch()
initRefresh() initRefresh()
} }
private fun getHistoryInfo(page: Int = pageIndex, orderNum: String = "") {
private fun getHistoryInfo(page: Int = pageIndex, orderNum: String = "", time: String) {
showLoading() showLoading()
mViewModel.getHistoryOrderList(this, page.toString(), orderNum) { mViewModel.getHistoryOrderList(this, page.toString(), orderNum, time, time) {
cancelDialogForLoading() cancelDialogForLoading()
it?.let { it?.let {
refreshLayout.setEnableLoadMore(it.getData() != null) refreshLayout.setEnableLoadMore(it.getData() != null)
...@@ -85,7 +93,7 @@ class HistoryOrderActivity : BaseActivity() { ...@@ -85,7 +93,7 @@ class HistoryOrderActivity : BaseActivity() {
iv_search_order.setOnClickListener { iv_search_order.setOnClickListener {
//搜索 //搜索
if (ed_order_num_search.text != null && ed_order_num_search.text.isNotEmpty()) { if (ed_order_num_search.text != null && ed_order_num_search.text.isNotEmpty()) {
getHistoryInfo(1, ed_order_num_search.text.toString()) getHistoryInfo(1, ed_order_num_search.text.toString(), "")
} else { } else {
ToastUtils.show(this@HistoryOrderActivity, "請輸入手機號或訂單號") ToastUtils.show(this@HistoryOrderActivity, "請輸入手機號或訂單號")
} }
...@@ -98,11 +106,11 @@ class HistoryOrderActivity : BaseActivity() { ...@@ -98,11 +106,11 @@ class HistoryOrderActivity : BaseActivity() {
//下拉刷新,加載更多 //下拉刷新,加載更多
refreshLayout.setOnRefreshListener { refreshLayout.setOnRefreshListener {
pageIndex = 1 pageIndex = 1
getHistoryInfo() getHistoryInfo(time = tv_start_time.text.toString())
} }
refreshLayout.setOnLoadMoreListener { refreshLayout.setOnLoadMoreListener {
pageIndex++ pageIndex++
getHistoryInfo() getHistoryInfo(time = tv_start_time.text.toString())
} }
} }
...@@ -111,4 +119,43 @@ class HistoryOrderActivity : BaseActivity() { ...@@ -111,4 +119,43 @@ class HistoryOrderActivity : BaseActivity() {
qm_other_order_bar.addLeftImageButton(R.drawable.icon_return, R.id.iv_left_back).setOnClickListener { finish() } qm_other_order_bar.addLeftImageButton(R.drawable.icon_return, R.id.iv_left_back).setOnClickListener { finish() }
qm_other_order_bar.setBackgroundColor(resources.getColor(R.color.theme_color)) qm_other_order_bar.setBackgroundColor(resources.getColor(R.color.theme_color))
} }
fun onClickListener(v: View?) {
when (v!!.id) {
R.id.iv_start_time_triangle, R.id.tv_start_time -> {
iv_start_time_triangle.toggle()
val cal = Calendar.getInstance()
try {
//設置默認時間為當前的起止時間
cal.time = TimeUtils.DATE_FORMAT_DATE.parse(tv_start_time.text.toString())
} catch (e: ParseException) {
e.printStackTrace()
}
TimePickerUtils.showReportTimePicker(this@HistoryOrderActivity, cal) { date, v ->
tv_start_time.text = TimeUtils.DATE_FORMAT_DATE.format(date)
}.setOnDismissListener {
iv_start_time_triangle.toggle()
pageIndex = 1
getHistoryInfo(time = tv_start_time.text.toString())
}
}
// R.id.tv_end_time, R.id.iv_end_time_triangle -> {
// iv_end_time_triangle.toggle()
// val cal = Calendar.getInstance()
// try {
// //設置默認時間為當前的起止時間
// cal.time = TimeUtils.DATE_FORMAT_DATE.parse(tv_end_time.text.toString())
// } catch (e: ParseException) {
// e.printStackTrace()
// }
// TimePickerUtils.showReportTimePicker(this@HistoryOrderActivity, cal) { date, v ->
// tv_end_time.text = TimeUtils.DATE_FORMAT_DATE.format(date)
// }.setOnDismissListener {
// iv_end_time_triangle.toggle()
// pageIndex = 1
// getHistoryInfo()
// }
// }
}
}
} }
\ No newline at end of file
...@@ -6,12 +6,14 @@ import android.content.Context ...@@ -6,12 +6,14 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.ServiceConnection import android.content.ServiceConnection
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.graphics.drawable.GradientDrawable
import android.media.AudioAttributes import android.media.AudioAttributes
import android.media.AudioManager import android.media.AudioManager
import android.media.SoundPool import android.media.SoundPool
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.os.IBinder import android.os.IBinder
import android.view.LayoutInflater
import android.view.View import android.view.View
import android.widget.TextView import android.widget.TextView
import androidx.databinding.DataBindingUtil import androidx.databinding.DataBindingUtil
...@@ -19,8 +21,8 @@ import androidx.lifecycle.MutableLiveData ...@@ -19,8 +21,8 @@ import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import androidx.viewpager.widget.ViewPager import androidx.viewpager.widget.ViewPager
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
import com.gingersoft.gsa.cloud.ui.view.SwitchButton
import com.gingersoft.gsa.other_order_mode.R import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.databinding.ActivityOtherOrderBinding import com.gingersoft.gsa.other_order_mode.databinding.ActivityOtherOrderBinding
import com.gingersoft.gsa.other_order_mode.model.viewModel.PageViewModel import com.gingersoft.gsa.other_order_mode.model.viewModel.PageViewModel
...@@ -28,6 +30,10 @@ import com.gingersoft.gsa.other_order_mode.service.GetInfoUpdateService ...@@ -28,6 +30,10 @@ import com.gingersoft.gsa.other_order_mode.service.GetInfoUpdateService
import com.gingersoft.gsa.other_order_mode.ui.adapter.SectionsPagerAdapter import com.gingersoft.gsa.other_order_mode.ui.adapter.SectionsPagerAdapter
import com.gingersoft.gsa.other_order_mode.ui.base.BaseActivity import com.gingersoft.gsa.other_order_mode.ui.base.BaseActivity
import com.gingersoft.gsa.other_order_mode.util.InjectorUtil import com.gingersoft.gsa.other_order_mode.util.InjectorUtil
import com.qmuiteam.qmui.alpha.QMUIAlphaTextView
import com.qmuiteam.qmui.util.QMUIDisplayHelper
import com.qmuiteam.qmui.widget.popup.QMUIPopup
import com.qmuiteam.qmui.widget.popup.QMUIPopups
import kotlinx.android.synthetic.main.activity_other_order.* import kotlinx.android.synthetic.main.activity_other_order.*
...@@ -56,7 +62,6 @@ class OtherOrderActivity : BaseActivity() { ...@@ -56,7 +62,6 @@ class OtherOrderActivity : BaseActivity() {
private var layoutHeight: Float = 0F private var layoutHeight: Float = 0F
private var btnHeight: Float = 0F private var btnHeight: Float = 0F
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
val binding: ActivityOtherOrderBinding = DataBindingUtil.setContentView(this, R.layout.activity_other_order) val binding: ActivityOtherOrderBinding = DataBindingUtil.setContentView(this, R.layout.activity_other_order)
...@@ -155,26 +160,85 @@ class OtherOrderActivity : BaseActivity() { ...@@ -155,26 +160,85 @@ class OtherOrderActivity : BaseActivity() {
} }
} }
private var restaurantPopup: QMUIPopup? = null
private var stateBg = GradientDrawable()
/** /**
* 切換餐廳狀態按鈕 * 切換餐廳狀態按鈕
*/ */
private fun initSwitchRestStatus() { private fun initSwitchRestStatus() {
stateBg.cornerRadius = QMUIDisplayHelper.dp2px(this, 4).toFloat()
btnOpenBg = resources.getDrawable(R.drawable.shape_white_bottom_border) btnOpenBg = resources.getDrawable(R.drawable.shape_white_bottom_border)
btnCloseBg = resources.getDrawable(R.drawable.shape_dialog_bg) btnCloseBg = resources.getDrawable(R.drawable.shape_dialog_bg)
btn_switch_restaurant_state.setOnClickListener { //切換營業狀態
pageViewModel.setRestaurantState(this, !(it as SwitchButton).statusBasedOnPos) tv_restaurant_state.setOnClickListener {
if (restaurantPopup == null) {
val view: View = LayoutInflater.from(this).inflate(R.layout.popup_layout_restaurant_state, null)
restaurantPopup = QMUIPopups.popup(this)
.preferredDirection(QMUIPopup.DIRECTION_BOTTOM)
.view(view)
.radius(QMUIDisplayHelper.dp2px(this, 5))
.arrow(false)
.shadow(false)
.offsetYIfTop(0)
.animStyle(QMUIPopup.ANIM_AUTO)
.show(it)
view.apply {
//營業中
findViewById<TextView>(R.id.tv_restaurant_open).setOnClickListener {
updateRestaurantState(1)
}
//休息中
findViewById<TextView>(R.id.tv_restaurant_close).setOnClickListener {
updateRestaurantState(0)
}
//繁忙不接單
findViewById<TextView>(R.id.tv_restaurant_busy_close).setOnClickListener {
updateRestaurantState(2)
}
//繁忙可接單
findViewById<TextView>(R.id.tv_restaurant_busy_open).setOnClickListener {
updateRestaurantState(3)
}
}
} else {
restaurantPopup?.show(it)
}
} }
//綁定營業按鈕狀態 //綁定營業按鈕狀態
pageViewModel.restaurantState.observe(this, Observer { pageViewModel.restaurantState.observe(this, Observer {
btn_switch_restaurant_state.isChecked = it when (it) {
0 -> {
tv_restaurant_state.text = "休息中"
stateBg.setColor(resources.getColor(R.color.color_c8))
}
1 -> {
tv_restaurant_state.text = "營業中"
stateBg.setColor(resources.getColor(R.color.restaurant_color_open))
}
2 -> {
tv_restaurant_state.text = "繁忙不接"
stateBg.setColor(resources.getColor(R.color.restaurant_color_busy_close))
}
3 -> {
tv_restaurant_state.text = "繁忙可接"
stateBg.setColor(resources.getColor(R.color.restaurant_color_busy_open))
}
}
tv_restaurant_state.background = stateBg
}) })
btn_open_or_close_info.setOnClickListener { btn_open_or_close_info.setOnClickListener {
setOrderInfoOpenOrClose() setOrderInfoOpenOrClose()
} }
} }
private fun updateRestaurantState(state: Int) {
pageViewModel.setRestaurantState(this@OtherOrderActivity, state)
restaurantPopup?.dismiss()
}
private fun initWebsocket() { private fun initWebsocket() {
//開啟websocket //開啟websocket
val intent = Intent(this, GetInfoUpdateService::class.java) val intent = Intent(this, GetInfoUpdateService::class.java)
...@@ -195,7 +259,7 @@ class OtherOrderActivity : BaseActivity() { ...@@ -195,7 +259,7 @@ class OtherOrderActivity : BaseActivity() {
if (type == 3 || type == 4 || type == 5 if (type == 3 || type == 4 || type == 5
|| type == 6 || type == 7) { || type == 6 || type == 7) {
//播放提示音 //播放提示音
if (type == 5) { if (type == 5 || type == 4) {
pageViewModel.refreshState.postValue(1) pageViewModel.refreshState.postValue(1)
} else { } else {
pageViewModel.refreshState.postValue(type) pageViewModel.refreshState.postValue(type)
...@@ -308,16 +372,47 @@ class OtherOrderActivity : BaseActivity() { ...@@ -308,16 +372,47 @@ class OtherOrderActivity : BaseActivity() {
view.requestLayout() view.requestLayout()
} }
private var pop: QMUIPopup? = null
/** /**
* 初始化標題欄 * 初始化標題欄
*/ */
private fun initAppTop() { private fun initAppTop() {
qm_other_order_bar.setTitle(R.string.app_name) qm_other_order_bar.setTitle(GsaCloudApplication.getRestaurantName(this))
qm_other_order_bar.addLeftImageButton(R.drawable.icon_return, R.id.iv_left_back).setOnClickListener { finish() } qm_other_order_bar.addLeftImageButton(R.drawable.icon_return, R.id.iv_left_back).setOnClickListener { finish() }
qm_other_order_bar.addRightImageButton(R.drawable.ic_history_order, R.id.iv_history).setOnClickListener { qm_other_order_bar.addRightImageButton(R.drawable.icon_topbar_overflow, R.id.topbar_right_change_button).setOnClickListener {
//歷史訂單 //彈出彈窗
startActivity(Intent(this, HistoryOrderActivity::class.java)) if (pop == null) {
val view = LayoutInflater.from(this).inflate(R.layout.layout_more_popup, null)
pop = QMUIPopups.popup(this)
.preferredDirection(QMUIPopup.DIRECTION_BOTTOM)
.view(view)
.radius(QMUIDisplayHelper.dp2px(this, 5))
.arrow(true)
.shadow(true)
.dimAmount(0.6f)
.offsetYIfTop(0)
.animStyle(QMUIPopup.ANIM_AUTO)
.show(it)
view.findViewById<QMUIAlphaTextView>(R.id.tv_delivery_setting).setOnClickListener {
//備送設置
startActivity(Intent(this, DeliverySettingActivity::class.java))
pop!!.dismiss()
}
view.findViewById<QMUIAlphaTextView>(R.id.tv_history_order).setOnClickListener {
//歷史訂單
startActivity(Intent(this, HistoryOrderActivity::class.java))
pop!!.dismiss()
}
} else {
pop!!.show(it)
}
} }
// qm_other_order_bar.addRightImageButton(R.drawable.ic_history_order, R.id.iv_history).setOnClickListener {
// //歷史訂單
// startActivity(Intent(this, HistoryOrderActivity::class.java))
// }
qm_other_order_bar.setBackgroundColor(resources.getColor(R.color.theme_color)) qm_other_order_bar.setBackgroundColor(resources.getColor(R.color.theme_color))
} }
} }
\ No newline at end of file
package com.gingersoft.gsa.other_order_mode.ui.adapter
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
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.DeliveryConfig
import com.gingersoft.gsa.other_order_mode.databinding.ItemDeliveryLayoutBinding
class DeliveryListAdapter(val context: Context, data: List<DeliveryConfig.Data.DeliveryInfo>) : BaseQuickAdapter<DeliveryConfig.Data.DeliveryInfo, DeliveryListAdapter.ViewHolder>(data) {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_delivery_layout, null)
return ViewHolder(view)
}
override fun convert(helper: ViewHolder?, item: DeliveryConfig.Data.DeliveryInfo?) {
helper?.let { helper ->
helper.binding.apply {
// deliveryType = when(item!!.distributionType){
// "SHORT_RANGE"->
// "STANDARD"->
// "LONG_DISTANCE"->
// else ->""
// }
item?.let { it ->
deliveryType = it.distributionType
deliveryExpenses = "${it.distributionFeeMin}-${it.distributionFeeMax}"
deliveryFee = it.distributionFee.toString()
deliveryMethod = if (it.type == 1) "物流備送" else "本店備送"
deliveryDifference = it.deliveryCost.toString()
}
}
}
}
class ViewHolder(itemView: View) : BaseViewHolder(itemView) {
var binding: ItemDeliveryLayoutBinding = DataBindingUtil.bind(itemView)!!
}
}
\ No newline at end of file
package com.gingersoft.gsa.other_order_mode.ui.adapter package com.gingersoft.gsa.other_order_mode.ui.adapter
import android.animation.Animator
import android.animation.AnimatorSet import android.animation.AnimatorSet
import android.animation.ObjectAnimator.ofFloat import android.animation.ObjectAnimator.ofFloat
import android.animation.ValueAnimator import android.animation.ValueAnimator
import android.content.Context import android.content.Context
import android.graphics.drawable.GradientDrawable import android.graphics.drawable.GradientDrawable
import android.support.v4.media.session.PlaybackStateCompat
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
...@@ -45,22 +43,18 @@ class OtherOrdersAdapter(var context: Context) : Adapter<OtherOrdersAdapter.View ...@@ -45,22 +43,18 @@ class OtherOrdersAdapter(var context: Context) : Adapter<OtherOrdersAdapter.View
holder.binding.data = data holder.binding.data = data
holder.binding.isSelf = data.order_type == 7 holder.binding.isSelf = data.order_type == 7
data.trkNo?.apply { holder.binding.deliveryState = when (data.curStat) {
if (length > 0) { 1 -> "已通知物流"
holder.binding.deliveryState = when (data.curStat) { 2 -> "配送員已接單"
1 -> "訂單已創建" 3 -> "配送員到店附近"
2 -> "配送員已接單" 4 -> "配送員已到店"
3 -> "配送員到店附近" 5 -> "配送中"
4 -> "配送員已到店" 6 -> "到達目的地附近"
5 -> "配送中" 7 -> "訂單已完成"
6 -> "到達目的地附近" 8 -> "物流已取消"//取餐前
7 -> "訂單已完成" 9 -> "物流已取消"//取餐後
8 -> "物流已取消"//取餐前 10 -> "已指派另一位配送員"
9 -> "物流已取消"//取餐後 else -> ""
10 -> "已指派另一位配送員"
else -> ""
}
}
} }
var state: String? = null var state: String? = null
...@@ -100,20 +94,22 @@ class OtherOrdersAdapter(var context: Context) : Adapter<OtherOrdersAdapter.View ...@@ -100,20 +94,22 @@ class OtherOrdersAdapter(var context: Context) : Adapter<OtherOrdersAdapter.View
//堂食外賣背景 //堂食外賣背景
val orderingMethodBg = GradientDrawable() val orderingMethodBg = GradientDrawable()
orderingMethodBg.shape = GradientDrawable.OVAL orderingMethodBg.shape = GradientDrawable.RECTANGLE
orderingMethodBg.cornerRadii = floatArrayOf(dp2px(8f).toFloat(), dp2px(8f).toFloat(), 0f, 0f, 0f, 0f, dp2px(8f).toFloat(), dp2px(8f).toFloat())
holder.binding.orderingMethod = holder.binding.orderingMethod =
when { when {
data.order_type == 2 -> { data.order_type == 2 -> {
orderingMethodBg.setColor(getColor(R.color.order_state2_color)) orderingMethodBg.setColor(getColor(R.color.order_state2_color))
"外" "外"
} }
data.order_type == 7 -> { data.order_type == 7 -> {
orderingMethodBg.setColor(getColor(R.color.order_state3_color)) orderingMethodBg.setColor(getColor(R.color.order_state3_color))
"自" "自"
} }
else -> { else -> {
orderingMethodBg.setColor(getColor(R.color.order_state1_color)) orderingMethodBg.setColor(getColor(R.color.order_state1_color))
"堂" "堂"
} }
} }
holder.binding.orderingMethodBg = orderingMethodBg holder.binding.orderingMethodBg = orderingMethodBg
......
package com.gingersoft.gsa.other_order_mode.ui.fragment
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.model.viewModel.DeliveryViewModel
import com.gingersoft.gsa.other_order_mode.ui.adapter.DeliveryListAdapter
import com.gingersoft.gsa.other_order_mode.util.InjectorUtil
import kotlinx.android.synthetic.main.fragment_delivery_list.*
class DeliveryFragment : Fragment() {
companion object {
fun newInstance() = DeliveryFragment()
}
private lateinit var viewModel: DeliveryViewModel
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.fragment_delivery_list, container, false)
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
viewModel = ViewModelProvider(activity?.viewModelStore!!, InjectorUtil.getDeliveryFactory())[DeliveryViewModel::class.java]
viewModel.queryDeliveryList(GsaCloudApplication.getRestaurantId(activity!!).toString()) {
if (it?.data?.list != null && it.data.list.isNotEmpty()) {
val deliveryListAdapter = DeliveryListAdapter(context!!, it.data.list)
rv_delivery.adapter = deliveryListAdapter
rv_delivery.layoutManager = LinearLayoutManager(context!!)
rv_delivery.visibility = View.VISIBLE
} else {
rv_delivery.visibility = View.GONE
}
}
// rv_delivery
}
}
...@@ -11,6 +11,7 @@ import androidx.lifecycle.ViewModelProvider ...@@ -11,6 +11,7 @@ import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
import com.gingersoft.gsa.cloud.ui.utils.AppDialog
import com.gingersoft.gsa.other_order_mode.R import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.model.viewModel.PageViewModel import com.gingersoft.gsa.other_order_mode.model.viewModel.PageViewModel
import com.gingersoft.gsa.other_order_mode.ui.adapter.OtherOrdersAdapter import com.gingersoft.gsa.other_order_mode.ui.adapter.OtherOrdersAdapter
...@@ -19,6 +20,8 @@ import com.gingersoft.gsa.other_order_mode.util.InjectorUtil ...@@ -19,6 +20,8 @@ import com.gingersoft.gsa.other_order_mode.util.InjectorUtil
import com.gingersoft.gsa.other_order_mode.util.OtherOrderUtils import com.gingersoft.gsa.other_order_mode.util.OtherOrderUtils
import com.gingersoft.gsa.other_order_mode.util.setState import com.gingersoft.gsa.other_order_mode.util.setState
import kotlinx.android.synthetic.main.fragment_other_order.* import kotlinx.android.synthetic.main.fragment_other_order.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import kotlin.String as String1 import kotlin.String as String1
/** /**
...@@ -53,7 +56,9 @@ class PlaceholderFragment : BaseFragment() { ...@@ -53,7 +56,9 @@ class PlaceholderFragment : BaseFragment() {
adapter.setOnItemClickListenter { data -> adapter.setOnItemClickListenter { data ->
// 點擊查詢食品詳情 // 點擊查詢食品詳情
pageViewModel.getOrderInfo(data.Id.toString()) { it1 -> showLoading()
pageViewModel.getShipanyAndOrderInfo(data.curStat, GsaCloudApplication.getRestaurantId(context).toString(), data.Id.toString()) { it1 ->
cancelDialogForLoading()
//顯示彈窗 //顯示彈窗
if (this@PlaceholderFragment.context != null && it1 != null) { if (this@PlaceholderFragment.context != null && it1 != null) {
OtherOrderUtils.showOrderDetailsDialog(this@PlaceholderFragment.context!!, it1, data.STATUS, data.order_type) { view, _, dialog -> OtherOrderUtils.showOrderDetailsDialog(this@PlaceholderFragment.context!!, it1, data.STATUS, data.order_type) { view, _, dialog ->
...@@ -71,31 +76,52 @@ class PlaceholderFragment : BaseFragment() { ...@@ -71,31 +76,52 @@ class PlaceholderFragment : BaseFragment() {
R.id.btn_cancel_order -> { R.id.btn_cancel_order -> {
//取消訂單,先判斷有沒有物流 //取消訂單,先判斷有沒有物流
showLoading() showLoading()
if (it1.data!![0].isDelete == 1) { if (it1.data!![0].isDelete == 0) {
//本店配送的單,應該先需要召回 //第三方物流單
pageViewModel.cancelOrder(context!!, data.Id.toString()){ //彈出彈窗詢問是否確認取消
ToastUtils.show(context, it) AppDialog.showWaringDialog(context, "是否確認取消第三方派送?") { v, dialog ->
cancelDialogForLoading() when (v.id) {
R.id.tv_dialog_confirm -> {
//取消物流
pageViewModel.cancelLogistics(GsaCloudApplication.getRestaurantId(context).toString(), data.Id.toString()) {
ToastUtils.show(context, it)
cancelDialogForLoading()
refresh()//刷新當前頁面
}
dialog.dismiss()
}
R.id.tv_dialog_cancel -> dialog.dismiss()
}
} }
} else { } else {
//第三方物流單,得先取消物流 //本店配送的單
pageViewModel.cancelLogistics(GsaCloudApplication.getRestaurantId(context).toString(), data.Id.toString()) { pageViewModel.cancelOrder(context!!, data.Id.toString()) {
ToastUtils.show(context, it) ToastUtils.show(context, if (it) {
"取消訂單成功"
} else {
"取消訂單失敗"
})
cancelDialogForLoading() cancelDialogForLoading()
refresh()//刷新當前頁面
} }
} }
dialog.dismiss()
} }
} }
} }
} else {
ToastUtils.show(context, "獲取訂單詳情失敗")
} }
} }
} }
rv_other_order.adapter = adapter rv_other_order.adapter = adapter
//有多少個Fragment就添加多少個監聽
while (pageViewModel.mOrderList.size <= arguments?.getInt(INDEX)!!) { while (pageViewModel.mOrderList.size <= arguments?.getInt(INDEX)!!) {
pageViewModel.mOrderList.add(MutableLiveData()) pageViewModel.mOrderList.add(MutableLiveData())
} }
// 綁定當前fragment的數據項 // 綁定監聽當前fragment的數據項
pageViewModel.mOrderList[arguments?.getInt(INDEX)!!].observe(viewLifecycleOwner, Observer { pageViewModel.mOrderList[arguments?.getInt(INDEX)!!].observe(viewLifecycleOwner, Observer {
it.let { adapter.setData(it) } it.let { adapter.setData(it) }
}) })
...@@ -105,8 +131,10 @@ class PlaceholderFragment : BaseFragment() { ...@@ -105,8 +131,10 @@ class PlaceholderFragment : BaseFragment() {
// 下拉刷新,加載更多 // 下拉刷新,加載更多
refresh_layout.setOnRefreshListener { refresh_layout.setOnRefreshListener {
refresh() refresh()
//重新拉取一遍送貨員和第三方派送信息
pageViewModel.getDeliveryInfo(context!!)
pageViewModel.getDeliveryConfigDTO(context!!)
} }
refresh_layout.setOnLoadMoreListener { refresh_layout.setOnLoadMoreListener {
page++ page++
getOrderList(pageViewModel, true) getOrderList(pageViewModel, true)
......
package com.gingersoft.gsa.other_order_mode.ui.fragment
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.model.viewModel.DeliveryViewModel
import com.gingersoft.gsa.other_order_mode.util.InjectorUtil
import kotlinx.android.synthetic.main.update_delivery_fragment.*
class UpdateDeliveryFragment : Fragment() {
companion object {
fun newInstance() = UpdateDeliveryFragment()
}
private lateinit var viewModel: DeliveryViewModel
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.update_delivery_fragment, container, false)
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
viewModel = ViewModelProvider(activity?.viewModelStore!!, InjectorUtil.getDeliveryFactory())[DeliveryViewModel::class.java]
top_bar_update_delivery.setTitle("備送設置")
top_bar_update_delivery.setBackgroundColor(resources.getColor(R.color.theme_color))
top_bar_update_delivery.addLeftImageButton(R.drawable.icon_return, R.id.iv_left_back).setOnClickListener { activity?.let { it.onBackPressed() } }
}
}
package com.gingersoft.gsa.other_order_mode.util package com.gingersoft.gsa.other_order_mode.util
import com.gingersoft.gsa.other_order_mode.data.DeliveryRepository
import com.gingersoft.gsa.other_order_mode.data.HistoryOrderRepository import com.gingersoft.gsa.other_order_mode.data.HistoryOrderRepository
import com.gingersoft.gsa.other_order_mode.data.WeatherRepository import com.gingersoft.gsa.other_order_mode.data.WeatherRepository
import com.gingersoft.gsa.other_order_mode.data.network.CoolWeatherNetwork import com.gingersoft.gsa.other_order_mode.data.network.CoolWeatherNetwork
import com.gingersoft.gsa.other_order_mode.data.network.DeliveryNetwork
import com.gingersoft.gsa.other_order_mode.model.factory.DeliveryFactory
import com.gingersoft.gsa.other_order_mode.model.factory.HistoryOrderModelFactory import com.gingersoft.gsa.other_order_mode.model.factory.HistoryOrderModelFactory
import com.gingersoft.gsa.other_order_mode.model.factory.WeatherModelFactory import com.gingersoft.gsa.other_order_mode.model.factory.WeatherModelFactory
...@@ -19,5 +22,6 @@ object InjectorUtil { ...@@ -19,5 +22,6 @@ object InjectorUtil {
private fun getHistoryRepository() = HistoryOrderRepository.getInstance(CoolWeatherNetwork.getInstance()) private fun getHistoryRepository() = HistoryOrderRepository.getInstance(CoolWeatherNetwork.getInstance())
fun getDeliveryFactory() = DeliveryFactory(DeliveryRepository.getInstance(DeliveryNetwork.getInstance()))
} }
\ No newline at end of file
...@@ -41,13 +41,14 @@ object OtherOrderUtils { ...@@ -41,13 +41,14 @@ object OtherOrderUtils {
//自取 //自取
btnContent = "製作完成" btnContent = "製作完成"
tvStatus.setTextColor(context.resources.getColor(R.color.order_state0_color)) tvStatus.setTextColor(context.resources.getColor(R.color.order_state0_color))
cancelBtnContent = "取消訂單"
} else { } else {
if (orderData.isDelete == 1) { if (orderData.isDelete == 0) {
btnContent = "指派送貨"
cancelBtnContent = "取消訂單"
} else {
btnContent = "重印" btnContent = "重印"
cancelBtnContent = "取消物流" cancelBtnContent = "取消物流"
} else {
btnContent = "指派送貨"
cancelBtnContent = "取消訂單"
} }
tvStatus.setTextColor(context.resources.getColor(R.color.order_state1_color)) tvStatus.setTextColor(context.resources.getColor(R.color.order_state1_color))
} }
...@@ -71,9 +72,23 @@ object OtherOrderUtils { ...@@ -71,9 +72,23 @@ object OtherOrderUtils {
cancelBtnContent = "取消訂單" cancelBtnContent = "取消訂單"
} }
} }
layoutOrderInfoDialogBinding.patMethod = when (orderData.payType) {
1 -> "积分支付"
2 -> "支付宝"
3 -> "财付通"
4 -> "微信支付"
5 -> "货到付款"
6 -> "其他支付"
else -> ""
}
if (!showBtn) {
cancelBtnContent = ""
}
layoutOrderInfoDialogBinding.orderStatus = type + orderStatus layoutOrderInfoDialogBinding.orderStatus = type + orderStatus
layoutOrderInfoDialogBinding.btnContent = btnContent layoutOrderInfoDialogBinding.btnContent = btnContent
layoutOrderInfoDialogBinding.cancelBtnContent = cancelBtnContent layoutOrderInfoDialogBinding.cancelBtnContent = cancelBtnContent
layoutOrderInfoDialogBinding.estimatedTime = orderData.estimatedTime
} }
val rvFood: RecyclerView = hepler.getView(R.id.rv_food) val rvFood: RecyclerView = hepler.getView(R.id.rv_food)
......
package com.gingersoft.gsa.other_order_mode.util package com.gingersoft.gsa.other_order_mode.util
import android.content.Context
import android.graphics.drawable.Drawable
import android.view.View import android.view.View
fun View.setState(state: Boolean) { fun View.setState(state: Boolean) {
...@@ -8,4 +10,9 @@ fun View.setState(state: Boolean) { ...@@ -8,4 +10,9 @@ fun View.setState(state: Boolean) {
} else { } else {
View.GONE View.GONE
} }
}
fun Context.getDrawable(drawable: Int): Drawable {
return this.resources.getDrawable(drawable)
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/dp_4"/>
<solid android:color="@color/restaurant_color_open"/>
</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:id="@+id/fl_delivery"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.qmuiteam.qmui.widget.QMUITopBar
android:id="@+id/top_bar_delivery"
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" />
<fragment
android:name="com.gingersoft.gsa.other_order_mode.ui.fragment.DeliveryFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/top_bar_delivery" />
</RelativeLayout>
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/color_f0" android:background="@color/color_f0"
android:orientation="vertical" android:orientation="vertical"
tools:context=".ui.activity.OtherOrderActivity"> tools:context=".ui.activity.HistoryOrderActivity">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:padding="@dimen/dp_10"> android:padding="@dimen/dp_10">
<EditText <EditText
...@@ -35,11 +37,11 @@ ...@@ -35,11 +37,11 @@
android:layout_marginRight="@dimen/dp_10" android:layout_marginRight="@dimen/dp_10"
android:background="@drawable/shape_white_search_bg" android:background="@drawable/shape_white_search_bg"
android:hint="請輸入手機號或訂單號" android:hint="請輸入手機號或訂單號"
android:inputType="number"
android:paddingLeft="@dimen/dp_10" android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_50" android:paddingRight="@dimen/dp_50"
android:textColor="@color/theme_333_color" android:textColor="@color/theme_333_color"
android:textColorHint="@color/color_ccc" android:textColorHint="@color/color_ccc"
android:inputType="number"
android:textSize="@dimen/dp_14" android:textSize="@dimen/dp_14"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
...@@ -54,9 +56,70 @@ ...@@ -54,9 +56,70 @@
app:layout_constraintBottom_toBottomOf="@id/ed_order_num_search" app:layout_constraintBottom_toBottomOf="@id/ed_order_num_search"
app:layout_constraintRight_toRightOf="@id/ed_order_num_search" app:layout_constraintRight_toRightOf="@id/ed_order_num_search"
app:layout_constraintTop_toTopOf="@id/ed_order_num_search" /> app:layout_constraintTop_toTopOf="@id/ed_order_num_search" />
<TextView
android:id="@+id/tv_start_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:onClick="onClickListener"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_14"
app:layout_constraintLeft_toLeftOf="@id/ed_order_num_search"
app:layout_constraintTop_toBottomOf="@id/ed_order_num_search" />
<com.gingersoft.gsa.cloud.ui.view.TriangleView
android:id="@+id/iv_start_time_triangle"
android:layout_width="@dimen/dp_8"
android:layout_height="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_2"
android:onClick="onClickListener"
app:layout_constraintBottom_toBottomOf="@id/tv_start_time"
app:layout_constraintLeft_toRightOf="@id/tv_start_time"
app:layout_constraintTop_toTopOf="@id/tv_start_time"
app:trv_direction="bottom" />
<TextView
android:id="@+id/tv_to"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:text="至"
android:visibility="gone"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_14"
app:layout_constraintBottom_toBottomOf="@id/iv_start_time_triangle"
app:layout_constraintLeft_toRightOf="@id/iv_start_time_triangle"
app:layout_constraintTop_toTopOf="@id/iv_start_time_triangle" />
<TextView
android:id="@+id/tv_end_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:onClick="onClickListener"
android:textColor="@color/theme_333_color"
android:visibility="gone"
android:textSize="@dimen/dp_14"
app:layout_constraintBottom_toBottomOf="@id/tv_to"
app:layout_constraintLeft_toRightOf="@id/tv_to"
app:layout_constraintTop_toTopOf="@id/tv_to" />
<com.gingersoft.gsa.cloud.ui.view.TriangleView
android:id="@+id/iv_end_time_triangle"
android:layout_width="@dimen/dp_8"
android:layout_height="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_2"
android:onClick="onClickListener"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/tv_end_time"
app:layout_constraintLeft_toRightOf="@id/tv_end_time"
app:layout_constraintTop_toTopOf="@id/tv_end_time"
app:trv_direction="bottom" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/fragment_other_order"/> <include layout="@layout/fragment_other_order" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -47,9 +47,9 @@ ...@@ -47,9 +47,9 @@
android:id="@+id/cl_order_info" android:id="@+id/cl_order_info"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10" android:layout_marginLeft="@dimen/dp_6"
android:layout_marginTop="@dimen/dp_10" android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10" android:layout_marginRight="@dimen/dp_6"
android:background="@drawable/shape_dialog_bg" android:background="@drawable/shape_dialog_bg"
android:focusable="true" android:focusable="true"
android:focusableInTouchMode="true"> android:focusableInTouchMode="true">
...@@ -154,14 +154,14 @@ ...@@ -154,14 +154,14 @@
android:layout_marginRight="@dimen/dp_10" android:layout_marginRight="@dimen/dp_10"
android:background="@drawable/shape_search_bg" android:background="@drawable/shape_search_bg"
android:hint="請輸入手機號或訂單號" android:hint="請輸入手機號或訂單號"
android:inputType="number"
android:paddingLeft="@dimen/dp_10" android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_50" android:paddingRight="@dimen/dp_50"
android:textColor="@color/theme_333_color" android:textColor="@color/theme_333_color"
android:textColorHint="@color/color_ccc" android:textColorHint="@color/color_ccc"
android:textSize="@dimen/dp_14" android:textSize="@dimen/dp_14"
android:inputType="number"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/btn_switch_restaurant_state" app:layout_constraintRight_toLeftOf="@id/tv_restaurant_state"
app:layout_constraintTop_toBottomOf="@id/tv_month_takeaway_num_text" /> app:layout_constraintTop_toBottomOf="@id/tv_month_takeaway_num_text" />
<ImageView <ImageView
...@@ -175,22 +175,43 @@ ...@@ -175,22 +175,43 @@
app:layout_constraintTop_toTopOf="@id/ed_order_num_search" /> app:layout_constraintTop_toTopOf="@id/ed_order_num_search" />
<com.gingersoft.gsa.cloud.ui.view.SwitchButton <TextView
android:id="@+id/btn_switch_restaurant_state" android:id="@+id/tv_restaurant_state"
android:layout_width="wrap_content" style="@style/otherOrder_restaurant_state_style"
android:layout_height="@dimen/dp_40" android:background="@drawable/shape_restaurant_state_bg"
android:textColor="@color/white" android:text="營業中 "
android:textSize="@dimen/dp_12"
app:kswBackColor="@color/selector_switch_button"
app:kswBackRadius="@dimen/dp_20"
app:kswTextOff="@string/resting"
app:kswTextOn="@string/open"
app:kswThumbColor="@color/white"
app:kswThumbMarginBottom="@dimen/dp_4"
app:kswThumbMarginTop="@dimen/dp_4"
app:layout_constraintBottom_toBottomOf="@id/ed_order_num_search" app:layout_constraintBottom_toBottomOf="@id/ed_order_num_search"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/ed_order_num_search" /> app:layout_constraintTop_toTopOf="@id/ed_order_num_search" />
<ImageView
android:layout_width="@dimen/dp_10"
android:layout_height="@dimen/dp_5"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/dp_4"
android:src="@drawable/qmui_popup_arrow_down"
app:layout_constraintBottom_toBottomOf="@id/tv_restaurant_state"
app:layout_constraintRight_toRightOf="@id/tv_restaurant_state"
app:layout_constraintTop_toTopOf="@id/tv_restaurant_state" />
<!-- -->
<!-- <com.gingersoft.gsa.cloud.ui.view.SwitchButton-->
<!-- android:id="@+id/btn_switch_restaurant_state"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="@dimen/dp_40"-->
<!-- android:textColor="@color/white"-->
<!-- android:textSize="@dimen/dp_12"-->
<!-- app:kswBackColor="@color/selector_switch_button"-->
<!-- app:kswBackRadius="@dimen/dp_20"-->
<!-- app:kswTextOff="@string/resting"-->
<!-- app:kswTextOn="@string/open"-->
<!-- app:kswThumbColor="@color/white"-->
<!-- app:kswThumbMarginBottom="@dimen/dp_4"-->
<!-- app:kswThumbMarginTop="@dimen/dp_4"-->
<!-- app:layout_constraintBottom_toBottomOf="@id/ed_order_num_search"-->
<!-- app:layout_constraintRight_toRightOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="@id/ed_order_num_search" />-->
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_delivery"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.qmuiteam.qmui.layout.QMUIButton
android:id="@+id/tv_add_delivery"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_border_bg"
android:text="添加備送方式"
android:padding="@dimen/dp_10"
android:textColor="@color/theme_color" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="delivery_type"
type="String" />
<variable
name="delivery_expenses"
type="String" />
<variable
name="delivery_fee"
type="String" />
<variable
name="delivery_method"
type="String" />
<variable
name="delivery_difference"
type="String" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/tv_delivery_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10"
android:text="@{@string/delivery_type+ delivery_type}"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_14"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_delivery_expenses"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
android:text="@{@string/delivery_expenses + delivery_expenses}"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_14"
app:layout_constraintLeft_toLeftOf="@id/tv_delivery_type"
app:layout_constraintTop_toBottomOf="@id/tv_delivery_type" />
<TextView
android:id="@+id/tv_delivery_fee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
android:text="@{@string/delivery_fee + delivery_fee}"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_14"
app:layout_constraintLeft_toLeftOf="@id/tv_delivery_type"
app:layout_constraintTop_toBottomOf="@id/tv_delivery_expenses" />
<TextView
android:id="@+id/tv_delivery_method"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
android:text="@{@string/delivery_method + delivery_method}"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_14"
app:layout_constraintLeft_toLeftOf="@id/tv_delivery_type"
app:layout_constraintTop_toBottomOf="@id/tv_delivery_fee" />
<TextView
android:id="@+id/tv_difference"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
android:text="@{@string/delivery_difference + delivery_difference}"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_14"
app:layout_constraintLeft_toLeftOf="@id/tv_delivery_type"
app:layout_constraintTop_toBottomOf="@id/tv_delivery_method" />
<TextView
android:id="@+id/iv_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_10"
android:text="編輯"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_12"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/iv_delete"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/iv_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_10"
android:text="刪除"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_12"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/horizontal_dividing_line"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0_5"
android:layout_marginTop="@dimen/dp_10"
android:background="@color/color_ccc"
app:layout_constraintTop_toBottomOf="@id/tv_difference" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
\ No newline at end of file
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<TextView <TextView
android:id="@+id/tv_order_user_name" android:id="@+id/tv_order_user_name"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5" android:layout_marginTop="@dimen/dp_5"
android:text="@{data.rECEIVER}" android:text="@{data.rECEIVER}"
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_order_time"
app:layout_constraintTop_toBottomOf="@id/tv_ordering_method" /> app:layout_constraintTop_toBottomOf="@id/tv_ordering_method" />
<TextView <TextView
...@@ -92,7 +93,6 @@ ...@@ -92,7 +93,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5" android:layout_marginLeft="@dimen/dp_5"
android:text="@{TimeUtils.parseTimeRepeat(data.cREATE_TIME,TimeUtils.DEFAULT_DATE_FORMAT)}" android:text="@{TimeUtils.parseTimeRepeat(data.cREATE_TIME,TimeUtils.DEFAULT_DATE_FORMAT)}"
app:layout_constraintBottom_toBottomOf="@id/tv_order_user_name"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_order_user_name" /> app:layout_constraintTop_toTopOf="@id/tv_order_user_name" />
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/tv_delivery_setting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_20"
android:paddingTop="@dimen/dp_10"
android:paddingRight="@dimen/dp_20"
android:paddingBottom="@dimen/dp_10"
android:text="備送設置"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_14" />
<include layout="@layout/include_horizontal_color_ccc_dividing_line" />
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/tv_history_order"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_20"
android:paddingTop="@dimen/dp_10"
android:paddingRight="@dimen/dp_20"
android:paddingBottom="@dimen/dp_10"
android:text="歷史訂單"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_14" />
</LinearLayout>
...@@ -38,6 +38,14 @@ ...@@ -38,6 +38,14 @@
<variable <variable
name="showBtn" name="showBtn"
type="Boolean" /> type="Boolean" />
<variable
name="patMethod"
type="String" />
<variable
name="estimatedTime"
type="String" />
</data> </data>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
...@@ -119,18 +127,42 @@ ...@@ -119,18 +127,42 @@
app:layout_constraintTop_toBottomOf="@id/tv_total_amount_text" /> app:layout_constraintTop_toBottomOf="@id/tv_total_amount_text" />
<TextView <TextView
android:id="@+id/tv_order_no" android:id="@+id/tv_take_food_code"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/other_order_info_dialog_content_marginLeft" android:layout_marginLeft="@dimen/other_order_info_dialog_content_marginLeft"
android:layout_marginTop="@dimen/dp_15" android:layout_marginTop="@dimen/dp_15"
android:text="@{@string/order_no + data.oRDER_NO}" android:text="取餐碼:"
android:textColor="@color/color_3c" android:textColor="@color/color_3c"
android:textSize="@dimen/dp_14" android:textSize="@dimen/dp_14"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_total_amount" /> app:layout_constraintTop_toBottomOf="@id/tv_total_amount" />
<TextView <TextView
android:id="@+id/tv_order_num"
style="@style/otherOrder_item_info_title_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{data.takeFoodCode.equals("0")? @string/take_food_code_omit:data.takeFoodCode}'
android:textSize="@dimen/dp_16"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/tv_take_food_code"
app:layout_constraintLeft_toRightOf="@id/tv_take_food_code"
app:layout_constraintTop_toTopOf="@id/tv_take_food_code" />
<TextView
android:id="@+id/tv_order_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/other_order_info_dialog_content_marginLeft"
android:layout_marginTop="@dimen/dp_10"
android:text="@{@string/order_no + data.oRDER_NO}"
android:textColor="@color/color_3c"
android:textSize="@dimen/dp_14"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_order_num" />
<TextView
android:id="@+id/tv_create_time" android:id="@+id/tv_create_time"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -142,13 +174,26 @@ ...@@ -142,13 +174,26 @@
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_order_no" /> app:layout_constraintTop_toBottomOf="@id/tv_order_no" />
<TextView
android:id="@+id/tv_estimated_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/other_order_info_dialog_content_marginLeft"
android:layout_marginTop="@dimen/dp_10"
android:text="@{estimatedTime}"
android:textColor="@color/color_3c"
android:textSize="@dimen/dp_14"
android:visibility="@{estimatedTime.length()>0?View.VISIBLE:View.GONE}"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_create_time" />
<View <View
android:id="@+id/line_info_top" android:id="@+id/line_info_top"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_1" android:layout_height="@dimen/dp_1"
android:layout_marginTop="@dimen/dp_10" android:layout_marginTop="@dimen/dp_10"
android:background="@color/color_ccc" android:background="@color/color_ccc"
app:layout_constraintTop_toBottomOf="@id/tv_create_time" /> app:layout_constraintTop_toBottomOf="@id/tv_estimated_time" />
<TextView <TextView
android:id="@+id/tv_receiver_text" android:id="@+id/tv_receiver_text"
...@@ -536,6 +581,29 @@ ...@@ -536,6 +581,29 @@
android:textColor="#FF0000" android:textColor="#FF0000"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_pay_amount_text" /> app:layout_constraintTop_toTopOf="@id/tv_pay_amount_text" />
<TextView
android:id="@+id/tv_pay_method_text"
style="@style/otherOrder_bill_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="支付方式:"
android:visibility="@{patMethod.length()==0?View.GONE:View.VISIBLE}"
app:layout_constraintRight_toRightOf="@id/tv_total_text"
app:layout_constraintTop_toBottomOf="@id/tv_pay_amount_text" />
<TextView
android:id="@+id/tv_pay_method"
style="@style/otherOrder_bill_info_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/other_order_info_dialog_content_marginRight"
android:text="@{patMethod}"
android:visibility="@{patMethod.length()==0?View.GONE:View.VISIBLE}"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_pay_method_text" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
<import type="com.gingersoft.gsa.cloud.base.utils.time.TimeUtils" /> <import type="com.gingersoft.gsa.cloud.base.utils.time.TimeUtils" />
<import type="android.view.View" />
<variable <variable
name="data" name="data"
type="com.gingersoft.gsa.other_order_mode.data.model.bean.OrderList.DataBeanX.DataBean" /> type="com.gingersoft.gsa.other_order_mode.data.model.bean.OrderList.DataBeanX.DataBean" />
...@@ -44,180 +46,201 @@ ...@@ -44,180 +46,201 @@
type="Boolean" /> type="Boolean" />
</data> </data>
<com.lihang.ShadowLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_7" android:layout_marginLeft="@dimen/dp_3"
android:layout_marginTop="@dimen/dp_7" android:layout_marginTop="@dimen/dp_7"
android:layout_marginRight="@dimen/dp_7" android:layout_marginRight="@dimen/dp_3">
app:hl_cornerRadius="@dimen/dp_8"
app:hl_shadowLimit="@dimen/dp_3">
<androidx.constraintlayout.widget.ConstraintLayout <com.lihang.ShadowLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="@dimen/dp_10" app:hl_cornerRadius="@dimen/dp_8"
android:paddingTop="@dimen/dp_5" app:hl_shadowLimit="@dimen/dp_3">
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10"> <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
<TextView android:layout_height="wrap_content">
android:id="@+id/tv_payment_method"
android:layout_width="wrap_content" <TextView
android:layout_height="wrap_content" android:id="@+id/tv_delivery_method"
android:background="@{payMethodBg}" android:layout_width="@dimen/dp_19"
android:paddingLeft="@dimen/dp_6" android:layout_height="0dp"
android:paddingTop="@dimen/dp_2" android:background="@{orderingMethodBg}"
android:paddingRight="@dimen/dp_6" android:gravity="center"
android:paddingBottom="@dimen/dp_2" android:text="@{orderingMethod}"
android:text="@{payMethod}" android:textColor="@color/white"
android:textColor="@color/white" android:textSize="@dimen/dp_14"
android:textSize="@dimen/sp_14" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/tv_ordering_method" android:id="@+id/tv_payment_method"
android:layout_width="@dimen/dp_20" android:layout_width="wrap_content"
android:layout_height="@dimen/dp_20" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_8" android:layout_marginTop="@dimen/dp_5"
android:background="@{orderingMethodBg}" android:background="@{payMethodBg}"
android:gravity="center" android:paddingLeft="@dimen/dp_10"
android:text="@{orderingMethod}" android:paddingTop="@dimen/dp_2"
android:textColor="@color/white" android:paddingRight="@dimen/dp_10"
android:textSize="@dimen/sp_14" android:paddingBottom="@dimen/dp_2"
app:layout_constraintLeft_toRightOf="@id/tv_payment_method" android:text="@{payMethod}"
app:layout_constraintTop_toTopOf="parent" /> android:textColor="@color/white"
android:textSize="@dimen/sp_10"
<TextView app:layout_constraintLeft_toLeftOf="@id/tv_order_user_name"
android:id="@+id/tv_delivery_state" app:layout_constraintTop_toTopOf="parent" />
style="@style/otherOrder_item_info_title_textStyle"
android:layout_width="wrap_content" <TextView
android:layout_height="wrap_content" android:id="@+id/tv_order_time"
android:text="@{delivery_state}" style="@style/otherOrder_item_create_time_textStyle"
app:layout_constraintRight_toRightOf="parent" android:layout_width="0dp"
app:layout_constraintTop_toTopOf="parent" /> android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_10"
<TextView android:gravity="right"
android:id="@+id/tv_order_user_name" android:textSize="@dimen/dp_10"
android:layout_width="0dp" android:text="@{TimeUtils.parseTimeRepeat(data.cREATE_TIME,TimeUtils.DEFAULT_DATE_FORMAT)}"
android:layout_height="wrap_content" app:layout_constraintLeft_toRightOf="@id/tv_payment_method"
android:layout_marginTop="@dimen/dp_5" app:layout_constraintRight_toRightOf="parent"
android:text="@{data.rECEIVER}" app:layout_constraintBottom_toBottomOf="@id/tv_payment_method"
android:textColor="@color/theme_text_color" app:layout_constraintTop_toTopOf="@id/tv_payment_method" />
android:textSize="@dimen/sp_14"
android:textStyle="bold" <TextView
app:layout_constraintRight_toLeftOf="@id/tv_order_time" android:id="@+id/tv_order_user_name"
app:layout_constraintLeft_toLeftOf="parent" android:layout_width="0dp"
app:layout_constraintTop_toBottomOf="@id/tv_ordering_method" /> android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_4"
<TextView android:layout_marginTop="@dimen/dp_6"
android:id="@+id/tv_order_time" android:layout_marginRight="@dimen/dp_10"
style="@style/otherOrder_item_create_time_textStyle" android:textColor="@color/theme_text_color"
android:layout_width="wrap_content" android:textSize="@dimen/sp_14"
android:layout_height="wrap_content" android:text="@{data.rECEIVER + @string/left_parenthesis+data.pHONE + @string/right_parenthesis}"
android:layout_marginLeft="@dimen/dp_5" android:textStyle="bold"
android:text="@{TimeUtils.parseTimeRepeat(data.cREATE_TIME,TimeUtils.DEFAULT_DATE_FORMAT)}" app:layout_constraintLeft_toRightOf="@id/tv_delivery_method"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toLeftOf="@id/barrier_order_right_line"
app:layout_constraintTop_toTopOf="@id/tv_order_user_name" /> app:layout_constraintTop_toBottomOf="@id/tv_payment_method" />
<androidx.constraintlayout.widget.Barrier <TextView
android:id="@+id/barrier_order_info" android:id="@+id/tv_delivery_state"
android:layout_width="wrap_content" style="@style/otherOrder_item_info_title_textStyle"
android:layout_height="wrap_content" android:layout_width="0dp"
android:orientation="vertical" android:layout_height="wrap_content"
app:barrierDirection="right" android:layout_marginTop="@dimen/dp_18"
app:constraint_referenced_ids="tv_address_text,tv_cellphone_num_text,tv_order_num_text" /> android:gravity="right"
android:text="@{delivery_state}"
<TextView android:textColor="@color/color_3c"
android:id="@+id/tv_cellphone_num_text" app:layout_constraintLeft_toRightOf="@id/tv_order_user_name"
style="@style/otherOrder_item_info_title_textStyle" app:layout_constraintRight_toRightOf="@id/tv_order_time"
android:layout_width="wrap_content" app:layout_constraintTop_toBottomOf="@id/tv_order_time" />
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5" <androidx.constraintlayout.widget.Barrier
android:text="手機號:" android:id="@+id/barrier_order_right_line"
app:layout_constraintLeft_toLeftOf="parent" android:layout_width="wrap_content"
app:layout_constraintTop_toBottomOf="@id/tv_order_user_name" /> android:layout_height="wrap_content"
android:orientation="vertical"
<TextView app:barrierDirection="left"
android:id="@+id/tv_cellphone_num" app:constraint_referenced_ids="tv_order_amount,tv_delivery_state,tv_order_state" />
style="@style/otherOrder_item_info_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content" <androidx.constraintlayout.widget.Barrier
android:layout_marginLeft="@dimen/dp_5" android:id="@+id/barrier_order_info"
android:text="@{data.pHONE}" android:layout_width="wrap_content"
app:layout_constraintLeft_toRightOf="@id/barrier_order_info" android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tv_cellphone_num_text" /> android:orientation="vertical"
app:barrierDirection="right"
<TextView app:constraint_referenced_ids="tv_address_text,tv_order_num_text" />
android:id="@+id/tv_order_num_text"
style="@style/otherOrder_item_info_title_textStyle" <TextView
android:layout_width="wrap_content" android:id="@+id/tv_delivery_time"
android:layout_height="wrap_content" android:layout_width="0dp"
android:layout_marginLeft="@dimen/dp_2" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5" android:layout_marginTop="@dimen/dp_9"
android:text="取餐碼:" android:text="@{data.waimaiSendTime}"
app:layout_constraintLeft_toLeftOf="@id/tv_cellphone_num_text" android:textColor="#EC2D2D"
app:layout_constraintTop_toBottomOf="@id/tv_cellphone_num_text" /> android:textSize="@dimen/dp_12"
android:visibility="visible"
<TextView app:layout_constraintRight_toLeftOf="@id/barrier_order_right_line"
android:id="@+id/tv_order_num" app:layout_constraintLeft_toLeftOf="@id/tv_order_user_name"
style="@style/otherOrder_item_info_textStyle" app:layout_constraintTop_toBottomOf="@id/tv_order_user_name" />
android:layout_width="wrap_content"
android:textStyle="bold"
android:layout_height="wrap_content" <TextView
android:text='@{data.takeFoodCode.equals("0")? @string/take_food_code_omit:data.takeFoodCode}' android:id="@+id/tv_order_num_text"
app:layout_constraintLeft_toLeftOf="@id/tv_cellphone_num" style="@style/otherOrder_item_info_title_textStyle"
app:layout_constraintTop_toTopOf="@id/tv_order_num_text" /> android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
<TextView android:text="取餐碼:"
android:id="@+id/tv_order_state" app:layout_constraintLeft_toLeftOf="@id/tv_order_user_name"
android:layout_width="wrap_content" app:layout_constraintTop_toBottomOf="@id/tv_delivery_time" />
android:layout_height="wrap_content"
android:background="@{stateBg}" <TextView
android:padding="@dimen/dp_5" android:id="@+id/tv_order_num"
android:text="@{state}" style="@style/otherOrder_item_info_title_textStyle"
android:textColor="@color/white" android:layout_width="wrap_content"
android:textSize="@dimen/dp_14" android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="@id/tv_order_num_text" android:text='@{data.takeFoodCode.equals("0")? @string/take_food_code_omit:data.takeFoodCode}'
app:layout_constraintRight_toRightOf="parent" android:textSize="@dimen/dp_14"
app:layout_constraintTop_toTopOf="@id/tv_cellphone_num_text" /> android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/tv_order_num_text"
app:layout_constraintLeft_toRightOf="@id/barrier_order_info"
<TextView app:layout_constraintTop_toTopOf="@id/tv_order_num_text" />
android:id="@+id/tv_address_text"
style="@style/otherOrder_item_info_title_textStyle"
android:layout_width="wrap_content" <TextView
android:layout_height="wrap_content" android:id="@+id/tv_order_state"
android:layout_marginLeft="@dimen/dp_2" android:layout_width="wrap_content"
android:layout_marginTop="@dimen/dp_5" android:layout_height="wrap_content"
android:text="@{isSelf?@string/meal_code:@string/address}" android:layout_marginTop="@dimen/dp_14"
app:layout_constraintLeft_toLeftOf="parent" android:background="@{stateBg}"
app:layout_constraintTop_toBottomOf="@id/tv_order_num_text" /> android:padding="@dimen/dp_5"
android:text="@{state}"
<TextView android:textColor="@color/white"
android:id="@+id/tv_address" android:textSize="@dimen/dp_14"
style="@style/otherOrder_item_info_textStyle" app:layout_constraintRight_toRightOf="@id/tv_order_time"
android:layout_width="0dp" app:layout_constraintTop_toBottomOf="@id/tv_delivery_state" />
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_5" <TextView
android:text="@{isSelf?data.takeFoodCode:data.aDDRESS_DETAIL}" android:id="@+id/tv_address_text"
app:layout_constraintLeft_toLeftOf="@id/tv_cellphone_num" style="@style/otherOrder_item_info_title_textStyle"
app:layout_constraintRight_toLeftOf="@id/tv_order_amount" android:layout_width="wrap_content"
app:layout_constraintTop_toTopOf="@id/tv_address_text" /> android:layout_height="0dp"
android:layout_marginTop="@dimen/dp_9"
<TextView android:text="@{@string/address}"
android:id="@+id/tv_order_amount" android:visibility="@{isSelf?View.GONE:View.VISIBLE}"
android:layout_width="wrap_content" app:layout_constraintBottom_toBottomOf="@id/tv_address"
android:layout_height="wrap_content" app:layout_constraintLeft_toLeftOf="@id/tv_order_user_name"
android:text="@{@string/amount_unit + data.pAY_AMOUNT}" app:layout_constraintTop_toBottomOf="@id/tv_order_num_text" />
android:textColor="@color/red_600"
android:textSize="@dimen/sp_14" <TextView
app:layout_constraintBottom_toBottomOf="@id/tv_address" android:id="@+id/tv_address"
app:layout_constraintRight_toRightOf="parent" style="@style/otherOrder_item_info_textStyle"
app:layout_constraintTop_toTopOf="@id/tv_address" /> android:layout_width="0dp"
</androidx.constraintlayout.widget.ConstraintLayout> android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_10"
android:text="@{data.aDDRESS_DETAIL}"
android:visibility="@{isSelf?View.GONE:View.VISIBLE}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/barrier_order_info"
app:layout_constraintRight_toLeftOf="@id/barrier_order_right_line"
app:layout_constraintTop_toTopOf="@id/tv_address_text"
app:layout_constraintVertical_chainStyle="packed" />
<TextView
android:id="@+id/tv_order_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_3"
android:layout_marginRight="@dimen/dp_10"
android:text="@{@string/amount_unit + data.pAY_AMOUNT}"
android:textColor="@color/red_600"
android:textSize="@dimen/sp_16"
app:layout_constraintRight_toRightOf="@id/tv_order_time"
app:layout_constraintTop_toTopOf="@id/tv_address_text"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.lihang.ShadowLayout>
<FrameLayout <FrameLayout
android:id="@+id/fl_border" android:id="@+id/fl_border"
...@@ -225,5 +248,5 @@ ...@@ -225,5 +248,5 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/shape_order_border" android:background="@drawable/shape_order_border"
android:visibility="gone" /> android:visibility="gone" />
</com.lihang.ShadowLayout> </FrameLayout>
</layout> </layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/tv_restaurant_open"
style="@style/otherOrder_restaurant_state_style"
android:background="@color/restaurant_color_open"
android:text="營業中" />
<TextView
android:id="@+id/tv_restaurant_close"
style="@style/otherOrder_restaurant_state_style"
android:background="@color/color_c8"
android:text="休息中" />
<TextView
android:id="@+id/tv_restaurant_busy_close"
style="@style/otherOrder_restaurant_state_style"
android:background="@color/restaurant_color_busy_close"
android:text="繁忙不接" />
<TextView
android:id="@+id/tv_restaurant_busy_open"
style="@style/otherOrder_restaurant_state_style"
android:background="@color/restaurant_color_busy_open"
android:text="繁忙可接" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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_height="match_parent"
android:background="@color/white"
tools:context=".ui.fragment.UpdateDeliveryFragment">
<com.qmuiteam.qmui.widget.QMUITopBar
android:id="@+id/top_bar_update_delivery"
android:layout_width="match_parent"
android:layout_height="@dimen/head_height"
android:fitsSystemWindows="true"
app:layout_constraintTop_toTopOf="parent"
app:qmui_topbar_text_btn_color_state_list="@color/theme_white_color"
app:qmui_topbar_title_color="@color/theme_white_color" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -41,4 +41,14 @@ ...@@ -41,4 +41,14 @@
<string name="deliveryman_phone">送貨員手機號:</string> <string name="deliveryman_phone">送貨員手機號:</string>
<string name="logistics_number">物流號:</string> <string name="logistics_number">物流號:</string>
<string name="take_food_code_omit">----</string> <string name="take_food_code_omit">----</string>
<string name="left_parenthesis"></string>
<string name="right_parenthesis"></string>
<string name="delivery_type">配送類型:</string>
<string name="delivery_expenses">配送費範圍:</string>
<string name="delivery_fee">起送費:</string>
<string name="delivery_method">配送方式:</string>
<string name="delivery_difference">補差價:</string>
</resources> </resources>
...@@ -82,6 +82,14 @@ ...@@ -82,6 +82,14 @@
<item name="android:textColor">@color/color_66</item> <item name="android:textColor">@color/color_66</item>
<item name="android:textSize">@dimen/dp_12</item> <item name="android:textSize">@dimen/dp_12</item>
</style> </style>
<!-- 餐廳營業狀態按鈕樣式-->
<style name="otherOrder_restaurant_state_style">
<item name="android:layout_width">@dimen/dp_80</item>
<item name="android:layout_height">@dimen/dp_28</item>
<item name="android:gravity">center_vertical</item>
<item name="android:paddingLeft">@dimen/dp_8</item>
<item name="android:textColor">@color/white</item>
<item name="android:textSize">@dimen/dp_14</item>
</style>
</resources> </resources>
...@@ -203,7 +203,7 @@ public class PrintOtherOrder extends PrinterRoot { ...@@ -203,7 +203,7 @@ public class PrintOtherOrder extends PrinterRoot {
//配送費 //配送費
setAmount(data.getDELIVERY_CHARGE(), view.findViewById(R.id.tv_delivery_fee_text), view.findViewById(R.id.tv_delivery_fee), amountUnit); setAmount(data.getDELIVERY_CHARGE(), view.findViewById(R.id.tv_delivery_fee_text), view.findViewById(R.id.tv_delivery_fee), amountUnit);
//折扣 //折扣
setAmount(data.getDiscount_amount(), view.findViewById(R.id.tv_discount_text), view.findViewById(R.id.tv_discount), amountUnit); setAmount(data.getDiscount_amount(), view.findViewById(R.id.tv_discount_text), view.findViewById(R.id.tv_discount), "-" + amountUnit);
//總金額 //總金額
setText(view, R.id.tv_total_amount, amountUnit + MoneyUtil.sub(Double.parseDouble(data.getTOTAL_AMOUNT()), data.getDiscount_amount())); setText(view, R.id.tv_total_amount, amountUnit + MoneyUtil.sub(Double.parseDouble(data.getTOTAL_AMOUNT()), data.getDiscount_amount()));
//支付金額 //支付金額
......
...@@ -363,6 +363,7 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis ...@@ -363,6 +363,7 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
hepler.setViewClick(R.id.internet_print, v -> { hepler.setViewClick(R.id.internet_print, v -> {
//修改默認打印方式為IP打印 //修改默認打印方式為IP打印
SPUtils.put(mContext, PrintConstans.DEFAULT_PRINT_METHOD, PrintConstans.IP_PRINT); SPUtils.put(mContext, PrintConstans.DEFAULT_PRINT_METHOD, PrintConstans.IP_PRINT);
dialog.dismiss();
//彈出彈窗,讓用戶選擇ip打印機 //彈出彈窗,讓用戶選擇ip打印機
showIpPrintDeviceList(printerDeviceBeans, bitmaps); showIpPrintDeviceList(printerDeviceBeans, bitmaps);
}); });
......
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10" android:layout_marginTop="@dimen/dp_10"
android:text="配送費:" android:text="送貨費:"
android:textStyle="normal" android:textStyle="normal"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_lunchbox_cost" /> app:layout_constraintTop_toBottomOf="@id/tv_lunchbox_cost" />
......
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