details.vue 2.34 KB
<template>
  <div class="microStore">
    <div class="wa-container">
      <div class="big-title">查看详情</div>
      <div class="details-content">
        <div class="content" v-for="(item,index) in detailsList" :key="index">
          <div class="list-text">
            <span class="label">{{ item.label }}:</span>
            <span class="prop" v-if="detailsRes">{{ detailsRes[item.prop] || '--' }}</span>
          </div>
        </div>
      </div>
    </div>
    <el-button  class="back-btn" @click="handleBack">返回</el-button>
  </div>
</template>

<script>
export default {
  name: "details",
  data() {
    return {
      detailsList: [
        {
          label: '项目名称',
          prop: 'bizRelName'
        },
        {
          label: '消费积分',
          prop: 'integralValue'
        },
        {
          label: '客户昵称',
          prop: 'customerWechatName'
        },
        {
          label: '手机号',
          prop: 'customerPhone'
        },
        {
          label: '核销员工',
          prop: 'verificationStaff'
        },
        {
          label: '结算状态',
          prop: 'settlementStatus'
        },
        {
          label: '核销日期',
          prop: 'verificationTime'
        },
        {
          label: '订单编号',
          prop: 'orderCode'
        }
      ],
      detailsRes: null
    }
  },
  methods: {
    getDetails(id) {
      let params = {
        id
      }
      this.$apis.pointWriteOff.pointWriteOffDetail(params).then(res => {
        res.settlementStatus = res.settlementStatus == 0 ? '未结算' : '已结算'
        this.detailsRes = res
      })
    },
    handleBack() {
      this.$router.back()
    }
  },
  created() {
    let id = this.$route.query.id || ''
    this.getDetails(id)
  }
}
</script>

<style lang="scss" scoped>
.wa-container {
  background: #FFFFFF;
  min-height: 80vh;

  .big-title {
    font-size: 16px;
    font-weight: 600;
    padding: 15px 20px;
    color: #333;
    border-bottom: 1px solid #E5E5E5;
  }

  .details-content {
    padding: 50px 120px;
    display: grid;
    grid-template-columns: 33.3% 33.3% 33.3%;

    .list-text {
      margin-bottom: 20px;
      font-size: 14px;

      .label {
        color: #666666;
      }
      .prop{
        color: #333333;
      }
    }
  }
}

.back-btn {
  margin: 16px auto;
  display: flex;
}
</style>