
<template>
  <view class="form_item">
    <view class="form_item--left">
      {{ name }}
    </view>
    <view class="form_item--right">
      <view class="upop">
        <input
          type="text"
          class="title upop_input"
          v-model="valueData"
          :placeholder="placeholder"
          @input="changeInput"
        />
        <slot name="next"></slot>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    name: {
      type: String,
      default: "自提码",
    },
    placeholder: {
      type: String,
      default: "请输入自提码",
    },
  },
  data() {
    return {
      valueData: "",
    };
  },
  methods: {
    changeInput() {
      this.$emit("change", this.valueData);
    },
  },
};
</script>

<style lang="scss" scoped>
.form_item {
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100rpx;
  // border-bottom: 2rpx solid #e5e5e5;
  &--left {
    max-width: 200rpx;
    font-family: PingFangSC, PingFang SC;
    font-weight: 400;
    font-size: 30rpx;
    color: #333333;
    line-height: 30rpx;
  }
  &--right {
    flex: 1;
    padding-left: 50rpx;
    padding-right: 12rpx;
    text-align: right;
    .title {
      font-family: PingFangSC, PingFang SC;
      font-weight: 400;
      font-size: 28rpx;
      color: #999999;
    }
    .upop {
      display: flex;
      width: 100%;
      align-items: center;
      justify-content: flex-end;
      image {
        width: 30rpx;
        height: 30rpx;
        margin-left: 5rpx;
      }
      .image-box {
        width: 40rpx;
        height: 38rpx;
      }
    }
    .upop_input {
      padding: 15rpx 10rpx;
      flex: 1;
    }
    .xcv {
      flex: 1;
    }
  }
  &:last-child {
    border-bottom: none;
  }
}
</style>
