Register.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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" ref="clearInfo"></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. if (this.user.data.enterprise.isVendor === 313) {
  100. this.$http.get('/basic/vendor/transactionInfo').then(response => {
  101. if (response.data.isOpenStore === false) {
  102. this.section = 3
  103. this.checkData.checked = true
  104. }
  105. })
  106. } else {
  107. this.section = 1
  108. this.checkData.checked = false
  109. }
  110. })
  111. } else { // 是个人
  112. this.$http.get('/basic/user/userCacheEnterprise')
  113. .then(response => {
  114. if (!response.data.name) {
  115. this.section = 1
  116. this.checkData.checked = false
  117. } else if (!response.data.enIsRead) {
  118. this.section = 2
  119. this.checkData.checked = false
  120. this.enterpriseData = response.data
  121. } else if (response.data.enIsRead) {
  122. this.section = 3
  123. this.checkData.checked = true
  124. this.enterpriseData = response.data
  125. }
  126. })
  127. }
  128. this.loginData.isSelf = isSelf
  129. this.loginData.section = this.section
  130. this.loginData.enterprise = tempEnterprise
  131. },
  132. methods: {
  133. sectionChange: function (num, tab) {
  134. this.section = num
  135. this.tab = ''
  136. if (tab) {
  137. this.$refs.clearInfo.clearInfo()
  138. this.tab = tab
  139. }
  140. },
  141. onRegister: function (data) {
  142. this.registerData.isValidRegister = data.isValidRegister
  143. this.registerData.enterprise = data.enterprise
  144. this.registerData.url = data.url
  145. },
  146. onCacheData: function (cache) {
  147. this.cacheData = cache
  148. },
  149. onBusinessImgUrl: function (url) {
  150. this.businessImgUrl = url
  151. }
  152. }
  153. }
  154. </script>
  155. <style>
  156. </style>