<!-- 详情页 -->
<template>
    <view class="detail">
        <!-- 三大套餐对比 -->
        <view class="menu_tmps">
            <view class="tips">
                <view class="tips-title">
                    <text class="title-text">三大套餐所有内容对比</text>
                    <image :src="lineBg" class="line" mode="widthFix"></image>
                </view>
            </view>
            <view class="menu_table">
                <view class="table-prop flex jcsb aic">
                    <view class="table-prop-item">内容板块</view>
                    <view v-for="item in tabLists" :key="item" class="table-prop-item">{{ item }}</view>
                </view>
                <view v-for="(item, index) in configs" :key="index" class="table-item">
                    <view class="table-title flex aic jcsb">
                        <text class="ttitle">{{ item.name }}</text>
                        <view class="cutout flex aic" @click="item.flag = !item.flag">
                            <text>{{ item.flag ? '展开' : '收起' }}</text>
                            <image :src="item.flag ? more_mindown : more_minup"></image>
                        </view>
                    </view>
                    <view v-if="!item.flag" v-for="(items, indexs) in item.data" :key="indexs" class="table-content">
                        <view class="row flex aic jcsb">
                            <view class="row_name">
                                <text>{{ items.name }}</text>
                            </view>
                            <view v-for="(itm, inx) in items.data" :key="inx" class="row_value">
                                <image v-if="!itm || itm == ''" :src="emptyImg" class="row_empty"></image>
                                <text v-else>{{ itm }}</text>
                            </view>
                        </view>
                    </view>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
import { home } from '@/apis/index'

export default {
    data() {
        return {
            lineBg: 'https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_line.png',
            emptyImg: 'https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_empty.png',
            tabLists: [],
            packagesEntity: [],
            configs: [],
            type: "",
        };
    },
    onLoad(options) {
        if (options.type) this.type = options.type
        this.getData()
    },
    methods: {
        // 获取列表
        getData() {
            home({ type: this.type }).then(res => {
                this.tabLists = res.packages
                this.configs = res.configs

            })
        },
    },
}
</script>
<style lang='scss' scoped>
.detail {
    width: 100%;
    // min-height: 100vh;
    background-color: #0D121A;
    // position: absolute;
    // top: 0;
    // bottom: 0;
    display: flex;
    flex-direction: column;
    padding: 96rpx 24rpx 24rpx;
}

.tips {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    .tips-title {
        display: flex;
        flex-direction: column;
        align-items: flex-end;

        .title-text {
            font-weight: bold;
            font-size: 40rpx;
            color: transparent;
            background: linear-gradient(54.35820730218651deg, #00C1FF 0%, #2FFFFC 100%);
            -webkit-background-clip: text;
        }

        .line {
            width: 112rpx;
        }
    }

    .tips-content {
        font-size: 32rpx;
        color: #F8FAFF;
        margin-top: 28rpx;

        .cantant {
            font-weight: 400;
            font-size: 32rpx;
            color: #00ECFF;
            background: linear-gradient(54.35820730218651deg, #00C1FF 0%, #2FFFFC 100%);
            -webkit-background-clip: text;
            text-decoration: underline;
            margin-left: 8rpx;
        }
    }
}

.menu_tmps {
    width: 100%;

    .menu_table {
        background: linear-gradient(180deg, rgba(9, 155, 255, 0.12) 0%, rgba(66, 121, 192, 0.08) 100%);
        border-radius: 24rpx;
        border: 2rpx solid #003849;
        margin-top: 48rpx;

        .table-prop {
            padding: 36rpx 40rpx;
            color: #F8FAFF;
            font-size: 24rpx;
            border-bottom: #1D3A4A 2rpx solid;
        }

        .table-item {
            padding: 40rpx;
            font-size: 24rpx;
            border-bottom: #1D3A4A 2rpx solid;

            .table-title {
                .ttitle {
                    background: linear-gradient(311.670791165708deg, #00C1FF 0%, #2FFFFC 100%);
                    -webkit-background-clip: text;
                    color: transparent;
                }

                .cutout {
                    text {
                        background: linear-gradient(54.35820730218651deg, #00C1FF 0%, #2FFFFC 100%);
                        -webkit-background-clip: text;
                        color: transparent;
                    }

                    image {
                        width: 32rpx;
                        height: 32rpx;
                        margin-left: 8rpx;
                    }
                }
            }

            .table-content {
                margin-top: 40rpx;
                color: #FFFFFF;

                .row {
                    margin-top: 40rpx;
                    width: 100%;

                    .row_name {
                        white-space: nowrap;
                        width: 15%;
                        display: flex;
                        flex-direction: column;

                        text:nth-child(2) {
                            font-size: 20rpx;
                            text-align: center;
                        }
                    }

                    .row_value {
                        width: 15%;
                        text-align: center;
                        display: flex;
                        justify-content: center;
                    }

                    .row_empty {
                        width: 32rpx;
                        height: 32rpx;
                    }
                }

                .row:nth-child(1) {
                    margin-top: 0;
                }
            }
        }

        .table-item:last-child {
            border: none;
        }
    }
}
</style>