123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472 |
- <template>
- <div class="page">
- <div class="page-top">
- <SimpleCenterCover />
- <div class="club-logo">
- <img :src="clubInfo.logo" alt="" v-if="isAuth" />
- <img
- src="~/assets/theme-images/normal/pc/icon-club-logo-default.png"
- v-else-if="isPc"
- />
- <img
- src="~/assets/theme-images/normal/h5/icon-club-logo-default.png"
- v-else
- />
- <div class="club-mobile">{{ userInfo.mobile }}</div>
- <div class="club-name" v-if="isAuth">
- 机构:{{ clubInfo.authParty }}
- </div>
- </div>
- </div>
- <div class="page-content">
- <div class="section-title">我的认证</div>
- <div class="section-content">
- <div class="item club" @click="onToClubDetail">
- <div class="auth-icon" :class="isAuth ? 'auth' : 'un-auth'">
- {{ isAuth ? '已认证' : '未认证' }}
- </div>
- <div class="tip">机构认证</div>
- <div class="btn">
- 点击查看<span class="icon el-icon-arrow-right"></span>
- </div>
- </div>
- <div class="item device" @click="onToDeviceList">
- <div class="auth-icon" :class="isAuthDevice ? 'auth' : 'un-auth'">
- {{ isAuthDevice ? '已认证' : '未认证' }}
- </div>
- <div class="tip">设备认证</div>
- <div class="btn">
- 点击查看<span class="icon el-icon-arrow-right"></span>
- </div>
- </div>
- </div>
- <div class="line"></div>
- <template v-if="isPc">
- <div class="section-title">账户设置</div>
- <div class="section-content">
- <div class="reset-pwd" @click="onResetPassword">修改密码</div>
- </div>
- </template>
- <template v-else>
- <div class="menu-list">
- <div class="item" @click="toAccountSubNav">
- <span>账户设置</span>
- <span class="el-icon-arrow-right"></span>
- </div>
- </div>
- </template>
- <div v-if="!isPc" class="logout" @click="logout">退出登录</div>
- </div>
- </div>
- </template>
- <script>
- import { mapGetters } from 'vuex'
- export default {
- layout: 'app-normal',
- data() {
- return {
- clubInfo: {},
- list: [],
- }
- },
- computed: {
- ...mapGetters(['routePrefix', 'isPc', 'userInfo', 'authUserId']),
- isAuth() {
- return this.clubInfo.auditStatus === 1
- },
- isAuthDevice() {
- return this.isAuth && this.list.length > 0
- },
- },
- created() {
- this.initUserInfo()
- },
- methods: {
- // 初始化用户信息
- async initUserInfo() {
- try {
- const res = await this.$http.api.checkTokenResult()
- this.$store.dispatch('user/login', res.data)
- this.$setStorage(this.routePrefix, 'userInfo', res.data)
- this.fetchAuthDetail()
- this.fetchProductList()
- } catch (error) {
- console.log(error)
- }
- },
- // 获取机构信息
- async fetchAuthDetail() {
- try {
- const authId = this.userInfo.authId
- if (!authId) return
- const res = await this.$http.api.fetchClubAuthInfoData({
- authId,
- })
- this.clubInfo = res.data
- } catch (error) {
- console.log(error)
- }
- },
- // 获取已认证设备列表
- async fetchProductList() {
- try {
- const authId = this.userInfo.authId
- if (!authId) return
- const res = await this.$http.api.fetchClubAuthProductList({
- authId,
- authUserId: this.authUserId,
- })
- if (res.data) {
- this.list = res.data
- }
- } catch (error) {
- console.log(error)
- }
- },
- // 去账户设置菜单列表
- toAccountSubNav() {
- this.$router.push(`${this.routePrefix}/center/subnav/account`)
- },
- // 机构详情
- onToClubDetail() {
- this.$router.push(`${this.routePrefix}/center/club-detail`)
- },
- // 设备认证
- onToDeviceList() {
- this.$router.push(`${this.routePrefix}/center/device`)
- },
- // 修改密码
- onResetPassword() {
- this.$router.push(`${this.routePrefix}/center/settings/password`)
- },
- // 退出登录
- logout() {
- this.$store.dispatch('user/logout')
- this.$removeStorage(this.routePrefix, 'userInfo')
- this.backHome()
- },
- // 回到首页
- backHome() {
- if (this.$route.path === this.routePrefix) return
- this.$router.replace(this.routePrefix)
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- @media screen and (min-width: 768px) {
- .page {
- position: relative;
- min-height: calc(100vh - 80px - 80px);
- background-color: #fff;
- overflow: hidden;
- }
- .page-top {
- position: relative;
- height: 360px;
- // background-image: url(~assets/theme-images/normal/pc/banner-doc.png);
- .club-logo {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- text-align: center;
- img {
- display: inline-block;
- width: 90px;
- height: 90px;
- border-radius: 50%;
- }
- .club-mobile {
- margin: 8px 0;
- }
- .club-mobile,
- .club-name {
- font-size: 18px;
- color: #fff;
- }
- }
- }
- .page-content {
- width: 704px;
- margin: 8px auto 60px;
- .section-title {
- font-size: 24px;
- color: #666666;
- padding: 16px 0;
- }
- .section-content {
- display: flex;
- justify-content: space-between;
- align-items: flex-start;
- .item {
- position: relative;
- width: 340px;
- height: 230px;
- background: #eee;
- box-sizing: border-box;
- padding-left: 24px;
- cursor: pointer;
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- justify-content: center;
- background-size: 340px 230px;
- background-position: center center;
- background-repeat: no-repeat;
- &.club {
- background-image: url(~assets/theme-images/normal/pc/icon-center-item-auth-club.png);
- .icon {
- color: #bc1724;
- }
- }
- &.device {
- background-image: url(~assets/theme-images/normal/pc/icon-center-item-device.png);
- .icon {
- color: #0a6eb1;
- }
- }
- .auth-icon {
- position: absolute;
- right: 16px;
- top: 16px;
- width: 72px;
- height: 32px;
- line-height: 32px;
- text-align: center;
- font-size: 16px;
- color: #fff;
- border-radius: 4px;
- &.auth {
- background: #1890ff;
- }
- &.un-auth {
- background: #f94b4b;
- }
- }
- .tip {
- font-size: 24px;
- color: #fff;
- margin-bottom: 8px;
- }
- .btn {
- font-size: 16px;
- color: #fff;
- .icon {
- display: inline-block;
- width: 18px;
- height: 18px;
- border-radius: 50%;
- background: #fff;
- // background: #0A6EB1;
- font-size: 12px;
- text-align: center;
- line-height: 18px;
- margin-left: 9px;
- font-weight: bold;
- vertical-align: 1px;
- }
- }
- }
- .reset-pwd {
- width: 98px;
- height: 36px;
- background: #bc1724;
- opacity: 1;
- border-radius: 4px;
- font-size: 16px;
- font-weight: 400;
- line-height: 36px;
- color: #ffffff;
- text-align: center;
- cursor: pointer;
- }
- }
- .line {
- height: 1px;
- background: #c2c2c2;
- margin: 32px 0;
- }
- }
- }
- @media screen and (max-width: 768px) {
- .page-top {
- height: 36vw;
- position: relative;
- .club-logo {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- text-align: center;
- img {
- display: inline-block;
- width: 12.8vw;
- height: 12.8vw;
- border-radius: 50%;
- }
- .club-mobile {
- margin: 0.8vw 0;
- }
- .club-mobile,
- .club-name {
- font-size: 3.4vw;
- color: #fff;
- }
- }
- }
- .page-content {
- padding-bottom: 26vw;
- .section-title {
- font-size: 4.2vw;
- color: #666666;
- padding: 6.4vw 0 3.2vw;
- padding-left: 4vw;
- }
- .logout {
- width: 85.2vw;
- height: 12vw;
- background: #bc1724;
- border-radius: 0.2vw;
- text-align: center;
- line-height: 12vw;
- color: #ffffff;
- font-size: 3.6vw;
- position: fixed;
- bottom: 24vw;
- left: 50%;
- transform: translateX(-50%);
- }
- .section-content {
- display: flex;
- justify-content: space-between;
- align-items: flex-start;
- padding: 0 4vw;
- .item {
- position: relative;
- width: 44.4vw;
- height: 30vw;
- background: #eee;
- box-sizing: border-box;
- padding-left: 3.6vw;
- cursor: pointer;
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- justify-content: center;
- background-size: 44.4vw 30vw;
- background-position: center center;
- background-repeat: no-repeat;
- &.club {
- background-image: url(~assets/theme-images/normal/pc/icon-center-item-auth-club.png);
- .icon {
- color: #bc1724;
- }
- }
- &.device {
- background-image: url(~assets/theme-images/normal/pc/icon-center-item-device.png);
- .icon {
- color: #0a6eb1;
- }
- }
- .auth-icon {
- position: absolute;
- right: 1.6vw;
- top: 1.6vw;
- width: 12.8vw;
- height: 5.6vw;
- line-height: 5.6vw;
- text-align: center;
- font-size: 3vw;
- color: #fff;
- border-radius: 0.4vw;
- &.auth {
- background: #1890ff;
- }
- &.un-auth {
- background: #f94b4b;
- }
- }
- .tip {
- font-size: 4vw;
- color: #fff;
- margin-bottom: 1.2vw;
- }
- .btn {
- font-size: 3vw;
- color: #fff;
- .icon {
- display: inline-block;
- width: 3.4vw;
- height: 3.4vw;
- border-radius: 50%;
- background: #fff;
- font-size: 2.8vw;
- text-align: center;
- line-height: 3.4vw;
- margin-left: 0.8vw;
- font-weight: bold;
- vertical-align: 1px;
- }
- }
- }
- }
- .menu-list {
- padding: 0 4vw;
- padding-top: 2.4vw;
- .item {
- width: 100%;
- padding: 3vw 0;
- display: flex;
- justify-content: space-between;
- font-size: 3.4vw;
- border-bottom: 0.1vw solid #c2c2c2;
- .el-icon-arrow-right {
- font-size: 4vw;
- }
- }
- }
- .line {
- height: 1.6vw;
- background: #f7f7f7;
- margin-top: 6.4vw;
- }
- }
- }
- </style>
|