index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <scroll-view class="scroll-height" :scroll-y="true" :data-theme="'theme-' + proxy.$settingStore.themeColor.name">
  3. <view class="padding-sm">
  4. <!-- 宫格列表 -->
  5. <view class="section2 section bg-white">
  6. <view class="cu-list grid col-4 no-border" style="padding-top: 0.3125rem">
  7. <view class="cu-item justify-center align-center" v-for="(item, index) in inspectList" :key="index" @tap="navItemClick(item.redirectUrl, item.id)">
  8. <image :src="item.imgUrl" style="width: 40px; height: 40px"></image>
  9. <view class="cu-tag badge" v-if="item.badge != 0">
  10. <block v-if="item.badge != 0">{{ item.badge > 99 ? "99+" : item.badge }}</block>
  11. </view>
  12. <text style="font-size: 14px">{{ item.title }}</text>
  13. </view>
  14. </view>
  15. </view>
  16. <!-- 宫格列表 end -->
  17. </view>
  18. </scroll-view>
  19. </template>
  20. <script setup>
  21. import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
  22. import { ref, reactive, computed, onMounted, getCurrentInstance, toRefs, inject } from "vue";
  23. import { xunJianStores, publicStores } from "@/store/modules/index";
  24. const publicStore = publicStores(); //全局公共Store
  25. const xunJianStore = xunJianStores(); //全局变量值Store
  26. const { proxy } = getCurrentInstance();
  27. const inspectList = [
  28. {
  29. id: 1,
  30. title: "设施采集",
  31. badge: "0",
  32. imgUrl: "/static/images/xunjian/xunJian-icon1.png",
  33. redirectUrl: "/pages/business/fireIot/facilitiesGather/index",
  34. },
  35. {
  36. id: 2,
  37. title: "设施查看",
  38. badge: "0",
  39. imgUrl: "/static/images/xunjian/xunJian-icon2.png",
  40. redirectUrl: "/pages/business/fireIot/facilitiesView/index",
  41. },
  42. ]; //九宫格json数据
  43. function navItemClick(url, id) {
  44. if (url) {
  45. uni.navigateTo({
  46. url: url,
  47. });
  48. } else {
  49. uni.showModal({
  50. title: "Tips",
  51. content: "此模块开发中~",
  52. showCancel: false,
  53. success: function (res) {
  54. if (res.confirm) {
  55. } else if (res.cancel) {
  56. }
  57. },
  58. });
  59. }
  60. }
  61. onLoad(() => {});
  62. onShow(() => {
  63. //调用系统主题颜色
  64. proxy.$settingStore.systemThemeColor([1]);
  65. });
  66. </script>
  67. <style lang="scss"></style>