Register.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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="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"></step-third>
  34. </div>
  35. </div>
  36. </template>
  37. <script>
  38. import StepFirst from '~components/register-saler/register/StepFirst.vue'
  39. import StepSecond from '~components/register-saler/register/StepSecond.vue'
  40. import StepThird from '~components/register-saler/register/StepThird.vue'
  41. export default {
  42. data () {
  43. return {
  44. section: 1,
  45. checkData: {
  46. checked: false
  47. },
  48. registerData: {
  49. enterprise: {},
  50. c: false,
  51. url: ''
  52. },
  53. loginData: {
  54. isSelf: true,
  55. section: 1,
  56. enterprise: {}
  57. },
  58. cacheData: {},
  59. enterpriseData: {},
  60. businessImgUrl: ''
  61. }
  62. },
  63. components: {
  64. StepFirst,
  65. StepSecond,
  66. StepThird
  67. },
  68. computed: {
  69. user () {
  70. return this.$store.state.option.user
  71. }
  72. },
  73. created () {
  74. let ens = this.user.data.enterprises
  75. let isSelf = true
  76. let tempEnterprise = {}
  77. if (ens && ens.length) {
  78. console.log(ens)
  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.name) {
  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. .x-step .x-split {
  136. float: right;
  137. }
  138. .x-step li.active .x-split:before {
  139. border-left-color: #5078cb;
  140. right: -17px;
  141. z-index: 4;
  142. }
  143. .x-step li .x-split:before {
  144. border-left-color: #e8e8e8;
  145. right: -16px;
  146. z-index: 2;
  147. }
  148. .x-step .x-split:before {
  149. border-left-color: #e8e8e8;
  150. right: -20px;
  151. z-index: 2;
  152. }
  153. .x-step li .x-split:after {
  154. border-left-color: #fff;
  155. right: -18px;
  156. z-index: 1;
  157. }
  158. .x-step .x-split:after {
  159. /*border-left-color: #e8e8e8;*/
  160. right: -17px;
  161. z-index: 1;
  162. }
  163. .x-step li.active:after {
  164. border-left-color: #5078cb;
  165. right: -17px;
  166. }
  167. .x-step li.active:before {
  168. /*border-left-color: #e8e8e8;*/
  169. left: -17px;
  170. z-index: 3;
  171. }
  172. .x-step li:first-child:before, .x-step li:last-child:after {
  173. border-width: 0;
  174. }
  175. .x-step li.active:before, .x-step li.active:after, .x-step .x-split:before, .x-step .x-split:after {
  176. position: absolute;
  177. top: 0;
  178. display: inline-block;
  179. border-top: 17px solid transparent;
  180. border-bottom: 17px solid transparent;
  181. border-left: 17px solid transparent;
  182. content: '';
  183. }
  184. .brand-type .brand-small-img .preview {
  185. line-height: 84px;
  186. }
  187. </style>