register.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <script>
  2. import {
  3. getInstallThirdAppUrl,
  4. findWxQrLoginInfo,
  5. getRegisterQrCode,
  6. getCustomerServiceQrUrl,
  7. } from '@/api/login'
  8. export default {
  9. name: '',
  10. components: {},
  11. data() {
  12. return {
  13. active: 0,
  14. // dialogVisible: false,
  15. authQrcode: '',
  16. serviceQrcode: '',
  17. }
  18. },
  19. computed: {},
  20. watch: {},
  21. created() {
  22. this.getRegisterQrCode()
  23. this.getCustomerServiceQrUrl()
  24. },
  25. mounted() {},
  26. methods: {
  27. auth() {
  28. getInstallThirdAppUrl().then(({ data }) => {
  29. // this.dialogVisible = true
  30. location.href = data
  31. })
  32. },
  33. getRegisterQrCode() {
  34. getRegisterQrCode().then(({ data }) => {
  35. this.authQrcode = 'data:image/gif;base64,' + data.qrcodeUrl
  36. })
  37. },
  38. getCustomerServiceQrUrl() {
  39. getCustomerServiceQrUrl().then(({ data }) => {
  40. this.serviceQrcode = data
  41. })
  42. },
  43. login() {
  44. findWxQrLoginInfo().then(({ data }) => {
  45. location.href = data
  46. })
  47. },
  48. },
  49. }
  50. </script>
  51. <template>
  52. <div class="register cc bgw">
  53. <el-steps :active="active" process-status="finish">
  54. <el-step title="第三方应用授权"> </el-step>
  55. <el-step title="自建代开发授权"></el-step>
  56. <el-step title="等待配置完成"></el-step>
  57. </el-steps>
  58. <div v-show="active == 0" class="register-step first ac">
  59. <div class="auth-btn">
  60. <el-button size="default" type="primary" style="width: 255px" @click="auth">
  61. <svg-icon icon-class="qiyeweixin" class="qiyeweixin-icon"></svg-icon>
  62. <span>企业微信扫码授权</span>
  63. </el-button>
  64. </div>
  65. <el-button size="default" type="primary" plain style="width: 255px" @click="active = 1">
  66. <span>我已完成第三方授权</span>
  67. </el-button>
  68. <ul class="register-step-desc al">
  69. <li>第三方应用授权主要用于进行企业验证并安装{{lwConfig.SYSTEM_NAME}}第三方应用:</li>
  70. <li>如果您是首次注册,请点击「企业微信扫码授权」进行授权;</li>
  71. <li>如果您已经进行过授权,点击「我已完成第三方授权」进入下一步;</li>
  72. </ul>
  73. </div>
  74. <div v-show="active == 1" class="register-step ac">
  75. <div class="blod">管理员使用企业微信扫码授权自建应用代开发</div>
  76. <div class="fxbw step-main">
  77. <div class="step-aside">
  78. <div class="step-text">管理员扫码授权</div>
  79. <img class="step-qrcode" :src="authQrcode" alt="" />
  80. </div>
  81. <div class="step-line"></div>
  82. <div class="step-aside">
  83. <div class="step-text">
  84. 请确保扫码并成功授权后点击
  85. <el-popover ref="popover1" placement="right" width="" trigger="hover">
  86. <img class="auth-desc-img" src="@/assets/register/auth-desc-1.png" alt="" />
  87. <i class="el-icon-question" slot="reference"></i>
  88. </el-popover>
  89. </div>
  90. <el-button size="default" type="primary" style="margin-top: 50px" @click="active = 2">
  91. <span>我已完成扫码并授权</span>
  92. </el-button>
  93. </div>
  94. </div>
  95. <ul class="register-step-desc al">
  96. <li>自建应用代开发主要用于{{lwConfig.SYSTEM_NAME}}为您提供更灵活的定制化服务:</li>
  97. <li>
  98. 请使用管理员的企业微信进行授权;
  99. <el-popover ref="popover1" placement="right" width="" trigger="hover">
  100. <img class="auth-desc-img" src="@/assets/register/auth-desc-1.png" alt="" />
  101. <i class="el-icon-question" slot="reference"></i>
  102. </el-popover>
  103. </li>
  104. <li>授权成功后,我们将火速为您配置并上线应用,即刻体验;</li>
  105. </ul>
  106. </div>
  107. <div v-show="active == 2" class="register-step ac">
  108. <div class="blod">正在为您火速配置应用中,预计需要10分钟时间</div>
  109. <div class="fxbw step-main">
  110. <div class="step-aside">
  111. <div class="step-text">联系客服催办</div>
  112. <img class="step-qrcode" :src="serviceQrcode" alt="" />
  113. </div>
  114. <div class="step-line"></div>
  115. <div class="step-aside">
  116. <div class="step-text">
  117. 已收到上线通知
  118. <el-popover ref="popover1" placement="right" width="" trigger="hover">
  119. <img class="auth-desc-img" src="@/assets/register/auth-desc-2.png" alt="" />
  120. <i class="el-icon-question" slot="reference"></i>
  121. </el-popover>
  122. </div>
  123. <el-button size="default" type="primary" style="margin-top: 50px" @click="login">
  124. <span>立即登录</span>
  125. </el-button>
  126. </div>
  127. </div>
  128. <ul class="register-step-desc al">
  129. <li>我们已经收到您的注册请求,正在为您配置应用:</li>
  130. <li>
  131. 配置过程中您将会收到权限变更通知,请点击确认授权;
  132. <el-popover ref="popover1" placement="right" width="" trigger="hover">
  133. <img class="auth-desc-img" src="@/assets/register/auth-desc-3.png" alt="" />
  134. <i class="el-icon-question" slot="reference"></i>
  135. </el-popover>
  136. </li>
  137. <li>
  138. 应用配置完成后,您将会收到代开发应用上线通知,快登录体验吧;
  139. <el-popover ref="popover1" placement="right" width="" trigger="hover">
  140. <img class="auth-desc-img" src="@/assets/register/auth-desc-2.png" alt="" />
  141. <i class="el-icon-question" slot="reference"></i>
  142. </el-popover>
  143. </li>
  144. </ul>
  145. </div>
  146. <!-- <el-dialog
  147. title="授权第三方应用中…"
  148. :visible.sync="dialogVisible"
  149. width="400px"
  150. :close-on-click-modal="false"
  151. append-to-body
  152. top="30vh"
  153. >
  154. <div>
  155. 请在新窗口中为您的企业授权安装{{lwConfig.SYSTEM_NAME}}第三方应用,授权完成后,点击此弹窗右下角的「我已完成授权」进入下一步。
  156. </div>
  157. <div slot="footer">
  158. <el-button @click="auth">重新授权</el-button>
  159. <el-button
  160. type="primary"
  161. @click="
  162. active = 1
  163. dialogVisible = false
  164. "
  165. >我已完成授权</el-button
  166. >
  167. </div> -->
  168. </el-dialog>
  169. </div>
  170. </template>
  171. <style lang="scss" scoped>
  172. .register {
  173. width: 750px;
  174. height: 490px;
  175. padding: 30px 35px;
  176. }
  177. .register-step {
  178. margin: 30px auto;
  179. }
  180. .first {
  181. .auth-btn {
  182. margin: 90px auto 20px;
  183. }
  184. }
  185. .step-main {
  186. width: 500px;
  187. margin: 30px auto;
  188. .step-aside {
  189. width: 200px;
  190. }
  191. .step-text {
  192. margin-top: 20px;
  193. }
  194. .step-qrcode {
  195. width: 150px;
  196. }
  197. .step-line {
  198. width: 2px;
  199. height: 190px;
  200. background: #eee;
  201. }
  202. }
  203. .register-step-desc {
  204. position: absolute;
  205. left: 50%;
  206. transform: translateX(-50%);
  207. width: 520px;
  208. padding: 10px 40px;
  209. margin: 0 auto;
  210. background: #eee;
  211. border-radius: 5px;
  212. line-height: 1.5;
  213. bottom: 20px;
  214. }
  215. .el-icon-question {
  216. color: #aaa;
  217. }
  218. .auth-desc-img {
  219. height: 400px;
  220. }
  221. </style>