<template>
  <div id="list-1">
    <van-row>
      <van-col span="24" class="main">
        <van-col :span="24" class="one">
          <van-col :span="24" class="list" v-for="(item, index) in list" :key="index">
            <van-col :span="24" class="name">
              {{ item.order_num }}
            </van-col>
            <van-col :span="24" class="other">
              <van-col :span="24" class="otherInfo">
                联系人：<span>{{ item.contact || '暂无' }}</span>
              </van-col>
              <van-col :span="24" class="otherInfo">
                联系电话：<span>{{ item.phone || '暂无' }}</span>
              </van-col>
            </van-col>
            <van-col :span="24" class="btn">
              <van-button type="info" size="small" @click="toView(item)">查看信息</van-button>
            </van-col>
          </van-col>
        </van-col>
      </van-col>
    </van-row>
  </div>
</template>

<script>
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'list-1',
  props: {
    list: { type: Array },
  },
  components: {},
  data: function () {
    return {};
  },
  created() {},
  methods: {
    toView(data) {
      this.$emit('toView', data);
    },
  },
  computed: {
    ...mapState(['user']),
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

<style lang="less" scoped>
.main {
  .one {
    padding: 8px 8px 0 8px;
    .list {
      background-color: #fff;
      padding: 8px;
      margin: 0 0 8px 0;
      border-radius: 5px;
      .name {
        font-size: 16px;
        margin: 0 0 5px 0;
      }
      .other {
        margin: 0 0 5px 0;
        .otherInfo {
          font-size: 14px;
          color: #666;
          margin: 0 0 5px 0;
          span {
            color: #000;
          }
        }
      }
      .btn {
        text-align: center;
      }
    }
  }
}
</style>
