index.vue 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <app-view class="setting">
  3. <template #header>
  4. <app-navbar title="设置" />
  5. </template>
  6. <CellGroup title="账户" inset>
  7. <Cell is-link :to="{ name: 'account-certification' }"
  8. v-if="userStore.userAccount.hasauth === AuthStatus.Uncertified">
  9. <template #title>
  10. <app-iconfont icon="g-icon-certification">实名认证</app-iconfont>
  11. </template>
  12. </Cell>
  13. <Cell is-link :to="{ name: 'account-authresult' }" v-else>
  14. <template #title>
  15. <app-iconfont icon="g-icon-certification">实名认证</app-iconfont>
  16. </template>
  17. </Cell>
  18. <Cell is-link :to="{ name: 'user-password' }">
  19. <template #title>
  20. <app-iconfont icon="g-icon-password">修改密码</app-iconfont>
  21. </template>
  22. </Cell>
  23. <Cell is-link :to="{ name: 'user-cancel' }">
  24. <template #title>
  25. <app-iconfont icon="g-icon-cancel">注销服务</app-iconfont>
  26. </template>
  27. </Cell>
  28. </CellGroup>
  29. <CellGroup title="系统" inset>
  30. <Cell is-link v-if="globalStore.getSystemInfo('i18nEnabled')">
  31. <template #title>
  32. <app-iconfont icon="g-icon-lang">语言设置</app-iconfont>
  33. </template>
  34. <template #value>
  35. <app-luanguage />
  36. </template>
  37. </Cell>
  38. <Cell is-link @click="userLogout">
  39. <template #title>
  40. <app-iconfont icon="g-icon-cancel">退出登录</app-iconfont>
  41. </template>
  42. </Cell>
  43. </CellGroup>
  44. </app-view>
  45. </template>
  46. <script lang="ts" setup>
  47. import { Cell, CellGroup } from 'vant'
  48. import { dialog } from '@/utils/vant'
  49. import { AuthStatus } from '@/constants/account'
  50. import { useUserStore, useLoginStore, useGlobalStore } from '@/stores'
  51. import eventBus from '@/services/bus'
  52. import AppIconfont from '@/components/base/iconfont/index.vue'
  53. import AppLuanguage from '@mobile/components/modules/luanguage/index.vue'
  54. const globalStore = useGlobalStore()
  55. const loginStore = useLoginStore()
  56. const userStore = useUserStore()
  57. const userLogout = () => {
  58. dialog({
  59. message: '是否退出当前账号?',
  60. showCancelButton: true,
  61. }).then(() => {
  62. loginStore.clearAutoLoginData()
  63. eventBus.$emit('LogoutNotify')
  64. })
  65. }
  66. </script>
  67. <style lang="less">
  68. @import './index.less';
  69. </style>