index.uvue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <cl-page>
  3. <view class="p-3">
  4. <cl-list :pt="{ className: 'mb-3' }">
  5. <cl-list-item
  6. :label="t('通用设置')"
  7. icon="settings-line"
  8. arrow
  9. hoverable
  10. @tap="router.to('/pages/set/general')"
  11. >
  12. </cl-list-item>
  13. <cl-list-item
  14. :label="t('通知设置')"
  15. icon="notification-4-line"
  16. arrow
  17. hoverable
  18. @tap="router.to('/pages/set/notice')"
  19. >
  20. </cl-list-item>
  21. <cl-list-item :label="t('隐私设置')" icon="lock-line" arrow hoverable>
  22. </cl-list-item>
  23. </cl-list>
  24. <cl-list :pt="{ className: 'mb-3' }">
  25. <cl-list-item
  26. :label="$t('关于{name}', { name: config.name })"
  27. icon="error-warning-line"
  28. arrow
  29. hoverable
  30. :pt="{
  31. label: {
  32. className: 'flex-1'
  33. }
  34. }"
  35. @tap="router.to('/pages/set/about')"
  36. >
  37. </cl-list-item>
  38. <cl-list-item
  39. :label="t('联系客服')"
  40. icon="customer-service-line"
  41. arrow
  42. hoverable
  43. @tap="router.to('/pages/set/cs')"
  44. >
  45. </cl-list-item>
  46. </cl-list>
  47. <cl-list :pt="{ className: 'mb-3' }">
  48. <cl-list-item hoverable justify="center" @tap="toLogout">
  49. <cl-text color="error">{{ t("退出登录") }}</cl-text>
  50. </cl-list-item>
  51. </cl-list>
  52. </view>
  53. </cl-page>
  54. </template>
  55. <script setup lang="ts">
  56. import { config } from "@/config";
  57. import { router, useStore } from "@/cool";
  58. import { $t, t } from "@/locale";
  59. import { useUi } from "@/uni_modules/cool-ui";
  60. const ui = useUi();
  61. const { user } = useStore();
  62. function toLogout() {
  63. ui.showConfirm({
  64. title: t("提示"),
  65. message: t("确定退出登录吗?"),
  66. callback(action) {
  67. if (action == "confirm") {
  68. user.logout();
  69. }
  70. }
  71. });
  72. }
  73. </script>