<template >
  <div class="panel panel-default auto repair-info-content">
    <div class="panel-body">
      <div class="panel panel-default well" v-for="row in model">
        <div class="bg-info">
          <div class="row form-group">
            <div class="col-xs-12 col-sm-12 col-md-12">
              <div class="row">
                <div class="col-xs-6 col-sm-6 col-md-6">
                  购气量: {{row.f_preamount_gas}}
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6">
                  购气金额: {{row.f_preamount}}
                </div>
                <div class="col-xs-12 col-sm-12 col-md-12">
                  购气时间: {{row.f_date}}
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <p v-show="model.length == 0 ">此用户暂无购气记录</p>
    </div>
  </div>
</template>

<script>
  import { HttpResetClass } from 'vue-client'
  export default {
    title: '查询用户',
    data () {
      return {
        model: [],
        show: false,
        row: Object
      }
    },
    props: {
      user: {
        type: Object
      },
      f_userinfo_id:''
    },
    methods: {
      getmodel () {
        let userinfoid
        if(this.f_userinfo_id){
          userinfoid = this.f_userinfo_id
        }else{
          userinfoid = this.user.f_userinfo_id
          //tag
        }
        //tag
        let http = new HttpResetClass()
        http.load('POST',`${this.$androidUtil.getProxyUrl()}/rs/logic/SaUserSellingGasInfo`, {data:{f_userinfo_code:userinfoid}}).then((row) => {
          var sellgas
          if(typeof row.data.sellgas === 'string'){
             sellgas = JSON.parse(row.data.sellgas)
          }else{
            sellgas = row.data.sellgas
          }
          this.model = sellgas.orders
        })
      }
    },
    ready () {
      if(this.f_userinfo_id){
        this.getmodel()
      }
    }
  }
</script>
<style>
  .app-botton {
    position:fixed;
    background: #87b2dd;
    color: #FFF;
    padding: 8px;
    text-align: center;
    font-size: 1.2em;
    z-index: 10;
    opacity:0.5;
    bottom: 50px;
    margin-top: -10px;
    height: 40px;
  }
</style>
