rider-recruit.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view class="flex-common-css iPhone-bottom box-border-box">
  3. <Nav title="骑手招聘" titleColor="#333" bgckgroundBox='#fff'></Nav>
  4. <scroll-view :scroll-y="true" class="scroll-view-css content-box">
  5. <image class="zp-bg" src="@/static/img/my/zp.png" mode=""></image>
  6. <view class="info-box box-border-box">
  7. <image class="sxnr mb-32" src="@/static/img/my/sxnr.png" mode=""></image>
  8. <image class="jrlc mb-48" src="@/static/img/my/jrlc.png" mode=""></image>
  9. <view class="title-box fs-36 fc-3 fw-b text-align-center mb-24">
  10. 校园实习生申请表
  11. </view>
  12. <view class="bgc-f b-rad-20 card-box box-border-box p-24">
  13. <EnRadio label='性别' :radioData='radioData' v-model="fromData.sex"></EnRadio>
  14. <view class="box-input align-items-center box-border-box p-b-20">
  15. <view class="fs-32 fw-400 w158">手机号</view>
  16. <input v-model="fromData.phone" type="number" placeholder="请输入手机号">
  17. </view>
  18. <view class="box-input align-items-center box-border-box p-b-20">
  19. <view class="fs-32 fw-400 w158">验证码</view>
  20. <input v-model="fromData.code" type="number" placeholder="请输入验证码">
  21. <view class="fs-28 fc-41ABF5 code-box" @click="getCode()">{{codeText}}{{isCode?'s':''}}</view>
  22. </view>
  23. </view>
  24. </view>
  25. </scroll-view>
  26. <view class="bot-box bgc-f" @click="save()">
  27. <view class="bot-but fc-f fs-32 text-align-center b-rad-200 bgc-4FB3EF">
  28. 提交
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import EnRadio from '@/components/en-from/en-radio/en-radio.vue';
  35. import {getCode,setRiderApply} from '@/api/common.js';
  36. import tools from "@/service/tools";
  37. export default {
  38. components: {EnRadio,},
  39. data() {
  40. return {
  41. isCode:false,
  42. isAJAX:false,
  43. codeText:'获取验证码',
  44. fromData:{
  45. sex:'',
  46. phone:'',
  47. school_id:'',
  48. code:'',
  49. },
  50. radioData:[{name:"男",id:1},{name:"女",id:2},],
  51. };
  52. },
  53. methods: {
  54. getCode(){
  55. if(!this.fromData.phone){
  56. return tools.error('请输入手机号')
  57. }
  58. if (this.isCode) {
  59. return
  60. }
  61. this.isCode = true;
  62. getCode({phone:this.fromData.phone,send_type:'rider_apply'}).then((res)=>{
  63. if(res.code === 1){
  64. this.codeText = 60;
  65. let timer = setInterval(() => {
  66. this.codeText -= 1;
  67. if (this.codeText <= 0) {
  68. clearInterval(timer);
  69. this.isCode = false;
  70. this.codeText = '获取验证码'
  71. }
  72. }, 1000);
  73. }else{
  74. this.isCode = false;
  75. tools.error('获取验证码失败,请稍后重试')
  76. }
  77. })
  78. },
  79. save(){
  80. if(this.isAJAX){
  81. return
  82. }
  83. this.isAJAX = true;
  84. this.fromData.school_id = uni.getStorageSync('school_id');
  85. setRiderApply(this.fromData).then((res)=>{
  86. if(res.code === 1){
  87. this.isAJAX = false;
  88. tools.success('提交成功');
  89. setTimeout(()=>{
  90. uni.reLaunch({
  91. url:'/pages/me/index'
  92. })
  93. },1500)
  94. }else{
  95. this.isAJAX = false;
  96. tools.error(res.msg);
  97. }
  98. })
  99. },
  100. },
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. .bot-box {
  105. width: 100%;
  106. padding: 12rpx 32rpx;
  107. box-sizing: border-box;
  108. .bot-but {
  109. width: 100%;
  110. height: 92rpx;
  111. line-height: 92rpx;
  112. }
  113. }
  114. .card-box{
  115. width: 100%;
  116. min-height: 200rpx;
  117. }
  118. .box-input{
  119. padding-top: 34rpx;
  120. padding-bottom: 34rpx;
  121. border-bottom: 2rpx solid #F0F0F0;
  122. position: relative;
  123. .w158{
  124. width: 210rpx;
  125. }
  126. input{
  127. font-size: 32rpx;
  128. }
  129. .code-box{
  130. position: absolute;
  131. right: 0;
  132. top: 34rpx;
  133. }
  134. }
  135. .content-box{
  136. position: relative;
  137. }
  138. .zp-bg{
  139. position: absolute;
  140. left: 0;
  141. top: 0;
  142. width: 100%;
  143. height: 1448rpx;
  144. z-index: 0;
  145. }
  146. .info-box{
  147. padding: 436rpx 32rpx 0;
  148. position: relative;
  149. z-index: 1;
  150. }
  151. .sxnr{
  152. width: 448rpx;
  153. height: 98rpx;
  154. }
  155. .jrlc{
  156. width: 684rpx;
  157. height: 142rpx;
  158. }
  159. .title-box{
  160. width: 320rpx;
  161. height: 72rpx;
  162. line-height: 72rpx;
  163. background: linear-gradient( 90deg, #43AFF6 0%, rgba(161,255,227,0.4) 26%, #DAE6FF 100%);
  164. border-radius: 12rpx;
  165. }
  166. </style>