applyfor.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <view style="padding: 0 40upx;">
  3. <van-field
  4. :value="contacts_name"
  5. placeholder="请输入您的姓名"
  6. label="姓名"
  7. @change="onChange"
  8. />
  9. <van-field
  10. :value="contacts_phone"
  11. placeholder="请输入您的手机号码"
  12. label="手机号码"
  13. @change="changenumber"
  14. />
  15. <van-field
  16. :value="contacts_number"
  17. placeholder="请输入您的身份证号码"
  18. label="身份证号码"
  19. @change="changIdcard"
  20. />
  21. <van-field
  22. :value="contacts_address"
  23. placeholder="请输入您的联系地址"
  24. label="联系地址"
  25. @change="changaddress"
  26. />
  27. <view>
  28. <uploadImage @getImg="getImg" />
  29. <view style="padding: 15upx 0;">须上传营业执照和手持身份证照</view>
  30. </view>
  31. <view class="submitRemin" @click="goapply">申请代理</view>
  32. </view>
  33. </template>
  34. <script>
  35. import uploadImage from '@/component/uploadImage.vue'
  36. import baseUrl from '@/common/new_file.js'
  37. export default {
  38. components: {
  39. uploadImage
  40. },
  41. data(){
  42. return{
  43. name:'',
  44. imageList:[],
  45. contacts_name:'',
  46. contacts_phone:'',
  47. contacts_number:'',
  48. contacts_address:'',
  49. }
  50. },
  51. methods: {
  52. onChange(e) {
  53. this.contacts_name = e.detail;
  54. },
  55. changenumber(e){
  56. this.contacts_phone = e.detail;
  57. },
  58. changIdcard(e) {
  59. this.contacts_number = e.detail;
  60. },
  61. changaddress(e) {
  62. this.contacts_address = e.detail;
  63. },
  64. goapply() {
  65. let reg_card = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
  66. let reg_phone = /^1[3456789]\d{9}$/;
  67. if(this.contacts_name == '') {
  68. this.$msg("请输入姓名");
  69. return;
  70. }else if(this.contacts_phone == '') {
  71. this.$msg("请输入电话号码");
  72. return;
  73. }else if( !reg_phone.test(this.contacts_phone)) {
  74. this.$msg("请输入正确手机号")
  75. return;
  76. }else if(this.contacts_number == '') {
  77. this.$msg("请输入身份证号码");
  78. return;
  79. }else if( !reg_card.test(this.contacts_number)) {
  80. this.$msg("请输入正确身份证号码")
  81. return;
  82. }else if(this.contacts_address == '') {
  83. this.$msg("请输入地址");
  84. return;
  85. }else if(this.imageList.length == 0) {
  86. this.$msg("请上传图片");
  87. return;
  88. }
  89. let licence_image = this.imageList.join(',');
  90. this.request({
  91. url: '/v2/member/application',
  92. method:'post',
  93. data: {
  94. contacts_name: this.contacts_name,
  95. contacts_phone: this.contacts_phone,
  96. contacts_number : this.contacts_number,
  97. contacts_address: this.contacts_address,
  98. join_type: 0,
  99. licence_image: licence_image
  100. },
  101. success: (res) => {
  102. if(res.data.code == 1000) {
  103. this.$msg("申请成功");
  104. setTimeout(() => {
  105. uni.navigateBack();
  106. }, 1000);
  107. }
  108. }
  109. })
  110. },
  111. getImg(e) {
  112. this.imageList = e;
  113. }
  114. }
  115. }
  116. </script>
  117. <style>
  118. .deepHeight {
  119. height: 108upx;
  120. width: 108upx;
  121. }
  122. .van-cell {
  123. padding-left: 0!important;
  124. }
  125. </style>