Settled.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <view style="padding: 0 32upx;">
  3. <van-field
  4. :value="name"
  5. placeholder="请输入酒店名称"
  6. label="酒店名称"
  7. />
  8. <van-field
  9. :value="name"
  10. placeholder="请输入酒店地址"
  11. label="酒店地址"
  12. />
  13. <van-field
  14. :value="name"
  15. placeholder="请输入负责人姓名"
  16. label="负责人"
  17. />
  18. <van-field
  19. :value="name"
  20. placeholder="请输入负责人手机号码"
  21. label="手机号码"
  22. />
  23. <van-field
  24. :value="name"
  25. placeholder="请输入负责人身份证号码"
  26. label="身份证号码"
  27. />
  28. <view>
  29. <view class="cell-pd">
  30. <view class="uni-uploader">
  31. <view class="uni-uploader-body">
  32. <view class="uni-uploader__files">
  33. <block v-for="(image,index) in imageList" :key="index">
  34. <view class="uni-uploader__file">
  35. <image class="uni-uploader__img" :src="image" :data-src="image" @tap="previewImage"></image>
  36. </view>
  37. </block>
  38. <view class="uni-uploader__input-box deepHeight">
  39. <view class="uni-uploader__input" @tap="chooseImage"></view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <view>须上传营业执照和手持身份证照</view>
  46. </view>
  47. <view class="submitRemin">申请入驻</view>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. data(){
  53. return{
  54. name:'',
  55. imageList:[]
  56. }
  57. },
  58. methods: {
  59. chooseImage() {
  60. if (this.imageList.length === 3) {
  61. // let isContinue = await this.isFullImg();
  62. // console.log("是否继续?", isContinue);
  63. // if (!isContinue) {
  64. // return;
  65. // }
  66. return;
  67. }
  68. uni.chooseImage({
  69. sourceType: this.sourceType,
  70. sizeType: this.sizeType,
  71. count: this.imageList.length + this.count[this.countIndex] > 3 ? 3 - this.imageList.length : this.count[this.countIndex],
  72. success: (res) => {
  73. this.imageList = this.imageList.concat(res.tempFilePaths);
  74. uni.uploadFile({
  75. url: 'https://www.example.com/upload', //仅为示例,非真实的接口地址
  76. filePath: tempFilePaths[0],
  77. name: 'file',
  78. formData: {
  79. 'user': 'test'
  80. },
  81. success: (uploadFileRes) => {
  82. console.log(uploadFileRes.data);
  83. }
  84. });
  85. }
  86. })
  87. },
  88. }
  89. }
  90. </script>
  91. <style>
  92. .deepHeight {
  93. height: 108upx;
  94. width: 108upx;
  95. }
  96. </style>