与牧同行-小程序用户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

114 lines
4.2 KiB

<view class="xqbox">
<!-- 表单内容 -->
<scroll-view class="page-content" scroll-y>
<form bindsubmit="submitForm">
<!-- 牲畜类型 -->
<view class="form-section">
<view class="section-header">
<view class="section-title">
<text>牲畜类型</text>
</view>
<text class="section-required">必填</text>
</view>
<input class="form-input" name="petType" placeholder="请输入牲畜品种(如:山羊、奶牛)" value="{{formData.animalType}}" bindinput="onPetTypeInput" maxlength="20" />
</view>
<!-- 牲畜信息 -->
<view class="form-section">
<view class="section-header">
<view class="section-title">
<text>牲畜信息</text>
</view>
<text class="section-required">必填</text>
</view>
<view class="info-grid">
<!-- 年龄 -->
<view class="info-item">
<view class="item-label">
<text>年龄</text>
</view>
<view class="item-input-wrapper">
<input class="item-input" name="petAge" type="digit" placeholder="例如:3岁或者3个月" value="{{formData.animalAge}}" bindinput="onPetAgeInput" />
</view>
</view>
<!-- 性别 -->
<view class="info-item">
<view class="item-label">
<text>性别</text>
</view>
<view class="gender-buttons">
<view class="gender-btn {{formData.animalGender === '公' ? 'active' : ''}}" data-value="公" bindtap="selectGender">
<text>公</text>
</view>
<view class="gender-btn {{formData.animalGender === '母' ? 'active' : ''}}" data-value="母" bindtap="selectGender">
<text>母</text>
</view>
</view>
</view>
</view>
</view>
<!-- 症状描述 -->
<view class="form-section">
<view class="section-header">
<view class="section-title">
<text>症状描述</text>
</view>
<text class="section-required">必填</text>
</view>
<view class="symptom-box">
<textarea class="symptom-textarea" name="symptoms" placeholder="请详细描述宠物的症状,包括持续时间、频率、具体表现等..." value="{{formData.description}}" bindinput="onSymptomsInput" maxlength="500" auto-height />
<view class="textarea-counter">
<text>{{symptomsLength}}/500</text>
</view>
</view>
</view>
<!-- 图片上传 -->
<view class="form-section">
<view class="section-header">
<view class="section-title">
<text>上传图片</text>
</view>
<text class="section-optional">可选</text>
</view>
<view class="upload-tips">
<text>最多可上传3张图片,用于帮助医生更直观了解病情</text>
</view>
<view class="image-upload-grid">
<!-- 已上传图片 - 使用tempImages预览 -->
<block wx:for="{{tempImages}}" wx:key="*this">
<view class="image-preview">
<image class="preview-image" src="{{item}}" mode="aspectFill" bindtap="previewImage" data-index="{{index}}"></image>
<view class="remove-overlay" data-index="{{index}}" bindtap="removeImage">
<image class="remove-icon" src="/pagesA/images/ch.png"></image>
</view>
</view>
</block>
<!-- 上传按钮 -->
<view class="upload-btn" wx:if="{{tempImages.length < 3}}" bindtap="chooseImage">
<view class="upload-icon-wrapper">
<image class="upload-icon" src="/pagesA/images/jh.png"></image>
</view>
<text class="upload-text">上传图片</text>
</view>
</view>
</view>
<!-- 提交按钮 -->
<view class="submit-section">
<button class="submit-btn" type="primary" formType="submit" loading="{{isSubmitting}}" disabled="{{isSubmitting || !isFormValid}}">
{{isSubmitting ? '提交中...' : '提交问诊单'}}
</button>
</view>
</form>
</scroll-view>
</view>