<template>
  <view class="pintuanshopdetail">
    <!-- "../../static/img/shoplb.png,../../static/img/caricon.png,../../static/img/caricon1.png" -->
    <pintuanshoptop
      :picarr="shopinfo.imgs"
      :money="shopinfo.price"
      :huaxian="shopinfo.price_h"
      :yituan="shopinfo.yp_num"
      :tuantotal="shopinfo.kp_num"
      :shopname="shopinfo.goods_name"
      ensurepic="../../static/img/pintuanensure.png"
      ensures="全正品,价格低,放心购,快送达"
    ></pintuanshoptop>
    <pintuanline1></pintuanline1>
    <pintuanshopdetailale ale="所有用户都能够开团，但是只有没有在养车购买过商品的用户才能参团哦，快邀请新朋友来参加吧~"></pintuanshopdetailale>
    <pintuanline1></pintuanline1>
    <view class="top">
      <pintuanlisttop :title1="shopinfo.rs_num+'人在开团'"></pintuanlisttop>
    </view>
    <pintuanshopdetaillist :pintuanlist="pintuanlist" @cantuan="cantuan" @getorderid="getorderid"></pintuanshopdetaillist>
    <pintuanline1></pintuanline1>
    <pintuanrule></pintuanrule>
    <view class="line1">
      <pintuanline1></pintuanline1>
    </view>
    <pintuanshopdetailbottom :dan="shopinfo.price_y" :pin="shopinfo.price" class="bottom" @dandu="buy" @group="group"></pintuanshopdetailbottom>
     <view class="choosesize">
      <shopdetailchoosesize
         :ifchoose="ifchoose"
        @close="guanbi"
        :shoppic="shopinfo.imgs[0].img_path"
        :price="shoptype != 0?shopinfo.price:shopinfo.price_y"
        :huaxian="shopinfo.price_y"
        :tags="guige"
        @tagchange="tagchange"
        :shoptype="shoptype"
        :ptid="shopinfo.goods_pt_id"
        :kucun="shopinfo.kp_num"
        :ptorderid="ptorderid"
        :shopid="shopinfo.goods_id"
      ></shopdetailchoosesize>
    </view>
  </view>
</template>

<script>
import pintuanshoptop from "../../components/pintuanshopdetail/pintuanshopdetail-top";
import pintuanshopdetailale from "../../components/pintuanshopdetail/pintuandetail-ale";
import pintuanshopdetaillist from "../../components/pintuanshopdetail/pintuandetail-list";
import pintuanlisttop from "../../components/pintuanshopdetail/pintuanlisttop";
import pintuanrule from "../../components/pintuanshopdetail/pintuanrule";
import pintuanline1 from "../../components/pintuanshopdetail/pintuanline1";
import pintuanshopdetailbottom from "../../components/pintuanshopdetail/pintuandetail-bottom";
import shopdetailchoosesize from "../../components/shopdetail/shopdetail-choosesize";
import requestP from "../../static/js/request.js";
export default {
  components: {
    pintuanshoptop,
    pintuanshopdetailale,
    pintuanshopdetaillist,
    pintuanlisttop,
    pintuanrule,
    pintuanline1,
    pintuanshopdetailbottom,
    shopdetailchoosesize
  },
  data(){
    return{
      pintuanlist:[
      //   {touxiang:"../../static/img/pintuanuser.png",username:"Awen",cha:3,hour:5,minute:12,second:40},
      // {touxiang:"../../static/img/pintuanuser.png",username:"Awen",cha:3,hour:5,minute:12,second:40}
      ],
      shopinfo:"",
      lbt:"",
      ifchoose:false,
      shoptype:2,
      ptorderid:""
    }
  },
  onLoad(e){
     requestP
      .requestP({
        url: "pintuan/get_goods_info",
        data:{
          goods_pt_id:e.shopid
        }
      })
      .then((res) => {
        var lbt=[]
        console.log(res);
        this.shopinfo=res.data.data;
        for(let i in res.data.data.imgs){
          lbt.push(res.data.data.imgs[i].img_path)
          // this.lbt=this.lbt+res.data.data.imgs[i].img_path+','
        }
        this.lbt=lbt
        console.log(this.lbt,122)
        this.pintuanlist=res.data.data.pt_order
        console.log(this.pintuanlist,6666669)
        // this.shijian(res.data.data)
        this.renshuall=res.data.data.rs_num
        console.log(res.data.data.rs_num,71111)
      });
    console.log(e)
  },
  methods:{
    buy(e){
      this.shoptype=0

      // console.log(e,46464)
       this.ifchoose = e;
    },
    group(e){
      this.shoptype=2
      console.log(this.ifchoose,"lolkkll")
        this.ifchoose = e;
    },
     guanbi(e) {
      this.ifchoose = e;
    },
    cantuan(e){
        this.shoptype=4
      this.ifchoose=e;
    },
    getorderid(e){
      console.log(e,"aweds")
      this.ptorderid=e
    }
  }
};
</script>

<style lang="scss">
.pintuanshopdetail{
  padding-bottom: 120upx;
}
.line {
  margin-top: 15upx;
}
.top {
  margin-bottom: 45upx;
  border-bottom: 1upx solid #eeeeee;
}
.bottom{
  position: fixed;
  bottom: 0;
  left: 0;
}
</style>  