2 Commits 1850a8741f ... 12527223df

Author SHA1 Message Date
  bai 12527223df @fun: remove HeadLeft 2 years ago
  bai 8e538806e6 @fun: Head 2 years ago

+ 9 - 14
app/src/main/java/com/ys/bdtp/adm/mvvm/ui/compose/HeadLeft.kt

@@ -8,10 +8,8 @@ import androidx.compose.material.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.painterResource
 import androidx.compose.ui.text.font.FontWeight
-import androidx.compose.ui.text.font.FontWeight.Companion.Bold
 import androidx.compose.ui.tooling.preview.Preview
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
@@ -19,24 +17,25 @@ import com.ys.bdtp.adm.R
 import com.ys.bdtp.adm.app.theme.divColor
 import com.ys.bdtp.adm.app.theme.textBlackColor
 
-
+/**
+ * 返回组件
+ */
 @Composable
-fun HeadLeft(
+fun Back(
     title: String,
-    back: (() -> Unit)? = null,
-    space: Int = 16
+    back: () -> Unit
 ) {
     Row(
         verticalAlignment = Alignment.CenterVertically,
         horizontalArrangement = Arrangement.Start
     ) {
 
-        Spacer(modifier = Modifier.width(space.dp))
+        Spacer(modifier = Modifier.width(16.dp))
 
         IconButton(
             modifier = Modifier.size(56.dp),
             onClick = {
-                back?.invoke()
+                back()
             }
         ) {
             Image(
@@ -56,7 +55,6 @@ fun HeadLeft(
         Spacer(
             modifier = Modifier
                 .width(16.dp)
-                .background(divColor)
         )
 
         Text(text = title, fontSize = 16.sp, fontWeight = FontWeight.Bold, color = textBlackColor)
@@ -64,15 +62,12 @@ fun HeadLeft(
         Spacer(
             modifier = Modifier
                 .width(16.dp)
-                .background(divColor)
         )
-
     }
 }
 
-
 @Preview(backgroundColor = 0xFF000000)
 @Composable
-fun PreviewHeadLeft() {
-    HeadLeft("京东")
+fun PreviewBack() {
+    Back("京东") {}
 }

+ 58 - 0
app/src/main/java/com/ys/bdtp/adm/mvvm/ui/compose/Ending.kt

@@ -0,0 +1,58 @@
+package com.ys.bdtp.adm.mvvm.ui.compose
+
+import androidx.compose.foundation.layout.*
+import androidx.compose.material.Divider
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.dp
+import com.ys.bdtp.adm.app.theme.divColor
+
+
+@Composable
+fun Ending(
+    notice: String,
+    role: String,
+    noticeClick: () -> Unit,
+    userClick: () -> Unit
+) {
+    Row(
+        modifier = Modifier.height(56.dp),
+        verticalAlignment = Alignment.CenterVertically,
+        horizontalArrangement = Arrangement.End
+    ) {
+        Notice(
+            notice = notice,
+            click = {
+                noticeClick()
+            }
+        )
+
+        Divider(
+            modifier = Modifier.width(1.dp).height(24.dp),
+            color = divColor
+        )
+
+        User(
+            role = role,
+            click = {
+                userClick()
+            }
+        )
+
+        Spacer(modifier = Modifier.width(16.dp))
+    }
+}
+
+
+@Preview
+@Composable
+fun PreviewHeadEnd() {
+    Ending(
+        notice = "21",
+        role = "管家",
+        noticeClick = { println("heiheihei") },
+        userClick = { println("heiheihei") }
+    )
+}

+ 19 - 44
app/src/main/java/com/ys/bdtp/adm/mvvm/ui/compose/Head.kt

@@ -1,24 +1,12 @@
 package com.ys.bdtp.adm.mvvm.ui.compose
 
 import androidx.compose.foundation.background
-import androidx.compose.foundation.layout.Arrangement
-import androidx.compose.foundation.layout.Box
-import androidx.compose.foundation.layout.Row
-import androidx.compose.foundation.layout.Spacer
-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.wrapContentHeight
-import androidx.compose.material.Text
+import androidx.compose.foundation.layout.*
 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.text.font.FontWeight
-import androidx.compose.ui.tooling.preview.Preview
 import androidx.compose.ui.unit.dp
-import androidx.compose.ui.unit.sp
 import com.google.accompanist.insets.LocalWindowInsets
 import com.google.accompanist.insets.rememberInsetsPaddingValues
 
@@ -55,38 +43,25 @@ fun Head(
     }
 }
 
-@Preview(widthDp = 1280, heightDp = 800)
 @Composable
-fun PreviewTop() {
-    Head(
-        left = { HeadLeft("禹数") },
-        right = {
-            HeadRight(
-                role = { "管家" },
-                click = { println("heiheihei") }
+fun Head(
+    content: @Composable () -> Unit,
+) {
+    Box(
+        modifier = Modifier.padding(
+            rememberInsetsPaddingValues(
+                LocalWindowInsets.current.statusBars
             )
+        )
+    ) {
+        Row(
+            modifier = Modifier.fillMaxWidth()
+                .height(56.dp)
+                .background(Color.White),
+            horizontalArrangement = Arrangement.SpaceBetween,
+            verticalAlignment = Alignment.CenterVertically
+        ) {
+            content()
         }
-    )
+    }
 }
-
-@Preview(widthDp = 1280, heightDp = 800)
-@Composable
-fun PreviewTop1() {
-    Head(
-        left = {
-            Row(
-                verticalAlignment = Alignment.CenterVertically,
-                horizontalArrangement = Arrangement.End
-            ) {
-                Spacer(modifier = Modifier.width(32.dp))
-                Text(text = "禹数数字化交付工具", fontSize = 16.sp, fontWeight = FontWeight.Bold, color = Color(0xFF1F2329))
-            }
-        },
-        right = {
-            HeadRight(
-                role = { "管家" },
-                click = { println("heiheihei") }
-            )
-        }
-    )
-}

+ 0 - 17
app/src/main/java/com/ys/bdtp/adm/mvvm/ui/compose/HeadMiddle.kt

@@ -1,17 +0,0 @@
-package com.ys.bdtp.adm.mvvm.ui.compose
-
-import androidx.compose.foundation.layout.Arrangement
-import androidx.compose.foundation.layout.Row
-import androidx.compose.runtime.Composable
-import androidx.compose.ui.Alignment
-
-@Composable
-fun HeadMiddle() {
-    Row(
-        verticalAlignment = Alignment.CenterVertically,
-        horizontalArrangement = Arrangement.Start
-    ) {
-
-    }
-
-}

+ 0 - 97
app/src/main/java/com/ys/bdtp/adm/mvvm/ui/compose/HeadRight.kt

@@ -1,97 +0,0 @@
-package com.ys.bdtp.adm.mvvm.ui.compose
-
-import androidx.compose.foundation.Image
-import androidx.compose.foundation.background
-import androidx.compose.foundation.clickable
-import androidx.compose.foundation.layout.*
-import androidx.compose.material.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.painterResource
-import androidx.compose.ui.text.font.FontWeight.Companion.Bold
-import androidx.compose.ui.tooling.preview.Preview
-import androidx.compose.ui.unit.dp
-import androidx.compose.ui.unit.sp
-import com.ys.bdtp.adm.R
-
-
-@Composable
-fun HeadRight(
-    role: () -> String,
-    click: () -> Unit
-) {
-    Row(
-        modifier = Modifier.height(56.dp),
-        verticalAlignment = Alignment.CenterVertically,
-        horizontalArrangement = Arrangement.End
-    ) {
-        Box(
-            modifier = Modifier.size(56.dp).padding(12.dp)
-        ) {
-            Image(
-                painter = painterResource(R.drawable.bell),
-                contentDescription = "",
-                modifier = Modifier.fillMaxSize()
-            )
-
-            Box(
-                modifier = Modifier.size(16.dp).align(Alignment.TopEnd)
-            ) {
-                Image(
-                    painter = painterResource(R.drawable.red_circle),
-                    contentDescription = "",
-                    modifier = Modifier.align(Alignment.Center)
-                )
-                Text(
-                    text = "2",
-                    fontSize = 10.sp,
-                    color = Color.White,
-                    modifier = Modifier.align(Alignment.Center)
-                )
-            }
-        }
-
-        Spacer(modifier = Modifier.width(4.dp))
-        Spacer(
-            modifier = Modifier.width(1.dp).height(24.dp).background(Color(0xFFD8D8D8))
-        )
-        Spacer(modifier = Modifier.width(16.dp))
-        Text(text = role(), fontSize = 16.sp, fontWeight = Bold, color = Color(0xFF1F2329), maxLines = 1)
-        Spacer(modifier = Modifier.width(4.dp))
-
-        Row(
-            modifier = Modifier
-                .height(56.dp)
-                .clickable {
-                    click()
-                }
-                .padding(12.dp),
-            verticalAlignment = Alignment.CenterVertically
-        ) {
-            Image(
-                painter = painterResource(R.drawable.avatar),
-                contentDescription = "",
-                Modifier.size(32.dp)
-            )
-            Spacer(modifier = Modifier.width(8.dp))
-            Image(
-                painter = painterResource(R.drawable.arrow_down),
-                contentDescription = "",
-                modifier = Modifier.size(16.dp)
-            )
-        }
-        Spacer(modifier = Modifier.width(20.dp))
-    }
-}
-
-
-@Preview
-@Composable
-fun PreviewTopRight() {
-    HeadRight(
-        role = { "管家" },
-        click = { println("heiheihei") }
-    )
-}

+ 62 - 0
app/src/main/java/com/ys/bdtp/adm/mvvm/ui/compose/Notice.kt

@@ -0,0 +1,62 @@
+package com.ys.bdtp.adm.mvvm.ui.compose
+
+import androidx.compose.foundation.Image
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.size
+import androidx.compose.material.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.painterResource
+import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+import com.ys.bdtp.adm.R
+
+/**
+ * 通知组件
+ */
+@Composable
+fun Notice(
+    notice: String,
+    click: () -> Unit
+) {
+    Box(
+        modifier = Modifier
+            .size(56.dp)
+            .clickable {
+                click()
+            }.padding(12.dp)
+    ) {
+        Image(
+            painter = painterResource(R.drawable.bell),
+            contentDescription = "",
+            modifier = Modifier.fillMaxSize()
+        )
+        Box(
+            modifier = Modifier.size(16.dp).align(Alignment.TopEnd)
+        ) {
+            Image(
+                painter = painterResource(R.drawable.red_circle),
+                contentDescription = "",
+                modifier = Modifier.align(Alignment.Center)
+            )
+            Text(
+                text = notice,
+                fontSize = 10.sp,
+                color = Color.White,
+                modifier = Modifier.align(Alignment.Center)
+            )
+        }
+    }
+}
+
+@Preview
+@Composable
+fun PreviewNotice() {
+    Notice("2") {}
+}

+ 61 - 0
app/src/main/java/com/ys/bdtp/adm/mvvm/ui/compose/User.kt

@@ -0,0 +1,61 @@
+package com.ys.bdtp.adm.mvvm.ui.compose
+
+import androidx.compose.foundation.Image
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.layout.*
+import androidx.compose.material.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.painterResource
+import androidx.compose.ui.text.font.FontWeight
+import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+import com.ys.bdtp.adm.R
+
+@Composable
+fun User(
+    role: String,
+    click: () -> Unit
+) {
+    Row(
+        verticalAlignment = Alignment.CenterVertically,
+    ) {
+        Spacer(modifier = Modifier.width(16.dp))
+        Text(
+            text = role,
+            fontSize = 16.sp,
+            fontWeight = FontWeight.Bold,
+            color = Color(0xFF1F2329),
+            maxLines = 1
+        )
+        Row(
+            modifier = Modifier
+                .height(56.dp)
+                .clickable {
+                    click()
+                }.padding(horizontal = 16.dp, vertical = 12.dp),
+            verticalAlignment = Alignment.CenterVertically
+        ) {
+            Image(
+                painter = painterResource(R.drawable.avatar),
+                contentDescription = "",
+                Modifier.size(32.dp)
+            )
+            Spacer(modifier = Modifier.width(8.dp))
+            Image(
+                painter = painterResource(R.drawable.arrow_down),
+                contentDescription = "",
+                modifier = Modifier.size(16.dp)
+            )
+        }
+    }
+}
+
+@Preview(backgroundColor = 0xff000000)
+@Composable
+fun PreviewRole() {
+    User(role = "管家", click = {})
+}

+ 55 - 61
app/src/main/java/com/ys/bdtp/adm/mvvm/ui/screen/cad/CadScreen.kt

@@ -4,6 +4,7 @@ import android.content.Intent
 import android.widget.Toast
 import androidx.compose.foundation.background
 import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Row
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.runtime.*
 import androidx.compose.ui.Modifier
@@ -37,32 +38,32 @@ fun CadScreen(projectId: String) {
     }
 
     Column(modifier = Modifier.background(Color.White)) {
-        Head(
-            left = {
-                HeadLeft(
-                    title = "CAD图纸核查",
-                    back = {
-                        nav.navigateUp()
-                    }
-                )
-            },
-            middle = {
-                SelectButton(
-                    SelectState.Left,
-                    click = {
-                        selectState = it
-                    }
-                )
-            },
-            right = {
-                HeadRight(
-                    role = { "物业管家" },
-                    click = {
-                        popupState = !popupState
-                    }
-                )
-            }
-        )
+        Head {
+            Back(
+                title = "CAD图纸核查",
+                back = {
+                    nav.navigateUp()
+                }
+            )
+
+            SelectButton(
+                SelectState.Left,
+                click = {
+                    selectState = it
+                }
+            )
+
+            Ending(
+                notice = "21",
+                role = "物业管家",
+                noticeClick = {
+
+                },
+                userClick = {
+                    popupState = !popupState
+                }
+            )
+        }
 
         if (popupState) {
             LogoutPopup(
@@ -75,43 +76,36 @@ fun CadScreen(projectId: String) {
                 }
             )
         }
-
         Div(Div.Row)
-        Body(modifier = Modifier.fillMaxSize(),
-            side = {
-                CadSide(
-                    project = project,
-                    floorClick = {
-                        scope.launch {
-                            floor = vm.getFloorWithCads(it.id)
-                        }
+        Row(modifier = Modifier.fillMaxSize()) {
+            CadSide(
+                project = project,
+                floorClick = {
+                    scope.launch {
+                        floor = vm.getFloorWithCads(it.id)
                     }
-                )
-            },
-            div = {
-                Div(Div.Col)
-            },
-            content = {
-                CadContent(
-                    selectState = selectState,
-                    floor = floor,
-                    itemClick = { cad ->
-                        val path = context.getExternalFilesDir("dwg")
-                        val file = File(path, cad.fileName)
-                        if (file.exists()) {
-                            val uri = file.getUri(context)
-                            val intent = Intent(Intent.ACTION_VIEW)
-                            intent.setDataAndType(uri, "application/dwg")
-                            intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
-                            context.startActivity(intent)
-                        } else {
-                            // TODO
-                            Toast.makeText(context, "图纸不存在", Toast.LENGTH_SHORT).show()
-                            println("not found")
-                        }
-                    })
-            }
-        )
+                }
+            )
+            Div(Div.Col)
+            CadContent(
+                selectState = selectState,
+                floor = floor,
+                itemClick = { cad ->
+                    val path = context.getExternalFilesDir("dwg")
+                    val file = File(path, cad.fileName)
+                    if (file.exists()) {
+                        val uri = file.getUri(context)
+                        val intent = Intent(Intent.ACTION_VIEW)
+                        intent.setDataAndType(uri, "application/dwg")
+                        intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
+                        context.startActivity(intent)
+                    } else {
+                        // TODO
+                        Toast.makeText(context, "图纸不存在", Toast.LENGTH_SHORT).show()
+                        println("not found")
+                    }
+                })
+        }
     }
 }
 

+ 20 - 16
app/src/main/java/com/ys/bdtp/adm/mvvm/ui/screen/offline/Offline.kt

@@ -19,9 +19,7 @@ import androidx.compose.ui.unit.dp
 import androidx.lifecycle.Lifecycle
 import androidx.lifecycle.flowWithLifecycle
 import com.ys.bdtp.adm.mvvm.model.Data
-import com.ys.bdtp.adm.mvvm.ui.compose.Head
-import com.ys.bdtp.adm.mvvm.ui.compose.HeadRight
-import com.ys.bdtp.adm.mvvm.ui.compose.LogoutPopup
+import com.ys.bdtp.adm.mvvm.ui.compose.*
 import com.ys.bdtp.adm.mvvm.ui.screen.main.LocalNavHostController
 import com.ys.bdtp.adm.mvvm.ui.screen.main.offlineToLogin
 import com.ys.bdtp.adm.mvvm.vm.offline.OfflineViewModel
@@ -42,19 +40,25 @@ fun Offline(projectId: String) {
     val projectsState = lifecycleWare.collectAsState(Data.loading())
 
     Column(modifier = Modifier.background(Color.White)) {
-        Head(
-            left = {
-                OfflineHeadLeft(back = { nav.navigateUp() })
-            },
-            right = {
-                HeadRight(
-                    role = { "业务角色" },
-                    click = {
-                        popupState = !popupState
-                    }
-                )
-            }
-        )
+        Head {
+            Back(
+                title = "离线数据",
+                back = {
+                    nav.navigateUp()
+                }
+            )
+
+            Ending(
+                notice = "21",
+                role = "物业管家",
+                noticeClick = {
+
+                },
+                userClick = {
+                    popupState = !popupState
+                }
+            )
+        }
 
         if (popupState) {
             LogoutPopup(

+ 27 - 18
app/src/main/java/com/ys/bdtp/adm/mvvm/ui/screen/project/Project.kt

@@ -1,22 +1,21 @@
 package com.ys.bdtp.adm.mvvm.ui.screen.project
 
-import android.content.SharedPreferences
-import android.net.ConnectivityManager
 import androidx.compose.foundation.ExperimentalFoundationApi
 import androidx.compose.foundation.background
-import androidx.compose.foundation.layout.Column
-import androidx.compose.foundation.layout.fillMaxSize
-import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.layout.wrapContentWidth
+import androidx.compose.foundation.layout.*
+import androidx.compose.material.Text
 import androidx.compose.runtime.*
+import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.platform.LocalLifecycleOwner
+import androidx.compose.ui.text.font.FontWeight
 import androidx.compose.ui.tooling.preview.Preview
 import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
 import androidx.lifecycle.Lifecycle
 import androidx.lifecycle.flowWithLifecycle
+import com.ys.bdtp.adm.app.theme.textBlackColor
 import com.ys.bdtp.adm.app.theme.underColor
-import com.ys.bdtp.adm.app.tools.isNet
 import com.ys.bdtp.adm.mvvm.model.Data
 import com.ys.bdtp.adm.mvvm.model.State
 import com.ys.bdtp.adm.mvvm.ui.compose.*
@@ -47,19 +46,29 @@ fun Project() {
     Column(
         modifier = Modifier.fillMaxSize()
     ) {
-        Head(
-            left = {
-                ProjectHeadLeft()
-            },
-            right = {
-                HeadRight(
-                    role = { "项目管家" },
-                    click = {
-                        popupState = !popupState
-                    }
+        Head {
+            Row(
+                verticalAlignment = Alignment.CenterVertically,
+                horizontalArrangement = Arrangement.Start
+            ) {
+                Spacer(modifier = Modifier.width(32.dp))
+                Text(
+                    text = "禹数数字化交付工具",
+                    fontSize = 16.sp,
+                    color = textBlackColor,
+                    fontWeight = FontWeight.Medium
                 )
             }
-        )
+
+            Ending(
+                notice = "21",
+                role = "项目管家",
+                noticeClick = {},
+                userClick = {
+                    popupState = !popupState
+                }
+            )
+        }
 
         if (popupState) {
             LogoutPopup(

+ 0 - 31
app/src/main/java/com/ys/bdtp/adm/mvvm/ui/screen/project/ProjectHeadLeft.kt

@@ -1,31 +0,0 @@
-package com.ys.bdtp.adm.mvvm.ui.screen.project
-
-import androidx.compose.foundation.layout.Arrangement
-import androidx.compose.foundation.layout.Row
-import androidx.compose.foundation.layout.Spacer
-import androidx.compose.foundation.layout.width
-import androidx.compose.material.Text
-import androidx.compose.runtime.Composable
-import androidx.compose.ui.Alignment
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.tooling.preview.Preview
-import androidx.compose.ui.unit.dp
-import androidx.compose.ui.unit.sp
-import com.ys.bdtp.adm.app.theme.textBlackColor
-
-@Composable
-fun ProjectHeadLeft() {
-    Row(
-        verticalAlignment = Alignment.CenterVertically,
-        horizontalArrangement = Arrangement.Start
-    ) {
-        Spacer(modifier = Modifier.width(32.dp))
-        Text(text = "禹数数字化交付工具", fontSize = 16.sp, color = textBlackColor)
-    }
-}
-
-@Preview
-@Composable
-fun PreviewProjectHeadLeft() {
-    ProjectHeadLeft()
-}

+ 17 - 16
app/src/main/java/com/ys/bdtp/adm/mvvm/ui/screen/task/Task.kt

@@ -24,8 +24,9 @@ import com.ys.bdtp.adm.app.theme.underColor
 import com.ys.bdtp.adm.mvvm.model.Data
 import com.ys.bdtp.adm.mvvm.model.State
 import com.ys.bdtp.adm.mvvm.model.db.entity.task.ProjectEntity
+import com.ys.bdtp.adm.mvvm.ui.compose.Back
 import com.ys.bdtp.adm.mvvm.ui.compose.Head
-import com.ys.bdtp.adm.mvvm.ui.compose.HeadRight
+import com.ys.bdtp.adm.mvvm.ui.compose.Ending
 import com.ys.bdtp.adm.mvvm.ui.compose.LogoutPopup
 import com.ys.bdtp.adm.mvvm.ui.screen.main.*
 import com.ys.bdtp.adm.mvvm.vm.task.TaskViewModel
@@ -60,21 +61,21 @@ fun Task(projectId: String) {
 
 
     Column(modifier = Modifier.fillMaxSize().background(Color.White)) {
-        Head(
-            left = {
-                TaskHeadLeft(
-                    title = "${project?.projectName}",
-                    click = {
-                        nav.navigateUp()
-                    })
-            },
-            right = {
-                TaskHeadRight(
-                    role = { "管家" },
-                    click = { popupState = !popupState }
-                )
-            }
-        )
+        Head {
+            Back(
+                title = "${project?.projectName}",
+                back = {
+                    nav.navigateUp()
+                }
+            )
+            Ending(
+                notice = "21",
+                role = "管家",
+                noticeClick = {},
+                userClick = { popupState = !popupState }
+            )
+        }
+       
         if (popupState) {
             LogoutPopup(
                 click = {

+ 20 - 27
app/src/main/java/com/ys/bdtp/adm/mvvm/ui/screen/task/Tasks.kt

@@ -1,23 +1,10 @@
 package com.ys.bdtp.adm.mvvm.ui.screen.task
 
 import androidx.compose.foundation.background
-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.fillMaxHeight
-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.*
 import androidx.compose.foundation.lazy.LazyColumn
 import androidx.compose.material.Text
-import androidx.compose.runtime.Composable
-import androidx.compose.runtime.getValue
-import androidx.compose.runtime.mutableStateOf
-import androidx.compose.runtime.remember
-import androidx.compose.runtime.setValue
+import androidx.compose.runtime.*
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.graphics.Color
@@ -25,24 +12,30 @@ import androidx.compose.ui.text.font.FontWeight
 import androidx.compose.ui.tooling.preview.Preview
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
+import com.ys.bdtp.adm.mvvm.ui.compose.Back
+import com.ys.bdtp.adm.mvvm.ui.compose.Ending
 import com.ys.bdtp.adm.mvvm.ui.compose.Head
-import com.ys.bdtp.adm.mvvm.ui.compose.HeadLeft
-import com.ys.bdtp.adm.mvvm.ui.compose.HeadRight
+import com.ys.bdtp.adm.mvvm.ui.screen.main.LocalNavHostController
 
 @Composable
 fun Tasks() {
     var value by remember { mutableStateOf("") }
+    val nav = LocalNavHostController.current!!
     Column(modifier = Modifier.fillMaxSize().background(Color.White)) {
-        Head(
-            left = { HeadLeft("") },
-            right = {
-                HeadRight(
-                    role = { "管家" },
-                    click = { println("heiheihei") }
-                )
-            }
-        )
-
+        Head {
+            Back(
+                title = "",
+                back = {
+                    nav.navigateUp()
+                }
+            )
+            Ending(
+                notice = "21",
+                role = "管家",
+                noticeClick = {},
+                userClick = { println("heiheihei") }
+            )
+        }
         Spacer(
             modifier = Modifier.fillMaxWidth().height(1.dp).background(Color(0xFFEFF0F1))
         )