index.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <div class="header ng-scope">
  3. <div class="p-wrap-full clear">
  4. <div class="logo fl" style="padding-top: 24px;">
  5. <a href="javascript:void(0)" style="text-decoration: none"
  6. class="rel ng-binding waphide" @click="$router.push('/')">
  7. {{config.title}}
  8. <div class="hover-block" style="padding-top: 24px;">
  9. <div class="hover-bd ng-scope" style="width:137px;margin-top: -20px" @click="$router.push('/')">
  10. <i class="arrowleft"></i>
  11. <div>点击进入门户首页</div>
  12. </div>
  13. </div>
  14. </a>
  15. </div>
  16. <div class="nav fr">
  17. <a href="javascript:void(0)" @click="gotoPage('/')" >
  18. <span class="p-ico2 ico-index"></span>
  19. <span class="nav-txt">回到主页</span>
  20. </a>
  21. <a href="javascript:void(0)" class="ng-scope current">
  22. <span class="p-ico2 ico-center"></span>
  23. <span class="nav-txt">学习中心</span>
  24. </a>
  25. <a href="javascript:void(0)" @click="gotoPage('/center/sign')">
  26. <span class="p-ico2 ico-bmpx"></span>
  27. <span class="nav-txt">学时证明</span>
  28. </a>
  29. <span class="p-ico2 ico-line"></span>
  30. <a href="javascript:void(0)" @click="logout()">
  31. <span class="p-ico2 ico-exit"></span>
  32. <span class="nav-txt">退出</span>
  33. </a>
  34. </div>
  35. </div>
  36. </div>
  37. </template>
  38. <script>
  39. import { mapActions } from "vuex";
  40. export default {
  41. props: {
  42. user: {
  43. type: Object,
  44. default: {
  45. nickanme: '',
  46. headImg:''
  47. }
  48. }
  49. },
  50. data(){
  51. return {
  52. config: window.baseConfig,
  53. }
  54. },
  55. methods:{
  56. ...mapActions("user", [ "doLogout"]),
  57. gotoPage( route ){
  58. if( this.$route.path == route){
  59. return;
  60. }
  61. this.$router.push(route);
  62. },
  63. isActive( path ){
  64. let rpath = this.$route.path;
  65. return rpath.indexOf( path )> -1;
  66. },
  67. logout(){
  68. this.doLogout().then( res=>{
  69. this.$router.push('/');
  70. })
  71. }
  72. }
  73. }
  74. </script>
  75. <style>
  76. @import url("./index.css");
  77. </style>