LoginBox.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <div class="mobile-modal">
  3. <div class="mobile-modal-box">
  4. <div class="mobile-modal-header">请登录后再操作<i @click="close" class="icon-guanbi iconfont"></i></div>
  5. <div class="mobile-modal-content">
  6. <span @click="onRegisterClick">立即注册</span><span @click="goLogin">马上登录</span>
  7. <p><i>*</i>目前手机端暂不支持开店功能,完成注册后请前往PC端操作</p>
  8. </div>
  9. </div>
  10. </div>
  11. </template>
  12. <script>
  13. export default {
  14. name: 'loginBox',
  15. methods: {
  16. close: function () {
  17. this.$emit('onLoginBoxClose')
  18. },
  19. goLogin: function () {
  20. this.$router.push('/auth/login?returnUrl=' + window.location.href)
  21. },
  22. onRegisterClick () {
  23. this.$http.get('/register/page').then(response => {
  24. if (response.data) {
  25. window.location.href = response.data.content
  26. }
  27. })
  28. }
  29. }
  30. }
  31. </script>
  32. <style lang="scss" scoped>
  33. .mobile-modal-content {
  34. padding: .54rem !important;
  35. text-align: center;
  36. span {
  37. display: inline-block;
  38. width: 1.5rem;
  39. height: .6rem;
  40. line-height: .6rem;
  41. text-align: center;
  42. background: #418df6;
  43. color: #fff;
  44. border-radius: .1rem;
  45. &:first-child {
  46. margin-right: .5rem;
  47. }
  48. }
  49. p {
  50. font-size: .28rem;
  51. color: #666;
  52. margin-top: .2rem;
  53. i {
  54. font-style: normal;
  55. color: red;
  56. margin-right: .05rem;
  57. }
  58. }
  59. }
  60. </style>