me-menu.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view class="">
  3. <view class="mx-30">
  4. <view class="mt-40 text-30 text-fore-title font-bold mb-16">常用功能</view>
  5. <view class="shadow-card rounded-8 py-20 grid grid-cols-4 bg-white">
  6. <view v-for="item in menus" :key="item.name" class="flex flex-col items-center" @click="handleClick(item)">
  7. <ie-image :src="item.icon" custom-class="w-70 h-70 rounded-full" />
  8. <view class="mt-10 text-28 text-fore-subtitle">{{ item.name }}</view>
  9. </view>
  10. </view>
  11. <view class="mt-40 text-30 text-fore-title font-bold">其他功能</view>
  12. </view>
  13. <view class="-mt-10 rounded-8 py-20">
  14. <uv-cell-group :border="false">
  15. <uv-cell isLink :cellStyle="cellStyle"
  16. @click="handleNavigate('/pagesOther/pages/personal-center/basic-info/basic-info', '基本资料')">
  17. <template #title>
  18. <view class="flex items-center gap-x-10">
  19. <ie-image src="/static/personal/icon_jibenziliao@2x.png" custom-class="w-34 h-34" />
  20. <text class="text-30 text-fore-subtitle">基本资料</text>
  21. </view>
  22. </template>
  23. </uv-cell>
  24. <uv-cell isLink :cellStyle="cellStyle"
  25. @click="handleNavigate('/pagesOther/pages/personal-center/change-pwd/change-pwd', '修改密码')">
  26. <template #title>
  27. <view class="flex items-center gap-x-10">
  28. <ie-image src="/static/personal/icon_password@2x.png" custom-class="w-36 h-36" />
  29. <text class="text-30 text-fore-subtitle">修改密码</text>
  30. </view>
  31. </template>
  32. </uv-cell>
  33. <uv-cell isLink :cellStyle="cellStyle" @click="handleQuestion">
  34. <template #title>
  35. <view class="flex items-center gap-x-10">
  36. <uv-icon name="question-circle" size="16" color="#888888" />
  37. <text class="text-30 text-fore-subtitle">常见问题</text>
  38. </view>
  39. </template>
  40. </uv-cell>
  41. </uv-cell-group>
  42. </view>
  43. <view v-if="userStore.isLogin" class="mt-80 w-400 mx-auto">
  44. <uv-button type="error" size="medium" shape="circle" text="退出登陆" plain @click="handleLogout"></uv-button>
  45. </view>
  46. </view>
  47. </template>
  48. <script lang="ts" setup>
  49. import useTransferPage from '@/hooks/useTransferPage';
  50. import useUserStore from '@/store/userStore';
  51. const { transferTo } = useTransferPage();
  52. const userStore = useUserStore();
  53. type MenuItem = {
  54. name: string;
  55. icon: string;
  56. pagePath: string;
  57. };
  58. const menus = [
  59. {
  60. name: '测评报告',
  61. icon: '/static/personal/test_report.png',
  62. pagePath: '/pagesOther/pages/test-center/list/list',
  63. },
  64. {
  65. name: '我的收藏',
  66. icon: '/static/personal/my_collected.png',
  67. pagePath: '/pagesOther/pages/personal-center/my-concerned/my-concerned',
  68. },
  69. {
  70. name: '我的志愿表',
  71. icon: '/static/personal/my_simulated.png',
  72. pagePath: '/pagesOther/pages/ie/entry-ai-list/entry-ai-list',
  73. },
  74. {
  75. name: '绑定会员卡',
  76. icon: '/static/personal/bind_card.png',
  77. pagePath: '/pagesOther/pages/personal-center/bind-card/bind-card',
  78. }
  79. ];
  80. const cellStyle = {
  81. padding: '30rpx 30rpx'
  82. }
  83. const handleClick = async (item: MenuItem) => {
  84. const isLogin = await userStore.checkLogin();
  85. if (isLogin) {
  86. transferTo(item.pagePath);
  87. }
  88. }
  89. const handleNavigate = async (pagePath: string, title: string) => {
  90. const isLogin = await userStore.checkLogin();
  91. if (isLogin) {
  92. transferTo(pagePath, {
  93. data: {
  94. settingName: title
  95. }
  96. });
  97. }
  98. }
  99. const handleQuestion = async () => {
  100. const isLogin = await userStore.checkLogin();
  101. if (isLogin) {
  102. transferTo('/pagesOther/pages/h5/h5', {
  103. data: {
  104. title: '常见问题',
  105. url: 'https://www.dz1kt.com/admin/FAQ/FAQ_IE.html'
  106. }
  107. });
  108. }
  109. }
  110. const handleLogout = async () => {
  111. const confirm = await userStore.askLogout();
  112. if (confirm) {
  113. }
  114. }
  115. </script>
  116. <style lang="scss" scoped></style>