package com.img.rabbit.pages.screen

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
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 androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.NavHostController
import androidx.navigation.compose.rememberNavController
import com.img.rabbit.R
import com.img.rabbit.route.ScreenRoute
import com.img.rabbit.viewmodel.GeneralViewModel

@Composable
fun HomeScreen(navController: NavHostController,generalViewModel: GeneralViewModel) {
    val context = LocalContext.current
    val scrollState = rememberScrollState()

    // 监听返回事件
    val currentBackStackEntry = navController.currentBackStackEntry

    LaunchedEffect(currentBackStackEntry) {
        // 当返回到MineScreen页面时执行的操作
        if (currentBackStackEntry?.destination?.route == "home") {
            // 显示TabBar
            generalViewModel.setNavigationBarVisible(true)
        }
    }

    Column(
        modifier = Modifier
            .fillMaxSize()
    ){
        Image(
            painter = painterResource(id = R.mipmap.ic_home_top_mask),
            contentDescription = null,
            contentScale = ContentScale.FillWidth,
            modifier = Modifier.fillMaxWidth()
        )
        Column (
            modifier = Modifier
                .fillMaxWidth()
                .wrapContentHeight()
                .offset(y = (-17).dp)
                .padding(bottom = 56.dp)
                .background(
                    color = Color.White,
                    shape = RoundedCornerShape(topStart = 18.dp, topEnd = 18.dp)
                )
                .verticalScroll(scrollState)
        ){
            //选尺寸制作
            Image(
                painter = painterResource(id = R.mipmap.ic_home_title_1_size),
                contentDescription = null,
                contentScale = ContentScale.Crop,
                modifier = Modifier
                    .wrapContentWidth()
                    .padding(start = 16.dp, end = 16.dp, top = 12.dp)
            )
            Row(
                modifier = Modifier
                    .fillMaxWidth()
                    .padding(start = 16.dp, end = 16.dp, top = 12.dp)
            ) {
                Box(
                    modifier = Modifier
                        .wrapContentWidth()
                        .weight(1f)
                        .clickable(
                            indication = null,
                            interactionSource = remember { MutableInteractionSource() }
                        ) {
                            // 隐藏TabBar
                            generalViewModel.setNavigationBarVisible(false)
                            // 跳转抠图页面
                            navController.apply {
                                currentBackStackEntry?.savedStateHandle?.set("width", 25f)
                                currentBackStackEntry?.savedStateHandle?.set("height", 35f)
                                navigate(ScreenRoute.Cutout.route)
                            }
                        }
                ){
                    Image(
                        painter = painterResource(id = R.mipmap.ic_home_size_bg),
                        contentDescription = null,
                    )

                    Column(
                        modifier = Modifier
                            .wrapContentSize()
                            .padding(start = 8.dp)
                            .align(Alignment.Center)
                    ) {
                        Text(
                            text = "标准一寸",
                            fontSize = 14.sp,
                            fontWeight = FontWeight.Bold,
                            color = Color(0xFF1A1A1A),
                            modifier = Modifier.wrapContentSize()
                        )
                        Text(
                            text = "25x35mm",
                            fontSize = 10.sp,
                            fontWeight = FontWeight.Normal,
                            color = Color(0xFF767676),
                            modifier = Modifier.wrapContentSize()
                        )
                    }
                }
                Box(
                    modifier = Modifier
                        .width(10.dp)
                )
                Box(
                    modifier = Modifier
                        .wrapContentWidth()
                        .weight(1f)
                        .clickable(
                            indication = null,
                            interactionSource = remember { MutableInteractionSource() }
                        ) {
                            // 隐藏TabBar
                            generalViewModel.setNavigationBarVisible(false)
                            // 跳转抠图页面
                            navController.apply {
                                currentBackStackEntry?.savedStateHandle?.set("width", 22f)
                                currentBackStackEntry?.savedStateHandle?.set("height", 32f)
                                navigate(ScreenRoute.Cutout.route)
                            }
                        }
                ){
                    Image(
                        painter = painterResource(id = R.mipmap.ic_home_size_bg),
                        contentDescription = null,
                    )

                    Column(
                        modifier = Modifier
                            .wrapContentSize()
                            .padding(start = 8.dp)
                            .align(Alignment.Center)
                    ) {
                        Text(
                            text = "小一寸",
                            fontSize = 14.sp,
                            fontWeight = FontWeight.Bold,
                            color = Color(0xFF1A1A1A),
                            modifier = Modifier.wrapContentSize()
                        )
                        Text(
                            text = "22x32mm",
                            fontSize = 10.sp,
                            fontWeight = FontWeight.Normal,
                            color = Color(0xFF767676),
                            modifier = Modifier.wrapContentSize()
                        )
                    }
                }
            }
            Row(
                modifier = Modifier
                    .fillMaxWidth()
                    .padding(start = 16.dp, end = 16.dp, top = 12.dp)
            ) {
                Box(
                    modifier = Modifier
                        .wrapContentWidth()
                        .weight(1f)
                        .clickable(
                            indication = null,
                            interactionSource = remember { MutableInteractionSource() }
                        ) {
                            // 隐藏TabBar
                            generalViewModel.setNavigationBarVisible(false)
                            // 跳转抠图页面
                            navController.apply {
                                currentBackStackEntry?.savedStateHandle?.set("width", 35f)
                                currentBackStackEntry?.savedStateHandle?.set("height", 53f)
                                navigate(ScreenRoute.Cutout.route)
                            }
                        }
                ){
                    Image(
                        painter = painterResource(id = R.mipmap.ic_home_size_bg),
                        contentDescription = null,
                    )

                    Column(
                        modifier = Modifier
                            .wrapContentSize()
                            .padding(start = 8.dp)
                            .align(Alignment.Center)
                    ) {
                        Text(
                            text = "标准二寸",
                            fontSize = 14.sp,
                            fontWeight = FontWeight.Bold,
                            color = Color(0xFF1A1A1A),
                            modifier = Modifier.wrapContentSize()
                        )
                        Text(
                            text = "35x53mm",
                            fontSize = 10.sp,
                            fontWeight = FontWeight.Normal,
                            color = Color(0xFF767676),
                            modifier = Modifier.wrapContentSize()
                        )
                    }
                }
                Box(
                    modifier = Modifier
                        .width(10.dp)
                )
                Box(
                    modifier = Modifier
                        .wrapContentWidth()
                        .weight(1f)
                        .clickable(
                            indication = null,
                            interactionSource = remember { MutableInteractionSource() }
                        ) {
                            // 隐藏TabBar
                            generalViewModel.setNavigationBarVisible(false)
                            // 跳转抠图页面
                            navController.apply {
                                currentBackStackEntry?.savedStateHandle?.set("width", 33f)
                                currentBackStackEntry?.savedStateHandle?.set("height", 48f)
                                navigate(ScreenRoute.Cutout.route)
                            }
                        }
                ){
                    Image(
                        painter = painterResource(id = R.mipmap.ic_home_size_bg),
                        contentDescription = null,
                    )

                    Column(
                        modifier = Modifier
                            .wrapContentSize()
                            .padding(start = 8.dp)
                            .align(Alignment.Center)
                    ) {
                        Text(
                            text = "小二寸",
                            fontSize = 14.sp,
                            fontWeight = FontWeight.Bold,
                            color = Color(0xFF1A1A1A),
                            modifier = Modifier.wrapContentSize()
                        )
                        Text(
                            text = "33x48mm",
                            fontSize = 10.sp,
                            fontWeight = FontWeight.Normal,
                            color = Color(0xFF767676),
                            modifier = Modifier.wrapContentSize()
                        )
                    }
                }
            }


            //证据制作
            Image(
                painter = painterResource(id = R.mipmap.ic_home_title_2_certificate),
                contentDescription = null,
                contentScale = ContentScale.Crop,
                modifier = Modifier
                    .wrapContentWidth()
                    .padding(start = 16.dp, end = 16.dp, top = 18.dp)
            )
            Row(
                modifier = Modifier
                    .fillMaxWidth()
                    .padding(start = 16.dp, end = 16.dp, top = 12.dp)
            ){
                Box(
                    modifier = Modifier
                        .wrapContentWidth()
                        .weight(1f)
                        .clickable(
                            indication = null,
                            interactionSource = remember { MutableInteractionSource() }
                        ) {
                            // 隐藏TabBar
                            generalViewModel.setNavigationBarVisible(false)
                            // 跳转抠图页面
                            navController.apply {
                                currentBackStackEntry?.savedStateHandle?.set("width", 26f)
                                currentBackStackEntry?.savedStateHandle?.set("height", 32f)
                                navigate(ScreenRoute.Cutout.route)
                            }
                        }
                ) {
                    Image(
                        painter = painterResource(id = R.mipmap.ic_home_certificate_bg),
                        contentDescription = null,
                    )

                    Column(
                        modifier = Modifier
                            .wrapContentSize()
                            .padding(start = 8.dp)
                            .align(Alignment.Center)
                    ) {
                        Text(
                            text = "身份证",
                            fontSize = 12.sp,
                            fontWeight = FontWeight.Bold,
                            color = Color(0xFF1A1A1A),
                            modifier = Modifier.wrapContentSize()
                        )
                        Text(
                            text = "26x32mm",
                            fontSize = 10.sp,
                            fontWeight = FontWeight.Normal,
                            color = Color(0xFFAAAAAA),
                            modifier = Modifier.wrapContentSize()
                        )
                    }
                }
                Box(
                    modifier = Modifier
                        .width(8.dp)
                )
                Box(
                    modifier = Modifier
                        .wrapContentWidth()
                        .weight(1f)
                        .clickable(
                            indication = null,
                            interactionSource = remember { MutableInteractionSource() }
                        ) {
                            // 隐藏TabBar
                            generalViewModel.setNavigationBarVisible(false)
                            // 跳转抠图页面
                            navController.apply {
                                currentBackStackEntry?.savedStateHandle?.set("width", 33f)
                                currentBackStackEntry?.savedStateHandle?.set("height", 48f)
                                navigate(ScreenRoute.Cutout.route)
                            }
                        }
                ) {
                    Image(
                        painter = painterResource(id = R.mipmap.ic_home_certificate_bg),
                        contentDescription = null,
                    )

                    Column(
                        modifier = Modifier
                            .wrapContentSize()
                            .padding(start = 8.dp)
                            .align(Alignment.Center)
                    ) {
                        Text(
                            text = "护照",
                            fontSize = 12.sp,
                            fontWeight = FontWeight.Bold,
                            color = Color(0xFF1A1A1A),
                            modifier = Modifier.wrapContentSize()
                        )
                        Text(
                            text = "33x48mm",
                            fontSize = 10.sp,
                            fontWeight = FontWeight.Normal,
                            color = Color(0xFFAAAAAA),
                            modifier = Modifier.wrapContentSize()
                        )
                    }
                }
                Box(
                    modifier = Modifier
                        .width(8.dp)
                )
                Box(
                    modifier = Modifier
                        .wrapContentWidth()
                        .weight(1f)
                        .clickable(
                            indication = null,
                            interactionSource = remember { MutableInteractionSource() }
                        ) {
                            // 隐藏TabBar
                            generalViewModel.setNavigationBarVisible(false)
                            // 跳转抠图页面
                            navController.apply {
                                currentBackStackEntry?.savedStateHandle?.set("width", 22f)
                                currentBackStackEntry?.savedStateHandle?.set("height", 32f)
                                navigate(ScreenRoute.Cutout.route)
                            }
                        }
                ) {
                    Image(
                        painter = painterResource(id = R.mipmap.ic_home_certificate_bg),
                        contentDescription = null,
                    )

                    Column(
                        modifier = Modifier
                            .wrapContentSize()
                            .padding(start = 8.dp)
                            .align(Alignment.Center)
                    ) {
                        Text(
                            text = "驾驶证",
                            fontSize = 12.sp,
                            fontWeight = FontWeight.Bold,
                            color = Color(0xFF1A1A1A),
                            modifier = Modifier.wrapContentSize()
                        )
                        Text(
                            text = "22x32mm",
                            fontSize = 10.sp,
                            fontWeight = FontWeight.Normal,
                            color = Color(0xFFAAAAAA),
                            modifier = Modifier.wrapContentSize()
                        )
                    }
                }
                Box(
                    modifier = Modifier
                        .width(8.dp)
                )
                Box(
                    modifier = Modifier
                        .wrapContentWidth()
                        .weight(1f)
                        .clickable(
                            indication = null,
                            interactionSource = remember { MutableInteractionSource() }
                        ) {
                            // 隐藏TabBar
                            generalViewModel.setNavigationBarVisible(false)
                            // 跳转抠图页面
                            navController.apply {
                                currentBackStackEntry?.savedStateHandle?.set("width", 26f)
                                currentBackStackEntry?.savedStateHandle?.set("height", 32f)
                                navigate(ScreenRoute.Cutout.route)
                            }
                        }
                ) {
                    Image(
                        painter = painterResource(id = R.mipmap.ic_home_certificate_bg),
                        contentDescription = null,
                    )

                    Column(
                        modifier = Modifier
                            .wrapContentSize()
                            .padding(start = 8.dp)
                            .align(Alignment.Center)
                    ) {
                        Text(
                            text = "社保卡",
                            fontSize = 12.sp,
                            fontWeight = FontWeight.Bold,
                            color = Color(0xFF1A1A1A),
                            modifier = Modifier.wrapContentSize()
                        )
                        Text(
                            text = "26x32mm",
                            fontSize = 10.sp,
                            fontWeight = FontWeight.Normal,
                            color = Color(0xFFAAAAAA),
                            modifier = Modifier.wrapContentSize()
                        )
                    }
                }

            }
            Row(
                modifier = Modifier
                    .fillMaxWidth()
                    .padding(start = 16.dp, end = 16.dp, top = 12.dp)
            ){
                Box(
                    modifier = Modifier
                        .wrapContentWidth()
                        .weight(1f)
                        .clickable(
                            indication = null,
                            interactionSource = remember { MutableInteractionSource() }
                        ) {
                            // 隐藏TabBar
                            generalViewModel.setNavigationBarVisible(false)
                            // 跳转抠图页面
                            navController.apply {
                                currentBackStackEntry?.savedStateHandle?.set("width", 26f)
                                currentBackStackEntry?.savedStateHandle?.set("height", 32f)
                                navigate(ScreenRoute.Cutout.route)
                            }
                        }
                ) {
                    Image(
                        painter = painterResource(id = R.mipmap.ic_home_certificate_bg),
                        contentDescription = null,
                    )

                    Column(
                        modifier = Modifier
                            .wrapContentSize()
                            .padding(start = 8.dp)
                            .align(Alignment.Center)
                    ) {
                        Text(
                            text = "四六级",
                            fontSize = 12.sp,
                            fontWeight = FontWeight.Bold,
                            color = Color(0xFF1A1A1A),
                            modifier = Modifier.wrapContentSize()
                        )
                        Text(
                            text = "26x32mm",
                            fontSize = 10.sp,
                            fontWeight = FontWeight.Normal,
                            color = Color(0xFFAAAAAA),
                            modifier = Modifier.wrapContentSize()
                        )
                    }
                }
                Box(
                    modifier = Modifier
                        .width(8.dp)
                )
                Box(
                    modifier = Modifier
                        .wrapContentWidth()
                        .weight(1f)
                        .clickable(
                            indication = null,
                            interactionSource = remember { MutableInteractionSource() }
                        ) {
                            // 隐藏TabBar
                            generalViewModel.setNavigationBarVisible(false)
                            // 跳转抠图页面
                            navController.apply {
                                currentBackStackEntry?.savedStateHandle?.set("width", 33f)
                                currentBackStackEntry?.savedStateHandle?.set("height", 48f)
                                navigate(ScreenRoute.Cutout.route)
                            }
                        }
                ) {
                    Image(
                        painter = painterResource(id = R.mipmap.ic_home_certificate_bg),
                        contentDescription = null,
                    )

                    Column(
                        modifier = Modifier
                            .wrapContentSize()
                            .padding(start = 8.dp)
                            .align(Alignment.Center)
                    ) {
                        Text(
                            text = "司法考试",
                            fontSize = 12.sp,
                            fontWeight = FontWeight.Bold,
                            color = Color(0xFF1A1A1A),
                            modifier = Modifier.wrapContentSize()
                        )
                        Text(
                            text = "33x48mm",
                            fontSize = 10.sp,
                            fontWeight = FontWeight.Normal,
                            color = Color(0xFFAAAAAA),
                            modifier = Modifier.wrapContentSize()
                        )
                    }
                }
                Box(
                    modifier = Modifier
                        .width(8.dp)
                )
                Box(
                    modifier = Modifier
                        .wrapContentWidth()
                        .weight(1f)
                        .clickable(
                            indication = null,
                            interactionSource = remember { MutableInteractionSource() }
                        ) {
                            // 隐藏TabBar
                            generalViewModel.setNavigationBarVisible(false)
                            // 跳转抠图页面
                            navController.apply {
                                currentBackStackEntry?.savedStateHandle?.set("width", 40f)
                                currentBackStackEntry?.savedStateHandle?.set("height", 60f)
                                navigate(ScreenRoute.Cutout.route)
                            }
                        }
                ) {
                    Image(
                        painter = painterResource(id = R.mipmap.ic_home_certificate_bg),
                        contentDescription = null,
                    )

                    Column(
                        modifier = Modifier
                            .wrapContentSize()
                            .padding(start = 8.dp)
                            .align(Alignment.Center)
                    ) {
                        Text(
                            text = "结婚证",
                            fontSize = 12.sp,
                            fontWeight = FontWeight.Bold,
                            color = Color(0xFF1A1A1A),
                            modifier = Modifier.wrapContentSize()
                        )
                        Text(
                            text = "40x60mm",
                            fontSize = 10.sp,
                            fontWeight = FontWeight.Normal,
                            color = Color(0xFFAAAAAA),
                            modifier = Modifier.wrapContentSize()
                        )
                    }
                }
                Box(
                    modifier = Modifier
                        .width(8.dp)
                )
                Box(
                    modifier = Modifier
                        .wrapContentWidth()
                        .weight(1f)
                        .clickable(
                            indication = null,
                            interactionSource = remember { MutableInteractionSource() }
                        ) {
                            // 隐藏TabBar
                            generalViewModel.setNavigationBarVisible(false)
                            // 跳转抠图页面
                            navController.apply {
                                currentBackStackEntry?.savedStateHandle?.set("width", 35f)
                                currentBackStackEntry?.savedStateHandle?.set("height", 45f)
                                navigate(ScreenRoute.Cutout.route)
                            }
                        }
                ) {
                    Image(
                        painter = painterResource(id = R.mipmap.ic_home_certificate_bg),
                        contentDescription = null,
                    )

                    Column(
                        modifier = Modifier
                            .wrapContentSize()
                            .padding(start = 8.dp)
                            .align(Alignment.Center)
                    ) {
                        Text(
                            text = "中国签证",
                            fontSize = 12.sp,
                            fontWeight = FontWeight.Bold,
                            color = Color(0xFF1A1A1A),
                            modifier = Modifier.wrapContentSize()
                        )
                        Text(
                            text = "35x45mm",
                            fontSize = 10.sp,
                            fontWeight = FontWeight.Normal,
                            color = Color(0xFFAAAAAA),
                            modifier = Modifier.wrapContentSize()
                        )
                    }
                }
            }


            //其他
            Image(
                painter = painterResource(id = R.mipmap.ic_home_title_3_other),
                contentDescription = null,
                contentScale = ContentScale.Crop,
                modifier = Modifier
                    .wrapContentWidth()
                    .padding(start = 16.dp, end = 16.dp, top = 18.dp)
            )

            Row(
                modifier = Modifier
                    .fillMaxWidth()
                    .padding(start = 16.dp, end = 16.dp, top = 12.dp)
            ){
                Box(
                    modifier = Modifier
                        .wrapContentWidth()
                        .weight(1f)
                        .clickable(
                            indication = null,
                            interactionSource = remember { MutableInteractionSource() }
                        ) {
                            // 隐藏TabBar
                            generalViewModel.setNavigationBarVisible(false)
                            // 跳转格式页面
                            navController.navigate(ScreenRoute.LongImage.route)
                        }
                ) {

                    Column(
                        modifier = Modifier
                            .wrapContentSize()
                            .padding(start = 8.dp)
                            .align(Alignment.Center)
                    ) {
                        Image(
                            painter = painterResource(id = R.mipmap.ic_home_other_1_puzzle),
                            contentDescription = null,
                        )

                        Text(
                            text = "拼长图",
                            fontSize = 12.sp,
                            fontWeight = FontWeight.Bold,
                            color = Color(0xFF1A1A1A),
                            modifier = Modifier.wrapContentSize().padding(top = 12.dp)
                        )
                    }
                }
                Box(
                    modifier = Modifier
                        .width(8.dp)
                )
                Box(
                    modifier = Modifier
                        .wrapContentWidth()
                        .weight(1f)
                        .clickable(
                            indication = null,
                            interactionSource = remember { MutableInteractionSource() }
                        ) {
                            // 隐藏TabBar
                            generalViewModel.setNavigationBarVisible(false)
                            // 跳转格式页面
                            navController.navigate(ScreenRoute.Format.route)
                        }
                ) {
                    Column(
                        modifier = Modifier
                            .wrapContentSize()
                            .padding(start = 8.dp)
                            .align(Alignment.Center)
                    ) {
                        Image(
                            painter = painterResource(id = R.mipmap.ic_home_other_2_format),
                            contentDescription = null,
                        )

                        Text(
                            text = "格式转换",
                            fontSize = 12.sp,
                            fontWeight = FontWeight.Bold,
                            color = Color(0xFF1A1A1A),
                            modifier = Modifier.wrapContentSize().padding(top = 12.dp)
                        )
                    }
                }
                Box(
                    modifier = Modifier
                        .width(8.dp)
                )
                Box(
                    modifier = Modifier
                        .wrapContentWidth()
                        .weight(1f)
                        .clickable(
                            indication = null,
                            interactionSource = remember { MutableInteractionSource() }
                        ) {
                            // 隐藏TabBar
                            generalViewModel.setNavigationBarVisible(false)
                            // 跳转证件页面
                            navController.apply {
                                currentBackStackEntry?.savedStateHandle?.set("width", 25f)
                                currentBackStackEntry?.savedStateHandle?.set("height", 35f)
                                navigate(ScreenRoute.Resize.route)
                            }
                        }
                ) {
                    Column(
                        modifier = Modifier
                            .wrapContentSize()
                            .padding(start = 8.dp)
                            .align(Alignment.Center)
                    ) {
                        Image(
                            painter = painterResource(id = R.mipmap.ic_home_other_3_size),
                            contentDescription = null,
                        )

                        Text(
                            text = "改尺寸",
                            fontSize = 12.sp,
                            fontWeight = FontWeight.Bold,
                            color = Color(0xFF1A1A1A),
                            modifier = Modifier.wrapContentSize().padding(top = 12.dp)
                        )
                    }
                }
                Box(
                    modifier = Modifier
                        .width(8.dp)
                )
                Box(
                    modifier = Modifier
                        .wrapContentWidth()
                        .weight(1f)
                        .clickable(
                            indication = null,
                            interactionSource = remember { MutableInteractionSource() }
                        ) {
                            // 隐藏TabBar
                            generalViewModel.setNavigationBarVisible(false)
                            // 跳转拍照指南页面
                            navController.navigate(ScreenRoute.CameraGuide.route)
                        }
                ) {
                    Column(
                        modifier = Modifier
                            .wrapContentSize()
                            .padding(start = 8.dp)
                            .align(Alignment.Center)
                    ) {
                        Image(
                            painter = painterResource(id = R.mipmap.ic_home_other_4_camera),
                            contentDescription = null,
                        )

                        Text(
                            text = "拍照指南",
                            fontSize = 12.sp,
                            fontWeight = FontWeight.Bold,
                            color = Color(0xFF1A1A1A),
                            modifier = Modifier.wrapContentSize().padding(top = 12.dp)
                        )
                    }
                }

            }
            Box(
                modifier = Modifier.fillMaxWidth().height(56.dp)
            )
        }


    }
}

@Preview(showBackground = true)
@Composable
private fun PreviewHomeScreen() {
    HomeScreen(navController = rememberNavController(),generalViewModel = viewModel())
}
