123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <template>
- <div id="index">
- <admin-frame :usePage="false" topType="2" :leftArrow="false">
- <template v-slot:info>
- <van-col span="24" class="one">
- <van-col span="24" class="image">
- <van-image :src="icon"></van-image>
- </van-col>
- <van-col span="24" class="other">
- <van-col span="24" class="otherInfo">
- {{ userInfo.name }}
- </van-col>
- <van-col span="24" class="otherInfo">
- {{ userInfo.phone }}
- </van-col>
- </van-col>
- </van-col>
- <van-col span="24" class="two">
- <van-cell title="基本信息" @click="btn('basic')" is-link />
- <van-cell title="关联用户" @click="btn('user')" is-link />
- <van-cell title="退出登录" @click="logout" is-link />
- {{ user }}
- </van-col>
- </template>
- </admin-frame>
- </div>
- </template>
- <script>
- import adminFrame from '@/layout/common/admin-frame.vue';
- import { mapState, createNamespacedHelpers } from 'vuex';
- export default {
- name: 'index',
- props: {},
- components: {
- adminFrame,
- },
- data: function () {
- return {
- icon: require('@a/icon.jpg'),
- userInfo: {},
- };
- },
- created() {
- console.log(this.user);
- if (this.user) this.$set(this, `userInfo`, this.user);
- },
- methods: {
- btn(type) {
- this.$router.push({ path: `/exchange/center/${type}/index` });
- },
- logout() {
- let token = localStorage.removeItem('token');
- let openid = sessionStorage.removeItem('openid');
- if (token == undefined && openid == undefined) {
- this.$notify({
- message: '退出成功',
- type: 'success',
- });
- this.$router.push({ path: '/login', query: { path: '/exchange/center/index', type: '1' } });
- }
- },
- },
- computed: {
- ...mapState(['user']),
- },
- metaInfo() {
- return { title: this.$route.meta.title };
- },
- watch: {
- test: {
- deep: true,
- immediate: true,
- handler(val) {},
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .one {
- margin: 0 0 8px 0;
- background: url('~@/assets/userbj.jpg');
- background-repeat: no-repeat;
- background-size: 100% 100%;
- .image {
- text-align: center;
- padding: 10px 0 10px 0;
- .van-image {
- width: 66px;
- height: 66px;
- /deep/.van-image__img {
- border-radius: 90px;
- }
- }
- }
- .other {
- text-align: center;
- .otherInfo {
- font-size: 16px;
- color: #000;
- font-weight: bold;
- margin: 0 0 5px 0;
- }
- }
- }
- .two {
- background: #fff;
- }
- </style>
|