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

251 lines
6.1 KiB

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