<template>
    <view class="h-[50px] mx-border-t bg-white mx-shadow-up fx-row fx-bet-cen px-30">
        <view class="flex-1 text-2xs text-content">
            共
            <text class="text-warning mx-5">{{ total }}</text>
            项结果
        </view>
        <view class="fx-row gap-20">
            <uv-tags shape="circle" plain text="查看志愿记录" @click="goMyVoluntary"/>
            <uv-tags shape="circle" :text="btnText" @click="$emit('preview')"/>
        </view>
    </view>
</template>

<script>
import InjectAIDataMixin from "@/pagesOther/pages/ie/entry-ai-form/components/InjectAIDataMixin";
import {useTransfer} from "@/hooks/useTransfer";

export default {
    name: "ai-form-footer",
    mixins: [InjectAIDataMixin],
    props: {
        total: {
            type: Number,
            default: 0
        }
    },
    setup() {
        const {transferTo} = useTransfer()
        return {
            transferTo
        }
    },
    computed: {
        btnText() {
            const {length} = this.cart
            return '预览志愿表' + (length ? '(' + length + ')' : '')
        }
    },
    methods: {
        goMyVoluntary() {
            this.transferTo('/pagesOther/pages/ie/entry-ai-list/entry-ai-list')
        }
    }
}
</script>

<style scoped lang="scss">
::v-deep(.uv-tags) {
    .uv-tags--medium {
        padding: 3px 10px;
    }
}
</style>
