与牧同行-小程序用户端
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.

162 lines
4.9 KiB

  1. <view class="xqbox">
  2. <!-- 表单内容 -->
  3. <scroll-view class="page-content" scroll-y>
  4. <form bindsubmit="submitForm">
  5. <!-- 宠物类型 -->
  6. <view class="form-section">
  7. <view class="section-header">
  8. <view class="section-title">
  9. <text>牲畜类型</text>
  10. </view>
  11. <text class="section-required">必填</text>
  12. </view>
  13. <input
  14. class="form-input"
  15. name="petType"
  16. placeholder="请输入牲畜品种(如:山羊、奶牛)"
  17. value="{{formData.petType}}"
  18. bindinput="onPetTypeInput"
  19. maxlength="20"
  20. />
  21. </view>
  22. <!-- 宠物信息 -->
  23. <view class="form-section">
  24. <view class="section-header">
  25. <view class="section-title">
  26. <text>宠物信息</text>
  27. </view>
  28. <text class="section-required">必填</text>
  29. </view>
  30. <view class="info-grid">
  31. <!-- 年龄 -->
  32. <view class="info-item">
  33. <view class="item-label">
  34. <text>年龄</text>
  35. </view>
  36. <view class="item-input-wrapper">
  37. <input
  38. class="item-input"
  39. name="petAge"
  40. type="digit"
  41. placeholder="0"
  42. value="{{formData.petAge}}"
  43. bindinput="onPetAgeInput"
  44. />
  45. <text class="input-unit">岁</text>
  46. </view>
  47. </view>
  48. <!-- 性别 -->
  49. <view class="info-item">
  50. <view class="item-label">
  51. <text>性别</text>
  52. </view>
  53. <view class="gender-buttons">
  54. <view
  55. class="gender-btn {{formData.petGender === '公' ? 'active' : ''}}"
  56. data-value="公"
  57. bindtap="selectGender"
  58. >
  59. <text>公</text>
  60. </view>
  61. <view
  62. class="gender-btn {{formData.petGender === '母' ? 'active' : ''}}"
  63. data-value="母"
  64. bindtap="selectGender"
  65. >
  66. <text>母</text>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <!-- 症状描述 -->
  73. <view class="form-section">
  74. <view class="section-header">
  75. <view class="section-title">
  76. <text>症状描述</text>
  77. </view>
  78. <text class="section-required">必填</text>
  79. </view>
  80. <view class="symptom-box">
  81. <textarea
  82. class="symptom-textarea"
  83. name="symptoms"
  84. placeholder="请详细描述宠物的症状,包括持续时间、频率、具体表现等..."
  85. value="{{formData.symptoms}}"
  86. bindinput="onSymptomsInput"
  87. maxlength="500"
  88. auto-height
  89. />
  90. <view class="textarea-counter">
  91. <text>{{symptomsLength}}/500</text>
  92. </view>
  93. </view>
  94. </view>
  95. <!-- 图片上传 -->
  96. <view class="form-section">
  97. <view class="section-header">
  98. <view class="section-title">
  99. <text>上传图片</text>
  100. </view>
  101. <text class="section-optional">可选</text>
  102. </view>
  103. <view class="upload-tips">
  104. <text>最多可上传3张图片,用于帮助医生更直观了解病情</text>
  105. </view>
  106. <view class="image-upload-grid">
  107. <!-- 已上传图片 -->
  108. <block wx:for="{{formData.images}}" wx:key="*this">
  109. <view class="image-preview">
  110. <image
  111. class="preview-image"
  112. src="{{item}}"
  113. mode="aspectFill"
  114. bindtap="previewImage"
  115. data-url="{{item}}"
  116. data-urls="{{formData.images}}"
  117. ></image>
  118. <view class="remove-overlay" data-index="{{index}}" bindtap="removeImage">
  119. <image class="remove-icon" src="/pagesA/images/ch.png"></image>
  120. </view>
  121. </view>
  122. </block>
  123. <!-- 上传按钮 -->
  124. <view
  125. class="upload-btn"
  126. wx:if="{{formData.images.length < 3}}"
  127. bindtap="chooseImage"
  128. >
  129. <view class="upload-icon-wrapper">
  130. <image class="upload-icon" src="/pagesA/images/jh.png"></image>
  131. </view>
  132. <text class="upload-text">上传图片</text>
  133. </view>
  134. </view>
  135. </view>
  136. <!-- 提交按钮 -->
  137. <view class="submit-section">
  138. <button
  139. class="submit-btn"
  140. type="primary"
  141. formType="submit"
  142. loading="{{isSubmitting}}"
  143. disabled="{{isSubmitting || !isFormValid}}"
  144. >
  145. {{isSubmitting ? '提交中...' : '提交问诊单'}}
  146. </button>
  147. </view>
  148. </form>
  149. </scroll-view>
  150. </view>