heads.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <div id="heads">
  3. <el-row>
  4. <el-col :span="24" class="heads">
  5. <el-col :span="12" class="left">
  6. <el-image :src="afterInfo.logo"></el-image>
  7. <span>{{ afterInfo.title }}</span>
  8. </el-col>
  9. <el-col :span="12" class="right">
  10. <span @click="bindBtn()"><i class="iconfont iconbangding"></i>绑定微信</span>
  11. <span @click="passwdBtn()"><i class="iconfont iconmima_huaban1"></i>修改密码</span>
  12. <span @click="nameBtn()"><i class="iconfont iconicon-person"></i>账号名称</span>
  13. <span @click="logoutBtn()"><i class="iconfont iconiconfront-"></i>退出登录</span>
  14. </el-col>
  15. </el-col>
  16. </el-row>
  17. <el-dialog title="绑定" :visible.sync="bindDia" width="30%" :before-close="handleClose">
  18. <bind @bindDown="bindDown"></bind>
  19. </el-dialog>
  20. <el-dialog title="修改密码" :visible.sync="passwdDia" width="30%" :before-close="handleClose">
  21. <passwdDias></passwdDias>
  22. </el-dialog>
  23. </div>
  24. </template>
  25. <script>
  26. import { mapState, createNamespacedHelpers } from 'vuex';
  27. import bind from './parts/bind.vue';
  28. import passwdDias from './parts/passwdDia.vue';
  29. export default {
  30. name: 'heads',
  31. props: {},
  32. components: {
  33. // 绑定微信
  34. bind,
  35. // 修改密码
  36. passwdDias,
  37. },
  38. data: function() {
  39. return {
  40. afterInfo: {
  41. logo: require('@/assets/logo.png'),
  42. title: '管理后台',
  43. },
  44. // 绑定微信
  45. bindDia: false,
  46. // 修改密码
  47. passwdDia: false,
  48. };
  49. },
  50. created() {},
  51. methods: {
  52. // 绑定微信
  53. bindBtn() {
  54. this.bindDia = true;
  55. },
  56. // 修改密码
  57. passwdBtn() {
  58. this.passwdDia = true;
  59. },
  60. // 点击名字
  61. nameBtn() {
  62. alert('点击名字事件');
  63. },
  64. // 退出登录
  65. logoutBtn() {
  66. alert('退出登录');
  67. },
  68. // 绑定微信关闭
  69. bindDown() {
  70. this.bindDia = false;
  71. },
  72. handleClose(done) {
  73. done();
  74. },
  75. },
  76. computed: {
  77. ...mapState(['user']),
  78. pageTitle() {
  79. return `${this.$route.meta.title}`;
  80. },
  81. },
  82. metaInfo() {
  83. return { title: this.$route.meta.title };
  84. },
  85. };
  86. </script>
  87. <style lang="less" scoped>
  88. .left {
  89. padding: 0 20px;
  90. .el-image {
  91. float: left;
  92. width: 50px;
  93. height: 50px;
  94. margin: 5px 0 0 0;
  95. }
  96. span {
  97. height: 64px;
  98. line-height: 60px;
  99. font-size: 30px;
  100. color: #fff;
  101. padding: 0 10px;
  102. text-shadow: cornflowerblue 3px 3px 3px;
  103. font-family: cursive;
  104. }
  105. }
  106. .right {
  107. float: right;
  108. padding: 0 20px;
  109. text-align: right;
  110. height: 63px;
  111. line-height: 63px;
  112. span {
  113. border-right: 1px solid #000;
  114. padding: 0 15px;
  115. color: #000;
  116. .iconfont {
  117. margin: 0 5px 0 0;
  118. }
  119. }
  120. span:hover {
  121. cursor: pointer;
  122. }
  123. span:last-child {
  124. border-right: 0;
  125. }
  126. }
  127. </style>