优化
This commit is contained in:
@@ -1,101 +1,101 @@
|
||||
package com.sw.inbound.ui.weight.dialog
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.layout.wrapContentSize
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.colorResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.compose.ui.window.Dialog
|
||||
import androidx.compose.ui.window.DialogProperties
|
||||
import com.sw.inbound.R
|
||||
import com.sw.inbound.ui.weight.CustomButton
|
||||
import com.sw.inbound.ui.weight.CustomOutlinedButton
|
||||
import com.sw.inbound.utils.ToastUtils
|
||||
|
||||
/**
|
||||
* 添加物品弹窗
|
||||
*/
|
||||
@Composable
|
||||
fun AddProductDialog(
|
||||
modifier: Modifier = Modifier,
|
||||
onCancelClick: () -> Unit,
|
||||
onConfirmClick: () -> Unit,
|
||||
onDismiss: () -> Unit,
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
Dialog(
|
||||
onDismissRequest = onDismiss,
|
||||
properties = DialogProperties(
|
||||
usePlatformDefaultWidth = false, // 不使用平台默认宽度
|
||||
decorFitsSystemWindows = false // 允许内容延伸到系统窗口后面
|
||||
)
|
||||
) {
|
||||
|
||||
Surface(
|
||||
modifier = Modifier
|
||||
.padding(start = 60.dp, end = 60.dp, bottom = 40.dp) // 设置弹窗距离边框60dp
|
||||
.wrapContentSize(),
|
||||
shape = RoundedCornerShape(30.dp),
|
||||
color = Color.White,
|
||||
shadowElevation = 0.dp
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(start = 152.dp, end = 152.dp, top = 56.dp, bottom = 30.dp),
|
||||
) {
|
||||
// 主要内容区域
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.weight(1f)
|
||||
) {
|
||||
content()
|
||||
}
|
||||
Spacer(modifier = Modifier.height(30.dp))
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.End
|
||||
) {
|
||||
CustomOutlinedButton(
|
||||
modifier = modifier
|
||||
.width(300.dp)
|
||||
.height(100.dp),
|
||||
text = "取消",
|
||||
fontSize = 36.sp,
|
||||
onClick = onCancelClick
|
||||
)
|
||||
Spacer(modifier = Modifier.width(20.dp))
|
||||
|
||||
CustomButton(
|
||||
modifier = modifier
|
||||
.width(300.dp)
|
||||
.height(100.dp),
|
||||
text = "确定",
|
||||
onClick = onConfirmClick,
|
||||
borderColor = colorResource(R.color.blue),
|
||||
textColor = colorResource(R.color.white),
|
||||
fontSize = 36.sp
|
||||
)
|
||||
}
|
||||
}
|
||||
ToastUtils.ToastComposable()
|
||||
}
|
||||
}
|
||||
}
|
||||
//package com.sw.inbound.ui.weight.dialog
|
||||
//
|
||||
//import androidx.compose.foundation.layout.Arrangement
|
||||
//import androidx.compose.foundation.layout.Box
|
||||
//import androidx.compose.foundation.layout.Column
|
||||
//import androidx.compose.foundation.layout.Row
|
||||
//import androidx.compose.foundation.layout.Spacer
|
||||
//import androidx.compose.foundation.layout.fillMaxSize
|
||||
//import androidx.compose.foundation.layout.fillMaxWidth
|
||||
//import androidx.compose.foundation.layout.height
|
||||
//import androidx.compose.foundation.layout.padding
|
||||
//import androidx.compose.foundation.layout.width
|
||||
//import androidx.compose.foundation.layout.wrapContentSize
|
||||
//import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
//import androidx.compose.material3.Surface
|
||||
//import androidx.compose.runtime.Composable
|
||||
//import androidx.compose.ui.Alignment
|
||||
//import androidx.compose.ui.Modifier
|
||||
//import androidx.compose.ui.graphics.Color
|
||||
//import androidx.compose.ui.res.colorResource
|
||||
//import androidx.compose.ui.unit.dp
|
||||
//import androidx.compose.ui.unit.sp
|
||||
//import androidx.compose.ui.window.Dialog
|
||||
//import androidx.compose.ui.window.DialogProperties
|
||||
//import com.sw.inbound.R
|
||||
//import com.sw.inbound.ui.weight.CustomButton
|
||||
//import com.sw.inbound.ui.weight.CustomOutlinedButton
|
||||
//import com.sw.inbound.utils.ToastUtils
|
||||
//
|
||||
///**
|
||||
// * 添加物品弹窗
|
||||
// */
|
||||
//@Composable
|
||||
//fun AddProductDialog(
|
||||
// modifier: Modifier = Modifier,
|
||||
// onCancelClick: () -> Unit,
|
||||
// onConfirmClick: () -> Unit,
|
||||
// onDismiss: () -> Unit,
|
||||
// content: @Composable () -> Unit
|
||||
//) {
|
||||
// Dialog(
|
||||
// onDismissRequest = onDismiss,
|
||||
// properties = DialogProperties(
|
||||
// usePlatformDefaultWidth = false, // 不使用平台默认宽度
|
||||
// decorFitsSystemWindows = false // 允许内容延伸到系统窗口后面
|
||||
// )
|
||||
// ) {
|
||||
//
|
||||
// Surface(
|
||||
// modifier = Modifier
|
||||
// .padding(start = 60.dp, end = 60.dp, bottom = 40.dp) // 设置弹窗距离边框60dp
|
||||
// .wrapContentSize(),
|
||||
// shape = RoundedCornerShape(30.dp),
|
||||
// color = Color.White,
|
||||
// shadowElevation = 0.dp
|
||||
// ) {
|
||||
// Column(
|
||||
// modifier = Modifier
|
||||
// .fillMaxSize()
|
||||
// .padding(start = 152.dp, end = 152.dp, top = 56.dp, bottom = 30.dp),
|
||||
// ) {
|
||||
// // 主要内容区域
|
||||
// Box(
|
||||
// modifier = Modifier
|
||||
// .fillMaxWidth()
|
||||
// .weight(1f)
|
||||
// ) {
|
||||
// content()
|
||||
// }
|
||||
// Spacer(modifier = Modifier.height(30.dp))
|
||||
// Row(
|
||||
// modifier = Modifier.fillMaxWidth(),
|
||||
// verticalAlignment = Alignment.CenterVertically,
|
||||
// horizontalArrangement = Arrangement.End
|
||||
// ) {
|
||||
// CustomOutlinedButton(
|
||||
// modifier = modifier
|
||||
// .width(300.dp)
|
||||
// .height(100.dp),
|
||||
// text = "取消",
|
||||
// fontSize = 36.sp,
|
||||
// onClick = onCancelClick
|
||||
// )
|
||||
// Spacer(modifier = Modifier.width(20.dp))
|
||||
//
|
||||
// CustomButton(
|
||||
// modifier = modifier
|
||||
// .width(300.dp)
|
||||
// .height(100.dp),
|
||||
// text = "确定",
|
||||
// onClick = onConfirmClick,
|
||||
// borderColor = colorResource(R.color.blue),
|
||||
// textColor = colorResource(R.color.white),
|
||||
// fontSize = 36.sp
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
// ToastUtils.ToastComposable()
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,103 +1,103 @@
|
||||
package com.sw.inbound.ui.weight.dialog
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.layout.wrapContentSize
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.colorResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.compose.ui.window.Dialog
|
||||
import androidx.compose.ui.window.DialogProperties
|
||||
import com.sw.inbound.R
|
||||
import com.sw.inbound.ui.weight.CustomButton
|
||||
import com.sw.inbound.ui.weight.CustomOutlinedButton
|
||||
import com.sw.inbound.utils.ToastUtils
|
||||
|
||||
/**
|
||||
* 添加物品弹窗
|
||||
*/
|
||||
@Composable
|
||||
fun AddPurchaseUnitDialog(
|
||||
modifier: Modifier = Modifier,
|
||||
onCancelClick: () -> Unit,
|
||||
onConfirmClick: () -> Unit,
|
||||
onDismiss: () -> Unit,
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
Dialog(
|
||||
onDismissRequest = onDismiss,
|
||||
properties = DialogProperties(
|
||||
usePlatformDefaultWidth = false, // 不使用平台默认宽度
|
||||
decorFitsSystemWindows = false // 允许内容延伸到系统窗口后面
|
||||
)
|
||||
) {
|
||||
|
||||
Surface(
|
||||
modifier = Modifier
|
||||
.width(1190.dp)
|
||||
.height(840.dp)
|
||||
.wrapContentSize(),
|
||||
shape = RoundedCornerShape(30.dp),
|
||||
color = Color.White,
|
||||
shadowElevation = 0.dp
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(30.dp),
|
||||
) {
|
||||
// 主要内容区域
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 164.dp)
|
||||
.weight(1f)
|
||||
) {
|
||||
content()
|
||||
}
|
||||
Spacer(modifier = Modifier.height(30.dp))
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.End
|
||||
) {
|
||||
CustomOutlinedButton(
|
||||
modifier = modifier
|
||||
.width(300.dp)
|
||||
.height(100.dp),
|
||||
text = "取消",
|
||||
fontSize = 36.sp,
|
||||
onClick = onCancelClick
|
||||
)
|
||||
Spacer(modifier = Modifier.width(20.dp))
|
||||
|
||||
CustomButton(
|
||||
modifier = modifier
|
||||
.width(300.dp)
|
||||
.height(100.dp),
|
||||
text = "确定",
|
||||
onClick = onConfirmClick,
|
||||
borderColor = colorResource(R.color.blue),
|
||||
textColor = colorResource(R.color.white),
|
||||
fontSize = 36.sp
|
||||
)
|
||||
}
|
||||
}
|
||||
ToastUtils.ToastComposable()
|
||||
}
|
||||
}
|
||||
}
|
||||
//package com.sw.inbound.ui.weight.dialog
|
||||
//
|
||||
//import androidx.compose.foundation.layout.Arrangement
|
||||
//import androidx.compose.foundation.layout.Box
|
||||
//import androidx.compose.foundation.layout.Column
|
||||
//import androidx.compose.foundation.layout.Row
|
||||
//import androidx.compose.foundation.layout.Spacer
|
||||
//import androidx.compose.foundation.layout.fillMaxSize
|
||||
//import androidx.compose.foundation.layout.fillMaxWidth
|
||||
//import androidx.compose.foundation.layout.height
|
||||
//import androidx.compose.foundation.layout.padding
|
||||
//import androidx.compose.foundation.layout.width
|
||||
//import androidx.compose.foundation.layout.wrapContentSize
|
||||
//import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
//import androidx.compose.material3.Surface
|
||||
//import androidx.compose.runtime.Composable
|
||||
//import androidx.compose.ui.Alignment
|
||||
//import androidx.compose.ui.Modifier
|
||||
//import androidx.compose.ui.graphics.Color
|
||||
//import androidx.compose.ui.res.colorResource
|
||||
//import androidx.compose.ui.unit.dp
|
||||
//import androidx.compose.ui.unit.sp
|
||||
//import androidx.compose.ui.window.Dialog
|
||||
//import androidx.compose.ui.window.DialogProperties
|
||||
//import com.sw.inbound.R
|
||||
//import com.sw.inbound.ui.weight.CustomButton
|
||||
//import com.sw.inbound.ui.weight.CustomOutlinedButton
|
||||
//import com.sw.inbound.utils.ToastUtils
|
||||
//
|
||||
///**
|
||||
// * 添加物品弹窗
|
||||
// */
|
||||
//@Composable
|
||||
//fun AddPurchaseUnitDialog(
|
||||
// modifier: Modifier = Modifier,
|
||||
// onCancelClick: () -> Unit,
|
||||
// onConfirmClick: () -> Unit,
|
||||
// onDismiss: () -> Unit,
|
||||
// content: @Composable () -> Unit
|
||||
//) {
|
||||
// Dialog(
|
||||
// onDismissRequest = onDismiss,
|
||||
// properties = DialogProperties(
|
||||
// usePlatformDefaultWidth = false, // 不使用平台默认宽度
|
||||
// decorFitsSystemWindows = false // 允许内容延伸到系统窗口后面
|
||||
// )
|
||||
// ) {
|
||||
//
|
||||
// Surface(
|
||||
// modifier = Modifier
|
||||
// .width(1190.dp)
|
||||
// .height(840.dp)
|
||||
// .wrapContentSize(),
|
||||
// shape = RoundedCornerShape(30.dp),
|
||||
// color = Color.White,
|
||||
// shadowElevation = 0.dp
|
||||
// ) {
|
||||
// Column(
|
||||
// modifier = Modifier
|
||||
// .fillMaxSize()
|
||||
// .padding(30.dp),
|
||||
// ) {
|
||||
// // 主要内容区域
|
||||
// Box(
|
||||
// modifier = Modifier
|
||||
// .fillMaxWidth()
|
||||
// .padding(horizontal = 164.dp)
|
||||
// .weight(1f)
|
||||
// ) {
|
||||
// content()
|
||||
// }
|
||||
// Spacer(modifier = Modifier.height(30.dp))
|
||||
// Row(
|
||||
// modifier = Modifier.fillMaxWidth(),
|
||||
// verticalAlignment = Alignment.CenterVertically,
|
||||
// horizontalArrangement = Arrangement.End
|
||||
// ) {
|
||||
// CustomOutlinedButton(
|
||||
// modifier = modifier
|
||||
// .width(300.dp)
|
||||
// .height(100.dp),
|
||||
// text = "取消",
|
||||
// fontSize = 36.sp,
|
||||
// onClick = onCancelClick
|
||||
// )
|
||||
// Spacer(modifier = Modifier.width(20.dp))
|
||||
//
|
||||
// CustomButton(
|
||||
// modifier = modifier
|
||||
// .width(300.dp)
|
||||
// .height(100.dp),
|
||||
// text = "确定",
|
||||
// onClick = onConfirmClick,
|
||||
// borderColor = colorResource(R.color.blue),
|
||||
// textColor = colorResource(R.color.white),
|
||||
// fontSize = 36.sp
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
// ToastUtils.ToastComposable()
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,228 +1,228 @@
|
||||
package com.sw.inbound.ui.weight.dialog
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.layout.wrapContentSize
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.itemsIndexed
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.colorResource
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.compose.ui.window.Dialog
|
||||
import androidx.compose.ui.window.DialogProperties
|
||||
import com.sw.inbound.R
|
||||
import com.sw.inbound.ext.bold
|
||||
import com.sw.inbound.ext.withColor
|
||||
import com.sw.inbound.ext.withSize
|
||||
import com.sw.inbound.model.response.GoodsInfo
|
||||
import com.sw.inbound.ui.theme.AppTypography
|
||||
import com.sw.inbound.ui.theme.GrayDivider
|
||||
import com.sw.inbound.ui.weight.CustomButton
|
||||
import com.sw.inbound.ui.weight.CustomOutlinedButton
|
||||
import com.sw.inbound.ui.weight.CustomSingleRightText
|
||||
import com.sw.inbound.utils.ToastUtils
|
||||
|
||||
/**
|
||||
* 收货确认弹窗
|
||||
*/
|
||||
@Composable
|
||||
fun ReceiptTipDialog(
|
||||
modifier: Modifier = Modifier,
|
||||
isWarn: Boolean = false,
|
||||
goodsList: List<GoodsInfo>,
|
||||
onCancelClick: () -> Unit,
|
||||
onConfirmClick: (Boolean) -> Unit,
|
||||
onDismiss: () -> Unit = {},
|
||||
) {
|
||||
Dialog(
|
||||
onDismissRequest = onDismiss,
|
||||
properties = DialogProperties(
|
||||
usePlatformDefaultWidth = false, // 不使用平台默认宽度
|
||||
decorFitsSystemWindows = false // 允许内容延伸到系统窗口后面
|
||||
)
|
||||
) {
|
||||
Surface(
|
||||
modifier = Modifier
|
||||
.width(1190.dp)
|
||||
.height(840.dp)
|
||||
.wrapContentSize(),
|
||||
shape = RoundedCornerShape(30.dp),
|
||||
color = Color.White,
|
||||
shadowElevation = 0.dp
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(30.dp),
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.weight(1f),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.Center,
|
||||
) {
|
||||
Image(
|
||||
painter = if (isWarn) painterResource(R.mipmap.ic_tip_warn) else painterResource(
|
||||
R.mipmap.ic_tip_success
|
||||
), contentDescription = "提示"
|
||||
)
|
||||
Spacer(modifier = Modifier.height(60.dp))
|
||||
Text(
|
||||
text = if (isWarn) "收货数量与采购量存在差异" else "核对无误,确认收货",
|
||||
style = AppTypography.black141428TextStyle.bold().withSize(48.sp)
|
||||
)
|
||||
if (isWarn) {
|
||||
Spacer(modifier = Modifier.height(60.dp))
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.height(257.dp)
|
||||
.width(810.dp)
|
||||
.border(width = 1.dp, color = GrayDivider)
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.padding(start = 80.dp, top = 20.dp, end = 80.dp)
|
||||
.height(50.dp),
|
||||
horizontalArrangement = Arrangement.SpaceEvenly,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
CustomSingleRightText(
|
||||
modifier = Modifier.weight(1f),
|
||||
text = "名称",
|
||||
style = AppTypography.gray999999TextStyle,
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
Spacer(modifier = Modifier.width(10.dp))
|
||||
CustomSingleRightText(
|
||||
modifier = Modifier.weight(1f),
|
||||
text = "采购量",
|
||||
style = AppTypography.gray999999TextStyle,
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
Spacer(modifier = Modifier.width(10.dp))
|
||||
CustomSingleRightText(
|
||||
modifier = Modifier.weight(1f),
|
||||
text = "实收",
|
||||
style = AppTypography.gray999999TextStyle,
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
}
|
||||
LazyColumn {
|
||||
itemsIndexed(items = goodsList) { index, goods ->
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.padding(horizontal = 80.dp)
|
||||
.height(50.dp),
|
||||
horizontalArrangement = Arrangement.SpaceEvenly,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
CustomSingleRightText(
|
||||
modifier = Modifier.weight(1f),
|
||||
text = goods.goodNameStr,
|
||||
style = AppTypography.blackMediumTextStyle,
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
Spacer(modifier = Modifier.width(10.dp))
|
||||
CustomSingleRightText(
|
||||
modifier = Modifier.weight(1f),
|
||||
text = "${goods.receiveCountListStr}${goods.unitNameStr}",
|
||||
style = AppTypography.blackMediumTextStyle.withColor(
|
||||
color = Color(0xFF0032C8)
|
||||
),
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
Spacer(modifier = Modifier.width(10.dp))
|
||||
CustomSingleRightText(
|
||||
modifier = Modifier.weight(1f),
|
||||
text = "${goods.receivedNumCount}${goods.unitNameStr}",
|
||||
style = AppTypography.blackMediumTextStyle.withColor(
|
||||
Color.Red
|
||||
),
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(29.dp))
|
||||
Text(
|
||||
text = "请确认实际收货数量,或选择部分收货处理",
|
||||
style = AppTypography.black141428TextStyle.withColor(
|
||||
color = Color(0xFF999999)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
HorizontalDivider(thickness = 1.dp, color = colorResource(R.color.divider))
|
||||
Spacer(modifier = Modifier.height(30.dp))
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.End
|
||||
) {
|
||||
CustomOutlinedButton(
|
||||
modifier = modifier
|
||||
.width(180.dp)
|
||||
.height(90.dp),
|
||||
text = "返回",
|
||||
fontSize = 36.sp,
|
||||
onClick = onCancelClick
|
||||
)
|
||||
Spacer(modifier = Modifier.width(12.dp))
|
||||
|
||||
if (isWarn) {
|
||||
CustomButton(
|
||||
modifier = modifier
|
||||
.width(260.dp)
|
||||
.height(90.dp),
|
||||
text = "部分收货",
|
||||
onClick = {
|
||||
onConfirmClick(false)
|
||||
},
|
||||
borderColor = colorResource(R.color.green),
|
||||
textColor = colorResource(R.color.white),
|
||||
fontSize = 36.sp
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.width(12.dp))
|
||||
}
|
||||
|
||||
CustomButton(
|
||||
modifier = modifier
|
||||
.width(260.dp)
|
||||
.height(90.dp),
|
||||
text = "确定收货",
|
||||
onClick = {
|
||||
onConfirmClick(true)
|
||||
},
|
||||
borderColor = colorResource(R.color.blue),
|
||||
textColor = colorResource(R.color.white),
|
||||
fontSize = 36.sp
|
||||
)
|
||||
}
|
||||
}
|
||||
ToastUtils.ToastComposable()
|
||||
}
|
||||
}
|
||||
}
|
||||
//package com.sw.inbound.ui.weight.dialog
|
||||
//
|
||||
//import androidx.compose.foundation.Image
|
||||
//import androidx.compose.foundation.border
|
||||
//import androidx.compose.foundation.layout.Arrangement
|
||||
//import androidx.compose.foundation.layout.Column
|
||||
//import androidx.compose.foundation.layout.Row
|
||||
//import androidx.compose.foundation.layout.Spacer
|
||||
//import androidx.compose.foundation.layout.fillMaxSize
|
||||
//import androidx.compose.foundation.layout.fillMaxWidth
|
||||
//import androidx.compose.foundation.layout.height
|
||||
//import androidx.compose.foundation.layout.padding
|
||||
//import androidx.compose.foundation.layout.width
|
||||
//import androidx.compose.foundation.layout.wrapContentSize
|
||||
//import androidx.compose.foundation.lazy.LazyColumn
|
||||
//import androidx.compose.foundation.lazy.itemsIndexed
|
||||
//import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
//import androidx.compose.material3.HorizontalDivider
|
||||
//import androidx.compose.material3.Surface
|
||||
//import androidx.compose.material3.Text
|
||||
//import androidx.compose.runtime.Composable
|
||||
//import androidx.compose.ui.Alignment
|
||||
//import androidx.compose.ui.Modifier
|
||||
//import androidx.compose.ui.graphics.Color
|
||||
//import androidx.compose.ui.res.colorResource
|
||||
//import androidx.compose.ui.res.painterResource
|
||||
//import androidx.compose.ui.text.style.TextAlign
|
||||
//import androidx.compose.ui.unit.dp
|
||||
//import androidx.compose.ui.unit.sp
|
||||
//import androidx.compose.ui.window.Dialog
|
||||
//import androidx.compose.ui.window.DialogProperties
|
||||
//import com.sw.inbound.R
|
||||
//import com.sw.inbound.ext.bold
|
||||
//import com.sw.inbound.ext.withColor
|
||||
//import com.sw.inbound.ext.withSize
|
||||
//import com.sw.inbound.model.response.GoodsInfo
|
||||
//import com.sw.inbound.ui.theme.AppTypography
|
||||
//import com.sw.inbound.ui.theme.GrayDivider
|
||||
//import com.sw.inbound.ui.weight.CustomButton
|
||||
//import com.sw.inbound.ui.weight.CustomOutlinedButton
|
||||
//import com.sw.inbound.ui.weight.CustomSingleRightText
|
||||
//import com.sw.inbound.utils.ToastUtils
|
||||
//
|
||||
///**
|
||||
// * 收货确认弹窗
|
||||
// */
|
||||
//@Composable
|
||||
//fun ReceiptTipDialog(
|
||||
// modifier: Modifier = Modifier,
|
||||
// isWarn: Boolean = false,
|
||||
// goodsList: List<GoodsInfo>,
|
||||
// onCancelClick: () -> Unit,
|
||||
// onConfirmClick: (Boolean) -> Unit,
|
||||
// onDismiss: () -> Unit = {},
|
||||
//) {
|
||||
// Dialog(
|
||||
// onDismissRequest = onDismiss,
|
||||
// properties = DialogProperties(
|
||||
// usePlatformDefaultWidth = false, // 不使用平台默认宽度
|
||||
// decorFitsSystemWindows = false // 允许内容延伸到系统窗口后面
|
||||
// )
|
||||
// ) {
|
||||
// Surface(
|
||||
// modifier = Modifier
|
||||
// .width(1190.dp)
|
||||
// .height(840.dp)
|
||||
// .wrapContentSize(),
|
||||
// shape = RoundedCornerShape(30.dp),
|
||||
// color = Color.White,
|
||||
// shadowElevation = 0.dp
|
||||
// ) {
|
||||
// Column(
|
||||
// modifier = Modifier
|
||||
// .fillMaxSize()
|
||||
// .padding(30.dp),
|
||||
// ) {
|
||||
// Column(
|
||||
// modifier = Modifier
|
||||
// .fillMaxWidth()
|
||||
// .weight(1f),
|
||||
// horizontalAlignment = Alignment.CenterHorizontally,
|
||||
// verticalArrangement = Arrangement.Center,
|
||||
// ) {
|
||||
// Image(
|
||||
// painter = if (isWarn) painterResource(R.mipmap.ic_tip_warn) else painterResource(
|
||||
// R.mipmap.ic_tip_success
|
||||
// ), contentDescription = "提示"
|
||||
// )
|
||||
// Spacer(modifier = Modifier.height(60.dp))
|
||||
// Text(
|
||||
// text = if (isWarn) "收货数量与采购量存在差异" else "核对无误,确认收货",
|
||||
// style = AppTypography.black141428TextStyle.bold().withSize(48.sp)
|
||||
// )
|
||||
// if (isWarn) {
|
||||
// Spacer(modifier = Modifier.height(60.dp))
|
||||
// Column(
|
||||
// modifier = Modifier
|
||||
// .height(257.dp)
|
||||
// .width(810.dp)
|
||||
// .border(width = 1.dp, color = GrayDivider)
|
||||
// ) {
|
||||
// Row(
|
||||
// modifier = Modifier
|
||||
// .padding(start = 80.dp, top = 20.dp, end = 80.dp)
|
||||
// .height(50.dp),
|
||||
// horizontalArrangement = Arrangement.SpaceEvenly,
|
||||
// verticalAlignment = Alignment.CenterVertically
|
||||
// ) {
|
||||
// CustomSingleRightText(
|
||||
// modifier = Modifier.weight(1f),
|
||||
// text = "名称",
|
||||
// style = AppTypography.gray999999TextStyle,
|
||||
// textAlign = TextAlign.Center
|
||||
// )
|
||||
// Spacer(modifier = Modifier.width(10.dp))
|
||||
// CustomSingleRightText(
|
||||
// modifier = Modifier.weight(1f),
|
||||
// text = "采购量",
|
||||
// style = AppTypography.gray999999TextStyle,
|
||||
// textAlign = TextAlign.Center
|
||||
// )
|
||||
// Spacer(modifier = Modifier.width(10.dp))
|
||||
// CustomSingleRightText(
|
||||
// modifier = Modifier.weight(1f),
|
||||
// text = "实收",
|
||||
// style = AppTypography.gray999999TextStyle,
|
||||
// textAlign = TextAlign.Center
|
||||
// )
|
||||
// }
|
||||
// LazyColumn {
|
||||
// itemsIndexed(items = goodsList) { index, goods ->
|
||||
// Row(
|
||||
// modifier = Modifier
|
||||
// .padding(horizontal = 80.dp)
|
||||
// .height(50.dp),
|
||||
// horizontalArrangement = Arrangement.SpaceEvenly,
|
||||
// verticalAlignment = Alignment.CenterVertically
|
||||
// ) {
|
||||
// CustomSingleRightText(
|
||||
// modifier = Modifier.weight(1f),
|
||||
// text = goods.goodNameStr,
|
||||
// style = AppTypography.blackMediumTextStyle,
|
||||
// textAlign = TextAlign.Center
|
||||
// )
|
||||
// Spacer(modifier = Modifier.width(10.dp))
|
||||
// CustomSingleRightText(
|
||||
// modifier = Modifier.weight(1f),
|
||||
// text = "${goods.receiveCountListStr}${goods.unitNameStr}",
|
||||
// style = AppTypography.blackMediumTextStyle.withColor(
|
||||
// color = Color(0xFF0032C8)
|
||||
// ),
|
||||
// textAlign = TextAlign.Center
|
||||
// )
|
||||
// Spacer(modifier = Modifier.width(10.dp))
|
||||
// CustomSingleRightText(
|
||||
// modifier = Modifier.weight(1f),
|
||||
// text = "${goods.receivedNumCount}${goods.unitNameStr}",
|
||||
// style = AppTypography.blackMediumTextStyle.withColor(
|
||||
// Color.Red
|
||||
// ),
|
||||
// textAlign = TextAlign.Center
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// Spacer(modifier = Modifier.height(29.dp))
|
||||
// Text(
|
||||
// text = "请确认实际收货数量,或选择部分收货处理",
|
||||
// style = AppTypography.black141428TextStyle.withColor(
|
||||
// color = Color(0xFF999999)
|
||||
// )
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
// HorizontalDivider(thickness = 1.dp, color = colorResource(R.color.divider))
|
||||
// Spacer(modifier = Modifier.height(30.dp))
|
||||
// Row(
|
||||
// modifier = Modifier.fillMaxWidth(),
|
||||
// verticalAlignment = Alignment.CenterVertically,
|
||||
// horizontalArrangement = Arrangement.End
|
||||
// ) {
|
||||
// CustomOutlinedButton(
|
||||
// modifier = modifier
|
||||
// .width(180.dp)
|
||||
// .height(90.dp),
|
||||
// text = "返回",
|
||||
// fontSize = 36.sp,
|
||||
// onClick = onCancelClick
|
||||
// )
|
||||
// Spacer(modifier = Modifier.width(12.dp))
|
||||
//
|
||||
// if (isWarn) {
|
||||
// CustomButton(
|
||||
// modifier = modifier
|
||||
// .width(260.dp)
|
||||
// .height(90.dp),
|
||||
// text = "部分收货",
|
||||
// onClick = {
|
||||
// onConfirmClick(false)
|
||||
// },
|
||||
// borderColor = colorResource(R.color.green),
|
||||
// textColor = colorResource(R.color.white),
|
||||
// fontSize = 36.sp
|
||||
// )
|
||||
//
|
||||
// Spacer(modifier = Modifier.width(12.dp))
|
||||
// }
|
||||
//
|
||||
// CustomButton(
|
||||
// modifier = modifier
|
||||
// .width(260.dp)
|
||||
// .height(90.dp),
|
||||
// text = "确定收货",
|
||||
// onClick = {
|
||||
// onConfirmClick(true)
|
||||
// },
|
||||
// borderColor = colorResource(R.color.blue),
|
||||
// textColor = colorResource(R.color.white),
|
||||
// fontSize = 36.sp
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
// ToastUtils.ToastComposable()
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user