Register.vue 5.4 KB

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