<template>
    <div class="base-container">
        <fnHeader showDate hideSwitch></fnHeader>
        <div class="content">
            <div class="tool">
                <div class="button" @click="goBack">
                    <img src="@/assets/images/common/back-icon.png" alt="" />
                    返回
                </div>
            </div>
            <div class="medal-list">
                <div class="medal-item" v-for="(item,index) in 20" :key="index">
                    <div class="btn" :class="{active:index===0}">{{index===0?'已置顶':'设为置顶'}}</div>
                    <img class="medal" src="@/assets/images/more/medal.png" alt="" />
                    <div class="icon-name">水源洁净</div>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup>
import fnHeader from "@/components/fnHeader.vue";
import {ref} from 'vue'
import { Popup } from 'vant';
import { useRouter } from "vue-router";
const router = useRouter();

const list = ref([
    {
        isDefalut:1
    }
])

const showPopup = ref(false)

const goBack = () =>{
    router.go('-1')
}
</script>

<style lang="scss" scoped>
.base-container {
    width: 100%;
    height: 100vh;
    color: #fff;
    box-sizing: border-box;
    background: #000;
    .content {
        width: 100%;
        height: 100%;
        height: calc(100% - 74px);
        padding: 16px 20px 0 20px;
        box-sizing: border-box;
        .tool{
            padding-bottom: 24px;
            border-bottom: 1px solid #444444;
            margin-bottom: 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            .button {
                display: flex;
                align-items: center;
                justify-content: center;
                border: 1px solid rgba(255, 255, 255, 0.78);
                border-radius: 4px;
                padding: 9px;
                width: 104px;
                cursor: pointer;
                img {
                    width: 14px;
                    margin-right: 5px;
                }
            }
        }
        .medal-list{
            width: 100%;
            height: calc(100% - 65px - 24px);
            overflow-y: auto;
            display: flex;
            align-content: flex-start;
            flex-wrap: wrap;
            .medal-item{
                width: 13.7%;
                height: 220px;
                border-radius: 8px;
                position: relative;
                margin: 0 12px 12px 0;
                background: #282828;
                display: flex;
                align-items: center;
                flex-direction: column;
                justify-content: center;
                &.medal-item:nth-child(7n) {
                    margin-right: 0;
                }
                .icon-name{
                    margin-top: 18px;
                    position: relative;
                    &::before{
                        content: '';
                        position: absolute;
                        top: -16px;
                        width: 60px;
                        height: 5px;
                        border-radius: 50%;
                        background: rgba(204, 204, 204, 0.1);
                    }
                }
                .btn{
                    position: absolute;
                    cursor: pointer;
                    right: 8px;
                    top: 8px;
                    background: rgba(0, 0, 0, 0.6);
                    border-radius: 4px;
                    padding: 4px 8px;
                    color: #FFD489;
                    &.active{
                        background:#FFD489;
                        color: #000;
                    }
                }
            }
        }
    }
}
.medal-popup {
    background: transparent;
}
</style>