Commit c1f49685 by Wyh

6.04 物流單不顯示結賬按鈕,打印格式修改

parent 97e038cb
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,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_15" android:layout_marginTop="@dimen/dp_15"
android:text="人中心" android:text="人中心"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/dp_17" /> android:textSize="@dimen/dp_17" />
......
...@@ -61,6 +61,10 @@ object OtherOrderUtils { ...@@ -61,6 +61,10 @@ object OtherOrderUtils {
orderStatus = "待取餐" orderStatus = "待取餐"
tvStatus.setTextColor(context.resources.getColor(R.color.order_state3_color)) tvStatus.setTextColor(context.resources.getColor(R.color.order_state3_color))
} else { } else {
if(orderData.isDelete == 0){
//如果是第三方物流,不顯示結賬按鈕
btnContent = ""
}
orderStatus = "派送中" orderStatus = "派送中"
tvStatus.setTextColor(context.resources.getColor(R.color.order_state2_color)) tvStatus.setTextColor(context.resources.getColor(R.color.order_state2_color))
} }
......
...@@ -272,7 +272,7 @@ ...@@ -272,7 +272,7 @@
style="@style/otherOrderInfoDialogTextStyle_font_style_twelve" style="@style/otherOrderInfoDialogTextStyle_font_style_twelve"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="外" android:text="外"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/line_today_order_info" app:layout_constraintRight_toLeftOf="@id/line_today_order_info"
app:layout_constraintTop_toTopOf="@id/line_today_order_info" /> app:layout_constraintTop_toTopOf="@id/line_today_order_info" />
...@@ -361,7 +361,7 @@ ...@@ -361,7 +361,7 @@
style="@style/otherOrderInfoDialogTextStyle_font_style_twelve" style="@style/otherOrderInfoDialogTextStyle_font_style_twelve"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="外" android:text="外"
app:layout_constraintHorizontal_chainStyle="packed" app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toRightOf="@id/line_today_info" app:layout_constraintLeft_toRightOf="@id/line_today_info"
app:layout_constraintRight_toLeftOf="@id/line_today_amount_info" app:layout_constraintRight_toLeftOf="@id/line_today_amount_info"
......
...@@ -236,6 +236,7 @@ ...@@ -236,6 +236,7 @@
android:text="@{@string/amount_unit + data.pAY_AMOUNT}" android:text="@{@string/amount_unit + data.pAY_AMOUNT}"
android:textColor="@color/red_600" android:textColor="@color/red_600"
android:textSize="@dimen/sp_16" android:textSize="@dimen/sp_16"
app:layout_constraintTop_toBottomOf="@id/tv_delivery_state"
app:layout_constraintRight_toRightOf="@id/tv_order_time" app:layout_constraintRight_toRightOf="@id/tv_order_time"
app:layout_constraintTop_toTopOf="@id/tv_address_text"/> app:layout_constraintTop_toTopOf="@id/tv_address_text"/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
......
...@@ -153,7 +153,7 @@ public class PrintOtherOrder extends PrinterRoot { ...@@ -153,7 +153,7 @@ public class PrintOtherOrder extends PrinterRoot {
RecyclerView rvFood = view.findViewById(R.id.rv_order_food); RecyclerView rvFood = view.findViewById(R.id.rv_order_food);
TextView tvTakeCode = view.findViewById(R.id.tv_order_take_code); TextView tvTakeCode = view.findViewById(R.id.tv_order_take_code);
if (dataBean.getOrder_type() == 2) { if (dataBean.getOrder_type() == 2) {
tvOrderType.setText("外"); tvOrderType.setText("外");
} else { } else {
tvOrderType.setText("自取"); tvOrderType.setText("自取");
} }
...@@ -173,22 +173,24 @@ public class PrintOtherOrder extends PrinterRoot { ...@@ -173,22 +173,24 @@ public class PrintOtherOrder extends PrinterRoot {
//創建時間 //創建時間
tvCreateTime.setText(TimeUtils.parseTimeRepeat(dataBean.getCREATE_TIME(), TimeUtils.DEFAULT_DATE_FORMAT)); tvCreateTime.setText(TimeUtils.parseTimeRepeat(dataBean.getCREATE_TIME(), TimeUtils.DEFAULT_DATE_FORMAT));
//訂單號 //訂單號
tvOrderNum.setText("單號:" + dataBean.getORDER_NO()); tvOrderNum.setText("單號:" + dataBean.getORDER_NO());
rvFood.setLayoutManager(new LinearLayoutManager(context)); rvFood.setLayoutManager(new LinearLayoutManager(context));
rvFood.setAdapter(new OtherOrderAdapter(context, orderDetail, false)); rvFood.setAdapter(new OtherOrderAdapter(context, orderDetail, false));
return viewToBitmap(context, view); return viewToBitmap(context, view);
} }
private Bitmap initPrintView(Context context, OrderDetails.DataBean data) { private Bitmap initPrintView(Context context, OrderDetails.DataBean data) {
View view = LayoutInflater.from(context).inflate(R.layout.print_confirm_order_view, null, false); View view = LayoutInflater.from(context).inflate(R.layout.print_confirm_order_view, null, false);
//品牌名
setText(view, R.id.tv_brand_name, GsaCloudApplication.getBrandName(context));
//餐廳名
setText(view, R.id.tv_restaurant_name, GsaCloudApplication.getRestaurantName(context));
// 訂單類型 // 訂單類型
setText(view, R.id.tv_order_type, data.getOrder_type() == 2 ? "外送" : "自取"); setText(view, R.id.tv_order_type, data.getOrder_type() == 2 ? "外送" : "自取");
// 訂單號 // 訂單號
setText(view, R.id.tv_order_number, "單號:" + data.getORDER_NO()); setText(view, R.id.tv_order_number, "單號:" + data.getORDER_NO());
if (data.getTakeFoodCode() != null && !data.getTakeFoodCode().equals("0")) { if (data.getTakeFoodCode() != null && !data.getTakeFoodCode().equals("0")) {
setText(view, R.id.tv_order_take_food_code, "#" + data.getTakeFoodCode()); setText(view, R.id.tv_order_take_food_code, "#" + data.getTakeFoodCode());
} else { } else {
...@@ -200,7 +202,7 @@ public class PrintOtherOrder extends PrinterRoot { ...@@ -200,7 +202,7 @@ public class PrintOtherOrder extends PrinterRoot {
RecyclerView rvBill = view.findViewById(R.id.rv_bill); RecyclerView rvBill = view.findViewById(R.id.rv_bill);
List<PrintBillBean> billData = new ArrayList<>(); List<PrintBillBean> billData = new ArrayList<>();
billData.add(getBillBean("合計:", amountUnit + MoneyUtil.sub(MoneyUtil.sub(Double.parseDouble(Objects.requireNonNull(data.getTOTAL_AMOUNT())), data.getLunchbox()), data.getDELIVERY_CHARGE()))); // billData.add(getBillBean("合計:", amountUnit + MoneyUtil.sub(MoneyUtil.sub(Double.parseDouble(Objects.requireNonNull(data.getTOTAL_AMOUNT())), data.getLunchbox()), data.getDELIVERY_CHARGE())));
if (data.getLunchbox() != 0) { if (data.getLunchbox() != 0) {
billData.add(getBillBean("餐盒費:", amountUnit + data.getLunchbox())); billData.add(getBillBean("餐盒費:", amountUnit + data.getLunchbox()));
} }
...@@ -216,14 +218,14 @@ public class PrintOtherOrder extends PrinterRoot { ...@@ -216,14 +218,14 @@ public class PrintOtherOrder extends PrinterRoot {
} }
} }
billData.add(getBillBean("總金額:", amountUnit + MoneyUtil.sub(Double.parseDouble(data.getTOTAL_AMOUNT()), data.getDiscount_amount()))); billData.add(getBillBean("總金額:", amountUnit + MoneyUtil.sub(Double.parseDouble(data.getTOTAL_AMOUNT()), data.getDiscount_amount())));
billData.add(getBillBean("支付金額:", amountUnit + MoneyUtil.sub(Double.parseDouble(data.getTOTAL_AMOUNT()), data.getDiscount_amount()))); // billData.add(getBillBean("支付金額:", amountUnit + MoneyUtil.sub(Double.parseDouble(data.getTOTAL_AMOUNT()), data.getDiscount_amount())));
BillItemAdapter adapter = new BillItemAdapter(billData, context); BillItemAdapter adapter = new BillItemAdapter(billData, context);
rvBill.setLayoutManager(new LinearLayoutManager(context)); rvBill.setLayoutManager(new LinearLayoutManager(context));
rvBill.setAdapter(adapter); rvBill.setAdapter(adapter);
//總金額 //合計
// setText(view, R.id.tv_total, amountUnit + MoneyUtil.sub(MoneyUtil.sub(Double.parseDouble(Objects.requireNonNull(data.getTOTAL_AMOUNT())), data.getLunchbox()), data.getDELIVERY_CHARGE())); setText(view, R.id.tv_total, amountUnit + MoneyUtil.sub(MoneyUtil.sub(Double.parseDouble(Objects.requireNonNull(data.getTOTAL_AMOUNT())), data.getLunchbox()), data.getDELIVERY_CHARGE()));
//餐盒費 //餐盒費
// setAmount(data.getLunchbox(), view.findViewById(R.id.tv_lunchbox_cost_text), view.findViewById(R.id.tv_lunchbox_cost), amountUnit); // setAmount(data.getLunchbox(), view.findViewById(R.id.tv_lunchbox_cost_text), view.findViewById(R.id.tv_lunchbox_cost), amountUnit);
//配送費 //配送費
...@@ -233,11 +235,30 @@ public class PrintOtherOrder extends PrinterRoot { ...@@ -233,11 +235,30 @@ public class PrintOtherOrder extends PrinterRoot {
//總金額 //總金額
// 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()));
//支付金額 //支付金額
// setText(view, R.id.tv_pay_amount, amountUnit + MoneyUtil.sub(Double.parseDouble(data.getTOTAL_AMOUNT()), data.getDiscount_amount())); setText(view, R.id.tv_pay_amount_text, "支付金額:" + amountUnit + MoneyUtil.sub(Double.parseDouble(data.getTOTAL_AMOUNT()), data.getDiscount_amount()));
//支付類型:貨到付款,在線支付 //支付類型:貨到付款,在線支付
setText(view, R.id.tv_pay_type, data.getOrderPayType() == 1 ? "貨到付款" : "在線支付"); String payType = "";
if (data.getPayType() == 1) {
payType = ":积分支付";
} else if (data.getPayType() == 2) {
payType = ":支付宝";
} else if (data.getPayType() == 3) {
payType = ":财付通";
} else if (data.getPayType() == 4) {
payType = ":微信支付";
} else if (data.getPayType() == 5) {
payType = ":货到付款";
} else if (data.getPayType() == 6) {
payType = ":其他支付";
}
if (data.getOrderPayType() == 1) {
//貨到付款
setText(view, R.id.tv_pay_type, "貨到付款");
} else {
setText(view, R.id.tv_pay_type, "在線支付" + payType);
}
//收貨時間 //收貨時間
setText(view, R.id.tv_delivery_time, data.getOrder_type() == 2 ? data.getTakeTime() : data.getSEND_TIME()); setText(view, R.id.tv_delivery_time, data.getOrder_type() == 2 ? data.getSEND_TIME() : data.getTakeTime());
//收貨地址 //收貨地址
setText(view, R.id.tv_address, context.getString(R.string.address) + data.getAddressDetail()); setText(view, R.id.tv_address, context.getString(R.string.address) + data.getAddressDetail());
//收貨人 //收貨人
...@@ -245,7 +266,12 @@ public class PrintOtherOrder extends PrinterRoot { ...@@ -245,7 +266,12 @@ public class PrintOtherOrder extends PrinterRoot {
//手機號 //手機號
setText(view, R.id.tv_phone, "手機號:" + data.getPHONE()); setText(view, R.id.tv_phone, "手機號:" + data.getPHONE());
//備註 //備註
setText(view, R.id.tv_remark, "備註:" + data.getRemark()); if (data.getRemark() != null && !data.getRemark().isEmpty()) {
setText(view, R.id.tv_remark, "備註:" + data.getRemark());
view.findViewById(R.id.tv_remark).setVisibility(View.VISIBLE);
} else {
view.findViewById(R.id.tv_remark).setVisibility(View.GONE);
}
if (data.getPRODUCT_NAME() != null) { if (data.getPRODUCT_NAME() != null) {
RecyclerView rvFoodList = view.findViewById(R.id.rv_order_print_food); RecyclerView rvFoodList = view.findViewById(R.id.rv_order_print_food);
......
...@@ -6,14 +6,14 @@ ...@@ -6,14 +6,14 @@
<TextView <TextView
android:id="@+id/print_bill_name" android:id="@+id/print_bill_name"
style="@style/printOtherOrderInfoPrintBoldTextStyle" style="@style/print_other_order_twenty_two_style"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1"/>
<TextView <TextView
android:id="@+id/print_bill_value" android:id="@+id/print_bill_value"
style="@style/printOtherOrderInfoPrintBoldTextStyle" style="@style/print_other_order_twenty_two_style"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5" android:layout_marginLeft="@dimen/dp_5"
......
...@@ -5,45 +5,64 @@ ...@@ -5,45 +5,64 @@
android:orientation="vertical"> android:orientation="vertical">
<!-- 接單的廚房單--> <!-- 接單的廚房單-->
<TextView <LinearLayout
android:id="@+id/tv_order_type" android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="外賣" android:gravity="center_vertical">
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_26" /> <TextView
android:id="@+id/tv_order_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_26" />
<TextView
android:id="@+id/tv_order_number"
style="@style/print_other_order_twenty_two_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
android:text="單號:"
android:textColor="@color/theme_333_color" />
</LinearLayout>
<TextView <TextView
android:id="@+id/tv_order_create_time" android:id="@+id/tv_order_create_time"
style="@style/print_other_order_eighteen_style" style="@style/print_other_order_twenty_two_style"
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_5"
android:text="廚房時間:" /> android:text="廚房時間:" />
<TextView <TextView
android:id="@+id/tv_order_take_code" android:id="@+id/tv_order_take_code"
style="@style/print_other_order_eighteen_style" style="@style/print_other_order_twenty_two_style"
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_5"
android:text="取餐碼:" android:text="取餐碼:"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
android:id="@+id/tv_operator_name" android:id="@+id/tv_operator_name"
style="@style/print_other_order_eighteen_style" style="@style/print_other_order_twenty_two_style"
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_5"
android:text="操作" /> android:text="操作" />
<TextView <TextView
android:id="@+id/tv_order_send_time" android:id="@+id/tv_order_send_time"
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_5"
android:text="送貨時間:" android:text="送貨時間:"
android:textColor="@color/theme_333_color" android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_22" /> android:textSize="@dimen/dp_22" />
<TextView <TextView
style="@style/print_other_order_twenty_two_style"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxLines="1" android:maxLines="1"
...@@ -55,18 +74,10 @@ ...@@ -55,18 +74,10 @@
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<TextView <TextView
style="@style/print_other_order_twenty_two_style"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxLines="1" android:maxLines="1"
android:text="@string/print_split_line" /> android:text="@string/print_split_line" />
<TextView
android:id="@+id/tv_order_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="訂單號:"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_18" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
app:layout_constraintHorizontal_weight="0.7" app:layout_constraintHorizontal_weight="0.6"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_food_number" app:layout_constraintRight_toLeftOf="@id/tv_food_number"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/theme_333_color" android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_20" android:textSize="@dimen/dp_22"
app:layout_constraintLeft_toRightOf="@id/iv_food_item_next" app:layout_constraintLeft_toRightOf="@id/iv_food_item_next"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="right" android:gravity="right"
android:textColor="@color/theme_333_color" android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_20" android:textSize="@dimen/dp_22"
app:layout_constraintHorizontal_weight="0.2" app:layout_constraintHorizontal_weight="0.2"
app:layout_constraintLeft_toRightOf="@id/layout_food_name" app:layout_constraintLeft_toRightOf="@id/layout_food_name"
app:layout_constraintRight_toLeftOf="@id/tv_food_price" app:layout_constraintRight_toLeftOf="@id/tv_food_price"
......
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
<item name="android:textColor">@color/theme_333_color</item> <item name="android:textColor">@color/theme_333_color</item>
<item name="android:textSize">@dimen/dp_18</item> <item name="android:textSize">@dimen/dp_18</item>
</style> </style>
<style name="print_other_order_twenty_two_style">
<style name="printOtherOrderTextStyle_font_style_twenty" parent="font_style_twenty">
<item name="android:textColor">@color/theme_333_color</item> <item name="android:textColor">@color/theme_333_color</item>
<item name="android:textSize">@dimen/dp_22</item>
</style> </style>
<style name="printOtherOrderInfoPrintBoldTextStyle"> <style name="printOtherOrderInfoPrintBoldTextStyle">
......
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