<!-- pages/threshold/threshold.wxml -->
<view class="container">
  <!-- 反酸阈值卡片 -->
  <view class="card">
    <text class="title">当前反酸模型阈值</text>
    <block wx:if="{{refluxThreshold !== null}}">
      <text class="value">{{refluxThreshold}}</text>
    </block>
    <block wx:else>
      <text class="value">--</text>
    </block>

    <view class="input-area">
      <input 
        type="number" 
        value="{{newReflux}}" 
        bindinput="onInput" 
        data-type="reflux"
        placeholder="请输入新阈值"
        class="input"
        disabled="{{loading}}"
      />
      <button 
        type="primary" 
        bindtap="updateThreshold" 
        data-type="reflux"
        class="button"
        disabled="{{loading}}"
      >
        {{loading ? '加载中...' : '更新阈值'}}
      </button>
    </view>
  </view>

  <!-- 降酸阈值卡片 -->
  <view class="card">
    <text class="title">当前降酸模型阈值</text>
    <block wx:if="{{reduceThreshold !== null}}">
      <text class="value">{{reduceThreshold}}</text>
    </block>
    <block wx:else>
      <text class="value">--</text>
    </block>

    <view class="input-area">
      <input 
        type="number" 
        value="{{newReduce}}" 
        bindinput="onInput" 
        data-type="reduce"
        placeholder="请输入新阈值"
        class="input"
        disabled="{{loading}}"
      />
      <button 
        type="primary" 
        bindtap="updateThreshold" 
        data-type="reduce"
        class="button"
        disabled="{{loading}}"
      >
        {{loading ? '加载中...' : '更新阈值'}}
      </button>
    </view>
  </view>
</view>