<!--pages/device/eartag-add/eartag-add.wxml-->
<view class="eartag-add-container">
  <!-- 顶部导航 -->
  <view class="header">
    <view class="back-btn" bindtap="goBack">
      <text class="back-icon">←</text>
    </view>
    <text class="title">添加耳标</text>
    <view class="placeholder"></view>
  </view>

  <!-- 表单 -->
  <view class="form-container">
    <view class="form-item">
      <text class="label">耳标编号</text>
      <input 
        class="input" 
        placeholder="请输入耳标编号" 
        bindinput="onEartagNumberInput"
        value="{{formData.eartagNumber}}"
      />
    </view>

    <view class="form-item">
      <text class="label">主机号</text>
      <input 
        class="input" 
        placeholder="请输入主机号" 
        bindinput="onHostNumberInput"
        value="{{formData.hostNumber}}"
      />
    </view>

    <view class="form-item">
      <text class="label">初始电量</text>
      <input 
        class="input" 
        placeholder="请输入初始电量" 
        type="number"
        bindinput="onBatteryInput"
        value="{{formData.batteryLevel}}"
      />
    </view>

    <view class="form-item">
      <text class="label">备注</text>
      <textarea 
        class="textarea" 
        placeholder="请输入备注信息" 
        bindinput="onRemarkInput"
        value="{{formData.remark}}"
      />
    </view>
  </view>

  <!-- 提交按钮 -->
  <view class="submit-container">
    <view class="btn submit-btn" bindtap="onSubmit">
      <text>添加耳标</text>
    </view>
  </view>

  <!-- 加载状态 -->
  <view wx:if="{{loading}}" class="loading-container">
    <view class="loading-spinner"></view>
    <text class="loading-text">添加中...</text>
  </view>
</view>
