applyfor.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view style="padding: 0 32upx;">
  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>须上传营业执照和手持身份证照</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. console.log(e);
  54. this.contacts_name = e.detail;
  55. },
  56. changenumber(e){
  57. this.contacts_phone = e.detail;
  58. },
  59. changIdcard(e) {
  60. this.contacts_number = e.detail;
  61. },
  62. changaddress(e) {
  63. this.contacts_address = e.detail;
  64. },
  65. goapply() {
  66. console.log(this.contacts_name)
  67. if(this.contacts_name == '') {
  68. this.$msg("请输入姓名");
  69. return;
  70. }else if(this.contacts_phone == '') {
  71. this.$msg("请输入电话号码");
  72. return;
  73. }else if(this.contacts_number == '') {
  74. this.$msg("请输入身份证号码");
  75. return;
  76. }else if(this.contacts_address == '') {
  77. this.$msg("请输入地址");
  78. return;
  79. }else if(this.imageList.length == 0) {
  80. this.$msg("请上传图片");
  81. return;
  82. }
  83. let licence_image = this.imageList.join(',');
  84. this.request({
  85. url: '/v2/member/application',
  86. method:'post',
  87. data: {
  88. contacts_name: this.contacts_name,
  89. contacts_phone: this.contacts_phone,
  90. contacts_number : this.contacts_number,
  91. contacts_address: this.contacts_address,
  92. join_type: 0,
  93. licence_image: licence_image
  94. },
  95. success: (res) => {
  96. if(res.data.code == 1000) {
  97. this.$msg("申请成功");
  98. setTimeout(() => {
  99. uni.navigateBack();
  100. }, 1000);
  101. }
  102. }
  103. })
  104. },
  105. getImg(e) {
  106. console.log(e);
  107. this.imageList = e;
  108. }
  109. }
  110. }
  111. </script>
  112. <style>
  113. .deepHeight {
  114. height: 108upx;
  115. width: 108upx;
  116. }
  117. </style>