Commit d1ac56b5 authored by yinjiacheng's avatar yinjiacheng

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

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