<template>
    <view class="container">
        <!-- 供销社列表 -->
        <view class="rnwdList" v-for="(item, index) in list" :key="index">
            <view @tap="goDetails(item.id)" class="cooperativeImgBox">
                <image :src="loadImgSrc('/snbj.png')" class="cooperativeImg"></image>
                <!--<image :src="loadImgSrc(item.imgUrl)" class="cooperativeImg"></image>-->
            </view>
            <view @tap="goDetails(item.id)" class="cooperativeBox">
                <view class="list">
                    <span class="listTitle">{{ item.name }}</span>
                    <view class="jlSj">
                        <span class="jf">
                            {{ item.address?item.address:'' }}
                        </span>
                    </view>
                </view>
            </view>
            <em class="iconfont icon-xiangyoujiantou"></em>
        </view>
    </view>
</template>

<script>
import { getList, getDetails } from '@/api/cooperative/cooperative';
export default {
    data() {
        return {
            list: [
                {
                    name:"-",
                    address:"-",
                    chargePeople:"-",
                    chargePhone:"-",
                    imgUrl:"-"
                }
            ],
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad(options) {
        this.getList();
    },
    methods: {
        /** 查询列表 */
        getList(type) {
            this.loading = true;
            getList().then(response => {
                this.list = response.rows;
            });
        },
        /** 查询详情 */
        goDetails(id) {
            uni.navigateTo({
                url: '/pages/cooperative/details?id='+id
            });
        }
    }
};
</script>
<style>
@import './cooperative.css';
</style>
