Register.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <div>
  3. <!--<div class="step-menu">-->
  4. <!--<ul class="x-step">-->
  5. <!--<li :class="section >= 1?'active':''" >第一步:完善企业信息-->
  6. <!--<i class="x-split"></i></li>-->
  7. <!--<li :class="section >= 2?'active':''" >第二步:阅读相关条例-->
  8. <!--<i class="x-split"></i></li>-->
  9. <!--<li :class="section >= 3?'active':''" >第三步:提交申请</li>-->
  10. <!--</ul>-->
  11. <!--</div>-->
  12. <div class="mobile-tab-list">
  13. <step-first v-show="section == 1"
  14. @sectionEvent="sectionChange"
  15. @registerAction="onRegister"
  16. :loginData="loginData"
  17. :enterpriseData="enterpriseData"
  18. :businessImgUrl="businessImgUrl"
  19. @businessImgUrlAction="onBusinessImgUrl"
  20. @isSelfCacheDataAction="onCacheData"></step-first>
  21. <step-second v-show="section == 2"
  22. @sectionEvent="sectionChange"
  23. :checkData="checkData"
  24. :loginData="loginData"
  25. :cacheData="cacheData"></step-second>
  26. <step-third v-show="section == 3"
  27. @sectionEvent="sectionChange"
  28. :registerData="registerData"
  29. :enterpriseData="enterpriseData"
  30. :checkData="checkData"
  31. :businessImgUrl="businessImgUrl"
  32. @businessImgUrlAction="onBusinessImgUrl"
  33. :loginData="loginData"
  34. :tab="'ORIGINAL_FACTORY'"></step-third>
  35. </div>
  36. </div>
  37. </template>
  38. <script>
  39. import StepFirst from '~components/mobile/register-saler/register/StepFirst.vue'
  40. import StepSecond from '~components/mobile/register-saler/register/StepSecond.vue'
  41. import StepThird from '~components/mobile/register-saler/register/StepThird.vue'
  42. export default {
  43. data () {
  44. return {
  45. section: 1,
  46. checkData: {
  47. checked: false
  48. },
  49. registerData: {
  50. enterprise: {},
  51. c: false,
  52. url: ''
  53. },
  54. loginData: {
  55. isSelf: true,
  56. section: 1,
  57. enterprise: {}
  58. },
  59. cacheData: {},
  60. enterpriseData: {},
  61. businessImgUrl: ''
  62. }
  63. },
  64. components: {
  65. StepFirst,
  66. StepSecond,
  67. StepThird
  68. },
  69. computed: {
  70. user () {
  71. return this.$store.state.option.user
  72. }
  73. },
  74. created () {
  75. let ens = this.user.data.enterprises
  76. let isSelf = true
  77. let tempEnterprise = {}
  78. if (ens && ens.length) {
  79. ens.forEach(function (item) {
  80. if (item.current) {
  81. isSelf = false
  82. tempEnterprise = item
  83. }
  84. })
  85. } else {
  86. isSelf = true
  87. }
  88. // if (!isSelf) { // 是企业
  89. // this.$http.get('/basic/enterprise/' + tempEnterprise.uu + '/info')
  90. // .then(response => {
  91. // this.enterpriseData = response.data
  92. // this.section = 1
  93. // this.checkData.checked = false
  94. // })
  95. // } else { // 是个人
  96. // this.$http.get('/basic/user/userCacheEnterprise')
  97. // .then(response => {
  98. // if (!response.data) {
  99. // this.section = 1
  100. // this.checkData.checked = false
  101. // } else if (!response.data.enIsRead) {
  102. // this.section = 2
  103. // this.checkData.checked = false
  104. // this.enterpriseData = response.data
  105. // } else if (response.data.enIsRead) {
  106. // this.section = 3
  107. // this.checkData.checked = true
  108. // this.enterpriseData = response.data
  109. // }
  110. // })
  111. // }
  112. this.loginData.isSelf = isSelf
  113. this.loginData.section = this.section
  114. this.loginData.enterprise = tempEnterprise
  115. },
  116. methods: {
  117. sectionChange: function (num) {
  118. this.section = num
  119. },
  120. onRegister: function (data) {
  121. this.registerData.isValidRegister = data.isValidRegister
  122. this.registerData.enterprise = data.enterprise
  123. this.registerData.url = data.url
  124. },
  125. onCacheData: function (cache) {
  126. this.cacheData = cache
  127. },
  128. onBusinessImgUrl: function (url) {
  129. this.businessImgUrl = url
  130. }
  131. }
  132. }
  133. </script>
  134. <style>
  135. </style>