LoginBox.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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="close">暂不登录</span><span @click="goLogin">马上登录</span>
  7. </div>
  8. </div>
  9. </div>
  10. </template>
  11. <script>
  12. export default {
  13. name: 'loginBox',
  14. methods: {
  15. close: function () {
  16. this.$emit('onLoginBoxClose')
  17. },
  18. goLogin: function () {
  19. this.$router.push('/auth/login?returnUrl=' + window.location.href)
  20. }
  21. }
  22. }
  23. </script>
  24. <style lang="scss" scoped>
  25. .mobile-modal-content {
  26. padding: .54rem !important;
  27. text-align: center;
  28. span {
  29. display: inline-block;
  30. width: 1.5rem;
  31. height: .6rem;
  32. line-height: .6rem;
  33. text-align: center;
  34. background: #418df6;
  35. color: #fff;
  36. border-radius: .1rem;
  37. &:first-child {
  38. margin-right: .5rem;
  39. }
  40. }
  41. }
  42. </style>