鸿宇研学生前端代码
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.

229 lines
5.3 KiB

3 days ago
3 days ago
  1. <template>
  2. <view class="page__view">
  3. <navbar leftClick @leftClick="$utils.navigateBack" >
  4. <image class="icon-nav" src="@/pages_order/static/activity/icon-nav.png" mode="widthFix"></image>
  5. </navbar>
  6. <view class="main">
  7. <view class="card">
  8. <view class="card-header">申请邮寄纸质版</view>
  9. <view class="form">
  10. <uv-form
  11. ref="form"
  12. :model="form"
  13. :rules="rules"
  14. errorType="toast"
  15. >
  16. <view class="form-item">
  17. <uv-form-item prop="name" :customStyle="formItemStyle">
  18. <view class="form-item-label">
  19. <image class="icon" src="@/pages_order/static/icon-require.png" mode="widthFix"></image>
  20. 姓名
  21. </view>
  22. <view class="form-item-content">
  23. <formInput v-model="form.name"></formInput>
  24. </view>
  25. </uv-form-item>
  26. </view>
  27. <view class="form-item">
  28. <uv-form-item prop="phone" :customStyle="formItemStyle">
  29. <view class="form-item-label">
  30. <image class="icon" src="@/pages_order/static/icon-require.png" mode="widthFix"></image>
  31. 电话
  32. </view>
  33. <view class="form-item-content">
  34. <formInput v-model="form.phone"></formInput>
  35. </view>
  36. </uv-form-item>
  37. </view>
  38. <view class="form-item">
  39. <uv-form-item prop="address" :customStyle="formItemStyle">
  40. <view class="form-item-label">
  41. <image class="icon" src="@/pages_order/static/icon-require.png" mode="widthFix"></image>
  42. 邮寄地址
  43. </view>
  44. <view class="form-item-content">
  45. <formInput v-model="form.address"></formInput>
  46. </view>
  47. </uv-form-item>
  48. </view>
  49. </uv-form>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="bottom">
  54. <view class="flex btn" @click="onSubmit">提交</view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import formInput from '@/pages_order/components/formInput.vue'
  60. export default {
  61. components: {
  62. formInput,
  63. },
  64. data() {
  65. return {
  66. id: null,
  67. form: {
  68. name: null,
  69. phone: null,
  70. address: null,
  71. },
  72. rules: {
  73. 'name': {
  74. type: 'string',
  75. required: true,
  76. message: '请输入姓名',
  77. },
  78. 'phone': {
  79. type: 'string',
  80. required: true,
  81. message: '请输入电话',
  82. },
  83. 'address': {
  84. type: 'string',
  85. required: true,
  86. message: '请输入邮寄地址',
  87. },
  88. },
  89. formItemStyle: { padding: 0 },
  90. }
  91. },
  92. onLoad(arg) {
  93. const { id, pdfUrl } = arg
  94. this.id = id
  95. console.log('pdfUrl', pdfUrl)
  96. },
  97. methods: {
  98. async onSubmit() {
  99. try {
  100. await this.$refs.form.validate()
  101. const {
  102. } = this.form
  103. const params = {
  104. }
  105. // todo: fetch
  106. // await this.$fetch('updateAddress', params)
  107. uni.showToast({
  108. icon: 'success',
  109. title: '提交成功',
  110. });
  111. setTimeout(() => {
  112. this.$utils.navigateBack()
  113. }, 800)
  114. } catch (err) {
  115. console.log('onSave err', err)
  116. }
  117. },
  118. },
  119. }
  120. </script>
  121. <style lang="scss" scoped>
  122. .page__view {
  123. width: 100vw;
  124. height: 100vh;
  125. position: relative;
  126. background: linear-gradient(to right, #21FEEC, #019AF9);
  127. /deep/ .nav-bar__view {
  128. position: fixed;
  129. top: 0;
  130. left: 0;
  131. }
  132. .icon-nav {
  133. width: 392rpx;
  134. height: auto;
  135. }
  136. }
  137. .main {
  138. height: 100%;
  139. padding-top: calc(var(--status-bar-height) + 142rpx);
  140. box-sizing: border-box;
  141. }
  142. .card {
  143. width: 100%;
  144. height: 100%;
  145. padding: 40rpx;
  146. box-sizing: border-box;
  147. font-family: PingFang SC;
  148. font-weight: 400;
  149. line-height: 1.4;
  150. background: linear-gradient(#DAF3FF, #FBFEFF 90rpx, #FBFEFF);
  151. border: 2rpx solid #FFFFFF;
  152. border-radius: 48rpx;
  153. &-header {
  154. font-family: PingFang SC;
  155. font-weight: 500;
  156. font-size: 36rpx;
  157. line-height: 1.4;
  158. color: #191919;
  159. }
  160. }
  161. .form {
  162. &-item {
  163. margin-top: 32rpx;
  164. border-bottom: 2rpx solid #EEEEEE;
  165. &-label {
  166. font-family: PingFang SC;
  167. font-weight: 400;
  168. font-size: 26rpx;
  169. line-height: 1.4;
  170. color: #181818;
  171. .icon {
  172. margin-right: 8rpx;
  173. width: 16rpx;
  174. height: auto;
  175. }
  176. }
  177. &-content {
  178. }
  179. }
  180. }
  181. .bottom {
  182. position: fixed;
  183. left: 0;
  184. bottom: 0;
  185. width: 100vw;
  186. background: #FFFFFF;
  187. box-sizing: border-box;
  188. padding: 32rpx 40rpx;
  189. padding-bottom: calc(env(safe-area-inset-bottom) + 32rpx);
  190. box-sizing: border-box;
  191. .btn {
  192. width: 100%;
  193. padding: 14rpx 0;
  194. font-family: PingFang SC;
  195. font-weight: 500;
  196. font-size: 36rpx;
  197. line-height: 1.4;
  198. color: #FFFFFF;
  199. background: linear-gradient(to right, #21FEEC, #019AF9);
  200. border: 2rpx solid #00A9FF;
  201. border-radius: 41rpx;
  202. }
  203. }
  204. </style>