Register.vue 4.4 KB

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