SocialSignin.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <div class="social-signup-container">
  3. <div class="sign-btn" @click="wechatHandleClick('wechat')">
  4. <span class="wx-svg-container"><svg-icon icon-class="wechat" class="icon" /></span>
  5. WeChat
  6. </div>
  7. <div class="sign-btn" @click="tencentHandleClick('tencent')">
  8. <span class="qq-svg-container"><svg-icon icon-class="qq" class="icon" /></span>
  9. QQ
  10. </div>
  11. </div>
  12. </template>
  13. <script>
  14. // import openWindow from '@/utils/open-window'
  15. export default {
  16. name: 'SocialSignin',
  17. methods: {
  18. wechatHandleClick(thirdpart) {
  19. alert('ok')
  20. // this.$store.commit('SET_AUTH_TYPE', thirdpart)
  21. // const appid = 'xxxxx'
  22. // const redirect_uri = encodeURIComponent('xxx/redirect?redirect=' + window.location.origin + '/auth-redirect')
  23. // const url = 'https://open.weixin.qq.com/connect/qrconnect?appid=' + appid + '&redirect_uri=' + redirect_uri + '&response_type=code&scope=snsapi_login#wechat_redirect'
  24. // openWindow(url, thirdpart, 540, 540)
  25. },
  26. tencentHandleClick(thirdpart) {
  27. alert('ok')
  28. // this.$store.commit('SET_AUTH_TYPE', thirdpart)
  29. // const client_id = 'xxxxx'
  30. // const redirect_uri = encodeURIComponent('xxx/redirect?redirect=' + window.location.origin + '/auth-redirect')
  31. // const url = 'https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=' + client_id + '&redirect_uri=' + redirect_uri
  32. // openWindow(url, thirdpart, 540, 540)
  33. }
  34. }
  35. }
  36. </script>
  37. <style lang="scss" scoped>
  38. .social-signup-container {
  39. margin: 20px 0;
  40. .sign-btn {
  41. display: inline-block;
  42. cursor: pointer;
  43. }
  44. .icon {
  45. color: #fff;
  46. font-size: 24px;
  47. margin-top: 8px;
  48. }
  49. .wx-svg-container,
  50. .qq-svg-container {
  51. display: inline-block;
  52. width: 40px;
  53. height: 40px;
  54. line-height: 40px;
  55. text-align: center;
  56. padding-top: 1px;
  57. border-radius: 4px;
  58. margin-bottom: 20px;
  59. margin-right: 5px;
  60. }
  61. .wx-svg-container {
  62. background-color: #24da70;
  63. }
  64. .qq-svg-container {
  65. background-color: #6BA2D6;
  66. margin-left: 50px;
  67. }
  68. }
  69. </style>