index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <view class="page" :style="{'height':h+'px'}">
  3. <view class="left">
  4. <view class="item" :class="[(index===nIndex)?'active':'',index===(nIndex+1)?'rtb':'']"
  5. v-for="(item,index) in navList" :key="index" @click="changeType(index,item.name)">
  6. {{item.name}}
  7. </view>
  8. </view>
  9. <view class="right">
  10. <block v-if="solutionList.length">
  11. <u-list class="ulist" @scrolltolower="scrolltolower">
  12. <u-list-item class="item" :class="index===0?'item1':''" v-for="(item, index) in solutionList" :key="index">
  13. <view @click="toDetails(item)">
  14. <view class="top">
  15. <image :src="item.img"></image>
  16. </view>
  17. <view class="text">
  18. {{item.name}}
  19. </view>
  20. </view>
  21. </u-list-item>
  22. </u-list>
  23. </block>
  24. <block v-else></block>
  25. </view>
  26. <tabbar :tabbarIndex="1"></tabbar>
  27. </view>
  28. </template>
  29. <script>
  30. import { data } from '../plan/data.js'
  31. export default {
  32. data(){
  33. return {
  34. navList:[
  35. {name:'全部'},
  36. {name:'智能仓储'},
  37. {name:'能耗管理'},
  38. {name:'产业园区'},
  39. {name:'工业园区'},
  40. {name:'智慧校园'},
  41. {name:'智慧场馆'},
  42. {name:'公共交通'},
  43. {name:'智慧文旅'},
  44. {name:'城市服务'},
  45. {name:'住宅社区'},
  46. {name:'3D可视化'},
  47. {name:'智慧运维'},
  48. {name:'智慧安防'},
  49. {name:'楼宇自控'},
  50. {name:'能耗管理'},
  51. {name:'智能照明'},
  52. {name:'智慧通行'},
  53. {name:'智能环卫'},
  54. {name:'智慧电梯'},
  55. {name:'应急指挥'},
  56. {name:'资产管理'}
  57. ],
  58. nIndex:0,
  59. solutionList:[],
  60. isOver:false
  61. }
  62. },
  63. onLoad() {
  64. this.getList('全部');
  65. },
  66. methods:{
  67. changeType(index,key){
  68. this.nIndex = index;
  69. this.getList(key);
  70. },
  71. scrolltolower() {
  72. if (this.isOver) return;
  73. this.getList(this.nIndex);
  74. },
  75. getList(key){
  76. if(key=='全部'){
  77. this.solutionList = [];
  78. for (let d in data) {
  79. this.solutionList = [...this.solutionList,...data[d]];
  80. };
  81. }else{
  82. this.solutionList = data[key] || [];
  83. }
  84. },
  85. toDetails(item){
  86. uni.navigateTo({
  87. url:`/pages/plan/details?id=${item.id}&key=${item.parent}`
  88. })
  89. }
  90. }
  91. }
  92. </script>
  93. <style scoped lang="less">
  94. .page{
  95. background: #FFFFFF;
  96. box-sizing: border-box;
  97. display: flex;
  98. .left{
  99. width: 168rpx;
  100. height: 100%;
  101. overflow-y: auto;
  102. .item{
  103. width: 100%;
  104. height: 98rpx;
  105. background: #F3F4F8;
  106. display: flex;
  107. align-items: center;
  108. justify-content: center;
  109. overflow: hidden;
  110. white-space: nowrap;
  111. text-overflow: ellipsis;
  112. font-family: PingFangSC, PingFang SC;
  113. font-weight: 400;
  114. font-size: 26rpx;
  115. color: #9D9DA0;
  116. line-height: 37rpx;
  117. &.active{
  118. background: #FFFFFF;
  119. font-weight: bold;
  120. color: #1460CA;
  121. }
  122. &.rtb{
  123. border-top-right-radius: 16rpx;
  124. }
  125. }
  126. }
  127. .right{
  128. width: calc(100% - 168rpx);
  129. padding: 0 30rpx 20rpx;
  130. box-sizing: border-box;
  131. .ulist{
  132. height: 100% !important;
  133. .item{
  134. width: 100%;
  135. margin-top: 44rpx;
  136. border-radius: 12rpx 12rpx 0rpx 0rpx;
  137. background: #FFFFFF;
  138. &.item1{
  139. margin-top: 20rpx;
  140. }
  141. .top{
  142. width: 100%;
  143. height: 262rpx;
  144. background: #D8D8D8;
  145. border-radius: 12rpx 12rpx 0rpx 0rpx;
  146. image{
  147. width: 100%;
  148. height: 100%;
  149. border-radius: 12rpx 12rpx 0rpx 0rpx;
  150. }
  151. }
  152. .text{
  153. box-sizing: border-box;
  154. overflow: hidden;
  155. text-overflow: ellipsis;
  156. white-space: nowrap;
  157. font-family: PingFang-SC, PingFang-SC;
  158. font-weight: bold;
  159. font-size: 28rpx;
  160. color: #111111;
  161. line-height: 28rpx;
  162. margin-top: 20rpx;
  163. }
  164. }
  165. }
  166. }
  167. }
  168. </style>