<template>
	<view class="conent">
		<!-- <view class="con_kuo"
			@click="navigator(`/pages/nongKe/supply_chain/supplierA?tit=1&type_id=12&isDetail=1&product_type=98&cate_id=${id}`)">
			<image class="con_img" src="@/static/images/bg1.png" mode=""></image>
			<image class="con_ico" src="@/static/images/bgic1.png" mode=""></image>
			<view class="con_text">
				<h3>先款后货</h3>
				<span>先付款后发货</span>
			</view>
		</view>
		<view class="con_kuo"
			@click="navigator(`/pages/nongKe/supply_chain/supplierA?tit=2&type_id=12&isDetail=1&credit_buy=1&product_type=98&cate_id=${id}`)">
			<image class="con_img" src="@/static/images/bg3.png" mode=""></image>
			<image class="con_ico" src="@/static/images/bgic2.png" mode=""></image>
			<view class="con_text">
				<h3>先货后款</h3>
				<span>先发货后付款</span>
			</view>
		</view> -->
    <view class="con_kuo"
    v-for="(item, index) in list"
    :key="item.value"
    	@click="navigator(`/pages/nongKe/cloud_entrepot/${item.name=='现款现货'?'indexb':'indexOther'}?type_id=12&value=${item.value}&tips=${item.content}`)">
    	<image class="con_img" :src="item.bg" mode=""></image>
    	<image class="con_ico" src="@/static/images/bgic1.png" mode=""></image>
    	<view class="con_text">
    		<h3>{{item.name}}</h3>
    		<span>{{item.content}}</span>
    	</view>
    </view>
	</view>
</template>

<script>
  import { systemGroupValue } from "@/api/public.js"
	export default {
		data() {
			return {
				id: '',
        list: []
			}
		},
		onLoad(option) {
			this.id = option.cate_id;
      this.initList();
		},
		methods: {
      initList(){
        systemGroupValue({
          name: 'purchasing_navigation'
        }).then(res=>{
          res.data.forEach((item)=>{
            if(item.name=='线上铺货'){
              item.bg = 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/71e06202312151146467207.png';
              item.content = '线上选品 一键铺货';
            }
            if(item.name=='实体铺货'){
              item.bg = 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/8cb7a202312151147485701.png';
              item.content = '先售利润 后结货款';
            }
            if(item.name=='现款现货'){
              item.bg = 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/f4521202312151148087081.png';
              item.content = '先付款 后发货';
            }
            if(item.name=='赊账进货'){
              item.bg = 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/899a4202312151148319478.png';
              item.content = '先发货 后付款';
            }
          })
		  res.data = res.data.filter(item=>item.name!='线上铺货'&&item.name!='实体铺货')
          this.list = res.data;
        })
      },
			navigator(url, t) {
				uni.navigateTo({
					url: url
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	* {
		padding: 0;
		margin: 0;
	}

	.conent {
		width: 100%;
		display: flex;
		justify-content: space-evenly;
    flex-wrap: wrap;
		margin-top: 20px;

		.con_kuo {
			position: relative;

			.con_img {
				width: 360rpx;
				height: 92px;
			}

			.con_ico {
				position: absolute;
				left: 15px;
				top: 32px;
				width: 31px;
				height: 32px;
			}

			.con_text {
				position: absolute;
				left: 55px;
				top: 20px;
				color: white;
			}
		}
	}
</style>