index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. <template>
  2. <view class="mine-container">
  3. <!-- 面包屑 -->
  4. <custom-breadcrumb separator=">">
  5. <custom-breadcrumb-item v-for="(route,index) in routes" :key="index" :to="route.to" :switch="true">
  6. {{route.name}}
  7. </custom-breadcrumb-item>
  8. </custom-breadcrumb>
  9. <!-- 面包屑 -->
  10. <view class="content">
  11. <!--个人信息-->
  12. <view class="person-info flex">
  13. <image v-if="avatar" :src="avatar" class="cu-avatar xl round" mode="widthFix" />
  14. <view class="info flex flex-direction justify-between">
  15. <view>{{name}}</view>
  16. <view>{{ loginIdentity | loginIdentity}}</view>
  17. </view>
  18. </view>
  19. <!--个人信息-->
  20. <!-- 通知区域 -->
  21. <view class="message-content">
  22. <view class="flex justify-between align-center">
  23. <view class="message-title">通知</view>
  24. <view class="flex" @click="handleToMessage">
  25. <view class="message-all">全部</view>
  26. <u-icon name="arrow-right" style="margin-left: 8rpx;" size="12px"></u-icon>
  27. </view>
  28. </view>
  29. <view class="message-list">
  30. <view class="message-empty" v-if="!messageList || messageList.length == 0">
  31. 没有任何消息哦
  32. </view>
  33. <view v-else @click="handleToMessage">
  34. <view class="message-item flex align-center" v-for="(item, index) in messageList.slice(0,4)" :key="index">
  35. <image mode="heightFix" v-if="item.businessStatus == '3'||item.businessStatus == '4'" src="@/static/images/notice_person.png"></image>
  36. <image v-else src="/static/images/message_case_icon.png"></image>
  37. <view style="margin-left: 8rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{item.messageContent}}</view>
  38. <view style="margin-left: 8rpx;flex: 1;text-align: start;white-space: nowrap;"
  39. :class="getClass(item.businessStatus)">{{item.businessStatus | status}}</view>
  40. <u-icon name="arrow-right" size="12px"></u-icon>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <!-- 通知区域 -->
  46. <view class="menu-list-content">
  47. <view class="menu-item" @click="toVolunteer">
  48. <image src="/static/images/volunteer.png"></image>
  49. <view class="menu-item-title">{{ loginIdentity == 0 ? '志愿者管理' : '医生管理' }}</view>
  50. <u-icon name="arrow-right" size="12px"></u-icon>
  51. </view>
  52. <view class="menu-item" @click="handleToSetting">
  53. <image src="/static/images/faceback.png"></image>
  54. <view class="menu-item-title">意见反馈</view>
  55. <u-icon name="arrow-right" size="12px"></u-icon>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. import storage from '@/utils/storage'
  63. import {
  64. getMessageList,
  65. } from '@/api/my/my.js'
  66. var elementIcon = document.getElementsByClassName('uni-tabbar__icon')
  67. export default {
  68. data() {
  69. return {
  70. name: '',
  71. loginIdentity: '',
  72. routes: [{
  73. to: "/pages/phone/mine/index",
  74. name: "个人中心",
  75. }, ],
  76. messageList: [],
  77. }
  78. },
  79. computed: {
  80. avatar() {
  81. return this.$store.state.user.avatar
  82. },
  83. },
  84. filters: {
  85. status(type) {
  86. let tempStr = '未知'
  87. switch (type) {
  88. case '0':
  89. tempStr = '审核通过'
  90. break
  91. case '1':
  92. tempStr = '审核未通过'
  93. break
  94. case '2':
  95. tempStr = '已美化'
  96. break
  97. case '3':
  98. tempStr = '完成绑定'
  99. break
  100. case '4':
  101. tempStr = '解除绑定'
  102. break
  103. case '5':
  104. tempStr = '已点评'
  105. break
  106. case '6':
  107. tempStr = '解析申请通过'
  108. break
  109. case '7':
  110. tempStr = '解析申请未通过'
  111. break
  112. case '8':
  113. tempStr = '解析完成'
  114. break
  115. }
  116. return tempStr
  117. },
  118. loginIdentity(type){
  119. //0医生 1志愿者 2专家
  120. if(type === '0'){
  121. return '医生'
  122. }else if(type === '1'){
  123. return '志愿者'
  124. }else if(type === '2'){
  125. return '专家'
  126. }else{
  127. return '未知'
  128. }
  129. }
  130. },
  131. onLoad() {
  132. this.name = this.$store.state.user.nickName
  133. this.loginIdentity = this.$store.state.user.loginIdentity
  134. this.getMessageList()
  135. },
  136. onShow() {
  137. elementIcon[0].className = 'uni-tabbar__icon '
  138. elementIcon[2].className = 'uni-tabbar__icon icons-tabbar-custom'
  139. this.getMessageList()
  140. },
  141. methods: {
  142. getMessageList() {
  143. getMessageList().then(res => {
  144. if (res.code == 200) {
  145. this.messageList = res.data
  146. }
  147. })
  148. },
  149. getClass(type) {
  150. //0审核通过 1审核未通过 2已美化 3完成绑定 4解除绑定
  151. if (type == 0) {
  152. return 'color_green'
  153. } else if (type == 1) {
  154. return 'color_red'
  155. } else if (type == 1) {
  156. return 'blue'
  157. }
  158. },
  159. handleToSetting() {
  160. // this.$tab.navigateTo('/pages/phone/mine/setting/index')
  161. this.$tab.navigateTo('/pages/phone/mine/faceback/index')
  162. },
  163. handleLogout() {
  164. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  165. this.$store.dispatch('LogOut').then(() => {
  166. this.$tab.reLaunch('/pages/index')
  167. })
  168. })
  169. },
  170. handleToMessage() {
  171. if (!this.messageList || this.messageList.length == 0) {
  172. return
  173. }
  174. uni.navigateTo({
  175. url: '/pages/phone/mine/message/index'
  176. })
  177. // this.$tab.navigateTo('/pages/phone/mine/message/index')
  178. },
  179. handleItemClick(){
  180. },
  181. // 去志愿者管理页面
  182. toVolunteer(){
  183. uni.navigateTo({
  184. url: '/pages/phone/mine/volunteer/index'
  185. })
  186. }
  187. }
  188. }
  189. </script>
  190. <style lang="scss" scoped>
  191. page {
  192. background-color: #F7F8FA;
  193. }
  194. .mine-container {
  195. width: 100%;
  196. height: 100%;
  197. .content {
  198. width: 100%;
  199. height: 100%;
  200. box-sizing: border-box;
  201. padding: 60rpx 32rpx;
  202. .person-info {
  203. height: 128rpx;
  204. .info {
  205. padding: 14rpx 32rpx;
  206. view:nth-child(1) {
  207. font-size: 40rpx;
  208. font-weight: 600;
  209. color: #1D2129;
  210. }
  211. view:nth-child(2) {
  212. font-size: 28rpx;
  213. font-weight: 400;
  214. color: #86909C;
  215. }
  216. }
  217. }
  218. .message-content {
  219. background: #fff;
  220. padding: 24rpx;
  221. border-radius: 16rpx;
  222. margin-top: 32rpx;
  223. .message-title {
  224. color: #1D2129;
  225. font-size: 32rpx;
  226. font-weight: 600;
  227. }
  228. .message-all {
  229. color: #86909C;
  230. font-size: 26rpx;
  231. }
  232. .message-list {
  233. min-height: 84rpx;
  234. box-sizing: border-box;
  235. padding: 8rpx 20rpx;
  236. border-radius: 12rpx;
  237. background: #F7F8FA;
  238. margin-top: 16rpx;
  239. .message-empty {
  240. text-align: center;
  241. line-height: 84rpx;
  242. color: #4E5969;
  243. font-size: 28rpx;
  244. }
  245. .message-item {
  246. box-sizing: border-box;
  247. padding: 12rpx 0px;
  248. //height: 68rpx;
  249. font-size: 28rpx;
  250. color: #4E5969;
  251. image {
  252. width: 28rpx;
  253. height: 28rpx;
  254. }
  255. }
  256. }
  257. }
  258. .menu-list-content {
  259. margin-top: 32rpx;
  260. .menu-item {
  261. width: 100%;
  262. height: 112rpx;
  263. box-sizing: border-box;
  264. padding: 24rpx 0rpx;
  265. display: flex;
  266. align-items: center;
  267. image {
  268. width: 64rpx;
  269. height: 64rpx;
  270. }
  271. .menu-item-title {
  272. flex: 1;
  273. text-align: start;
  274. font-size: 30rpx;
  275. color: #1D2129;
  276. font-weight: 600;
  277. }
  278. }
  279. }
  280. }
  281. .color_green {
  282. color: #00B42A;
  283. }
  284. .color_red {
  285. color: #F53F3F;
  286. }
  287. .color_blue {
  288. color: #FB7299;
  289. }
  290. /deep/ .uni-popup{
  291. z-index: 1000;
  292. }
  293. }
  294. </style>