<template>
  <view>
    <proyearCarinfo :carname="carname" :carpic="carpic"></proyearCarinfo>
    <proyearChoosetitle desc="选择发动机排量"></proyearChoosetitle>
    <view v-for="(i,j) in list" :key="j" @click="toproyear(i.pailiang_id,i.pailiang)">
      <proyearChoose ifline="true" :desc="i.pailiang"></proyearChoose>
    </view>
    <!-- <proyearChoose ifline=true desc="0.8L"></proyearChoose>
     <proyearChoose ifline=true desc="0.8L"></proyearChoose>
    <proyearChoose ifline=true desc="0.8L"></proyearChoose>-->
  </view>
</template>
<script>
import proyearCarinfo from "../../components/proyear/proyear-carinfo";
import proyearChoose from "../../components/proyear/proyear-choose";
import proyearChoosetitle from "../../components/proyear/proyear-choosetitle";
import { requestP } from "../../static/js/request";
export default {
  components: {
    proyearCarinfo,
    proyearChoose,
    proyearChoosetitle
  },
  data() {
    return {
      list: [],
      title: [],
      carname: [],
      carpic: [],
      canshu: {}
    };
  },
  methods: {
    toproyear(e,f) {
      uni.navigateTo({
        url:
          "/pages/proyear/proyear?pailiangid=" +
          e +
          "&popname=" +
          this.canshu.popname +
          "&popimg=" +
          this.canshu.popimg +
          "&pinpaiid=" +
          this.canshu.pinpaiid +
          "&chexingid=" +
          this.canshu.chexingid +
          "&chexiid=" +
          this.canshu.chexiid+"&pailiang="+f
      });
    }
  },
  onLoad(a) {
    console.log(a, "fjd");
    this.canshu = a;
    this.carname = a.popname;
    this.carpic = a.popimg;
    requestP({
      url: "car/get_pailiang_list",
      data: {
        brand_id: a.pinpaiid,
        chexi_id: a.chexiid,
        chexing_id: a.chexingid
      }
    }).then(res => {
      console.log(res);
      this.list = res.data.data;
      // this.title = res.data.
    });
  }
};
</script>
<style lang="scss">
</style>