enterprise-reg.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <view>
  3. <view class="box">
  4. <view class="top">
  5. <text class="title">企业注册</text>
  6. </view>
  7. <view class="item">
  8. <view class="l">企业名称:</view>
  9. <view class="r">
  10. <u-input v-model="form.name" placeholder="输入企业名称" />
  11. </view>
  12. </view>
  13. <view class="item">
  14. <view class="l">联系人:</view>
  15. <view class="r">
  16. <u-input v-model="form.dutyPeople" placeholder="输入联系人" />
  17. </view>
  18. </view>
  19. <view class="item">
  20. <view class="l">联系电话:</view>
  21. <view class="r">
  22. <u-input maxlength="11" v-model="form.phone" placeholder="输入电话号码" />
  23. </view>
  24. </view>
  25. <view class="item">
  26. <view class="l">结算方式:</view>
  27. <view class="r">
  28. <radio-group @change="payChange">
  29. <label class="radio" >
  30. <radio value="1" checked />现结
  31. </label>
  32. <label class="radio" style="margin-left: 20rpx;">
  33. <radio value="2" />月结
  34. </label>
  35. </radio-group>
  36. </view>
  37. </view>
  38. <!-- <view class="item">
  39. <view class="l">验证码:</view>
  40. <view class="r">
  41. <u-input placeholder="输入验证码"/>
  42. <view class="btn">发送</view>
  43. </view>
  44. </view> -->
  45. <view class="item">
  46. <view class="l">营业执照:</view>
  47. <view class="r">
  48. <view class="img">
  49. <!-- <u-upload max-count="1" ref="license" :file-list="imgList" :action="uploadImageUrl" width="300" height="200"></u-upload> -->
  50. <uni-file-picker
  51. v-model="imageValue"
  52. fileMediatype="image"
  53. mode="grid"
  54. limit="1"
  55. @select="select"
  56. @progress="progress"
  57. @success="success"
  58. @fail="fail"
  59. :image-styles="imageStyles"
  60. />
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="common-btn" @click="confirm">确认注册</view>
  66. </view>
  67. </template>
  68. <script>
  69. import request from '../../utils/request.js'
  70. export default {
  71. data() {
  72. return {
  73. imgList: [],
  74. imageValue:[],
  75. imageStyles:{
  76. width:150,
  77. height:100,
  78. border:{
  79. color:"#eee",
  80. width:1,
  81. style:'dashed',
  82. radius:'5px'
  83. }
  84. },
  85. imgList:[],
  86. uploadImageUrl: request.server + '/upload/image',
  87. form: {
  88. name: '',
  89. dutyPeople: '',
  90. phone: '',
  91. payType: '1',
  92. businessLicence: ''
  93. }
  94. }
  95. },
  96. methods: {
  97. payChange(e) {
  98. this.form.payType = e.detail.value
  99. // 获取上传状态
  100. select(e){
  101. console.log('选择文件:',e)
  102. },
  103. // 获取上传进度
  104. progress(e){
  105. console.log('上传进度:',e)
  106. },
  107. // 上传成功
  108. success(e){
  109. console.log('上传成功')
  110. },
  111. // 上传失败
  112. fail(e){
  113. console.log('上传失败:',e)
  114. },
  115. payChange(e){
  116. this.form.payType=e.detail.value
  117. },
  118. check() {
  119. if (!this.form.name) {
  120. this.$common.toast('请录入名称');
  121. return false;
  122. }
  123. if (!this.form.dutyPeople) {
  124. this.$common.toast('请录入负责人');
  125. return false;
  126. }
  127. if (!this.form.phone) {
  128. this.$common.toast('请录入联系号码');
  129. return false;
  130. }
  131. let licenseFiles = this.$refs.license.lists.filter(val => {
  132. return val.progress == 100;
  133. })
  134. if (licenseFiles.length > 0) {
  135. this.form.businessLicence = licenseFiles.map(obj => {
  136. if (obj.response) {
  137. return obj.response.data;
  138. } else if (obj.url) {
  139. return obj.url;
  140. }
  141. }).join(',');
  142. }
  143. return true;
  144. },
  145. confirm() {
  146. if (this.check()) {
  147. this.$api.register(this.form).then(resp => {
  148. if (resp.code == 200) {
  149. this.$common.to('/pages/ok/registerSuccess')
  150. }
  151. })
  152. }
  153. }
  154. }
  155. }
  156. </script>
  157. <style lang="scss">
  158. page {
  159. background-color: #fff;
  160. }
  161. @import '@/common/common.scss'
  162. </style>