Settled.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. this.contacts_name = e.detail;
  62. },
  63. changenumber(e){
  64. this.contacts_phone = e.detail;
  65. },
  66. changIdcard(e) {
  67. this.contacts_number = e.detail;
  68. },
  69. changaddress(e) {
  70. this.contacts_address = e.detail;
  71. },
  72. getImg(e) {
  73. this.imageList = e;
  74. },
  75. submitRemin() {
  76. if(this.hotel_name == '') {
  77. this.$msg("请输入酒店名称");
  78. return;
  79. }
  80. else if(this.contacts_address == '') {
  81. this.$msg("请输入地址");
  82. return;
  83. }
  84. else if(this.contacts_name == '') {
  85. this.$msg("请输入姓名");
  86. return;
  87. }else if(this.contacts_phone == '') {
  88. this.$msg("请输入电话号码");
  89. return;
  90. }else if(this.contacts_number == '') {
  91. this.$msg("请输入身份证号码");
  92. return;
  93. }else if(this.imageList.length == 0) {
  94. this.$msg("请上传图片");
  95. return;
  96. }
  97. let licence_image = this.imageList.join(',');
  98. this.request({
  99. url: '/v2/member/application',
  100. method:'post',
  101. data: {
  102. contacts_name: this.contacts_name,
  103. contacts_phone: this.contacts_phone,
  104. contacts_number : this.contacts_number,
  105. contacts_address: this.contacts_address,
  106. join_type: 1,
  107. licence_image: licence_image
  108. },
  109. success: (res) => {
  110. if(res.data.code == 1000) {
  111. this.$msg("申请成功");
  112. setTimeout(() => {
  113. uni.navigateBack();
  114. }, 1000);
  115. }
  116. }
  117. })
  118. },
  119. }
  120. }
  121. </script>
  122. <style>
  123. </style>