Register.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. <choose-storetype v-show="section == 3"
  27. @sectionEvent="sectionChange"
  28. >
  29. </choose-storetype>
  30. <step-third v-show="section == 4"
  31. @sectionEvent="sectionChange"
  32. :registerData="registerData"
  33. :enterpriseData="enterpriseData"
  34. :checkData="checkData"
  35. :businessImgUrl="businessImgUrl"
  36. @businessImgUrlAction="onBusinessImgUrl"
  37. :loginData="loginData"
  38. :tab="tab"></step-third>
  39. </div>
  40. </div>
  41. </template>
  42. <script>
  43. import StepFirst from '~components/mobile/register-saler/register/StepFirst.vue'
  44. import StepSecond from '~components/mobile/register-saler/register/StepSecond.vue'
  45. import StepThird from '~components/mobile/register-saler/register/StepThird.vue'
  46. import chooseStoretype from '~components/mobile/register-saler/register/chooseStoretype.vue'
  47. export default {
  48. data () {
  49. return {
  50. tab: 'ORIGINAL_FACTORY',
  51. section: 1,
  52. checkData: {
  53. checked: false
  54. },
  55. registerData: {
  56. enterprise: {},
  57. c: false,
  58. url: ''
  59. },
  60. loginData: {
  61. isSelf: true,
  62. section: 1,
  63. enterprise: {}
  64. },
  65. cacheData: {},
  66. enterpriseData: {},
  67. businessImgUrl: ''
  68. }
  69. },
  70. components: {
  71. StepFirst,
  72. StepSecond,
  73. StepThird,
  74. chooseStoretype
  75. },
  76. computed: {
  77. user () {
  78. return this.$store.state.option.user
  79. }
  80. },
  81. created () {
  82. let ens = this.user.data.enterprises
  83. let isSelf = true
  84. let tempEnterprise = {}
  85. if (ens && ens.length) {
  86. ens.forEach(function (item) {
  87. if (item.current) {
  88. isSelf = false
  89. tempEnterprise = item
  90. }
  91. })
  92. } else {
  93. isSelf = true
  94. }
  95. if (!isSelf) { // 是企业
  96. this.$http.get('/basic/enterprise/' + tempEnterprise.uu + '/info')
  97. .then(response => {
  98. this.enterpriseData = response.data
  99. this.section = 1
  100. this.checkData.checked = false
  101. })
  102. } else { // 是个人
  103. this.$http.get('/basic/user/userCacheEnterprise')
  104. .then(response => {
  105. if (!response.data.name) {
  106. this.section = 1
  107. this.checkData.checked = false
  108. } else if (!response.data.enIsRead) {
  109. this.section = 2
  110. this.checkData.checked = false
  111. this.enterpriseData = response.data
  112. } else if (response.data.enIsRead) {
  113. this.section = 3
  114. this.checkData.checked = true
  115. this.enterpriseData = response.data
  116. }
  117. })
  118. }
  119. this.loginData.isSelf = isSelf
  120. this.loginData.section = this.section
  121. this.loginData.enterprise = tempEnterprise
  122. },
  123. methods: {
  124. sectionChange: function (num, tab) {
  125. this.section = num
  126. if (tab) {
  127. this.tab = tab
  128. }
  129. },
  130. onRegister: function (data) {
  131. this.registerData.isValidRegister = data.isValidRegister
  132. this.registerData.enterprise = data.enterprise
  133. this.registerData.url = data.url
  134. },
  135. onCacheData: function (cache) {
  136. this.cacheData = cache
  137. },
  138. onBusinessImgUrl: function (url) {
  139. this.businessImgUrl = url
  140. }
  141. }
  142. }
  143. </script>
  144. <style>
  145. </style>