<template>
    <view class="cert-page">
        <u-navbar
            back-icon-color="#000000"
            :background="background"
            title-color="#000"
            :border-bottom="false"
            title="我的证件"
            title-bold="true"
        ></u-navbar>
        <view class="content-cody">
            <view v-for="item,key in info.url" :key="key">
                <view class="title">{{ info.desc[key] }}</view>
                <image class="content" :src="item" mode="aspectFit"></image>
            </view>
        </view>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                info: {
                    type: "",
                    url: null
                }
            }
        },
        onLoad() {
			getApp().trackPage('我的证件详情页')
            var that = this;
            const eventChannel = this.getOpenerEventChannel()
            eventChannel.on('acceptDataFromCert', function(data) {
                try{
                    let urlArr = data.url.split(',');
                    that.info.type = data.type;
                    that.info.url = urlArr;
                    that.info.desc = data.desc;
                }catch(e){}
            })
        },
    }
</script>

<style>
    .cert-page {
        font-size: 28rpx;
        margin: 30rpx;
    }
    
    .content-cody {
        background-color: #F4F5F7;
        border-radius: 12rpx;
    }
    
    .title {
        font-size: 32rpx;
        font-weight: bold;
    }
    
    .content {
        padding-top: 30rpx;
        width:100%;
    }
</style>
