四零语境前端代码仓库
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.

202 lines
4.4 KiB

  1. <template>
  2. <view class="submit-container">
  3. <!-- 主体内容 -->
  4. <view class="main-content">
  5. <!-- 表单卡片 -->
  6. <view class="form-card">
  7. <!-- 标题 -->
  8. <view class="title-section">
  9. <text class="main-title">信息填写</text>
  10. </view>
  11. <!-- 姓名 -->
  12. <view class="form-item">
  13. <text class="form-label">姓名</text>
  14. <uv-input
  15. v-model="formData.name"
  16. placeholder="请输入"
  17. border="bottom"
  18. :custom-style="{
  19. backgroundColor: '#fff',
  20. borderRadius: '12rpx',
  21. paddingLeft: '-24rpx',
  22. fontSize: '32rpx'
  23. }"
  24. ></uv-input>
  25. </view>
  26. <!-- 联系方式 -->
  27. <view class="form-item">
  28. <text class="form-label">联系方式</text>
  29. <uv-input
  30. v-model="formData.phone"
  31. placeholder="请输入"
  32. border="bottom"
  33. :custom-style="{
  34. backgroundColor: '#fff',
  35. paddingLeft: '-24rpx',
  36. fontSize: '32rpx'
  37. }"
  38. ></uv-input>
  39. </view>
  40. <!-- 个人期待 -->
  41. <view class="form-item">
  42. <text class="form-label">个人期待</text>
  43. <uv-textarea
  44. v-model="formData.expectation"
  45. placeholder="请输入"
  46. border="bottom"
  47. :auto-height="true"
  48. :custom-style="{
  49. backgroundColor: '#fff',
  50. paddingLeft: '-24rpx',
  51. fontSize: '32rpx',
  52. }"
  53. ></uv-textarea>
  54. </view>
  55. <!-- 文化背景 -->
  56. <view class="form-item">
  57. <text class="form-label">文化背景</text>
  58. <uv-textarea
  59. v-model="formData.background"
  60. placeholder="请输入"
  61. border="none"
  62. :auto-height="true"
  63. :custom-style="{
  64. backgroundColor: '#fff',
  65. paddingLeft: '-24rpx',
  66. fontSize: '32rpx',
  67. }"
  68. ></uv-textarea>
  69. </view>
  70. </view>
  71. </view>
  72. <!-- 底部固定提交栏 -->
  73. <view class="bottom-bar">
  74. <uv-button
  75. type="primary"
  76. text="提交"
  77. :custom-style="{
  78. width: '100%',
  79. height: '82rpx',
  80. borderRadius: '44rpx',
  81. backgroundColor: '#06DADC',
  82. fontSize: '36rpx',
  83. fontWeight: '500',
  84. border: '1px solid #06DADC'
  85. }"
  86. @click="handleSubmit"
  87. ></uv-button>
  88. <uv-safe-bottom></uv-safe-bottom>
  89. </view>
  90. </view>
  91. </template>
  92. <script>
  93. export default {
  94. data() {
  95. return {
  96. formData: {
  97. name: '',
  98. phone: '',
  99. expectation: '',
  100. background: ''
  101. }
  102. }
  103. },
  104. methods: {
  105. handleSubmit() {
  106. console.log('提交表单', this.formData)
  107. // 这里添加表单提交逻辑
  108. if (!this.formData.name) {
  109. uni.showToast({
  110. title: '请输入姓名',
  111. icon: 'none'
  112. })
  113. return
  114. }
  115. if (!this.formData.phone) {
  116. uni.showToast({
  117. title: '请输入联系方式',
  118. icon: 'none'
  119. })
  120. return
  121. }
  122. uni.showToast({
  123. title: '提交成功',
  124. icon: 'success'
  125. })
  126. }
  127. }
  128. }
  129. </script>
  130. <style scoped lang="scss">
  131. .submit-container {
  132. background: #F2F2F2;
  133. min-height: 100vh;
  134. display: flex;
  135. flex-direction: column;
  136. }
  137. .main-content {
  138. flex: 1;
  139. padding: 40rpx 32rpx 120rpx;
  140. }
  141. .form-card {
  142. display: flex;
  143. flex-direction: column;
  144. background: #fff;
  145. margin: 0 18rpx;
  146. height: 732rpx;
  147. border-radius: 32rpx;
  148. padding-top: 40rpx;
  149. padding-right: 32rpx;
  150. padding-bottom: 40rpx;
  151. padding-left: 32rpx;
  152. gap: 44rpx;
  153. // box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.08);
  154. .title-section {
  155. // margin-bottom: 40rpx;
  156. .main-title {
  157. font-size: 32rpx;
  158. font-weight: 500;
  159. color: $primary-text-color;
  160. line-height: 1.4;
  161. }
  162. }
  163. }
  164. .form-item {
  165. // margin-bottom: 48rpx;
  166. &:last-child {
  167. margin-bottom: 0;
  168. }
  169. .form-label {
  170. display: block;
  171. font-size: 26rpx;
  172. line-height: 1.4;
  173. color: $primary-text-color;
  174. margin-bottom: 10rpx;
  175. }
  176. }
  177. .bottom-bar {
  178. position: fixed;
  179. bottom: 0;
  180. left: 0;
  181. right: 0;
  182. background: #fff;
  183. padding: 24rpx 50rpx;
  184. z-index: 999;
  185. }
  186. </style>