Register.vue 4.8 KB

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