index.vue 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <route lang="json">
  2. {
  3. "style": {
  4. "navigationBarTitleText": "个人设置",
  5. "navigationBarBackgroundColor": "#fff"
  6. }
  7. }
  8. </route>
  9. <script lang="ts" setup>
  10. import { useUserStore } from '../../../../store'
  11. import { storeToRefs } from 'pinia'
  12. import { rightArrowIcon } from '@designer-hub/assets/src/svgs'
  13. import { getBroker, getVendorAppInfo } from '../../../../core/libs/requests'
  14. import SectionHeading from '@designer-hub/app/src/components/section-heading.vue'
  15. import { messages } from '../../../../core/libs/messages'
  16. import { useMessage } from 'wot-design-uni'
  17. import BottomAppBar from '@/components/bottom-app-bar.vue'
  18. import { useDictStore } from '@/store/dict'
  19. const dictStore = useDictStore()
  20. const { getOptionLabel } = dictStore
  21. const userStore = useUserStore()
  22. // cons useMessage()
  23. const { isLogined, userInfo } = storeToRefs(userStore)
  24. const { data, run: setData } = useRequest(() =>
  25. getBroker({ brokerId: String(userInfo.value.userId) }),
  26. )
  27. const logout = () => {
  28. uni.showModal({
  29. title: messages.mine.setting.logoutMessageText,
  30. success: function (res) {
  31. if (res.confirm) {
  32. userStore.clearUserInfo()
  33. uni.reLaunch({ url: '/pages/login/index' })
  34. }
  35. },
  36. })
  37. }
  38. onMounted(async () => {
  39. await setData()
  40. })
  41. </script>
  42. <template>
  43. <view class="bg-white p-[16px] flex-grow flex flex-col gap-8.5">
  44. <SectionHeading size="sm" :title="'头像'">
  45. <template #append>
  46. <wd-img width="28" height="28" round custom-class="" :src="data?.headImgUrl" />
  47. </template>
  48. </SectionHeading>
  49. <SectionHeading size="sm" :title="'姓名'" :end-text="String(data?.brokerName)"></SectionHeading>
  50. <!-- <SectionHeading size="sm" :title="'ID'" :end-text="String(data?.id)"></SectionHeading>-->
  51. <SectionHeading
  52. size="sm"
  53. :title="messages.mine.setting.channelTypeTitleText"
  54. :end-text="getOptionLabel('member_channel_type', String(data?.channelType))"
  55. ></SectionHeading>
  56. <SectionHeading
  57. size="sm"
  58. :title="messages.mine.setting.mobileTitleText"
  59. :end-text="data?.mobile"
  60. ></SectionHeading>
  61. <SectionHeading
  62. title="修改密码"
  63. size="sm"
  64. path="/pages/common/auth/change-password/index"
  65. end-arrow
  66. ></SectionHeading>
  67. <BottomAppBar fixed placeholder>
  68. <wd-button block :round="false" @click="logout">
  69. <div
  70. class="text-center text-white text-base font-normal font-['PingFang_SC'] leading-normal"
  71. >
  72. 退出登录
  73. </div>
  74. </wd-button>
  75. </BottomAppBar>
  76. </view>
  77. </template>
  78. <style lang="scss" scoped></style>