<template>
    <view class="container">
        <!-- 供销社详情 -->
        <view class="cooperativeImgBox">
            <!--<image :src="loadImgSrc('/snbj.png')" class="cooperativeImg"></image>-->
            <image :src="loadImgSrc(imgUrl)" class="cooperativeImg"></image>
        </view>
        <view class="itemBox" v-for="(item, index) in list" :key="index">
            <view class="item">
                <span>
                    {{ item.title }}：
                </span>
                <span>
                    {{ item.content?item.content:'' }}
                </span>
            </view>
        </view>
    </view>
</template>

<script>
    import { getDetails } from '@/api/highFrequencyService/cooperative/cooperative';
    export default {
    data() {
        return {
            imgUrl:'-',
            list: [
                {
                    title: "名称",
                    content: "-",
                },
                {
                    title: "地址",
                    content: "-",
                },
                {
                    title: "负责人",
                    content: "-",
                },
                {
                    title: "负责人电话",
                    content: "-",
                }
            ],
            cooperative: {
                name:"第十三号供销社",
                address:"十三号街区地下研究所",
                chargePeople:"高耀",
                chargePhone:"13103215236",
                imgUrl:"/profile/upload/2024/03/01/nacos_20240301145836A002.png"
            }
        }
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad(options) {
        this.getDetails(options.id);
    },
    methods: {
        /** 详情 */
        getDetails(id) {
            getDetails(id).then(response => {
                let details = response.data;
                let list = [];
                list.push({ title:"名称", content:details.name });
                list.push({ title:"地址", content:details.address });
                list.push({ title:"负责人", content:details.chargePeople });
                list.push({ title:"负责人电话", content:details.chargePhone });
                this.list = list;
                this.imgUrl = details.imgUrl;
            });
        },
    }
};
</script>
<style>
@import './details.css';
</style>
