-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
645 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
domain/src/main/kotlin/co/orange/domain/entity/response/SellDetailModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package co.orange.domain.entity.response | ||
|
||
import co.orange.domain.enums.ItemStatus | ||
import co.orange.domain.enums.OrderStatus | ||
|
||
data class SellDetailModel( | ||
val itemId: String, | ||
val itemStatus: ItemStatus, | ||
val productName: String, | ||
val imgUrl: String, | ||
val originPrice: Int, | ||
val salePrice: Int, | ||
val orderId: String, | ||
val orderStatus: OrderStatus, | ||
val buyerNickname: String, | ||
val addressInfo: List<AddressInfoModel>, | ||
val paymentInfo: List<PaymentInfoModel>, | ||
) |
2 changes: 1 addition & 1 deletion
2
...e/domain/entity/response/SellItemModel.kt → ...omain/entity/response/SellProductModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package co.orange.domain.enums | ||
|
||
enum class ItemStatus { | ||
ON_SALE, | ||
IN_TRANSACTION, | ||
CLOSED, | ||
EXPIRED, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
presentation/src/main/java/co/orange/presentation/sell/info/SellInfoActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package co.orange.presentation.sell.info | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import android.os.Bundle | ||
import androidx.activity.viewModels | ||
import co.orange.domain.entity.response.SellDetailModel | ||
import coil.load | ||
import dagger.hilt.android.AndroidEntryPoint | ||
import kr.genti.core.base.BaseActivity | ||
import kr.genti.core.extension.breakLines | ||
import kr.genti.core.extension.setNumberForm | ||
import kr.genti.core.extension.setOnSingleClickListener | ||
import kr.genti.presentation.R | ||
import kr.genti.presentation.databinding.ActivitySellInfoBinding | ||
|
||
@AndroidEntryPoint | ||
class SellInfoActivity : | ||
BaseActivity<ActivitySellInfoBinding>(R.layout.activity_sell_info) { | ||
private val viewModel by viewModels<SellInfoViewModel>() | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
initExitBtnListener() | ||
initFixPurchaseBtnListener() | ||
getIntentInfo() | ||
setIntentUi(viewModel.mockSellInfo) | ||
} | ||
|
||
private fun initExitBtnListener() { | ||
binding.btnExit.setOnSingleClickListener { finish() } | ||
} | ||
|
||
private fun initFixPurchaseBtnListener() { | ||
// TODO | ||
binding.btnFixSell.setOnSingleClickListener { } | ||
} | ||
|
||
private fun getIntentInfo() { | ||
viewModel.productId = intent.getLongExtra(EXTRA_PRODUCT_ID, -1) | ||
} | ||
|
||
private fun setIntentUi(item: SellDetailModel) { | ||
with(binding) { | ||
tvInfoTransaction.text = getString(R.string.transaction_id, item.orderId).breakLines() | ||
ivInfoProduct.load(item.imgUrl) | ||
tvInfoProductName.text = item.productName | ||
tvInfoProductPrice.text = item.originPrice.setNumberForm() | ||
tvInfoBuyerNickname.text = item.buyerNickname | ||
tvInfoDeliveryName.text = item.addressInfo[0].recipient | ||
tvInfoDeliveryAddress.text = | ||
getString( | ||
R.string.address_format, | ||
item.addressInfo[0].zipCode, | ||
item.addressInfo[0].address, | ||
).breakLines() | ||
tvInfoDeliveryPhone.text = item.addressInfo[0].phone | ||
tvInfoTransactionMethod.text = item.paymentInfo[0].method | ||
tvInfoTransactionDate.text = item.paymentInfo[0].completedAt | ||
tvInfoPayKakao.text = item.originPrice.setNumberForm() | ||
tvInfoPayReal.text = item.salePrice.setNumberForm() | ||
tvInfoPayTotal.text = item.salePrice.setNumberForm() | ||
} | ||
} | ||
|
||
companion object { | ||
private const val EXTRA_PRODUCT_ID = "EXTRA_PRODUCT_ID" | ||
|
||
@JvmStatic | ||
fun createIntent( | ||
context: Context, | ||
productId: Long, | ||
): Intent = | ||
Intent(context, SellInfoActivity::class.java).apply { | ||
putExtra(EXTRA_PRODUCT_ID, productId) | ||
} | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
presentation/src/main/java/co/orange/presentation/sell/info/SellInfoViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package co.orange.presentation.sell.info | ||
|
||
import androidx.lifecycle.ViewModel | ||
import co.orange.domain.entity.response.AddressInfoModel | ||
import co.orange.domain.entity.response.PaymentInfoModel | ||
import co.orange.domain.entity.response.SellDetailModel | ||
import co.orange.domain.enums.ItemStatus | ||
import co.orange.domain.enums.OrderStatus | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class SellInfoViewModel | ||
@Inject | ||
constructor( | ||
// private val feedRepository: FeedRepository, | ||
) : ViewModel() { | ||
var productId: Long = -1 | ||
|
||
val mockSellInfo = | ||
SellDetailModel( | ||
"1", | ||
ItemStatus.ON_SALE, | ||
"상품이름은 한줄로만 보여줄거에야야야야야야", | ||
"https://github.com/Marchbreeze/Marchbreeze/assets/97405341/cd2c0454-92b4-41e7-ae2f-319f83e2426f", | ||
24000, | ||
21000, | ||
"123e4567-e89b-12d3-a456-426614174000", | ||
OrderStatus.ORDER_PLACED, | ||
"등둔", | ||
listOf( | ||
AddressInfoModel( | ||
"김상호", | ||
"04567", | ||
"서울특벌시 성동구 성수이로 137 107동 903호", | ||
"010-3259-0327", | ||
), | ||
), | ||
listOf( | ||
PaymentInfoModel( | ||
"NAVERPAY", | ||
"2024.06.06", | ||
), | ||
), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="21dp" | ||
android:height="14dp" | ||
android:viewportWidth="21" | ||
android:viewportHeight="14"> | ||
<path | ||
android:pathData="M8,12.229C12.168,5.858 4.07,2.412 0,2.067L21,0C15.791,7.235 4,18.344 8,12.229Z" | ||
android:fillColor="#FF6C6C"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<solid android:color="@color/seg_red" /> | ||
<corners | ||
android:radius="5dp" /> | ||
</shape> |
Oops, something went wrong.