|
|
@ -61,14 +61,18 @@ class CreateGoodsOrderAct : BaseVmAct<ShopMallVm>() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
mViewModel.defaultAddressLiveData.observe(this){
|
|
|
|
mViewModel.defaultAddressLiveData.observe(this){
|
|
|
|
addrId = it.data.id
|
|
|
|
if(it.data != null){
|
|
|
|
binding.tvChooseAddress.text = "${it.data.province}${it.data.city}${it.data.district}${it.data.address}"
|
|
|
|
addrId = it.data.id
|
|
|
|
|
|
|
|
binding.tvChooseAddress.text = "${it.data.province}${it.data.city}${it.data.district}${it.data.address}"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
mViewModel.computeAmountLiveData.observe(this){
|
|
|
|
mViewModel.computeAmountLiveData.observe(this){
|
|
|
|
binding.tvTotalPrice.text ="¥ ${it.data.pay_price}"
|
|
|
|
binding.tvTotalPrice.text ="¥ ${it.data.pay_price}"
|
|
|
|
binding.tvPlatformDiscounts.text ="¥ ${it.data.discount_price}"
|
|
|
|
binding.tvPlatformDiscounts.text ="¥ ${it.data.discount_price}"
|
|
|
|
couponBean?.let {
|
|
|
|
couponBean?.let {
|
|
|
|
|
|
|
|
couponsId = it.id
|
|
|
|
binding.tvDiscounts.text = "可优惠¥ ${it.as_amount}"
|
|
|
|
binding.tvDiscounts.text = "可优惠¥ ${it.as_amount}"
|
|
|
|
// binding.tvPlatformDiscounts.text = "${(bean!!.ori_price * bean!!.skuNum) - (it.skuPrice * it.skuNum) - couponBean.as_amount}"
|
|
|
|
// binding.tvPlatformDiscounts.text = "${(bean!!.ori_price * bean!!.skuNum) - (it.skuPrice * it.skuNum) - couponBean.as_amount}"
|
|
|
|
|
|
|
|
|
|
|
@ -178,11 +182,11 @@ class CreateGoodsOrderAct : BaseVmAct<ShopMallVm>() {
|
|
|
|
REQUEST_COUP ->{
|
|
|
|
REQUEST_COUP ->{
|
|
|
|
couponBean = data?.extras!!.getParcelable<ChooseCouponBean>("coupon")
|
|
|
|
couponBean = data?.extras!!.getParcelable<ChooseCouponBean>("coupon")
|
|
|
|
if (couponBean != null) {
|
|
|
|
if (couponBean != null) {
|
|
|
|
couponsId = couponBean!!.id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bean?.let {
|
|
|
|
bean?.let {
|
|
|
|
// binding.tvTotalPrice.text ="¥ ${it.skuPrice * it.skuNum - couponBean.as_amount}"
|
|
|
|
// binding.tvTotalPrice.text ="¥ ${it.skuPrice * it.skuNum - couponBean.as_amount}"
|
|
|
|
mViewModel.computeAmount(it.skuId,it.skuNum,couponsId)
|
|
|
|
mViewModel.computeAmount(it.skuId,it.skuNum,couponBean!!.id)
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|