<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">

    <data>

        <variable
            name="orderBean"
            type="com.datarecovery.master.data.api.bean.OrderBean" />

        <variable
            name="copyOrderClick"
            type="android.view.View.OnClickListener" />

        <variable
            name="copyLinkClick"
            type="android.view.View.OnClickListener" />

        <variable
            name="copyAuthCodeClick"
            type="android.view.View.OnClickListener" />

        <variable
            name="cancelOrderClick"
            type="android.view.View.OnClickListener" />

        <variable
            name="payOrderClick"
            type="android.view.View.OnClickListener" />


        <import type="com.datarecovery.master.utils.DateUtil" />

        <import type="com.datarecovery.master.data.api.bean.OrderBean.OrderStatus" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        tools:background="@color/black10">


        <View
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:background="@drawable/bg_order_card"
            app:layout_constraintBottom_toBottomOf="@+id/space6"
            app:layout_constraintEnd_toEndOf="@+id/order_header"
            app:layout_constraintStart_toStartOf="@+id/order_header"
            app:layout_constraintTop_toTopOf="@+id/order_header" />

        <View
            android:id="@+id/order_header"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_marginHorizontal="16dp"
            android:background="@drawable/bg_order_header"
            app:layout_constraintDimensionRatio="328:36"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/tv_order_status"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="12dp"
            android:text="@{orderBean.orderStatusDesc}"
            android:textColor="#202020"
            android:textSize="14sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toBottomOf="@+id/order_header"
            app:layout_constraintStart_toStartOf="@+id/order_header"
            app:layout_constraintTop_toTopOf="@+id/order_header"
            tools:text="订单已完成" />


        <Space
            android:id="@+id/space1"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_constraintDimensionRatio="360:12"
            app:layout_constraintTop_toBottomOf="@+id/order_header" />

        <TextView
            android:id="@+id/tv_order_buy_type"
            style="@style/Order_List_Content_Txt"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/order_buy_type"
            app:layout_constraintLeft_toLeftOf="@+id/tv_order_status"
            app:layout_constraintTop_toBottomOf="@+id/space1" />

        <TextView
            style="@style/Order_List_Content_Txt"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:text="@{orderBean.itemName}"
            app:layout_constraintBaseline_toBaselineOf="@+id/tv_order_buy_type"
            app:layout_constraintStart_toEndOf="@+id/tv_order_buy_type"
            tools:text="图片恢复" />


        <Space
            android:id="@+id/space2"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_constraintDimensionRatio="360:8"
            app:layout_constraintTop_toBottomOf="@+id/tv_order_buy_type" />


        <TextView
            android:id="@+id/tv_order_number"
            style="@style/Order_List_Content_Txt"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/order_number"
            app:layout_constraintLeft_toLeftOf="@+id/tv_order_status"
            app:layout_constraintTop_toBottomOf="@+id/space2" />

        <TextView
            android:id="@+id/tv_outTrade_No"
            style="@style/Order_List_Content_Txt"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:maxWidth="150dp"
            android:singleLine="true"
            android:text="@{orderBean.outTradeNo}"
            app:layout_constraintBaseline_toBaselineOf="@+id/tv_order_number"
            app:layout_constraintStart_toEndOf="@+id/tv_order_number"
            tools:text="adjf589489165561" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="6dp"
            android:background="@drawable/bg_order_copy"
            android:onClick="@{copyOrderClick}"
            android:paddingHorizontal="8dp"
            android:paddingVertical="1dp"
            android:text="@string/order_copy"
            android:textColor="#404040"
            android:textSize="12sp"
            app:layout_constraintBaseline_toBaselineOf="@+id/tv_outTrade_No"
            app:layout_constraintStart_toEndOf="@+id/tv_outTrade_No" />

        <Space
            android:id="@+id/space_number"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_constraintDimensionRatio="360:8"
            app:layout_constraintTop_toBottomOf="@+id/tv_order_number" />

        <TextView
            android:id="@+id/tv_auth_code_title"
            style="@style/Order_List_Content_Txt"
            isGone="@{!orderBean.isShowLink}"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/order_auth_code"
            app:layout_constraintLeft_toLeftOf="@+id/tv_order_status"
            app:layout_constraintTop_toBottomOf="@+id/space_number" />


        <TextView
            android:id="@+id/tv_auth_code"
            isGone="@{!orderBean.isShowLink}"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:maxWidth="100dp"
            android:singleLine="true"
            android:text="@{orderBean.authCode}"
            android:textColor="@color/colorPrimary"
            android:textSize="14sp"
            android:textStyle="bold"
            app:layout_constraintBaseline_toBaselineOf="@+id/tv_auth_code_title"
            app:layout_constraintStart_toEndOf="@id/tv_auth_code_title"
            tools:text="259647" />

        <TextView
            android:id="@+id/tv_auth_code_copy"
            isGone="@{!orderBean.isShowLink}"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="6dp"
            android:background="@drawable/bg_order_auth_copy"
            android:onClick="@{copyAuthCodeClick}"
            android:paddingHorizontal="8dp"
            android:paddingVertical="1dp"
            android:text="@string/order_copy"
            android:textColor="#404040"
            android:textSize="12sp"
            app:layout_constraintBaseline_toBaselineOf="@+id/tv_auth_code"
            app:layout_constraintStart_toEndOf="@+id/tv_auth_code" />

        <Space
            android:id="@+id/space_auth_code"
            isGone="@{!orderBean.isShowLink}"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_constraintDimensionRatio="360:8"
            app:layout_constraintTop_toBottomOf="@+id/tv_auth_code" />

        <TextView
            android:id="@+id/tv_order_buy_time"
            style="@style/Order_List_Content_Txt"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/order_buy_time"
            app:layout_constraintLeft_toLeftOf="@+id/tv_order_status"
            app:layout_constraintTop_toBottomOf="@+id/space_auth_code" />

        <TextView
            style="@style/Order_List_Content_Txt"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:text="@{orderBean.createTime}"
            app:layout_constraintBaseline_toBaselineOf="@+id/tv_order_buy_time"
            app:layout_constraintStart_toEndOf="@+id/tv_order_buy_time"
            tools:text="2023-12-16" />


        <Space
            android:id="@+id/space3"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_constraintDimensionRatio="360:8"
            app:layout_constraintTop_toBottomOf="@+id/tv_order_buy_time" />


        <TextView
            android:id="@+id/tv_order_member_validity"
            style="@style/Order_List_Content_Txt"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/order_member_validity"
            app:layout_constraintLeft_toLeftOf="@+id/tv_order_status"
            app:layout_constraintTop_toBottomOf="@+id/space3" />

        <TextView
            style="@style/Order_List_Content_Txt"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:text="@{orderBean.expirationDesc}"
            app:layout_constraintBaseline_toBaselineOf="@+id/tv_order_member_validity"
            app:layout_constraintStart_toEndOf="@+id/tv_order_member_validity"
            tools:text="永久有效" />


        <Space
            android:id="@+id/space4"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_constraintDimensionRatio="360:12"
            app:layout_constraintTop_toBottomOf="@+id/tv_order_member_validity" />

        <View
            android:id="@+id/v_line"
            android:layout_width="0dp"
            android:layout_height="1dp"
            android:layout_marginEnd="12dp"
            android:background="#F5F5F5"
            app:layout_constraintEnd_toEndOf="@+id/order_header"
            app:layout_constraintStart_toStartOf="@+id/tv_order_status"
            app:layout_constraintTop_toBottomOf="@+id/space4" />

        <Space
            android:id="@+id/space5"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_constraintDimensionRatio="360:8"
            app:layout_constraintTop_toBottomOf="@+id/v_line" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@{@string/member_price(orderBean.amount)}"
            android:textColor="#404040"
            android:textSize="14sp"
            app:layout_constraintBottom_toTopOf="@+id/space7"
            app:layout_constraintLeft_toLeftOf="@+id/tv_order_status"
            app:layout_constraintTop_toBottomOf="@+id/space5"
            tools:text="金额：￥66" />

        <TextView
            android:id="@+id/tv_cancel_order"
            isGone="@{orderBean.status != OrderStatus.TODO}"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_marginEnd="12dp"
            android:background="@drawable/bg_order_cancel"
            android:gravity="center"
            android:onClick="@{cancelOrderClick}"
            android:text="@string/order_cancel_order"
            android:textColor="#AAAAAA"
            android:textSize="14sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toTopOf="@+id/space6"
            app:layout_constraintDimensionRatio="88:36"
            app:layout_constraintEnd_toStartOf="@+id/tv_pay"
            app:layout_constraintTop_toBottomOf="@+id/space5"
            app:layout_constraintWidth_percent="0.2444444444444444" />

        <TextView
            android:id="@+id/tv_pay"
            isGone="@{orderBean.status != OrderStatus.TODO}"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_marginEnd="12dp"
            android:background="@drawable/bg_common_btn"
            android:gravity="center"
            android:onClick="@{payOrderClick}"
            android:text="@string/order_pay"
            android:textColor="@color/white"
            android:textSize="14sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toTopOf="@+id/space6"
            app:layout_constraintDimensionRatio="88:36"
            app:layout_constraintEnd_toEndOf="@+id/order_header"
            app:layout_constraintTop_toBottomOf="@+id/space5"
            app:layout_constraintWidth_percent="0.2444444444444444" />

        <TextView
            android:id="@+id/tv_copy_link"
            isGone="@{!orderBean.isShowLink}"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_marginEnd="12dp"
            android:background="@drawable/bg_common_btn"
            android:gravity="center"
            android:onClick="@{copyLinkClick}"
            android:text="@string/order_copy_link"
            android:textColor="@color/white"
            android:textSize="14sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toTopOf="@+id/space6"
            app:layout_constraintDimensionRatio="120:36"
            app:layout_constraintEnd_toEndOf="@+id/order_header"
            app:layout_constraintTop_toBottomOf="@+id/space5"
            app:layout_constraintWidth_percent="0.3333333333333333"
            tools:visibility="gone" />

        <Space
            android:id="@+id/space7"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_constraintBottom_toTopOf="@+id/space6"
            app:layout_constraintDimensionRatio="360:5" />

        <Space
            android:id="@+id/space6"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintDimensionRatio="360:8" />


    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>