mine.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view>
  3. <u-navbar class="u-navbar-box" title="我的" placeholder bgColor="transparent" left-icon-size="0" />
  4. <view class="top-box">
  5. <u-image class="bg-box" width="690rpx" height="270rpx" src="/static/mine/user-center-bg.png" />
  6. <div class="avatar-name">
  7. <up-avatar size="116rpx" :src="vuex_user.avatar" defaultUrl="/static/mine/avatar-def.png"
  8. bgColor="#305BFF" />
  9. <!-- <u-image class="avatar" width="116rpx" bgColor="transparent" height="116rpx"
  10. src="/static/mine/avatar-def.png" /> -->
  11. <view style="margin-left: 30rpx;">
  12. <view class="name">{{user.nickName}}</view>
  13. <view class="roles">{{handleRolesText()}}</view>
  14. </view>
  15. </div>
  16. <div class="abs-right">
  17. <u-image bgColor="transparent" width="220rpx" height="258rpx" src="/static/mine/user-center-img.png" />
  18. </div>
  19. </view>
  20. <u-cell-group :border="false" :customStyle="{background: '#fff', margin: '30rpx', borderRadius: '20rpx'}">
  21. <!-- 县民政 -->
  22. <u-cell icon="setting-fill" title="护理申请" isLink url="/pages/subpack/pages/application/list">
  23. <template #icon>
  24. <u-image src="/static/mine/task.png" bgColor="transparent" width="36rpx" height="36rpx" />
  25. </template>
  26. </u-cell>
  27. <!-- 区民政 -->
  28. <u-cell icon="setting-fill" title="护理审核" isLink url="/pages/subpack/pages/application/list">
  29. <template #icon>
  30. <u-image src="/static/mine/task.png" bgColor="transparent" width="36rpx" height="36rpx" />
  31. </template>
  32. </u-cell>
  33. <!-- 护理人员 -->
  34. <u-cell icon="setting-fill" title="护理打卡" isLink url="/pages/subpack/pages/application/list">
  35. <template #icon>
  36. <u-image src="/static/mine/task.png" bgColor="transparent" width="36rpx" height="36rpx" />
  37. </template>
  38. </u-cell>
  39. <!-- 县民政 -->
  40. <u-cell icon="setting-fill" title="业务评分" isLink url="/pages/subpack/pages/application/list">
  41. <template #icon>
  42. <u-image src="/static/mine/task.png" bgColor="transparent" width="36rpx" height="36rpx" />
  43. </template>
  44. </u-cell>
  45. <u-cell icon="integral-fill" title="个人信息" isLink :border="false" url="/pages/subpack/pages/myInfo/info">
  46. <template #icon>
  47. <u-image src="/static/mine/myself.png" bgColor="transparent" width="36rpx" height="36rpx" />
  48. </template>
  49. </u-cell>
  50. <u-cell icon="integral-fill" title="用户协议" isLink :border="false" url="/pages/subpack/pages/protocol/list">
  51. <template #icon>
  52. <u-image src="/static/mine/myself.png" bgColor="transparent" width="36rpx" height="36rpx" />
  53. </template>
  54. </u-cell>
  55. </u-cell-group>
  56. </view>
  57. </template>
  58. <script setup>
  59. import {
  60. onMounted,
  61. ref
  62. } from 'vue';
  63. import {
  64. useStore
  65. } from 'vuex';
  66. import {
  67. onLoad
  68. } from '@dcloudio/uni-app'
  69. // 获取 Vuex store 实例
  70. const store = useStore();
  71. const user = ref({
  72. nickName: ' ',
  73. roles: []
  74. })
  75. const roleKV = {
  76. common: '普通角色',
  77. admin: '超级管理员',
  78. village: '乡镇民政所',
  79. area: '区民政局',
  80. company: '护理公司',
  81. nurse: '护理员'
  82. }
  83. function handleRolesText() {
  84. let roles = user.value.roles;
  85. let roleText = [];
  86. roles.map(item => {
  87. if (roleKV.hasOwnProperty(item)) {
  88. roleText.push(roleKV[item]);
  89. }
  90. })
  91. return roleText.join(',');
  92. }
  93. onMounted(() => {
  94. console.log('store=>', store.state);
  95. user.value = store.state.vuex_user;
  96. })
  97. </script>
  98. <style>
  99. page {
  100. background-color: #F6F8FD;
  101. }
  102. </style>
  103. <style lang="scss" scoped>
  104. :deep(.u-image) {
  105. display: flex;
  106. align-items: center;
  107. justify-content: center;
  108. }
  109. :deep(.u-navbar__content__title) {
  110. font-weight: bold;
  111. font-size: 36rpx;
  112. color: #222222;
  113. }
  114. .u-navbar-box {
  115. background: radial-gradient(circle at left, #FFE5E4 0%, #EEF2F5 40%, #DBEEFB 100%);
  116. }
  117. .top-box {
  118. position: relative;
  119. margin: 30rpx;
  120. .avatar-name {
  121. position: absolute;
  122. top: 77rpx;
  123. left: 40rpx;
  124. display: flex;
  125. align-items: center;
  126. .name {
  127. font-weight: bold;
  128. font-size: 40rpx;
  129. color: #000000;
  130. }
  131. .roles {
  132. font-size: 28rpx;
  133. margin-top: 10rpx;
  134. color: #000000;
  135. }
  136. }
  137. .abs-right {
  138. position: absolute;
  139. bottom: 20rpx;
  140. right: 40rpx;
  141. }
  142. }
  143. </style>