<template>
  <view class="bg-white px-40rpx" @tap="$u.route('/pageB/user_select_pro/index',{id:goods.id})">
    <view class="h-78rpx flex justify-between items-center">
      <text class="text-lg">订单编号：{{goods.sn}}</text>
      <text class="text-md text-hex-2A82E4">{{goods.status |payStatusText}}</text>
    </view>
    <u-line color="#E5E5E5" />
    <block v-for="(ite,ind) in goods.products" :key="ind">
      <view class="flex py-base">
        <u-image border-radius="10" width="160rpx" height="160rpx" :src="ite.cover" :lazy-load="true"></u-image>
        <view class="flex-1 ml-16rpx w-0">
          <view class="h-70rpx">
            <view class="line-2">{{ite.name}}</view>
          </view>
          <view class="text-right text-lg mt-20rpx"> x {{ite.quantity}} </view>
        </view>
      </view>
      <u-line color="#E5E5E5" />
    </block>
    <view class="flex items-center justify-between h-85rpx">
      <text class="text-md">{{goods.created_date}}</text>
      <text class="text-lg font-medium">共件{{total}} 应付总额：￥{{goods.total_amount}}</text>
    </view>
  </view>
</template>
<script>
  export default {
   props:{
     goods:{
       type:Object,
       default:()=>{}
     }
   },
   computed:{
     total(){
       const num=this.goods.products.reduce((pr, cu)=>{
         return pr+ cu.quantity
       },0)
       return num
     }
   }
  }
</script>
