콘텐츠 구매 - 캔이 부족하면 캔 충전 페이지로 이동하도록 수정
This commit is contained in:
parent
d883a81602
commit
1a3396b293
|
@ -40,6 +40,7 @@ import kr.co.vividnext.sodalive.live.room.donation.LiveRoomDonationDialog
|
|||
import kr.co.vividnext.sodalive.mypage.auth.Auth
|
||||
import kr.co.vividnext.sodalive.mypage.auth.AuthVerifyRequest
|
||||
import kr.co.vividnext.sodalive.mypage.auth.BootpayResponse
|
||||
import kr.co.vividnext.sodalive.mypage.can.charge.CanChargeActivity
|
||||
import kr.co.vividnext.sodalive.report.ReportType
|
||||
import org.koin.android.ext.android.inject
|
||||
|
||||
|
@ -737,7 +738,11 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
|||
viewModel.order(
|
||||
contentId = audioContent.contentId,
|
||||
orderType = orderType
|
||||
)
|
||||
) {
|
||||
val intent = Intent(applicationContext, CanChargeActivity::class.java)
|
||||
intent.putExtra(Constants.EXTRA_GO_TO_PREV_PAGE, true)
|
||||
startActivity(intent)
|
||||
}
|
||||
},
|
||||
).show(screenWidth)
|
||||
}
|
||||
|
|
|
@ -176,7 +176,7 @@ class AudioContentDetailViewModel(
|
|||
_isShowPreviewAlert.value = !_isShowPreviewAlert.value!!
|
||||
}
|
||||
|
||||
fun order(contentId: Long, orderType: OrderType) {
|
||||
fun order(contentId: Long, orderType: OrderType, gotoShop: () -> Unit) {
|
||||
isLoading.value = true
|
||||
compositeDisposable.add(
|
||||
repository.orderContent(
|
||||
|
@ -200,6 +200,9 @@ class AudioContentDetailViewModel(
|
|||
} else {
|
||||
if (it.message != null) {
|
||||
_toastLiveData.postValue(it.message)
|
||||
if (it.message.contains("캔이 부족합니다")) {
|
||||
gotoShop()
|
||||
}
|
||||
} else {
|
||||
_toastLiveData.postValue(
|
||||
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
||||
|
|
|
@ -29,7 +29,7 @@ object Constants {
|
|||
const val EXTRA_MESSAGE_BOX = "extra_message_box"
|
||||
const val EXTRA_TEXT_MESSAGE = "extra_text_message"
|
||||
const val EXTRA_LIVE_TIME_NOW = "extra_live_time_now"
|
||||
const val EXTRA_PREV_LIVE_ROOM = "extra_prev_live_room"
|
||||
const val EXTRA_GO_TO_PREV_PAGE = "extra_go_to_prev_page"
|
||||
const val EXTRA_SELECT_RECIPIENT = "extra_select_recipient"
|
||||
const val EXTRA_ROOM_CHANNEL_NAME = "extra_room_channel_name"
|
||||
const val EXTRA_LIVE_RESERVATION_RESPONSE = "extra_live_reservation_response"
|
||||
|
|
|
@ -108,7 +108,7 @@ class LiveRoomDonationDialog(
|
|||
bottomSheetDialog.dismiss()
|
||||
|
||||
val intent = Intent(activity, CanChargeActivity::class.java)
|
||||
intent.putExtra(Constants.EXTRA_PREV_LIVE_ROOM, true)
|
||||
intent.putExtra(Constants.EXTRA_GO_TO_PREV_PAGE, true)
|
||||
activity.startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ class CanChargeActivity : BaseActivity<ActivityCanChargeBinding>(
|
|||
) {
|
||||
|
||||
private val viewModel: CanChargeViewModel by inject()
|
||||
private var prevLiveRoom: Boolean = false
|
||||
private var gotoPrevPage: Boolean = false
|
||||
|
||||
private lateinit var adapter: CanChargeAdapter
|
||||
private lateinit var loadingDialog: LoadingDialog
|
||||
|
@ -51,8 +51,8 @@ class CanChargeActivity : BaseActivity<ActivityCanChargeBinding>(
|
|||
binding.toolbar.tvBack.text = "충전하기"
|
||||
binding.toolbar.tvBack.setOnClickListener { finish() }
|
||||
|
||||
prevLiveRoom = intent.getBooleanExtra(
|
||||
Constants.EXTRA_PREV_LIVE_ROOM,
|
||||
gotoPrevPage = intent.getBooleanExtra(
|
||||
Constants.EXTRA_GO_TO_PREV_PAGE,
|
||||
false
|
||||
)
|
||||
|
||||
|
@ -60,7 +60,7 @@ class CanChargeActivity : BaseActivity<ActivityCanChargeBinding>(
|
|||
adapter = CanChargeAdapter {
|
||||
val intent = Intent(applicationContext, CanPaymentActivity::class.java)
|
||||
intent.putExtra(Constants.EXTRA_CAN, it)
|
||||
intent.putExtra(Constants.EXTRA_PREV_LIVE_ROOM, prevLiveRoom)
|
||||
intent.putExtra(Constants.EXTRA_GO_TO_PREV_PAGE, gotoPrevPage)
|
||||
activityResultLauncher.launch(intent)
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ class CanPaymentActivity : BaseActivity<ActivityCanPaymentBinding>(
|
|||
private val viewModel: CanPaymentViewModel by inject()
|
||||
|
||||
private var canResponse: CanResponse? = null
|
||||
private var prevLiveRoom: Boolean = false
|
||||
private var gotoPrevPage: Boolean = false
|
||||
|
||||
private val handler = Handler(Looper.getMainLooper())
|
||||
|
||||
|
@ -60,8 +60,8 @@ class CanPaymentActivity : BaseActivity<ActivityCanPaymentBinding>(
|
|||
finish()
|
||||
}
|
||||
|
||||
prevLiveRoom = intent.getBooleanExtra(
|
||||
Constants.EXTRA_PREV_LIVE_ROOM,
|
||||
gotoPrevPage = intent.getBooleanExtra(
|
||||
Constants.EXTRA_GO_TO_PREV_PAGE,
|
||||
false
|
||||
)
|
||||
|
||||
|
@ -211,7 +211,7 @@ class CanPaymentActivity : BaseActivity<ActivityCanPaymentBinding>(
|
|||
request,
|
||||
onSuccess = {
|
||||
Toast.makeText(applicationContext, "캔이 충전되었습니다", Toast.LENGTH_LONG).show()
|
||||
if (prevLiveRoom) {
|
||||
if (gotoPrevPage) {
|
||||
setResult(RESULT_OK)
|
||||
} else {
|
||||
val intent = Intent(applicationContext, CanStatusActivity::class.java)
|
||||
|
|
Loading…
Reference in New Issue