<template>
    <view class="home">
        <cu-custom class="home-custom" bgColor=".bg-sancolor"
                   bgImage="https://ahwgh.oss-cn-hangzhou.aliyuncs.com/enterprise/6525f808df760.png" :isBack="true">
            <block slot="content">安徽省农产品检测监测平台</block>
        </cu-custom>
        <view>
            <view class="cu-list menu content-box" v-for="(item, index) in sampleInfoDataList">
                <view class="cu-item" :class="menuArrow?'arrow':''">
                    <view class="content">
                        <div class="text-gray">样品名称：{{ item.name }}</div>
                        <div class="text-gray">样品来源：{{ item.source }}</div>
                        <div class="text-gray">抽样数量：{{ item.samplingNumber }}{{ item.samplingType }}</div>
                        <div class="text-gray">抽样基数：{{ item.samplingBase }}{{ item.samplingType }}</div>
                        <div class="text-gray">生产日期：{{ item.manufactureDate }}</div>
                        <div class="text-gray">抽样日期：{{ item.samplingDate }}</div>
                    </view>
                </view>
            </view>
            <!-- <view class="home-fixed" @tap="rediectHome">首页</view> -->
        </view>

    </view>
</template>


<script>

    import { _sampleInfo } from "./sample-info-model.js";

    export default {

        data() {
            return {
                sampleInfoDataList: []
            };
        },

        created() {

        },

        onLoad(options) {
            this.getSampleInfoList(options.id);
        },

        mounted() {

        },
        methods: {
            rediectHome() {
                uni.redirectTo({
                    url: "/pages/index/index"
                });
            },
            getSampleInfoList(id) {
                _sampleInfo.getAhSampleDetail(id, res => {
                    this.sampleInfoDataList = res.data.data.records;
                    console.log(this.sampleInfoDataList);
                });
            }
        }
    };

</script>

<style scoped>
    .content {
        padding: 10px;
    }

    .content-box {
        margin: 20px;
        border-radius: 5px;
    }
</style>
