<template>
    <view class="copyright" @tap="jump" v-if="copyrightText.length>0">
        备案号:{{copyrightText}}
    </view>
</template>

<script lang="ts" setup>
import { onLoad } from '@dcloudio/uni-app'
import { ref } from 'vue'
import { getStorage } from '@/utils/storage'
import toast from '@/utils/toast'

interface Copyright {

}
let copyrightText = ref('蜀ICP备18030159号')

withDefaults(defineProps<Copyright>(), {
})

// 获取机型
onLoad(() => {
    let brand = getStorage('brand')
    // console.log('获取手机品牌信息',brand)
    // copyrightText.value = copyrightText.value + '-4A'  // 京西菜市门店管理
    if(brand === 'xiaomi') copyrightText.value = copyrightText.value + '4A'  // 京西菜市门店管理
    else copyrightText.value = ''
})

function jump() {
    if(copyrightText.value.length === 0) return
    uni.setClipboardData({
        data: copyrightText.value,
        success() {
            toast('复制备案号成功', 1)
        },
    })
    const timer = setTimeout(() => {
        plus.runtime.openURL('http://beian.miit.gov.cn/')
        clearTimeout(timer)
    },500)
    
}
</script>

<style lang="scss" scoped>
.copyright{
    display: flex;
    justify-content: flex-end;
    font-size: 12px;
    position: fixed;
    left: -5px;
    bottom: 10px;
    color:#9b9b9b;

    width: 750rpx;
    box-sizing: border-box;
    text-align: center;
}
</style>