Settled.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view style="padding: 0 32upx;">
  3. <van-field
  4. :value="hotel_name"
  5. placeholder="请输入酒店名称"
  6. label="酒店名称"
  7. @change="hotel_name"
  8. />
  9. <van-field
  10. :value="contacts_address"
  11. placeholder="请输入酒店地址"
  12. label="酒店地址"
  13. @change="changaddress"
  14. />
  15. <van-field
  16. :value="contacts_name"
  17. placeholder="请输入负责人姓名"
  18. label="负责人"
  19. @change="onChange"
  20. />
  21. <van-field
  22. :value="contacts_phone"
  23. placeholder="请输入负责人手机号码"
  24. label="手机号码"
  25. @change="changenumber"
  26. />
  27. <van-field
  28. :value="contacts_number"
  29. placeholder="请输入负责人身份证号码"
  30. label="身份证号码"
  31. @change="changIdcard"
  32. />
  33. <view>
  34. <uploadImage @getImg="getImg" />
  35. <view>须上传营业执照和手持身份证照</view>
  36. </view>
  37. <view class="submitRemin" @click="submitRemin">申请入驻</view>
  38. </view>
  39. </template>
  40. <script>
  41. import uploadImage from '@/component/uploadImage.vue'
  42. export default {
  43. components: {
  44. uploadImage
  45. },
  46. data(){
  47. return{
  48. imageList:[],
  49. hotel_name:'',
  50. contacts_address:'',
  51. contacts_name:'',
  52. contacts_phone:'',
  53. contacts_number:''
  54. }
  55. },
  56. methods: {
  57. hotel_name(e) {
  58. this.hotel_name = e.detail;
  59. },
  60. onChange(e) {
  61. console.log(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. console.log(e);
  75. this.imageList = e;
  76. },
  77. submitRemin() {
  78. console.log(this.contacts_name)
  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(this.contacts_number == '') {
  94. this.$msg("请输入身份证号码");
  95. return;
  96. }else if(this.imageList.length == 0) {
  97. this.$msg("请上传图片");
  98. return;
  99. }
  100. let licence_image = this.imageList.join(',');
  101. this.request({
  102. url: '/v2/member/application',
  103. method:'post',
  104. data: {
  105. contacts_name: this.contacts_name,
  106. contacts_phone: this.contacts_phone,
  107. contacts_number : this.contacts_number,
  108. contacts_address: this.contacts_address,
  109. join_type: 1,
  110. licence_image: licence_image
  111. },
  112. success: (res) => {
  113. if(res.data.code == 1000) {
  114. this.$msg("申请成功");
  115. setTimeout(() => {
  116. uni.navigateBack();
  117. }, 1000);
  118. }
  119. }
  120. })
  121. },
  122. }
  123. }
  124. </script>
  125. <style>
  126. </style>