Settled.vue 3.2 KB

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