Commit 77361964 by Wyh

6.24 adapter升級,prj打印開啟,外賣接單UI佈局優化,切換環境優化

parent 2b3e65d7
package com.gingersoft.gsa.cloud.base.adapter.print;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.base.R;
import com.gingersoft.gsa.cloud.base.common.bean.BillingBean;
import java.util.List;
import androidx.annotation.Nullable;
/**
* Created by Wyh on 2020/1/9.
*/
......@@ -20,11 +21,11 @@ public class BillAdapter extends BaseQuickAdapter<BillingBean, BaseViewHolder> {
@Override
protected void convert(BaseViewHolder helper, BillingBean item) {
helper.setText(R.id.tv_total_text, item.getOptionName());
helper.setText(R.id.tv_bill_total_text, item.getOptionName());
if (item.getTotalAmount() < 0) {
helper.setText(R.id.tv_total, "-$" + Math.abs(item.getTotalAmount()));
helper.setText(R.id.tv_bill_total, "-$" + Math.abs(item.getTotalAmount()));
} else if(item.getTotalAmount() > 0){
helper.setText(R.id.tv_total, "$" + item.getTotalAmount());
helper.setText(R.id.tv_bill_total, "$" + item.getTotalAmount());
}
}
}
package com.gingersoft.gsa.cloud.base.adapter.print;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.base.R;
import com.gingersoft.gsa.cloud.base.common.bean.BillMethodBean;
import com.gingersoft.gsa.cloud.base.common.bean.PayMethod;
import com.gingersoft.gsa.cloud.database.bean.Food;
import java.util.List;
import androidx.annotation.Nullable;
/**
* Created by Wyh on 2020/1/9.
* 結賬方式
......
......@@ -3,7 +3,7 @@ package com.gingersoft.gsa.cloud.base.adapter.print;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.base.R;
import com.gingersoft.gsa.cloud.base.common.bean.OrderDetail;
......
......@@ -5,7 +5,7 @@ import android.widget.TextView;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.base.R;
import com.gingersoft.gsa.cloud.base.common.bean.OrderDetail;
......
......@@ -98,7 +98,7 @@ public class GsaCloudApplication extends BaseApplication {
CC.enableDebug(true);
CC.enableRemoteCC(true);
//初始化服務器地址
initDomainUrl(false);
initDomainUrl();
//初始化側滑回退
// QMUISwipeBackActivityManager.init(this);
......@@ -148,8 +148,8 @@ public class GsaCloudApplication extends BaseApplication {
ClassicsFooter.REFRESH_FOOTER_NOTHING = getString(R.string.srl_footer_nothing);//"全部加载完成";
}
public static void initDomainUrl(boolean isSwitchServer) {
HttpsConstans.init(mAppContext,isSwitchServer);
public static void initDomainUrl() {
HttpsConstans.init(mAppContext);
//需要單獨配置域名URL的,在接口上添加@Headers({"Domain-Name: settlement_report_server"}),不添加則是使用默認域名
setGlobalDomain();
//清機報表請求地址
......
......@@ -185,7 +185,7 @@ public class OrderBean {
/**
* 打印設定, 用逗號分隔, *=切紙
*/
private String printSeting;
private String printSetIng;
/**
* 是否参与折扣#0:不參與;1:參與;
*/
......@@ -315,12 +315,12 @@ public class OrderBean {
this.orderId = orderId;
}
public String getPrintSeting() {
return printSeting;
public String getPrintSetIng() {
return printSetIng;
}
public void setPrintSeting(String printSeting) {
this.printSeting = printSeting;
public void setPrintSetIng(String printSetIng) {
this.printSetIng = printSetIng;
}
public long getAblediscount() {
......
......@@ -625,7 +625,7 @@ public class OrderDetail implements Serializable {
orderDetail.setNumber(orderDetailsBean.getNumber());
orderDetail.setPrice(orderDetailsBean.getPrice() * orderDetailsBean.getNumber());
orderDetail.setVisible(orderDetailsBean.getStatus() == 0);
orderDetail.setPrintseting(orderDetailsBean.getPrintSeting());
orderDetail.setPrintseting(orderDetailsBean.getPrintSetIng());
// orderDetail.setAutomod(foods.getAutomod());
orderDetail.setIsfood(orderDetailsBean.getType() == FOOD_TYPE);
orderDetail.setNew(false);
......
......@@ -67,13 +67,13 @@ public class HttpsConstans {
/**
* 修改這個值控制是否是正式
* 1=正式
* 2=香港
* 3=友常
* 4=世维
* 5=石书
* 0=正式
* 1=香港
* 2=友常
* 3=世维
* 4=石书
*/
public static int isFormal = 1;
public static int isFormal = 0;
//沽清控制地址
......@@ -94,9 +94,8 @@ public class HttpsConstans {
//修改這個值,修改微信公眾號報表地址:首頁曲線圖數據,支付分析報表數據
public static String WECHAR_REPORT_SERVER_ADDRESS;// = (isFormal ? WECHAR_REPORT_FORMAL_ADDRESS : WECHAR_REPORT_TEST_ADDRESS) + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
public static void init(Context context, boolean isSwitchServer) {
isFormal = BuildConfig.DEBUG ? 2 : 1;
isFormal = (int) SPUtils.get(context, "isFormal", 1);
public static void init(Context context) {
isFormal = (int) SPUtils.get(context, "isFormal", 0);
// if (!isSwitchServer) {
// }
// isFormal = 1;
......@@ -107,9 +106,8 @@ public class HttpsConstans {
// ROOT_URL = isFormal ==1 ? ROOT_FORMAL_URL : ROOT_HK_TEST_URL;//正式:ROOT_FORMAL_URL 測試:ROOT_HK_TEST_URL
// REPORT_SERVER_ADDRESS = (isFormal ==1 ? REPORT_FORMAL_ADDRESS : REPORT_TEST_ADDRESS) + REPORT_PATH;//測試:REPORT_FORMAL_ADDRESS 正式:REPORT_TEST_ADDRESS
// WECHAR_REPORT_SERVER_ADDRESS = (isFormal == 1 ? WECHAR_REPORT_FORMAL_ADDRESS : WECHAR_REPORT_TEST_ADDRESS) + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
switch (isFormal) {
case 1:
default:
_SERVER_ADDRESS = HTTP_ADDRESS_URL_FORMAL + "/member-web/api/";
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_FORMAL;
ROOT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_FORMAL + PATH;
......@@ -117,7 +115,7 @@ public class HttpsConstans {
REPORT_SERVER_ADDRESS = REPORT_FORMAL_ADDRESS + REPORT_PATH;
WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_FORMAL_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
break;
case 2:
case 1:
_SERVER_ADDRESS = "http://a.ricepon.com:61177" + "/member-web/api/";
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS;
ROOT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_HK + PATH;
......@@ -125,7 +123,7 @@ public class HttpsConstans {
REPORT_SERVER_ADDRESS = REPORT_TEST_ADDRESS + REPORT_PATH;
WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_TEST_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
break;
case 3:
case 2:
_SERVER_ADDRESS = ROOT_SERVER_YOU_CHANG_HK + "/member-web/api/";
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS;
ROOT_SERVER_ADDRESS_FORMAL = ROOT_SERVER_YOU_CHANG_HK;
......@@ -133,7 +131,7 @@ public class HttpsConstans {
REPORT_SERVER_ADDRESS = REPORT_TEST_ADDRESS + REPORT_PATH;
WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_TEST_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
break;
case 4:
case 3:
_SERVER_ADDRESS = ROOT_SERVER_SHI_WEI_HK + "/member-web/api/";
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS;
ROOT_SERVER_ADDRESS_FORMAL = ROOT_SERVER_SHI_WEI_HK;
......@@ -141,7 +139,7 @@ public class HttpsConstans {
REPORT_SERVER_ADDRESS = REPORT_TEST_ADDRESS + REPORT_PATH;
WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_TEST_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
break;
case 5:
case 4:
_SERVER_ADDRESS = ROOT_SERVER_SHI_SHU_HK + "/member-web/api/";
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS;
ROOT_SERVER_ADDRESS_FORMAL = ROOT_SERVER_SHI_SHU_HK;
......
......@@ -3,7 +3,7 @@ package com.gingersoft.gsa.cloud.ui.adapter;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.base.R;
import com.gingersoft.gsa.cloud.base.common.bean.PayMethod;
import com.qmuiteam.qmui.alpha.QMUIAlphaTextView;
......
......@@ -5,7 +5,7 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.base.R;
import com.gingersoft.gsa.cloud.base.common.bean.PayMethod;
......@@ -46,7 +46,7 @@ public class BillMoneyAdapter extends BaseQuickAdapter<PayMethod, BaseViewHolder
tv_bill_method_name.setTextColor(datasBean.getPayMoneyTextColor());
tv_bill_money.setTextColor(datasBean.getPayMoneyTextColor());
if (select_position == helper.getPosition()) {
if (select_position == helper.getAdapterPosition()) {
ll_container.setBackgroundResource(R.color.itemSelected);
} else {
ll_container.setBackgroundResource(R.color.theme_background_color);
......
......@@ -6,7 +6,7 @@
android:orientation="horizontal">
<TextView
android:id="@+id/tv_total_text"
android:id="@+id/tv_bill_total_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.7"
......@@ -14,7 +14,7 @@
style="@style/Print_text_style"/>
<TextView
android:id="@+id/tv_total"
android:id="@+id/tv_bill_total"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"
......
......@@ -115,7 +115,7 @@ ext {
"arms" : "me.jessyan:arms:2.5.2",
"fastjson" : "com.alibaba:fastjson:1.2.46",
"zxing" : "cn.yipianfengye.android:zxing-library:2.2",
"BaseRecyclerViewAdapter" : "com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.46",
"BaseRecyclerViewAdapter" : "com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4",
"yzjRecyclerView" : "com.yanzhenjie.recyclerview:x:1.3.2"
]
......
......@@ -2,8 +2,8 @@ package com.gingersoft.gsa.cloud.login.mvp.ui.activity.mvp.ui.activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
......@@ -11,9 +11,9 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.billy.cc.core.component.CC;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.utils.other.SPUtils;
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.constans.HttpsConstans;
import com.gingersoft.gsa.cloud.login.R;
import com.gingersoft.gsa.cloud.login.R2;
......@@ -82,93 +82,101 @@ public class SwitchServerActivity extends BaseActivity<SwitchServerPresenter> im
String nowServer = HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL;
tvNowServer.setText("當前服務器:" + nowServer);
setChecked((Integer) SPUtils.get(this, "isFormal", 2));
int defaultSelect = (Integer) SPUtils.get(this, "isFormal", -1);
if (defaultSelect == -1) {
defaultSelect = HttpsConstans.isFormal;
}
rbHK.setText("測試服務器");
rbFormal.setText("正式服務器");
((RadioButton) radioGroup.getChildAt(defaultSelect)).setChecked(true);
rbHK.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
setChecked(2);
}
});
rbFormal.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
setChecked(1);
}
});
rb_youchang.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
setChecked(3);
}
});
rb_shiwei.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
setChecked(4);
}
});
rb_shishu.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
setChecked(5);
}
radioGroup.setOnCheckedChangeListener((group, checkedId) -> {
SPUtils.put(mContext, "isFormal", group.indexOfChild(findViewById(checkedId)));
ToastUtils.show(mContext, "已切換環境,下次重啟生效");
});
// rbHK.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
// @Override
// public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// setChecked(2);
// }
// });
// rbFormal.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
// @Override
// public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// setChecked(1);
// }
// });
// rb_youchang.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
// @Override
// public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// setChecked(3);
// }
// });
// rb_shiwei.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
// @Override
// public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// setChecked(4);
// }
// });
// rb_shishu.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
// @Override
// public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// setChecked(5);
// }
// });
// });
switchServer.setOnClickListener(v -> {
GsaCloudApplication.initDomainUrl(true);
// GsaCloudApplication.initDomainUrl();
GsaCloudApplication.isLogin = false;
CC.obtainBuilder("User.Component.Login")
.setActionName("showActivityA")
.build()
.call();
finish();
// CC.obtainBuilder("User.Component.Login")
// .setActionName("showActivityA")
// .build()
// .call();
// finish();
System.exit(0);
});
}
private void setChecked(int i) {
switch (i) {
case 1:
rbHK.setChecked(false);
rb_youchang.setChecked(false);
rb_shiwei.setChecked(false);
rb_shishu.setChecked(false);
rbFormal.setChecked(true);
break;
case 2:
rbFormal.setChecked(false);
rb_youchang.setChecked(false);
rb_shiwei.setChecked(false);
rb_shishu.setChecked(false);
rbHK.setChecked(true);
break;
case 3:
rbHK.setChecked(false);
rbFormal.setChecked(false);
rb_shiwei.setChecked(false);
rb_shishu.setChecked(false);
rb_youchang.setChecked(true);
break;
case 4:
rbHK.setChecked(false);
rbFormal.setChecked(false);
rb_youchang.setChecked(false);
rb_shishu.setChecked(false);
rb_shiwei.setChecked(true);
break;
case 5:
rbHK.setChecked(false);
rbFormal.setChecked(false);
rb_youchang.setChecked(false);
rb_shiwei.setChecked(false);
rb_shishu.setChecked(true);
break;
}
SPUtils.put(this, "isFormal", i);
}
// private void setChecked(int i) {
// switch (i) {
// case 1:
// rbHK.setChecked(false);
// rb_youchang.setChecked(false);
// rb_shiwei.setChecked(false);
// rb_shishu.setChecked(false);
// rbFormal.setChecked(true);
// break;
// case 2:
// rbFormal.setChecked(false);
// rb_youchang.setChecked(false);
// rb_shiwei.setChecked(false);
// rb_shishu.setChecked(false);
// rbHK.setChecked(true);
// break;
// case 3:
// rbHK.setChecked(false);
// rbFormal.setChecked(false);
// rb_shiwei.setChecked(false);
// rb_shishu.setChecked(false);
// rb_youchang.setChecked(true);
// break;
// case 4:
// rbHK.setChecked(false);
// rbFormal.setChecked(false);
// rb_youchang.setChecked(false);
// rb_shishu.setChecked(false);
// rb_shiwei.setChecked(true);
// break;
// case 5:
// rbHK.setChecked(false);
// rbFormal.setChecked(false);
// rb_youchang.setChecked(false);
// rb_shiwei.setChecked(false);
// rb_shishu.setChecked(true);
// break;
// }
// SPUtils.put(this, "isFormal", i);
// }
@Override
......
......@@ -11,20 +11,20 @@
android:layout_height="wrap_content">
<RadioButton
android:id="@+id/rb_server_hk"
android:id="@+id/rb_server_formal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
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_server_formal"
android:id="@+id/rb_server_hk"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/dp_10"
android:text="正式環境"
android:text="測試環境"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/sp_16" />
......
package com.gingersoft.gsa.cloud.main.mvp.ui.activity;
import android.content.BroadcastReceiver;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import android.util.SparseArray;
import android.view.KeyEvent;
import android.view.View;
......@@ -20,7 +17,6 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentManager;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
......@@ -30,8 +26,8 @@ import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.utils.JsonUtils;
import com.gingersoft.gsa.cloud.base.utils.RestaurantInfoUtils;
import com.gingersoft.gsa.cloud.base.utils.encryption.Aes;
import com.gingersoft.gsa.cloud.base.utils.other.SPUtils;
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.constans.AppConstans;
import com.gingersoft.gsa.cloud.database.bean.Function;
import com.gingersoft.gsa.cloud.main.BuildConfig;
import com.gingersoft.gsa.cloud.main.R;
......@@ -60,8 +56,6 @@ import java.util.List;
import butterknife.BindView;
import butterknife.BindViews;
import butterknife.OnClick;
import io.reactivex.schedulers.Schedulers;
import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber;
import static com.jess.arms.utils.Preconditions.checkNotNull;
......@@ -144,8 +138,6 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
FragmentManager fragmentManager = getSupportFragmentManager();
mainTopFragment = (MainTopFragment) fragmentManager.findFragmentById(R.id.main_top_fragment);
tv_version_name.setText("v_" + DeviceUtils.getVersionName(this));
tvStoreName.setText(GsaCloudApplication.getRestaurantName(mContext));
refresh.setOnRefreshListener(refreshLayout -> {
if (mainTopFragment != null) {
......@@ -171,6 +163,16 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
});
}
@Override
protected void onResume() {
super.onResume();
if(((int) SPUtils.get(mContext, "isFormal", 0)) != 0){
tv_version_name.setText("v_" + DeviceUtils.getVersionName(this) + "\u1500Beta");
} else {
tv_version_name.setText("v_" + DeviceUtils.getVersionName(this));
}
}
/**
* 初始化側邊欄菜單項
*/
......
package com.gingersoft.gsa.cloud.main.mvp.ui.adapter;
import android.widget.BaseAdapter;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.main.R;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.BusinessBean;
import java.util.List;
import androidx.annotation.Nullable;
/**
* Created by Wyh on 2020/2/24.
*/
......@@ -18,16 +16,8 @@ public class BusinessInfoAdapter extends BaseQuickAdapter<BusinessBean, BaseView
public BusinessInfoAdapter(@Nullable List<BusinessBean> data) {
super(R.layout.report_business_info_item, data);
}
// @Override
// public void setNewData(@Nullable List<BusinessBean> data) {
//// super.setNewData(data);
// this.mData = data;
// notifyDataSetChanged();
// }
@Override
protected void convert(BaseViewHolder helper, BusinessBean item) {
helper.setText(R.id.tv_business_info_amount, item.getAmount() + "");
......
......@@ -5,7 +5,7 @@ import android.content.Context;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.base.utils.MoneyUtil;
import com.gingersoft.gsa.cloud.main.R;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.SalesFoodsBean;
......
package com.gingersoft.gsa.cloud.main.mvp.ui.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.database.bean.Function;
import com.gingersoft.gsa.cloud.main.R;
......
package com.gingersoft.gsa.cloud.main.mvp.ui.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.main.R;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.MainSideMenuBean;
......
......@@ -6,7 +6,7 @@ import android.os.Build;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.main.R;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.PaymentMethodBean;
import com.gingersoft.gsa.cloud.main.mvp.ui.view.MyProgressBar;
......
......@@ -6,7 +6,7 @@ import android.graphics.drawable.GradientDrawable;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.main.R;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.PaymentMethodBean;
......
......@@ -6,7 +6,7 @@ import android.view.View;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.main.R;
import com.gingersoft.gsa.cloud.main.mvp.model.bean.SalesFoodsBean;
......
......@@ -77,8 +77,6 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.ethanhua:skeleton:1.1.2'
implementation 'io.supercharge:shimmerlayout:2.1.0'
implementation 'com.ditclear:bindinglistadapter:1.0.0'
if (project.ext.runAsApp) {
addComponent 'print-module'
}
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
data class DeliveryBean(val data: List<Data>,
data class DeliveryBean(val data: MutableList<Data>,
val success: Boolean,
val sysTime: Long) {
data class Data(
......
package com.gingersoft.gsa.other_order_mode.data.network
import android.util.Log
import com.gingersoft.gsa.cloud.constans.HttpsConstans
import com.gingersoft.gsa.cloud.globalconfig.applyOptions.intercept.LoggingInterceptor
import okhttp3.OkHttpClient
......
......@@ -514,7 +514,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
val recycler = hepler.getView<RecyclerView>(R.id.rv_delivery)
recycler.layoutManager = GridLayoutManager(context, 4)
val deliveryAdapter = DeliveryAdapter(context, deliveryBean!!.data)
val deliveryAdapter = DeliveryAdapter(deliveryBean!!.data)
recycler.adapter = deliveryAdapter
deliveryAdapter.setOnItemClickListener { adapter, view, position ->
......@@ -583,7 +583,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
cancelReasons.add(data)
}
val deliveryAdapter = DeliveryAdapter(context, cancelReasons)
val deliveryAdapter = DeliveryAdapter(cancelReasons)
recycler.adapter = deliveryAdapter
deliveryAdapter.setOnItemClickListener { adapter, view, position ->
......
package com.gingersoft.gsa.other_order_mode.ui.activity
import android.os.Bundle
import androidx.databinding.ObservableArrayList
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.ui.base.BaseActivity
import com.gingersoft.gsa.other_order_mode.ui.fragment.DeliveryFragment
import com.gingersoft.gsa.other_order_mode.ui.fragment.UpdateDeliveryFragment
import io.ditclear.bindingadapter.SingleTypeAdapter
import kotlinx.android.synthetic.main.activity_delivery.*
class DeliverySettingActivity : BaseActivity() {
......
......@@ -104,7 +104,10 @@ class OrderDetailsActivity : BaseActivity() {
tv_order_state.setTextColor(resources.getColor(R.color.order_state1_color))
}
orderStatusText = "製作中"
btnList.add(BtnBuilder().getCancelBtn())
if (orderDetails.isDelete != 0) {
//不是第三方物流才顯示取消訂單
btnList.add(BtnBuilder().getCancelBtn())
}
}
3 -> {//外賣是送貨中,自取是待取餐
btnList.add(BtnBuilder().getPrintBtn())
......@@ -171,7 +174,7 @@ class OrderDetailsActivity : BaseActivity() {
//如果是在線支付的訂單,就直接修改訂單狀態
if (orderPayType != 1) {
gsUpdateOrderStatus(orderDetails.ID.toString(), orderDetails.order_type) { status, isSuccess ->
if(isSuccess) {
if (isSuccess) {
finish()
} else {
ToastUtils.show(this@OrderDetailsActivity, "結賬失敗")
......
......@@ -25,7 +25,9 @@ import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
import com.gingersoft.gsa.cloud.base.widget.DialogUtils
import com.gingersoft.gsa.cloud.constans.AppConstans
import com.gingersoft.gsa.cloud.constans.HttpsConstans
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.network.ServiceCreator
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.service.GetInfoUpdateService
......@@ -68,7 +70,7 @@ class OtherOrderActivity : BaseActivity() {
private var btnHeight: Float = 0F
private var selectPosition = 0
lateinit var mReceiver :ClearHeartBroadcastReceiver
lateinit var mReceiver: ClearHeartBroadcastReceiver
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
......@@ -461,6 +463,14 @@ class OtherOrderActivity : BaseActivity() {
qm_other_order_bar.setBackgroundColor(resources.getColor(R.color.theme_color))
}
override fun onStart() {
super.onStart()
if (ServiceCreator.ROOT_URL == HttpsConstans.ROOT_HK_TEST_URL) {
//測試
qm_other_order_bar.setTitle("(Beta) " + GsaCloudApplication.getRestaurantName(this))
}
}
inner class ClearHeartBroadcastReceiver : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
finish()
......
package com.gingersoft.gsa.other_order_mode.ui.adapter
import android.content.Context
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.model.bean.DeliveryBean
class DeliveryAdapter(val context: Context, data: List<DeliveryBean.Data>) : BaseQuickAdapter<DeliveryBean.Data, BaseViewHolder>(R.layout.other_order_delivery_item, data) {
var selectIndex = -1
override fun convert(helper: BaseViewHolder?, item: DeliveryBean.Data?) {
helper!!.setText(R.id.tv_delivery_name, item!!.userName)
if (helper.adapterPosition == selectIndex) {
helper.setBackgroundRes(R.id.layout_delivery_item, R.drawable.shape_delivery_item_btn)
helper.setTextColor(R.id.tv_delivery_name, context.resources.getColor(R.color.order_state0_color))
class DeliveryAdapter(data: MutableList<DeliveryBean.Data>) : BaseQuickAdapter<DeliveryBean.Data, BaseViewHolder>(R.layout.other_order_delivery_item, data) {
override fun convert(holder: BaseViewHolder, item: DeliveryBean.Data) {
holder.setText(R.id.tv_delivery_name, item.userName)
if (holder.adapterPosition == selectIndex) {
holder.setBackgroundResource(R.id.layout_delivery_item, R.drawable.shape_delivery_item_btn)
holder.setTextColor(R.id.tv_delivery_name, context.resources.getColor(R.color.order_state0_color))
} else {
helper.setBackgroundRes(R.id.layout_delivery_item, R.drawable.shape_delivery_item_btn_normal)
helper.setTextColor(R.id.tv_delivery_name, context.resources.getColor(R.color.color_c8))
holder.setBackgroundResource(R.id.layout_delivery_item, R.drawable.shape_delivery_item_btn_normal)
holder.setTextColor(R.id.tv_delivery_name, context.resources.getColor(R.color.color_c8))
}
}
var selectIndex = -1
}
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 android.widget.ImageView
import android.widget.TextView
import androidx.databinding.DataBindingUtil
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.chad.library.adapter.base.viewholder.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) {
class DeliveryListAdapter(data: MutableList<DeliveryConfig.Data.DeliveryInfo>) : BaseQuickAdapter<DeliveryConfig.Data.DeliveryInfo, DeliveryListAdapter.ViewHolder>(R.layout.item_delivery_layout, 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 ->
override fun convert(holder: ViewHolder, item: DeliveryConfig.Data.DeliveryInfo) {
holder.let { helper ->
helper.binding.apply {
deliveryType = when (item!!.distributionType) {
deliveryType = when (item.distributionType) {
"SHORT_RANGE" -> "短途送"
"STANDARD" -> "中途送"
"LONG_DISTANCE" -> "長途送"
......@@ -38,14 +31,19 @@ class DeliveryListAdapter(val context: Context, data: List<DeliveryConfig.Data.D
}
}
helper.getView<ImageView>(R.id.iv_delete).setOnClickListener {
onItemChildClickListener?.onItemChildClick(this, it, helper.adapterPosition)
getOnItemChildClickListener()?.onItemChildClick(this, it, helper.adapterPosition)
}
helper.itemView.setOnClickListener {
onItemChildClickListener?.onItemChildClick(this, it, helper.adapterPosition)
getOnItemChildClickListener()?.onItemChildClick(this, it, helper.adapterPosition)
}
}
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_delivery_layout, null)
return ViewHolder(view)
}
class ViewHolder(itemView: View) : BaseViewHolder(itemView) {
var binding: ItemDeliveryLayoutBinding = DataBindingUtil.bind(itemView)!!
}
......
package com.gingersoft.gsa.other_order_mode.ui.adapter
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.model.bean.BtnBuilder
class OrderDetailsAdapter(list: List<BtnBuilder.BtnBean>) : BaseQuickAdapter<BtnBuilder.BtnBean, BaseViewHolder>(R.layout.item_btn, list) {
class OrderDetailsAdapter(list: MutableList<BtnBuilder.BtnBean>) : BaseQuickAdapter<BtnBuilder.BtnBean, BaseViewHolder>(R.layout.item_btn, list) {
override fun convert(helper: BaseViewHolder, item: BtnBuilder.BtnBean) {
helper.setText(R.id.tv_btn_content, item.btnContent)
helper.setBackgroundRes(R.id.layout_btn_item, item.btnColor)
helper.setImageResource(R.id.iv_btn_mark, item.btnImg)
override fun convert(holder: BaseViewHolder, item: BtnBuilder.BtnBean) {
holder.setText(R.id.tv_btn_content, item.btnContent)
holder.setBackgroundResource(R.id.layout_btn_item, item.btnColor)
holder.setImageResource(R.id.iv_btn_mark, item.btnImg)
}
......
......@@ -9,12 +9,13 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import androidx.core.content.ContextCompat
import androidx.databinding.DataBindingUtil
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.Adapter
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.model.bean.OrderList
import com.gingersoft.gsa.other_order_mode.databinding.LayoutOtherOrderItemNewBinding
import com.gingersoft.gsa.other_order_mode.databinding.LayoutOtherOrderItemBinding
import com.scwang.smartrefresh.layout.util.SmartUtil.dp2px
class OtherOrdersAdapter(var context: Context) : Adapter<OtherOrdersAdapter.ViewHolder>() {
......@@ -34,7 +35,7 @@ class OtherOrdersAdapter(var context: Context) : Adapter<OtherOrdersAdapter.View
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.layout_other_order_item_new, parent, false))
return ViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.layout_other_order_item, parent, false))
}
......@@ -164,12 +165,11 @@ class OtherOrdersAdapter(var context: Context) : Adapter<OtherOrdersAdapter.View
}
private fun getColor(color: Int): Int {
return context.resources.getColor(color)
return ContextCompat.getColor(context, color)
}
class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
var binding: LayoutOtherOrderItemNewBinding = DataBindingUtil.bind(itemView)!!
var binding: LayoutOtherOrderItemBinding = DataBindingUtil.bind(itemView)!!
var flBorder: FrameLayout = itemView.findViewById(R.id.fl_border)
}
}
\ No newline at end of file
package com.gingersoft.gsa.other_order_mode.ui.adapter
import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.model.bean.BillBean
class PayBillAdapter(billBeans: List<BillBean>) : BaseQuickAdapter<BillBean, BaseViewHolder>(R.layout.item_pay_bill, billBeans) {
class PayBillAdapter(billBeans: MutableList<BillBean>) : BaseQuickAdapter<BillBean, BaseViewHolder>(R.layout.item_pay_bill, billBeans) {
override fun convert(helper: BaseViewHolder, item: BillBean) {
helper.setText(R.id.tv_item_pay_name, item.name)
helper.setText(R.id.tv_item_pay_amount, item.amount.toString())
override fun convert(holder: BaseViewHolder, item: BillBean) {
holder.setText(R.id.tv_item_pay_name, item.name)
holder.setText(R.id.tv_item_pay_amount, item.amount.toString())
if(item.isRed == 0){
helper.setTextColor(R.id.tv_item_pay_name, helper.itemView.context.resources.getColor(R.color.color_3c))
helper.setTextColor(R.id.tv_item_pay_name, helper.itemView.context.resources.getColor(R.color.color_3c))
holder.setTextColor(R.id.tv_item_pay_name, ContextCompat.getColor(context, R.color.color_3c))
holder.setTextColor(R.id.tv_item_pay_name, ContextCompat.getColor(context, R.color.color_3c))
} else {
helper.setTextColor(R.id.tv_item_pay_name, helper.itemView.context.resources.getColor(R.color.discount_red))
helper.setTextColor(R.id.tv_item_pay_name, helper.itemView.context.resources.getColor(R.color.discount_red))
holder.setTextColor(R.id.tv_item_pay_name, ContextCompat.getColor(context, R.color.discount_red))
holder.setTextColor(R.id.tv_item_pay_name,ContextCompat.getColor(context, R.color.discount_red))
}
}
}
\ No newline at end of file
package com.gingersoft.gsa.other_order_mode.ui.adapter
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.gingersoft.gsa.other_order_mode.R
import com.qmuiteam.qmui.alpha.QMUIAlphaTextView
class TextAdapter(list: List<String>) : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_textview, list) {
override fun convert(helper: BaseViewHolder?, item: String?) {
helper?.setText(R.id.tv_item, item)
helper?.getView<TextView>(R.id.tv_item)!!.setOnClickListener {
if (onItemClickListener != null) {
onItemClickListener.onItemClick(this, it, helper.adapterPosition)
}
}
class TextAdapter(list: MutableList<String>) : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_textview, list) {
override fun convert(holder: BaseViewHolder, item: String) {
holder.setText(R.id.tv_item, item)
addChildClickViewIds(R.id.tv_item)
}
}
\ No newline at end of file
......@@ -42,14 +42,14 @@ class DeliveryFragment : BaseFragment() {
(activity as DeliverySettingActivity).editDelivery(null)
}
viewModel.otherInfo.observe(viewLifecycleOwner, Observer { it ->
viewModel.otherInfo.observe(viewLifecycleOwner, Observer {
if (it?.data?.list != null && it.data.list.isNotEmpty()) {
if (deliveryListAdapter == null) {
deliveryListAdapter = DeliveryListAdapter(context!!, it.data.list)
deliveryListAdapter = DeliveryListAdapter(it.data.list)
rv_delivery.adapter = deliveryListAdapter
rv_delivery.layoutManager = LinearLayoutManager(context!!)
} else {
deliveryListAdapter!!.setNewData(it.data.list)
deliveryListAdapter!!.setNewInstance(it.data.list)
}
deliveryListAdapter!!.setOnItemChildClickListener { adapter, view, position ->
when (view.id) {
......
package com.gingersoft.gsa.other_order_mode.ui.fragment
import android.os.Bundle
import android.util.Log
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 androidx.recyclerview.widget.RecyclerView
......@@ -21,9 +20,7 @@ import com.jess.arms.utils.ArmsUtils
import com.qmuiteam.qmui.util.QMUIDisplayHelper
import com.qmuiteam.qmui.widget.popup.QMUIPopup
import com.qmuiteam.qmui.widget.popup.QMUIPopups
import com.zhy.autolayout.utils.ScreenUtils
import kotlinx.android.synthetic.main.update_delivery_fragment.*
import org.w3c.dom.Text
class UpdateDeliveryFragment : BaseFragment(R.layout.update_delivery_fragment) {
......@@ -144,12 +141,13 @@ class UpdateDeliveryFragment : BaseFragment(R.layout.update_delivery_fragment) {
}
var adapter: TextAdapter? = null
private fun showPopup(it: View, list: List<String>) {
private fun showPopup(it: View, list: MutableList<String>) {
if (pop == null) {
val view = LayoutInflater.from(context).inflate(R.layout.recyclerview, null)
val listView = view.findViewById<RecyclerView>(R.id.ryview)
listView.layoutManager = LinearLayoutManager(context)
adapter = TextAdapter(list)
adapter?.setOnItemClickListener { _, _, _ ->}
listView.layoutParams.width = (ArmsUtils.getScreenWidth(context) * 0.7).toInt()
listView.adapter = adapter
......@@ -165,10 +163,10 @@ class UpdateDeliveryFragment : BaseFragment(R.layout.update_delivery_fragment) {
.animStyle(QMUIPopup.ANIM_AUTO)
.show(it)
} else {
adapter!!.setNewData(list)
pop!!.show(it)
adapter?.setNewInstance(list)
pop?.show(it)
}
adapter?.setOnItemClickListener { adapter, view, position ->
adapter?.setOnItemClickListener { _, _, position ->
when (it.id) {
R.id.layout_delivery_type -> {
//修改備送類型
......@@ -183,8 +181,6 @@ class UpdateDeliveryFragment : BaseFragment(R.layout.update_delivery_fragment) {
}
pop!!.dismiss()
}
}
}
......@@ -79,183 +79,258 @@
tools:text="外送"
tools:textColor="@color/theme_333_color" />
<LinearLayout
<FrameLayout
android:id="@+id/fl_payment_method"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="@dimen/dp_10"
android:paddingEnd="@dimen/dp_10"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_5"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toRightOf="@id/tv_delivery_method"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_order_time"
app:layout_constraintTop_toTopOf="parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_payment_method"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@{payMethodBg}"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_2"
android:paddingRight="@dimen/dp_10"
android:layout_centerVertical="true"
android:paddingBottom="@dimen/dp_2"
android:text="@{payMethod}"
android:textColor="@color/white"
android:textSize="@dimen/sp_10"
tools:text="支付方式支付方式支付方式支付方式支付方式"
tools:textColor="@color/theme_333_color" />
<TextView
android:id="@+id/tv_order_time"
style="@style/otherOrder_item_create_time_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="end"
android:layout_toEndOf="@id/tv_payment_method"
android:layout_alignParentEnd="true"
android:text="@{TimeUtils.parseTimeRepeat(data.cREATE_TIME,TimeUtils.DEFAULT_DATE_FORMAT)}"
android:textSize="@dimen/dp_10"
tools:text="下單時間下單時間下單時間下單時間"
tools:textColor="@color/theme_333_color" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_6"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_order_user_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_10"
android:text="@{data.rECEIVER + @string/left_parenthesis+data.pHONE + @string/right_parenthesis}"
android:textColor="@color/theme_text_color"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
tools:text="用戶名+手機號啊實打實啊實打實大阿達"
tools:textColor="@color/theme_333_color" />
<TextView
android:id="@+id/tv_delivery_state"
style="@style/otherOrder_item_info_title_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_toEndOf="@id/tv_order_user_name"
android:gravity="end"
android:text="@{delivery_state}"
android:textColor="@color/color_3c"
tools:text="用戶名+手"
tools:textColor="@color/theme_333_color" />
</RelativeLayout>
android:background="@{payMethodBg}"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_2"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_2"
android:text="@{payMethod}"
android:textColor="@color/white"
android:gravity="left"
android:layout_gravity="left"
android:textSize="@dimen/sp_10"
tools:text="支付方式"
tools:textColor="@color/theme_333_color" />
</FrameLayout>
<TextView
android:id="@+id/tv_order_time"
style="@style/otherOrder_item_create_time_textStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/dp_10"
android:layout_toEndOf="@id/fl_payment_method"
android:gravity="right"
android:text="@{TimeUtils.parseTimeRepeat(data.cREATE_TIME,TimeUtils.DEFAULT_DATE_FORMAT)}"
android:textSize="@dimen/dp_10"
app:layout_constraintBottom_toBottomOf="@id/fl_payment_method"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toRightOf="@id/fl_payment_method"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/fl_payment_method"
tools:text="下單時間"
tools:textColor="@color/theme_333_color" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier_order_item_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:barrierDirection="bottom"
app:constraint_referenced_ids="fl_payment_method,tv_order_time" />
<TextView
android:id="@+id/tv_order_user_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_6"
android:layout_marginRight="@dimen/dp_10"
android:text="@{data.rECEIVER + @string/left_parenthesis+data.pHONE + @string/right_parenthesis}"
android:textColor="@color/theme_text_color"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
app:layout_constraintHorizontal_weight="3"
app:layout_constraintLeft_toLeftOf="@id/fl_payment_method"
app:layout_constraintRight_toLeftOf="@id/tv_delivery_state"
app:layout_constraintTop_toBottomOf="@id/barrier_order_item_one"
tools:text="用戶名+手機號啊實打實啊實打實大阿打哈阿薩德達"
tools:textColor="@color/theme_333_color" />
<TextView
android:id="@+id/tv_delivery_state"
style="@style/otherOrder_item_info_title_textStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/dp_10"
android:layout_toEndOf="@id/tv_order_user_name"
android:gravity="end"
android:text="@{delivery_state}"
android:textColor="@color/color_3c"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toRightOf="@id/tv_order_user_name"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_order_user_name"
tools:text="用戶名"
tools:textColor="@color/theme_333_color" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier_order_item_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:barrierDirection="bottom"
app:constraint_referenced_ids="tv_order_user_name,tv_delivery_state" />
<TextView
android:id="@+id/tv_delivery_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_9"
android:text="@{data.sendTime}"
android:textColor="#EC2D2D"
android:textSize="@dimen/dp_12"
android:visibility="@{(data.sendTime == null || data.sendTime.length() == 0)?View.GONE:View.VISIBLE}"
app:layout_constraintLeft_toLeftOf="@id/fl_payment_method"
app:layout_constraintTop_toBottomOf="@id/barrier_order_item_two"
tools:text="送達時間Adasd奧術大師大所多啊實打實大啊實打實大阿薩德"
tools:textColor="@color/theme_333_color" />
<TextView
android:id="@+id/tv_order_num_text"
style="@style/otherOrder_item_info_title_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginTop="@dimen/dp_8"
android:text="取餐碼:"
app:layout_constraintLeft_toLeftOf="@id/fl_payment_method"
app:layout_constraintTop_toBottomOf="@id/tv_delivery_time" />
<TextView
android:id="@+id/tv_order_num"
style="@style/otherOrder_item_info_title_textStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_5"
android:gravity="left"
android:text='@{data.takeFoodCode.equals("0")? @string/take_food_code_omit:data.takeFoodCode}'
android:textSize="@dimen/dp_14"
android:textStyle="bold"
app:layout_constraintHorizontal_weight="2"
app:layout_constraintLeft_toRightOf="@id/barrier_order_item_right"
app:layout_constraintRight_toLeftOf="@id/rl_order_state"
app:layout_constraintTop_toBottomOf="@id/tv_delivery_time"
app:layout_constraintTop_toTopOf="@id/tv_order_num_text"
tools:text="0112121121"
tools:textColor="@color/theme_333_color" />
<FrameLayout
android:id="@+id/rl_order_state"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_10"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toRightOf="@id/tv_order_num"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_delivery_time"
app:layout_constraintTop_toTopOf="@id/tv_order_num_text">
<TextView
android:id="@+id/tv_delivery_time"
android:id="@+id/tv_order_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_9"
android:text="@{data.sendTime}"
android:textColor="#EC2D2D"
android:textSize="@dimen/dp_12"
android:visibility="visible"
tools:text="送達時間Adasd奧術大師大所多啊實打實大啊實打實大阿薩德"
android:layout_gravity="right"
android:background="@{stateBg}"
android:padding="@dimen/dp_5"
android:text="@{state}"
android:textColor="@color/white"
android:textSize="@dimen/dp_14"
tools:text="訂單狀態"
tools:textColor="@color/theme_333_color" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8">
<TextView
android:id="@+id/tv_order_num_text"
style="@style/otherOrder_item_info_title_textStyle"
android:layout_width="wrap_content"
android:layout_centerVertical="true"
android:layout_height="wrap_content"
android:text="取餐碼:" />
<TextView
android:id="@+id/tv_order_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:background="@{stateBg}"
android:padding="@dimen/dp_5"
android:text="@{state}"
android:textColor="@color/white"
android:textSize="@dimen/dp_14"
tools:text="訂單狀態"
tools:textColor="@color/theme_333_color" />
<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:layout_toStartOf="@id/tv_order_state"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/tv_order_num_text"
android:text='@{data.takeFoodCode.equals("0")? @string/take_food_code_omit:data.takeFoodCode}'
android:textSize="@dimen/dp_14"
android:textStyle="bold"
tools:text="012121201阿達as244342313154446455443434242"
tools:textColor="@color/theme_333_color" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_9"
android:layout_marginBottom="@dimen/dp_10">
<TextView
android:id="@+id/tv_address_text"
style="@style/otherOrder_item_info_title_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{@string/address}"
android:visibility="@{isSelf?View.GONE:View.VISIBLE}"
tools:text="地址:\u3000"
tools:textColor="@color/theme_333_color" />
<TextView
android:id="@+id/tv_order_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginTop="@dimen/dp_3"
android:layout_marginStart="@dimen/dp_4"
android:text="@{@string/amount_unit + data.pAY_AMOUNT}"
android:textColor="@color/red_600"
android:layout_centerVertical="true"
android:textSize="@dimen/sp_16"
tools:text="$1412121"
tools:textColor="@color/theme_333_color" />
<TextView
android:id="@+id/tv_address"
style="@style/otherOrder_item_info_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_toEndOf="@id/tv_address_text"
android:layout_toStartOf="@id/tv_order_amount"
android:text="@{data.aDDRESS_DETAIL}"
android:visibility="@{isSelf?View.GONE:View.VISIBLE}"
tools:text="地址安居客收到貨卡和山東傻了發哈連接阿斯蒂芬"
tools:textColor="@color/theme_333_color" />
</RelativeLayout>
</LinearLayout>
</FrameLayout>
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier_order_item_three"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:barrierDirection="bottom"
app:constraint_referenced_ids="tv_order_num_text,tv_order_num,rl_order_state" />
<TextView
android:id="@+id/tv_address_text"
style="@style/otherOrder_item_info_title_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_9"
android:layout_marginBottom="@dimen/dp_10"
android:text="@{@string/address}"
android:visibility="@{isSelf?View.GONE:View.VISIBLE}"
app:layout_constraintLeft_toLeftOf="@id/fl_payment_method"
app:layout_constraintTop_toBottomOf="@id/barrier_order_item_three"
tools:text="地址:"
tools:textColor="@color/theme_333_color" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier_order_item_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="right"
app:constraint_referenced_ids="tv_address_text,tv_order_num_text" />
<TextView
android:id="@+id/tv_address"
style="@style/otherOrder_item_info_textStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_10"
android:layout_toStartOf="@id/tv_order_amount"
android:layout_toEndOf="@id/tv_address_text"
android:text="@{data.aDDRESS_DETAIL}"
android:gravity="left"
android:visibility="@{isSelf?View.GONE:View.VISIBLE}"
app:layout_constraintHorizontal_weight="2"
app:layout_constraintLeft_toRightOf="@id/barrier_order_item_right"
app:layout_constraintRight_toLeftOf="@id/tv_order_amount"
app:layout_constraintTop_toTopOf="@id/tv_address_text"
tools:text="收貨地址"
tools:textColor="@color/theme_333_color" />
<TextView
android:id="@+id/tv_order_amount"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginStart="@dimen/dp_4"
android:layout_marginTop="@dimen/dp_9"
android:layout_marginEnd="@dimen/dp_10"
android:gravity="right"
android:text="@{@string/amount_unit + data.pAY_AMOUNT}"
android:textColor="@color/red_600"
android:textSize="@dimen/sp_16"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toRightOf="@id/tv_address"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/barrier_order_item_three"
tools:text="$14142"
tools:textColor="@color/theme_333_color" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier_order_item_bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="tv_address,tv_order_amount" />
<View
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/dp_10"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/barrier_order_item_bottom" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.lihang.ShadowLayout>
......
......@@ -250,7 +250,7 @@ public class PrintOtherOrder extends PrinterRoot {
// billData.add(getBillBean("總金額:", amountUnit + data.getTOTAL_AMOUNT()));
BillItemAdapter adapter = new BillItemAdapter(billData, context);
BillItemAdapter adapter = new BillItemAdapter(billData);
rvBill.setLayoutManager(new LinearLayoutManager(context));
rvBill.setAdapter(adapter);
//總金額
......
......@@ -121,7 +121,9 @@ public class PrjService extends Service implements PrintSocketHolder.OnStateChan
@Override
public void onNext(String s) {
Log.e("eee", "請求到PRJ數據:" + s);
Log.e("eee", "請求到PRJ數據:" + s);
Log.e("eee", "請求到PRJ數據:" + s);
Log.e("eee", "請求到PRJ數據:" + s);
//請求到數據,停止輪詢,開始打印,在打印完之後再重新開始輪詢
startPrint(s);
//開啟另一個定時,三十秒之後自動請求,避免上面的打印成功或失敗時沒有回調。
......
package com.joe.print.mvp.ui.adapter;
import android.content.Context;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.gingersoft.gsa.cloud.base.common.bean.BillingBean;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.joe.print.R;
import com.joe.print.mvp.model.bean.PrintBillBean;
import java.util.HashMap;
import java.util.List;
/**
* Created by Wyh on 2020/1/16.
*/
public class BillItemAdapter extends BaseQuickAdapter<PrintBillBean, BaseViewHolder> {
private Context mContext;
public BillItemAdapter(@Nullable List<PrintBillBean> data, Context mContext) {
public BillItemAdapter(@Nullable List<PrintBillBean> data) {
super(R.layout.print_item_bill, data);
this.mContext = mContext;
}
@Override
......
......@@ -5,7 +5,7 @@ import android.content.Context;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.joe.print.R;
......
......@@ -5,7 +5,7 @@ import android.widget.TextView;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.base.R;
import com.gingersoft.gsa.cloud.base.common.bean.OrderDetail;
import com.joe.print.mvp.model.bean.PrjBean;
......
......@@ -11,7 +11,7 @@ import android.widget.TextView;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.print.bean.OrderDetails;
import com.joe.print.R;
......
......@@ -5,7 +5,7 @@ import android.view.View;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.joe.print.R;
......
......@@ -6,7 +6,7 @@ import android.widget.ImageView;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.joe.print.R;
import java.util.List;
......
......@@ -3,7 +3,7 @@ package com.joe.print.mvp.ui.adapter;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.joe.print.R;
import com.gingersoft.gsa.cloud.database.bean.PrintModelBean;
......
......@@ -7,7 +7,7 @@ import android.widget.RadioButton;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.base.utils.other.SPUtils;
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
......@@ -41,9 +41,10 @@ public class PrinterListAdapter extends BaseQuickAdapter<PrinterDeviceBean, Base
helper.getView(R.id.tv_default_print).setVisibility(item.getStatus() == 2 ? View.VISIBLE : View.GONE);
// helper.setOnItemSelectedClickListener(R.id.layout_delete,)
helper.addOnClickListener(R.id.layout_delete);
}
// helper.addOnClickListener(R.id.layout_delete);
addChildClickViewIds(R.id.layout_delete);
}
public int getSelectPosition() {
......@@ -55,7 +56,8 @@ public class PrinterListAdapter extends BaseQuickAdapter<PrinterDeviceBean, Base
}
public void notifyData(List<PrinterDeviceBean> data) {
this.mData = data;
// this.mData = data;
setNewInstance(data);
super.notifyDataSetChanged();
}
}
......@@ -5,7 +5,7 @@ import android.widget.RadioButton;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.joe.print.R;
......
......@@ -3,6 +3,7 @@ package com.joe.print.mvp.ui.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.os.Message;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -270,24 +271,26 @@ public class IpPrintListActivityFragment extends BaseFragment<IpPrintListActivit
});// 监听拖拽和侧滑删除,更新UI和数据源。
printListAdapter = new PrinterListAdapter(devicess, mContext);
printListAdapter.setOnItemChildClickListener((adapter, view, position) -> new AppDialog().showWaringDialog(mContext, "是否刪除打印機", (view1, dialog) -> {
//調用刪除接口
mPresenter.deletePrinter(devicess.get(position).getId() + "");
devicess.remove(position);
printListAdapter.notifyItemRemoved(position);
dialog.dismiss();
if (devicess == null || devicess.size() == 0) {
mTvAddPrint.setVisibility(View.VISIBLE);
} else {
mTvAddPrint.setVisibility(View.GONE);
printListAdapter.setOnItemChildClickListener((adapter, view, position) -> {
if (view.getId() == R.id.layout_delete) {
new AppDialog().showWaringDialog(mContext, "是否刪除打印機", (view1, dialog) -> {
//調用刪除接口
mPresenter.deletePrinter(devicess.get(position).getId() + "");
devicess.remove(position);
printListAdapter.notifyItemRemoved(position);
dialog.dismiss();
if (devicess == null || devicess.size() == 0) {
mTvAddPrint.setVisibility(View.VISIBLE);
} else {
mTvAddPrint.setVisibility(View.GONE);
}
});
}
}));
});
mRvPrintList.setLayoutManager(new LinearLayoutManager(mContext));
//分割线
// mRvPrintList.addItemDecoration(new DefaultItemDecoration(ContextCompat.getColor(mContext, R.color.line_color)));
mRvPrintList.setSwipeMenuCreator(mSwipeMenuCreator); // 菜单创建器。
// mRvPrintList.setAdapter(printListAdapter);
printListAdapter.bindToRecyclerView(mRvPrintList);
mRvPrintList.setAdapter(printListAdapter);
} else {
printListAdapter.notifyData(devicess);
}
......@@ -297,7 +300,7 @@ public class IpPrintListActivityFragment extends BaseFragment<IpPrintListActivit
Intent intent = new Intent(mContext, PrinterAddActivity.class);
intent.putExtra("printer_position", adapterPosition);
intent.putExtra("printList", (Serializable) devicess);
if(mPresenter.getPrintModelBeans() != null){
if (mPresenter.getPrintModelBeans() != null) {
intent.putExtra("printModelList", (Serializable) mPresenter.getPrintModelBeans());
}
startActivity(intent);
......
......@@ -27,5 +27,4 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
\ No newline at end of file
......@@ -775,7 +775,7 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
request.setNumber(item.getNumber());
request.setPrice(item.getUnit_price());
request.setType(item.getType());
request.setPrintSeting(item.getPrintseting());
request.setPrintSetIng(item.getPrintseting());
request.setAblediscount(item.getAblediscount());
request.setDiscountId(getDiscountIdByParentId(foodList, mainProductId));
request.setLunchboxPrice(0);
......@@ -859,7 +859,7 @@ public class BaseOrderPresenter<M extends BaseOrderContract.Model, V extends Bas
request.setNumber(item.getNumber());
request.setPrice(item.getUnit_price());
request.setType(item.getType());
request.setPrintSeting(item.getPrintseting());
request.setPrintSetIng(item.getPrintseting());
request.setAblediscount(item.getAblediscount());
request.setDiscountId(getDiscountIdByParentId(foodList, mainParentId));
request.setLunchboxPrice(0);
......
......@@ -226,7 +226,7 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
// } else {
// btn_order_count.setVisibility(View.INVISIBLE);
// }
// tv_whole.setText("合計 $" + mPresenter.getFoodTotal());
tv_whole.setText("合計 $" + mPresenter.getFoodTotal());
// tv_total.setText("$" + mPresenter.getTotalAmount());
// setDifferenceText();
}
......
package com.gingersoft.gsa.cloud.table.mvp.ui.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.FoodReason;
import com.gingersoft.gsa.cloud.ui.bean.view.SectionTextItem3;
......
package com.gingersoft.gsa.cloud.table.mvp.ui.adapter;
import android.view.Gravity;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import com.gingersoft.gsa.cloud.base.common.bean.OrderDetail;
import com.gingersoft.gsa.cloud.base.common.bean.PayMethod;
import com.gingersoft.gsa.cloud.base.utils.MoneyUtil;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.OrderDetailItem;
import com.gingersoft.gsa.cloud.ui.bean.view.SectionTextItem3;
import java.util.List;
import androidx.annotation.Nullable;
public class OrderCenterDetailFoodAdapter extends BaseQuickAdapter<SectionTextItem3, BaseViewHolder> {
public OrderCenterDetailFoodAdapter(@Nullable List<SectionTextItem3> data) {
......
package com.gingersoft.gsa.cloud.table.mvp.ui.adapter;
import android.os.Build;
import android.view.Gravity;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.gingersoft.gsa.cloud.base.common.bean.OrderDetail;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.ui.bean.view.SectionTextItem3;
import java.util.List;
import androidx.annotation.Nullable;
public class OrderCenterMoneyAdapter extends BaseQuickAdapter<SectionTextItem3, BaseViewHolder> {
public OrderCenterMoneyAdapter(@Nullable List<SectionTextItem3> data) {
......@@ -32,8 +29,8 @@ public class OrderCenterMoneyAdapter extends BaseQuickAdapter<SectionTextItem3,
TextView tv_name = helper.getView(R.id.tv_name);
TextView tv_money = helper.getView(R.id.tv_money);
tv_name.setTextAppearance(mContext, item.getLeftTextStyle());
tv_money.setTextAppearance(mContext, item.getRightTextStyle());
tv_name.setTextAppearance(getContext(), item.getLeftTextStyle());
tv_money.setTextAppearance(getContext(), item.getRightTextStyle());
}
}
......@@ -4,42 +4,29 @@ import android.app.Dialog;
import android.content.Context;
import android.net.ParseException;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStub;
import android.widget.Button;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.gingersoft.gsa.cloud.table.R;
import com.gingersoft.gsa.cloud.table.R2;
import com.gingersoft.gsa.cloud.table.mvp.model.bean.FoodReason;
import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.FoodReasonAdapter;
import com.gingersoft.gsa.cloud.ui.adapter.BasTextSectiontAdapter;
import com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean;
import com.gingersoft.gsa.cloud.ui.bean.view.SectionHeader;
import com.gingersoft.gsa.cloud.ui.bean.view.SectionTextItem;
import com.gingersoft.gsa.cloud.ui.widget.dialog.ChooseRestaurantDialog;
import com.google.gson.JsonIOException;
import com.google.gson.JsonParseException;
import com.jess.arms.utils.AndroidWorkaround;
import com.jess.arms.utils.ArmsUtils;
import com.qmuiteam.qmui.layout.QMUILinearLayout;
import com.qmuiteam.qmui.util.QMUIDisplayHelper;
import com.qmuiteam.qmui.widget.QMUIEmptyView;
import com.qmuiteam.qmui.widget.QMUISlider;
import com.qmuiteam.qmui.widget.QMUITopBar;
import com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton;
import com.qmuiteam.qmui.widget.section.QMUISection;
import com.qmuiteam.qmui.widget.section.QMUIStickySectionAdapter;
import com.qmuiteam.qmui.widget.section.QMUIStickySectionLayout;
import org.json.JSONException;
......@@ -47,15 +34,6 @@ import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
/**
* 作者:ELEGANT_BIN
......@@ -216,12 +194,9 @@ public class CancelFoodDialog extends Dialog {
if (mAdapter == null) {
mAdapter = new FoodReasonAdapter(mItems);
}
mAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
if (onClickListener != null)
onClickListener.onItemClick(mItems.get(position), position, getInputNumber());
}
mAdapter.setOnItemClickListener((adapter, view, position) -> {
if (onClickListener != null)
onClickListener.onItemClick(mItems.get(position), position, getInputNumber());
});
recycle_cancel_info.setLayoutManager(createLayoutManager());
recycle_cancel_info.setAdapter(mAdapter);
......
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