<template>
  <view class="pintuanorderitem">
    <view class="top">
      <img  :src="shoppic" alt class="left" />
      <view class="right">
        <view class="shopname">{{shopname}}</view>
        <view class="pri">
          <view>
              <text class="num">{{num}}人团</text>
              <text class="money">￥{{money}}</text>
          </view>
          <view class="state">{{state}}</view>
        </view>
      </view>
    </view>
    <view class="btns">
        <view class="btn1" v-if="state=='拼团失败' && is_tuikuan == 0" @click="reboot">退款</view>
        <!-- <view class="btn" v-if="state=='已成团'">查看订单详情</view> -->
         <view class="btn" v-else @click="tiaozhuan">查看商品详情</view>
    </view>
  </view>
</template>

<script>
import {requestP} from "../../static/js/request"
export default {
  name: "pintuanorderitem",
  data(){
      return {
          status:""
      }
  },
  props:{
        shoppic:{
      type:String
  },
  shopname:{
      type:String
  },
  num:{
      type:Number
  },
  money:{
      type:Number
  },
  state:{
      type:String
  },
  sid:{

  },
  is_tuikuan:{

  },
  shopid:{

  }
  },
    mounted() {
  
  },
  methods:{
    reboot(){
      
      requestP({
        url:"pay/pay_pintuan_tuikuan",
        data:{
        pt_order_id:this.sid
        }
      }).then((res)=>{
        console.log(res)
      })
    },
    tiaozhuan(){
       uni.navigateTo({
        url:"/pages/pintuanshopdetail/pintuanshopdetail?shopid="+this.shopid
      })
    }
  }

};
</script>

<style lang="scss">
.pintuanorderitem {
  height: 322upx;
  width: 100%;
  background-color: white;
  .top {
    width: 712upx;
    height: 230upx;
    margin: 0 auto;
   margin-right: 30upx;
    display: flex;
    justify-content: space-between;
    border-bottom: 1upx solid #D7D7D7;
    .left {
      margin-left: 15upx;
      width: 170upx;
      height: 186upx;
       margin-top: 20upx;
    }
    .right {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      width: 380rpx;

      .shopname {
        color: #393939;
        font-size: 26upx;
        font-weight: 800;
        margin-top: 24upx;
      }
      .pri{
       display: flex;
       justify-content: space-between;
       margin-bottom: 40upx;
       .num{
           color: #1A1A1A;
           font-size: 24upx;
           padding-right:26upx;
       }
       .money{
           color: #FF0107;
           font-size: 36upx;
       }
        .state{
            color: #FF5001;
            font-size: 28upx;
        }
      }
    }
  }
  .btns{
      .btn{
          width: 180upx;
          height: 56upx;
          border: 1upx solid #D7D7D7;
          line-height: 56upx;
          text-align:center;
          color:#646464;
          font-size: 24upx;
          margin-top: 20upx;
          float:right;
          margin-right: 30upx;
          border-radius: 10upx;
      }
      .btn1{
          width: 142upx;
          height: 56upx;
          line-height:56upx;
          background-color: #FF5001;
          color: white;
          font-size: 24upx;
          text-align: center;
          float:right;
             margin-top: 20upx;
              margin-right: 30upx;
      }
  }
}
</style>