index.uvue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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="refs.open('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. <!-- 联系我们 -->
  54. <contact-us :ref="refs.set('cs')"></contact-us>
  55. </cl-page>
  56. </template>
  57. <script setup lang="ts">
  58. import { config } from "@/config";
  59. import { router, useRefs, useStore, t, $t } from "@/.cool";
  60. import { useUi } from "@/uni_modules/cool-ui";
  61. import ContactUs from "./components/contact-us.uvue";
  62. const refs = useRefs();
  63. const ui = useUi();
  64. const { user } = useStore();
  65. function toLogout() {
  66. ui.showConfirm({
  67. title: t("提示"),
  68. message: t("确定退出登录吗?"),
  69. callback(action) {
  70. if (action == "confirm") {
  71. user.logout();
  72. }
  73. }
  74. });
  75. }
  76. </script>