info copy.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <u-navbar :autoBack="false" :placeholder="true" :safeAreaInsetTop="true" :bgColor="proxy.$settingStore.themeColor.color">
  3. <template #left>
  4. <view class="u-navbar__content__left__item">
  5. <view class="u-navbar__content__left__item__title" style="color: #fff">消息</view>
  6. </view>
  7. </template>
  8. <template #right>
  9. <view class="u-navbar__content__right__item">
  10. <text class="iconfont oaIcon-qingchu" @click="handleIconClick('清除')"></text>
  11. </view>
  12. <view class="u-navbar__content__right__item">
  13. <text class="iconfont oaIcon-sousuo" @click="handleIconClick('搜索')"></text>
  14. </view>
  15. <view class="u-navbar__content__right__item">
  16. <text class="iconfont oaIcon-jiahao" @click="handleIconClick('加号')"></text>
  17. </view>
  18. </template>
  19. </u-navbar>
  20. <scroll-view class="info-container bg-white" scroll-y :style="`height: calc(100vh - (50px + ${proxy.$settingStore.barHightTop} + ${proxy.$settingStore.tabBarHeight}))`">
  21. <view class="content-area" v-for="item in infoList" :key="item" @tap="goAppMessage(item.path)">
  22. <view class="content-area-avatar">
  23. <image class="image-bg" :src="item.img" />
  24. </view>
  25. <view class="content-area-child">
  26. <view class="uni-item mb5">
  27. <view class="uni-item-text font14" style="color: #000000">{{ item.label }}</view>
  28. <view class="uni-item-right font12" style="color: #909399">{{ item.time }}</view>
  29. </view>
  30. <view class="uni-item">
  31. <view class="uni-item-text font12" style="color: #909399">{{ item.cont }}</view>
  32. <view class="uni-item-right font12" style="margin: auto 0">
  33. <u-badge numberType="overflow" max="99" :value="item.badge"></u-badge>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </scroll-view>
  39. <oa-tabbar :tabbarValue="1"></oa-tabbar>
  40. </template>
  41. <script setup>
  42. /*----------------------------------依赖引入-----------------------------------*/
  43. import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
  44. import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance, toRefs } from "vue";
  45. /*----------------------------------接口引入-----------------------------------*/
  46. import { getMceReceiveStatic, getDictList } from "@/api/mine/info.js";
  47. /*----------------------------------组件引入-----------------------------------*/
  48. /*----------------------------------store引入-----------------------------------*/
  49. import { stystemStores } from "@/store/modules/index";
  50. /*----------------------------------公共方法引入-----------------------------------*/
  51. /*----------------------------------公共变量-----------------------------------*/
  52. const { proxy } = getCurrentInstance();
  53. const stystemStore = stystemStores();
  54. /*----------------------------------变量声明-----------------------------------*/
  55. const data = reactive({
  56. infoList: [
  57. {
  58. id: 1,
  59. label: "应用消息",
  60. img: "/static/images/common/appMessage.png",
  61. time: "5月15日",
  62. cont: "您收到一条最新消息,请及时查看",
  63. badge: 1,
  64. path: "/pages/common/appMessage/index",
  65. },
  66. // {
  67. // id: 2,
  68. // label: "消防知识库",
  69. // time: "5月15日",
  70. // cont: "您收到一条最新消息,请及时查看",
  71. // badge: 0,
  72. // },
  73. {
  74. id: 3,
  75. label: "告警通知",
  76. img: "/static/images/common/alarmMessage.png",
  77. time: "5月15日",
  78. cont: "您收到一条最新消息,请及时查看",
  79. badge: 0,
  80. path: "/pages/common/alarmMessage/index",
  81. },
  82. ],
  83. });
  84. const { infoList } = toRefs(data);
  85. function init() {
  86. getMceReceiveStatic().then((res) => {
  87. stystemStore.infoList.messageCountData = res.data;
  88. getDictList({
  89. dictType: "sys_message_type",
  90. }).then((res1) => {
  91. stystemStore.infoList.messageTypeData = res1.data.rows;
  92. res.data.infoTypeStatic.forEach((e) => {});
  93. });
  94. });
  95. }
  96. function goAppMessage(path) {
  97. proxy.$tab.navigateTo(path);
  98. }
  99. function handleIconClick(type) {
  100. if (type === "清除") {
  101. } else if (type === "搜索") {
  102. proxy.$tab.navigateTo("/pages/common/searchSelect/index");
  103. } else if (type === "加号") {
  104. }
  105. }
  106. onShow(() => {
  107. init();
  108. });
  109. onLoad((options) => {
  110. uni.hideTabBar(); //隐藏自带tabbar
  111. });
  112. </script>
  113. <style lang="scss" scoped>
  114. .info-container {
  115. .content-area {
  116. display: flex;
  117. padding: 13px 13px 0 13px;
  118. &-avatar {
  119. display: flex;
  120. margin: auto 20upx auto 0;
  121. .image-bg {
  122. width: 40px;
  123. height: 40px;
  124. }
  125. }
  126. &-child {
  127. width: calc(100% - (32px + 0.625rem));
  128. justify-content: center;
  129. margin: auto;
  130. .uni-item {
  131. display: flex;
  132. white-space: nowrap;
  133. .uni-item-text {
  134. margin-right: auto;
  135. overflow: hidden;
  136. text-overflow: ellipsis;
  137. }
  138. .uni-item-right {
  139. width: auto;
  140. text-align: right;
  141. }
  142. }
  143. }
  144. }
  145. }
  146. </style>