|
@@ -0,0 +1,126 @@
|
|
|
|
+package com.example.pda.ui
|
|
|
|
+
|
|
|
|
+import androidx.compose.foundation.layout.*
|
|
|
|
+import androidx.compose.material3.*
|
|
|
|
+import androidx.compose.runtime.Composable
|
|
|
|
+import androidx.compose.ui.Alignment
|
|
|
|
+import androidx.compose.ui.Modifier
|
|
|
|
+import androidx.compose.ui.graphics.Color
|
|
|
|
+import androidx.compose.foundation.background
|
|
|
|
+import androidx.compose.material.icons.Icons
|
|
|
|
+import androidx.compose.material.icons.filled.ArrowBack
|
|
|
|
+
|
|
|
|
+import androidx.compose.ui.res.painterResource
|
|
|
|
+import androidx.compose.ui.unit.dp
|
|
|
|
+import androidx.compose.ui.unit.sp
|
|
|
|
+
|
|
|
|
+import com.example.pda.R
|
|
|
|
+import com.example.pda.network.HttpClientWCS
|
|
|
|
+import com.example.pda.network.NetworkWCS
|
|
|
|
+
|
|
|
|
+@OptIn(ExperimentalMaterial3Api::class)
|
|
|
|
+@Composable
|
|
|
|
+fun UpStationScreen(
|
|
|
|
+ onBack: () -> Unit,
|
|
|
|
+ onSetScreen: () -> Unit
|
|
|
|
+) {
|
|
|
|
+ Scaffold(
|
|
|
|
+ topBar = {
|
|
|
|
+ TopAppBar(
|
|
|
|
+ navigationIcon = {
|
|
|
|
+ IconButton(onClick = onBack) {
|
|
|
|
+ Icon(
|
|
|
|
+ imageVector = Icons.Default.ArrowBack,
|
|
|
|
+ contentDescription = "返回"
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ title = {
|
|
|
|
+ Row(verticalAlignment = Alignment.CenterVertically) {
|
|
|
|
+ Icon(
|
|
|
|
+ painter = painterResource(id = R.drawable.logo),
|
|
|
|
+ contentDescription = "PDA Logo",
|
|
|
|
+ modifier = Modifier.size(40.dp),
|
|
|
|
+ tint = MaterialTheme.colorScheme.surfaceTint
|
|
|
|
+ )
|
|
|
|
+ Spacer(Modifier.width(8.dp))
|
|
|
|
+ Text("信泰PDA扫描系统")
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ colors = TopAppBarDefaults.topAppBarColors(
|
|
|
|
+ containerColor = Color(0xFFBCD0C5), // 自定义颜色
|
|
|
|
+ titleContentColor = MaterialTheme.colorScheme.onPrimary,
|
|
|
|
+ actionIconContentColor = MaterialTheme.colorScheme.onPrimary
|
|
|
|
+ ),
|
|
|
|
+ actions = {
|
|
|
|
+ IconButton(onClick = { onSetScreen() }) {
|
|
|
|
+ Icon(
|
|
|
|
+ painter = painterResource(id = R.drawable.ic_settings),
|
|
|
|
+ contentDescription = "Settings",
|
|
|
|
+ tint = MaterialTheme.colorScheme.onSurface
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ ) { innerPadding ->
|
|
|
|
+ Box(
|
|
|
|
+ modifier = Modifier
|
|
|
|
+ .padding(innerPadding)
|
|
|
|
+ .fillMaxSize()
|
|
|
|
+ .background(Color(0xFFE6E6EB)),
|
|
|
|
+ contentAlignment = Alignment.Center
|
|
|
|
+
|
|
|
|
+ ) {
|
|
|
|
+
|
|
|
|
+ Column(
|
|
|
|
+ horizontalAlignment = Alignment.CenterHorizontally,
|
|
|
|
+ verticalArrangement = Arrangement.spacedBy(60.dp)
|
|
|
|
+ ) {
|
|
|
|
+ ExtendedFloatingActionButton(
|
|
|
|
+ onClick ={
|
|
|
|
+ HttpClientWCS.deviceId = 201
|
|
|
|
+ NetworkWCS.upstation()
|
|
|
|
+ } ,
|
|
|
|
+ modifier = Modifier.size(220.dp, 70.dp),
|
|
|
|
+ containerColor = Color(0xFFFDECD0),
|
|
|
|
+ icon = {
|
|
|
|
+ Icon(
|
|
|
|
+ painter = painterResource(id = R.drawable.ic_scan),
|
|
|
|
+ contentDescription = "入库扫描"
|
|
|
|
+ )
|
|
|
|
+ },
|
|
|
|
+ text = {
|
|
|
|
+ Text(
|
|
|
|
+ text = "出库提升",
|
|
|
|
+ fontSize = 18.sp,
|
|
|
|
+ color = MaterialTheme.colorScheme.onSurface
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ ExtendedFloatingActionButton(
|
|
|
|
+ onClick = {
|
|
|
|
+ HttpClientWCS.deviceId = 101
|
|
|
|
+ NetworkWCS.upstation()
|
|
|
|
+ },
|
|
|
|
+ modifier = Modifier.size(220.dp, 70.dp),
|
|
|
|
+ containerColor = Color(0xFF91BFBF),
|
|
|
|
+ icon = {
|
|
|
|
+ Icon(
|
|
|
|
+ painter = painterResource(id = R.drawable.ic_scan),
|
|
|
|
+ contentDescription = "托盘扫描"
|
|
|
|
+ )
|
|
|
|
+ },
|
|
|
|
+ text = {
|
|
|
|
+ Text(
|
|
|
|
+ text = "入库提升",
|
|
|
|
+ fontSize = 20.sp,
|
|
|
|
+ color = MaterialTheme.colorScheme.onSurface
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|