<script setup>
import fmt from "../../../static/images/fmt.png";
import linkIcon from '../../../static/icons/link.png';
import XImage from "../../../components/XImage.vue";

const {data} = defineProps({
    data: {
        type: Object,
        default: null,
    }
});
</script>

<template>
    <!--任务详情-->
    <view class="w-full">
        <view class="title">
            案例概览
        </view>
        <view class="block items-center" v-if="data.case_url">
            <view class="block-title">任务案例:</view>
            <view class="block-info w-full overflow-hidden">
                <view class="text-[#165DFF] !flex items-center gap-[10rpx]">
                    <image class="!size-[24rpx] flex-shrink-0" :src="linkIcon"></image>
                    <text class="ellipsis-1 flex-grow">
                        {{ data.case_url }}
                    </text>
                    <view class="nowrap flex-shrink !py-[7rpx] !px-[32rpx] rounded-full bg-[#E8F3FF]"
                          style="font-size: 24rpx">
                        复制
                    </view>
                </view>
            </view>
        </view>
        <view class="block">
            <view class="block-title">素材案例:</view>
            <view class="block-info !grid grid-cols-3 gap-[20rpx]">
                <x-image
                    v-if="data.case_images_arr.length > 0"
                    class="!size-[160rpx]"
                    :src="data.case_images_arr[0]"
                    :list="data.case_images_arr"
                    :cur="0" mode="aspectFill"
                    :draggable="false">
                </x-image>
            </view>
        </view>
        <view class="block">
            <view class="block-title">评论区案例:</view>
            <view class="test-24r text-[#4E5969]">
                <view v-if="data.comment_arr">
                    评论1:
                    <text v-if="data.comment_arr.pid!==0" class="text-[#86909C]">
                        <image class="!size-[20rpx]" src="/static/icons/msgback.png"></image>
                        回复1:
                    </text>
                    {{ data.comment_arr.intro }}
                </view>
                <view v-for="(v, index) in data.comment_arr.children">
                    评论1:
                    <text v-if="data.comment_arr.pid!==0" class="text-[#86909C]">
                        <image class="!size-[20rpx]" src="/static/icons/msgback.png"></image>
                        回复1:
                    </text>
                    {{ data.comment_arr.intro }}
                </view>
            </view>
        </view>
    </view>
</template>

<style scoped lang="scss">
.title {
    color: rgb(29, 33, 41);
    font-size: 28rpx;
    font-weight: 500;
    line-height: 140%;
    letter-spacing: 0;
    text-align: left;
    margin-bottom: 32rpx;
}

.block {
    display: flex;
    gap: 20rpx;
    margin-bottom: 20rpx;

    .block-title {
        flex-shrink: 0;
        color: rgb(134, 144, 156);
        font-size: 24rpx;
        font-weight: 500;
        line-height: 140%;
        letter-spacing: 0;
        text-align: left;
        width: 130rpx;
    }

    .block-info {
        color: rgb(78, 89, 105);
        font-size: 24rpx;
        font-weight: 500;
        line-height: 140%;
        letter-spacing: 0;
    }
}
</style>
