Commit 4cd86929 by Wyh Committed by 宁斌

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

parent 4155fd28
......@@ -23,7 +23,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_15"
android:text="人中心"
android:text="人中心"
android:textColor="@color/white"
android:textSize="@dimen/dp_17" />
......
......@@ -61,6 +61,10 @@ object OtherOrderUtils {
orderStatus = "待取餐"
tvStatus.setTextColor(context.resources.getColor(R.color.order_state3_color))
} else {
if(orderData.isDelete == 0){
//如果是第三方物流,不顯示結賬按鈕
btnContent = ""
}
orderStatus = "派送中"
tvStatus.setTextColor(context.resources.getColor(R.color.order_state2_color))
}
......
......@@ -272,7 +272,7 @@
style="@style/otherOrderInfoDialogTextStyle_font_style_twelve"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="外"
android:text="外"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/line_today_order_info"
app:layout_constraintTop_toTopOf="@id/line_today_order_info" />
......@@ -361,7 +361,7 @@
style="@style/otherOrderInfoDialogTextStyle_font_style_twelve"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="外"
android:text="外"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toRightOf="@id/line_today_info"
app:layout_constraintRight_toLeftOf="@id/line_today_amount_info"
......
......@@ -236,6 +236,7 @@
android:text="@{@string/amount_unit + data.pAY_AMOUNT}"
android:textColor="@color/red_600"
android:textSize="@dimen/sp_16"
app:layout_constraintTop_toBottomOf="@id/tv_delivery_state"
app:layout_constraintRight_toRightOf="@id/tv_order_time"
app:layout_constraintTop_toTopOf="@id/tv_address_text"/>
</androidx.constraintlayout.widget.ConstraintLayout>
......
......@@ -153,7 +153,7 @@ public class PrintOtherOrder extends PrinterRoot {
RecyclerView rvFood = view.findViewById(R.id.rv_order_food);
TextView tvTakeCode = view.findViewById(R.id.tv_order_take_code);
if (dataBean.getOrder_type() == 2) {
tvOrderType.setText("外");
tvOrderType.setText("外");
} else {
tvOrderType.setText("自取");
}
......@@ -173,22 +173,24 @@ public class PrintOtherOrder extends PrinterRoot {
//創建時間
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.setAdapter(new OtherOrderAdapter(context, orderDetail, false));
return viewToBitmap(context, view);
}
private Bitmap initPrintView(Context context, OrderDetails.DataBean data) {
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_number, "單號:" + data.getORDER_NO());
setText(view, R.id.tv_order_number, "單號:" + data.getORDER_NO());
if (data.getTakeFoodCode() != null && !data.getTakeFoodCode().equals("0")) {
setText(view, R.id.tv_order_take_food_code, "#" + data.getTakeFoodCode());
} else {
......@@ -200,7 +202,7 @@ public class PrintOtherOrder extends PrinterRoot {
RecyclerView rvBill = view.findViewById(R.id.rv_bill);
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) {
billData.add(getBillBean("餐盒費:", amountUnit + data.getLunchbox()));
}
......@@ -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())));
BillItemAdapter adapter = new BillItemAdapter(billData, context);
rvBill.setLayoutManager(new LinearLayoutManager(context));
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);
//配送費
......@@ -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_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());
//收貨人
......@@ -245,7 +266,12 @@ public class PrintOtherOrder extends PrinterRoot {
//手機號
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) {
RecyclerView rvFoodList = view.findViewById(R.id.rv_order_print_food);
......
......@@ -6,14 +6,14 @@
<TextView
android:id="@+id/print_bill_name"
style="@style/printOtherOrderInfoPrintBoldTextStyle"
style="@style/print_other_order_twenty_two_style"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"/>
<TextView
android:id="@+id/print_bill_value"
style="@style/printOtherOrderInfoPrintBoldTextStyle"
style="@style/print_other_order_twenty_two_style"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
......
......@@ -5,45 +5,64 @@
android:orientation="vertical">
<!-- 接單的廚房單-->
<TextView
android:id="@+id/tv_order_type"
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="外賣"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_26" />
android:gravity="center_vertical">
<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
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_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
android:text="廚房時間:" />
<TextView
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_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
android:text="取餐碼:"
android:textStyle="bold" />
<TextView
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_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
android:text="操作" />
<TextView
android:id="@+id/tv_order_send_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
android:text="送貨時間:"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_22" />
<TextView
style="@style/print_other_order_twenty_two_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
......@@ -55,18 +74,10 @@
android:layout_height="wrap_content" />
<TextView
style="@style/print_other_order_twenty_two_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
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>
\ No newline at end of file
......@@ -11,7 +11,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintHorizontal_weight="0.7"
app:layout_constraintHorizontal_weight="0.6"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_food_number"
app:layout_constraintTop_toTopOf="parent">
......@@ -31,7 +31,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
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_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......@@ -43,7 +43,7 @@
android:layout_height="wrap_content"
android:gravity="right"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_20"
android:textSize="@dimen/dp_22"
app:layout_constraintHorizontal_weight="0.2"
app:layout_constraintLeft_toRightOf="@id/layout_food_name"
app:layout_constraintRight_toLeftOf="@id/tv_food_price"
......
......@@ -23,9 +23,9 @@
<item name="android:textColor">@color/theme_333_color</item>
<item name="android:textSize">@dimen/dp_18</item>
</style>
<style name="printOtherOrderTextStyle_font_style_twenty" parent="font_style_twenty">
<style name="print_other_order_twenty_two_style">
<item name="android:textColor">@color/theme_333_color</item>
<item name="android:textSize">@dimen/dp_22</item>
</style>
<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