Commit d1ac56b5 authored by yinjiacheng's avatar yinjiacheng

update 订单详情数据结构、订单详情页UI

parent 0ce94962
...@@ -36,7 +36,7 @@ data class OrderDetailDto( ...@@ -36,7 +36,7 @@ data class OrderDetailDto(
@SerializedName("life_account_name") @SerializedName("life_account_name")
val lifeAccountName: String, val lifeAccountName: String,
@SerializedName("marketing_id") // 活动id @SerializedName("marketing_id") // 活动id
val marketingId: Int, val marketingId: Long,
@SerializedName("marketing_name") // 活动名称 @SerializedName("marketing_name") // 活动名称
val marketingName: String, val marketingName: String,
@SerializedName("merge_order_item_list") @SerializedName("merge_order_item_list")
...@@ -58,22 +58,22 @@ data class OrderDetailDto( ...@@ -58,22 +58,22 @@ data class OrderDetailDto(
@SerializedName("pay_time") // 支付时间 @SerializedName("pay_time") // 支付时间
val payTime: String, val payTime: String,
@SerializedName("payment") // 支付金额 @SerializedName("payment") // 支付金额
val payment: Int, val payment: Double,
@SerializedName("place_list") // 自提点信息 @SerializedName("place_list") // 自提点信息
val placeList: PlaceList, val placeList: PlaceList,
@SerializedName("post_fee") @SerializedName("post_fee")
val postFee: Int, val postFee: Double,
@SerializedName("receive_time") @SerializedName("receive_time")
val receiveTime: String, val receiveTime: String,
@SerializedName("refund_amount") // 退款金额 @SerializedName("refund_amount") // 退款金额
val refundAmount: Int, val refundAmount: Double,
@SerializedName("refund_apply_time") // 退款申请时间 @SerializedName("refund_apply_time") // 退款申请时间
val refundApplyTime: String, val refundApplyTime: String,
@SerializedName("refund_finish_time") // 退款时间 @SerializedName("refund_finish_time") // 退款时间
val refundFinishTime: String, val refundFinishTime: String,
@SerializedName("shop_id") @SerializedName("shop_id")
val shopId: String, val shopId: String,
@SerializedName("total_price") @SerializedName("total_price") // 合计金额
val totalPrice: Double, val totalPrice: Double,
@SerializedName("update_time") @SerializedName("update_time")
val updateTime: String, val updateTime: String,
...@@ -87,7 +87,7 @@ data class OrderDetailDto( ...@@ -87,7 +87,7 @@ data class OrderDetailDto(
data class Coupon( data class Coupon(
@SerializedName("coupon_amount") @SerializedName("coupon_amount")
val couponAmount: Int, val couponAmount: Double,
@SerializedName("coupon_id") @SerializedName("coupon_id")
val couponId: String, val couponId: String,
@SerializedName("create_time") @SerializedName("create_time")
...@@ -99,11 +99,11 @@ data class Coupon( ...@@ -99,11 +99,11 @@ data class Coupon(
@SerializedName("order_item_id") @SerializedName("order_item_id")
val orderItemId: String, val orderItemId: String,
@SerializedName("recover_coupon_amount") @SerializedName("recover_coupon_amount")
val recoverCouponAmount: Int, val recoverCouponAmount: Double,
@SerializedName("share_coupon_amount") @SerializedName("share_coupon_amount")
val shareCouponAmount: Int, val shareCouponAmount: Double,
@SerializedName("share_coupon_id") @SerializedName("share_coupon_id")
val shareCouponId: Int, val shareCouponId: Long,
@SerializedName("update_time") @SerializedName("update_time")
val updateTime: String, val updateTime: String,
@SerializedName("user_id") @SerializedName("user_id")
...@@ -123,7 +123,7 @@ data class MergeOrderItem( ...@@ -123,7 +123,7 @@ data class MergeOrderItem(
data class OrderItem( data class OrderItem(
@SerializedName("clear_price") @SerializedName("clear_price")
val clearPrice: Int, val clearPrice: Double,
@SerializedName("create_time") @SerializedName("create_time")
val createTime: String, val createTime: String,
@SerializedName("desc_pic_url") @SerializedName("desc_pic_url")
...@@ -151,7 +151,7 @@ data class OrderItem( ...@@ -151,7 +151,7 @@ data class OrderItem(
@SerializedName("is_used") @SerializedName("is_used")
val isUsed: Int, val isUsed: Int,
@SerializedName("marketing_id") @SerializedName("marketing_id")
val marketingId: Int, val marketingId: Long,
@SerializedName("marketing_type") @SerializedName("marketing_type")
val marketingType: Int, val marketingType: Int,
@SerializedName("order_id") @SerializedName("order_id")
...@@ -159,11 +159,11 @@ data class OrderItem( ...@@ -159,11 +159,11 @@ data class OrderItem(
@SerializedName("order_item_id") @SerializedName("order_item_id")
val orderItemId: String, val orderItemId: String,
@SerializedName("payment") @SerializedName("payment")
val payment: Int, val payment: Double,
@SerializedName("price") // 商品价格 @SerializedName("price") // 商品价格
val price: Double, val price: Double,
@SerializedName("refund_amount") @SerializedName("refund_amount")
val refundAmount: Int, val refundAmount: Double,
@SerializedName("refund_count") @SerializedName("refund_count")
val refundCount: Int, val refundCount: Int,
@SerializedName("refund_finish_time") @SerializedName("refund_finish_time")
...@@ -173,9 +173,9 @@ data class OrderItem( ...@@ -173,9 +173,9 @@ data class OrderItem(
@SerializedName("rule_refund") @SerializedName("rule_refund")
val ruleRefund: Int, val ruleRefund: Int,
@SerializedName("settle_code") @SerializedName("settle_code")
val settleCode: Int, val settleCode: Long,
@SerializedName("share_coupon") @SerializedName("share_coupon")
val shareCoupon: Int, val shareCoupon: Double,
@SerializedName("shop_id") @SerializedName("shop_id")
val shopId: String, val shopId: String,
@SerializedName("sub_shop_id") @SerializedName("sub_shop_id")
...@@ -200,7 +200,7 @@ data class OrderShippingInfo( ...@@ -200,7 +200,7 @@ data class OrderShippingInfo(
@SerializedName("receiver_name") // 收货人名称 @SerializedName("receiver_name") // 收货人名称
val receiverName: String, val receiverName: String,
@SerializedName("take_place_id") @SerializedName("take_place_id")
val takePlaceId: Int, val takePlaceId: Long,
@SerializedName("update_time") @SerializedName("update_time")
val updateTime: String, val updateTime: String,
@SerializedName("user_id") @SerializedName("user_id")
...@@ -233,7 +233,7 @@ data class PlaceList( ...@@ -233,7 +233,7 @@ data class PlaceList(
@SerializedName("province") @SerializedName("province")
val province: String, val province: String,
@SerializedName("take_place_id") @SerializedName("take_place_id")
val takePlaceId: Int, val takePlaceId: Long,
@SerializedName("take_place_name") // 自提点名称 @SerializedName("take_place_name") // 自提点名称
val takePlaceName: String, val takePlaceName: String,
@SerializedName("update_time") @SerializedName("update_time")
...@@ -252,7 +252,7 @@ data class Wechat( ...@@ -252,7 +252,7 @@ data class Wechat(
@SerializedName("gender") @SerializedName("gender")
val gender: String, val gender: String,
@SerializedName("invite_user_id") @SerializedName("invite_user_id")
val inviteUserId: Int, val inviteUserId: Long,
@SerializedName("is_history") @SerializedName("is_history")
val isHistory: Int, val isHistory: Int,
@SerializedName("language") @SerializedName("language")
...@@ -278,5 +278,5 @@ data class Wechat( ...@@ -278,5 +278,5 @@ data class Wechat(
@SerializedName("wechat_app_id") @SerializedName("wechat_app_id")
val wechatAppId: String, val wechatAppId: String,
@SerializedName("wechat_id") @SerializedName("wechat_id")
val wechatId: Int val wechatId: Long
) )
...@@ -43,7 +43,7 @@ class OrderStatusViewModel : BaseViewModel() { ...@@ -43,7 +43,7 @@ class OrderStatusViewModel : BaseViewModel() {
*/ */
@BindingAdapter(value = ["orderStatusDescription", "orderRefundAmount"], requireAll = true) @BindingAdapter(value = ["orderStatusDescription", "orderRefundAmount"], requireAll = true)
@JvmStatic @JvmStatic
fun setOrderStatusText(target: TextView, status: OrderStatus?, refundAmount: Int?) { fun setOrderStatusText(target: TextView, status: OrderStatus?, refundAmount: Double?) {
target.text = when (status) { target.text = when (status) {
OrderStatus.ORDER_STATUS_WAIT_REFUND -> "待商家确认" OrderStatus.ORDER_STATUS_WAIT_REFUND -> "待商家确认"
OrderStatus.ORDER_STATUS_REFUNDED -> "退款金额: ¥$refundAmount" OrderStatus.ORDER_STATUS_REFUNDED -> "退款金额: ¥$refundAmount"
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp8" android:layout_marginTop="@dimen/dp8"
android:includeFontPadding="false" android:includeFontPadding="false"
android:text="@{'共' + String.valueOf(data.goodsNum) + '件'}" android:text='@{"共" + String.valueOf(data.goodsNum) + "件"}'
android:textColor="@color/color_999999" android:textColor="@color/color_999999"
android:textSize="@dimen/sp13" android:textSize="@dimen/sp13"
app:layout_constraintStart_toStartOf="@id/tv_commodity_name" app:layout_constraintStart_toStartOf="@id/tv_commodity_name"
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp8" android:layout_marginTop="@dimen/dp8"
android:includeFontPadding="false" android:includeFontPadding="false"
android:text="@{'¥' + String.valueOf(data.price)}" android:text='@{"¥" + String.valueOf(data.price)}'
android:textColor="@color/color_333333" android:textColor="@color/color_333333"
android:textSize="@dimen/sp16" android:textSize="@dimen/sp16"
android:textStyle="bold" android:textStyle="bold"
......
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
android:layout_marginStart="@dimen/dp3" android:layout_marginStart="@dimen/dp3"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:text='@{data.couponList.size() > 0 ? data.couponList.get(0).couponId : ""}' android:text='@{data.couponList.size() > 0 ? data.couponList.get(0).couponId : @string/red_packet_or_coupon}'
android:textColor="@color/color_333333" android:textColor="@color/color_333333"
android:textSize="@dimen/sp14" android:textSize="@dimen/sp14"
android:visibility="@{data.couponList.size() > 0 ? View.VISIBLE : View.GONE}" android:visibility="@{data.couponList.size() > 0 ? View.VISIBLE : View.GONE}"
...@@ -120,26 +120,30 @@ ...@@ -120,26 +120,30 @@
app:layout_constraintEnd_toStartOf="@id/tv_coupon_amount" app:layout_constraintEnd_toStartOf="@id/tv_coupon_amount"
app:layout_constraintStart_toEndOf="@id/iv_coupon" app:layout_constraintStart_toEndOf="@id/iv_coupon"
app:layout_constraintTop_toTopOf="@id/iv_coupon" app:layout_constraintTop_toTopOf="@id/iv_coupon"
tools:text="@string/red_packet_or_coupon" /> tools:text="红包/优惠券" />
<TextView <TextView
android:id="@+id/tv_coupon_amount" android:id="@+id/tv_coupon_amount"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableEnd="@drawable/icon_next_white" android:text='@{data.couponList.size() > 0 ? "-¥" + String.valueOf(data.couponList.get(0).shareCouponAmount) : ""}'
android:paddingStart="@dimen/dp8" android:textColor="@color/color_FB4653"
android:paddingTop="@dimen/dp2" android:textSize="@dimen/sp14"
android:paddingEnd="@dimen/dp2"
android:paddingBottom="@dimen/dp2"
android:text='@{data.couponList.size() > 0 ? String.valueOf(data.couponList.get(0).shareCouponAmount) : ""}'
android:textColor="@color/white"
android:textSize="@dimen/sp11"
android:visibility="@{data.couponList.size() > 0 ? View.VISIBLE : View.GONE}" android:visibility="@{data.couponList.size() > 0 ? View.VISIBLE : View.GONE}"
app:layout_constraintBottom_toBottomOf="@id/iv_coupon" app:layout_constraintBottom_toBottomOf="@id/iv_coupon"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toStartOf="@id/iv_coupon_select"
app:layout_constraintTop_toTopOf="@id/iv_coupon" app:layout_constraintTop_toTopOf="@id/iv_coupon"
tools:ignore="UseCompatTextViewDrawableXml" tools:text="-¥10.00" />
tools:text="3张优惠券可用" />
<ImageView
android:id="@+id/iv_coupon_select"
android:layout_width="@dimen/dp14"
android:layout_height="@dimen/dp14"
android:src="@drawable/icon_next"
android:visibility="@{status == OrderStatus.ORDER_STATUS_UNKNOWN || status == OrderStatus.ORDER_STATUS_WAIT_PAY ? View.VISIBLE : View.GONE}"
app:layout_constraintBottom_toBottomOf="@id/iv_coupon"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/iv_coupon" />
<TextView <TextView
android:id="@+id/tv_discount_amount_text" android:id="@+id/tv_discount_amount_text"
...@@ -157,8 +161,8 @@ ...@@ -157,8 +161,8 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp8" android:layout_marginEnd="@dimen/dp8"
android:text="@{'¥' + String.valueOf(data.discountFee)}" android:text='@{"¥" + String.valueOf(data.discountFee)}'
android:textColor="@color/color_FD7823" android:textColor="@color/color_FB4653"
android:textSize="@dimen/sp14" android:textSize="@dimen/sp14"
android:visibility="@{data.useCoupon == 1 ? View.VISIBLE : View.GONE}" android:visibility="@{data.useCoupon == 1 ? View.VISIBLE : View.GONE}"
app:layout_constraintBaseline_toBaselineOf="@id/tv_total_amount" app:layout_constraintBaseline_toBaselineOf="@id/tv_total_amount"
...@@ -180,7 +184,7 @@ ...@@ -180,7 +184,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/dp24" android:layout_marginTop="@dimen/dp24"
android:text="@{'¥' + String.valueOf(data.totalPrice)}" android:text='@{"¥" + String.valueOf(data.totalPrice)}'
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/sp18" android:textSize="@dimen/sp18"
android:textStyle="bold" android:textStyle="bold"
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp12" android:layout_marginStart="@dimen/dp12"
android:autofillHints="123"
android:background="@null" android:background="@null"
android:hint="@string/please_input_consignee_name" android:hint="@string/please_input_consignee_name"
android:inputType="text" android:inputType="text"
......
...@@ -2,4 +2,5 @@ ...@@ -2,4 +2,5 @@
<resources> <resources>
<color name="color_F7F7F7">#FFF7F7F7</color> <color name="color_F7F7F7">#FFF7F7F7</color>
<color name="color_FD7823">#FD7823</color> <color name="color_FD7823">#FD7823</color>
<color name="color_FB4653">#FB4653</color>
</resources> </resources>
\ No newline at end of file
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