handleAffairs.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view>
  3. <!-- 搜索栏 -->
  4. <view class="input-view">
  5. <input confirm-type="search" class="nav-bar-input" type="text" placeholder="输入搜索关键词" @confirm="confirm" />
  6. <uni-icons class="input-uni-icon" type="search" size="18" color="#999" />
  7. </view>
  8. <!-- 网格配置列表滑动 -->
  9. <view>
  10. <uni-swiper-dot :info="info" :current="current" field="content" :mode="mode">
  11. <swiper class="swiper-box">
  12. <swiper-item v-for="(item ,index) in gridtType" :key="index">
  13. <!-- <ul class="mainNav" >
  14. <li v-for="(dataitem,dataindex) in item.dataList" :key="dataitem.id">
  15. <image class="uni-header-image" :src="'http://127.0.0.1:8080'+dataitem.fileUrl"
  16. @click="querygrid(dataitem)"></image>
  17. <text>{{dataitem.name}}</text>
  18. </li>
  19. </ul> -->
  20. <uni-grid :column="5" :highlight="true" :showBorder="false">
  21. <uni-grid-item v-for="(dataitem,dataindex) in item" :key="dataitem.id">
  22. <view>
  23. <image class="uni-header-image" :src="'http://127.0.0.1:8080'+dataitem.fileUrl"
  24. @click="querygrid(dataitem)"></image>
  25. <uni-title type="h5" :title="dataitem.name" align="center"></uni-title>
  26. </view>
  27. </uni-grid-item>
  28. </uni-grid>
  29. </swiper-item>
  30. </swiper>
  31. </uni-swiper-dot>
  32. </view>
  33. <view>
  34. <uni-row class="demo-uni-row" :width="nvueWidth">
  35. <uni-col :span="12">
  36. <button align="center" @click="topic">主题导航</button>
  37. </uni-col>
  38. <uni-col :span="12">
  39. <button align="center" @click="dept">部门导航</button>
  40. </uni-col>
  41. </uni-row>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. listGridType
  48. } from '@/api/handleAffairs/gridType.js';
  49. export default {
  50. data() {
  51. return {
  52. gridtType: [], //是一个list<map>数据 [{0,[1,2,3]}]
  53. };
  54. },
  55. created() {
  56. this.getList();
  57. },
  58. methods: {
  59. //主题导航跳转
  60. topic(){
  61. uni.navigateTo({
  62. url: '/pages/topic/topic',
  63. });
  64. },
  65. //部门导航跳转
  66. dept(){
  67. },
  68. querygrid(item) {
  69. console.log(item)
  70. uni.setStorageSync('id', item.id)
  71. uni.navigateTo({
  72. url: '/pages/gridQuery/gridQuery',
  73. });
  74. },
  75. getList() {
  76. const _that = this
  77. let query = {
  78. yesOrNoShow: "0"
  79. };
  80. listGridType(query).then(res => {
  81. let gridtTypeLits = res.rows
  82. let dataList = []
  83. for (var i = 0; i < gridtTypeLits.length; i++) {
  84. dataList.push(gridtTypeLits[i])
  85. if (((i + 1) % 5 == 0) || i == gridtTypeLits.length - 1) {
  86. _that.gridtType.push(dataList)
  87. dataList = []
  88. }
  89. }
  90. });
  91. },
  92. }
  93. }
  94. </script>
  95. <style scoped>
  96. .uni-header-image {
  97. width: 30px;
  98. height: 30px;
  99. display: block;
  100. margin: 0 auto;
  101. }
  102. /* 主导航 */
  103. .mainNav {
  104. width: 100%;
  105. background: #fff;
  106. }
  107. .input-view {
  108. /* #ifndef APP-PLUS-NVUE */
  109. display: flex;
  110. /* #endif */
  111. flex-direction: row;
  112. // width: 500rpx;
  113. flex: 1;
  114. background-color: #f8f8f8;
  115. height: $nav-height;
  116. border-radius: 15px;
  117. padding: 0 15px;
  118. flex-wrap: nowrap;
  119. margin: 7px 0;
  120. line-height: $nav-height;
  121. }
  122. </style>