DivisionTestStep2Allocate.vue 1.73 KB
<template>
  <div class="division-test-step2">
    <div class="merchant-grid">
      <div
        v-for="(item, index) in merchants"
        :key="merchantKey(item, index)"
        class="merchant-grid-item"
      >
        <p class="merchant-name">
          <span class="bullet">•</span>{{ item.merchantName }}
        </p>
        <div v-if="item.testCompleted" class="completed-tag">已完成测试</div>
        <el-input
          v-else
          :value="item.displayDivisionMoney"
          size="small"
          disabled
          placeholder="请输入分润金额"
        />
      </div>
    </div>
    <p class="step2-hint">
      设置待测试商户的分润金额<br>
      说明:分润总金额必须等于3.5元,最后一个商户默认承担手续费
    </p>
  </div>
</template>

<script>
export default {
  name: 'DivisionTestStep2Allocate',
  props: {
    merchants: {
      type: Array,
      default: () => []
    }
  },
  methods: {
    merchantKey(item, index) {
      return item.merchantId ?? item.merchantName ?? index
    }
  }
}
</script>

<style scoped lang="scss">
.division-test-step2 {
  background: #f5f7fa;
  border-radius: 8px;
  padding: 24px 32px 20px;
  min-height: 280px;
}

.merchant-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 40px;
  max-width: 640px;
  margin: 0 auto;
}

.merchant-grid-item {
  .merchant-name {
    margin: 0 0 8px;
    font-size: 14px;
    color: #333;

    .bullet {
      margin-right: 4px;
      color: #666;
    }
  }

  .completed-tag {
    height: 32px;
    line-height: 32px;
    font-size: 14px;
    color: #2b58ad;
    padding-left: 8px;
  }
}

.step2-hint {
  text-align: center;
  font-size: 12px;
  color: #666;
  line-height: 1.6;
  margin: 24px 0 0;
}
</style>