link-register.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. <template>
  2. <div class="page">
  3. <div class="page-content link-register flex justify-center items-center">
  4. <div class="link-register-section flex justify-center items-center">
  5. <div class="content">
  6. <div class="logo"><img :src="supplierInfo.logo" alt="" /></div>
  7. <div class="message">
  8. 完成账号注册与设备认证信息后,将获得<span>{{
  9. supplierInfo.shopName
  10. }}</span
  11. >授权牌匾制作及寄送
  12. </div>
  13. <div class="control">
  14. <div
  15. class="button"
  16. @click="toRegister"
  17. v-if="!isRequest && bindStatus === 0"
  18. >
  19. 点击进入
  20. </div>
  21. </div>
  22. </div>
  23. </div>
  24. </div>
  25. <SimpleDialog
  26. v-model="dialogActive"
  27. @confirm="onConfirm"
  28. :cancel="false"
  29. :description="dialogText"
  30. :center="true"
  31. />
  32. </div>
  33. </template>
  34. <script>
  35. import { mapGetters } from 'vuex'
  36. export default {
  37. layout: 'app',
  38. data() {
  39. return {
  40. authId: '',
  41. dialogActive: false,
  42. isRequest: false,
  43. bindStatus: 0,
  44. }
  45. },
  46. computed: {
  47. ...mapGetters([
  48. 'supplierInfo',
  49. 'authUserId',
  50. 'routePrefix',
  51. 'accessToken',
  52. 'userInfo',
  53. ]),
  54. dialogText() {
  55. return this.bindStatus === 1
  56. ? '该链接认证信息已被账号注册!'
  57. : '抱歉,当前登录手机号已绑定机构,您可以登录后再来进行正品授权申请!'
  58. },
  59. redirectLink() {
  60. return `${this.routePrefix}/form/club-register?type=link&authId=${this.authId}`
  61. },
  62. },
  63. created() {
  64. this.authId = this.$route.query.authId
  65. this.checkoutClubIsBind()
  66. },
  67. methods: {
  68. // 跳转首页
  69. onConfirm() {
  70. this.$router.push(`${this.routePrefix}`)
  71. },
  72. // 判断机构是否已经被绑定
  73. async checkoutClubIsBind() {
  74. this.isRequest = true
  75. try {
  76. const res = await this.$http.api.fetchClubAuthInfo({
  77. authUserId: this.authUserId,
  78. authId: this.authId,
  79. })
  80. const auth = res.data.auth
  81. if (auth) {
  82. this.bindStatus = auth.bindStatus
  83. this.dialogActive = auth.bindStatus === 1
  84. }
  85. this.isRequest = false
  86. } catch (error) {
  87. console.log(error)
  88. }
  89. },
  90. // 跳转注册页面
  91. async toRegister() {
  92. if (this.accessToken) {
  93. try {
  94. const res = await this.$http.api.fetchClubAuthInfo({
  95. authUserId: this.authUserId,
  96. mobile: this.userInfo.mobile,
  97. })
  98. if (res.data.auth) {
  99. this.dialogActive = true
  100. } else {
  101. this.$router.push(this.redirectLink)
  102. }
  103. } catch (error) {
  104. console.log(error)
  105. }
  106. } else {
  107. // 未登录状态缓存
  108. const bindFlag = this.$getStorage(this.routePrefix, 'bind-flag')
  109. if (bindFlag) this.$removeStorage(this.routePrefix, 'bind-flag')
  110. if (!bindFlag) {
  111. this.$setStorage(
  112. this.routePrefix,
  113. 'club-register-link',
  114. this.$route.fullPath
  115. )
  116. }
  117. this.$router.push(this.redirectLink)
  118. }
  119. },
  120. },
  121. }
  122. </script>
  123. <style lang="scss" scoped>
  124. @media screen and (min-width: 768px) {
  125. .page-content {
  126. position: fixed;
  127. top: 0;
  128. left: 0;
  129. z-index: 10000;
  130. width: 100vw;
  131. height: 100vh;
  132. background: url(https://static.caimei365.com/www/authentic/pc/link-register-bg.png)
  133. no-repeat center;
  134. .link-register-section {
  135. width: 1200px;
  136. height: 530px;
  137. background: url(https://static.caimei365.com/www/authentic/pc/link-register-section-bg.png)
  138. no-repeat center;
  139. .content {
  140. width: 1030px;
  141. height: 400px;
  142. background: #fff;
  143. background-image: url(https://static.caimei365.com/www/authentic/pc/link-register-icon.png);
  144. background-repeat: no-repeat;
  145. background-position: 580px center;
  146. box-sizing: border-box;
  147. padding-left: 70px;
  148. .logo {
  149. height: 40px;
  150. width: auto;
  151. margin-top: 48px;
  152. img {
  153. display: block;
  154. height: 40px;
  155. }
  156. }
  157. .message {
  158. width: 360px;
  159. font-size: 20px;
  160. line-height: 36px;
  161. color: #282828;
  162. margin: 40px 0 76px;
  163. span {
  164. font-weight: bold;
  165. }
  166. }
  167. .control {
  168. .button {
  169. width: 295px;
  170. height: 50px;
  171. background: #409eff;
  172. border-radius: 4px;
  173. text-align: center;
  174. font-size: 18px;
  175. line-height: 50px;
  176. color: #fff;
  177. cursor: pointer;
  178. }
  179. }
  180. }
  181. }
  182. }
  183. }
  184. @media screen and (max-width: 768px) {
  185. .page-content {
  186. position: fixed;
  187. top: 0;
  188. left: 0;
  189. z-index: 10000;
  190. width: 100vw;
  191. height: 100vh;
  192. background: url(https://static.caimei365.com/www/authentic/h5/link-register-bg.png)
  193. no-repeat center;
  194. .link-register-section {
  195. width: 100vw;
  196. height: 119.5vw;
  197. background: url(https://static.caimei365.com/www/authentic/h5/link-register-section-bg.png)
  198. no-repeat center;
  199. .content {
  200. width: 88.6vw;
  201. height: 106.6vw;
  202. background: #fff;
  203. background-image: url(https://static.caimei365.com/www/authentic/h5/link-register-icon.png);
  204. background-repeat: no-repeat;
  205. background-position: center 32vw;
  206. background-size: 62vw auto;
  207. box-sizing: border-box;
  208. padding-left: 8vw;
  209. position: relative;
  210. .logo {
  211. height: 8vw;
  212. width: auto;
  213. margin-top: 6.4vw;
  214. img {
  215. display: block;
  216. height: 8vw;
  217. }
  218. }
  219. .message {
  220. width: 72vw;
  221. font-size: 4vw;
  222. line-height: 7.2vw;
  223. color: #282828;
  224. margin-top: 4vw;
  225. span {
  226. font-weight: bold;
  227. }
  228. }
  229. .control {
  230. position: absolute;
  231. bottom: 7.2vw;
  232. left: 50%;
  233. transform: translateX(-50%);
  234. .button {
  235. width: 62vw;
  236. height: 8.8vw;
  237. background: #409eff;
  238. border-radius: 0.4vw;
  239. text-align: center;
  240. font-size: 3.6vw;
  241. line-height: 8.8vw;
  242. color: #fff;
  243. cursor: pointer;
  244. }
  245. }
  246. }
  247. }
  248. }
  249. }
  250. </style>