Register.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. ens.forEach(function (item) {
  79. if (item.current) {
  80. isSelf = false
  81. tempEnterprise = item
  82. }
  83. })
  84. } else {
  85. isSelf = true
  86. }
  87. if (!isSelf) { // 是企业
  88. this.$http.get('/basic/enterprise/' + tempEnterprise.uu + '/info')
  89. .then(response => {
  90. this.enterpriseData = response.data
  91. this.section = 1
  92. this.checkData.checked = false
  93. })
  94. } else { // 是个人
  95. this.$http.get('/basic/user/userCacheEnterprise')
  96. .then(response => {
  97. if (!response.data) {
  98. this.section = 1
  99. this.checkData.checked = false
  100. } else if (!response.data.enIsRead) {
  101. this.section = 2
  102. this.checkData.checked = false
  103. this.enterpriseData = response.data
  104. } else if (response.data.enIsRead) {
  105. this.section = 3
  106. this.checkData.checked = true
  107. this.enterpriseData = response.data
  108. }
  109. })
  110. }
  111. this.loginData.isSelf = isSelf
  112. this.loginData.section = this.section
  113. this.loginData.enterprise = tempEnterprise
  114. },
  115. methods: {
  116. sectionChange: function (num) {
  117. this.section = num
  118. },
  119. onRegister: function (data) {
  120. this.registerData.isValidRegister = data.isValidRegister
  121. this.registerData.enterprise = data.enterprise
  122. this.registerData.url = data.url
  123. },
  124. onCacheData: function (cache) {
  125. this.cacheData = cache
  126. },
  127. onBusinessImgUrl: function (url) {
  128. this.businessImgUrl = url
  129. }
  130. }
  131. }
  132. </script>
  133. <style>
  134. .x-step .x-split {
  135. float: right;
  136. }
  137. .x-step li.active .x-split:before {
  138. border-left-color: #5078cb;
  139. right: -17px;
  140. z-index: 4;
  141. }
  142. .x-step li .x-split:before {
  143. border-left-color: #e8e8e8;
  144. right: -16px;
  145. z-index: 2;
  146. }
  147. .x-step .x-split:before {
  148. border-left-color: #e8e8e8;
  149. right: -20px;
  150. z-index: 2;
  151. }
  152. .x-step li .x-split:after {
  153. border-left-color: #fff;
  154. right: -18px;
  155. z-index: 1;
  156. }
  157. .x-step .x-split:after {
  158. /*border-left-color: #e8e8e8;*/
  159. right: -17px;
  160. z-index: 1;
  161. }
  162. .x-step li.active:after {
  163. border-left-color: #5078cb;
  164. right: -17px;
  165. }
  166. .x-step li.active:before {
  167. /*border-left-color: #e8e8e8;*/
  168. left: -17px;
  169. z-index: 3;
  170. }
  171. .x-step li:first-child:before, .x-step li:last-child:after {
  172. border-width: 0;
  173. }
  174. .x-step li.active:before, .x-step li.active:after, .x-step .x-split:before, .x-step .x-split:after {
  175. position: absolute;
  176. top: 0;
  177. display: inline-block;
  178. border-top: 17px solid transparent;
  179. border-bottom: 17px solid transparent;
  180. border-left: 17px solid transparent;
  181. content: '';
  182. }
  183. .brand-type .brand-small-img .preview {
  184. line-height: 84px;
  185. }
  186. </style>