index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. key:'全部',
  60. solutionList:[],
  61. isOver:false
  62. }
  63. },
  64. onLoad() {
  65. this.getList('全部');
  66. },
  67. methods:{
  68. changeType(index,key){
  69. this.nIndex = index;
  70. this.key = key;
  71. this.getList();
  72. },
  73. scrolltolower() {
  74. // if (this.isOver) return;
  75. // this.getList();
  76. },
  77. getList(){
  78. if(this.key=='全部'){
  79. this.solutionList = [];
  80. for (let d in data) {
  81. this.solutionList = [...this.solutionList,...data[d]];
  82. };
  83. }else{
  84. this.solutionList = data[this.key] || [];
  85. }
  86. },
  87. toDetails(item){
  88. if(!item.details) return
  89. uni.navigateTo({
  90. url:`/pages/plan/details?id=${item.id}&key=${item.parent}`
  91. })
  92. }
  93. }
  94. }
  95. </script>
  96. <style scoped lang="less">
  97. .page{
  98. background: #FFFFFF;
  99. box-sizing: border-box;
  100. display: flex;
  101. .left{
  102. width: 168rpx;
  103. height: 100%;
  104. overflow-y: auto;
  105. .item{
  106. width: 100%;
  107. height: 98rpx;
  108. background: #F3F4F8;
  109. display: flex;
  110. align-items: center;
  111. justify-content: center;
  112. overflow: hidden;
  113. white-space: nowrap;
  114. text-overflow: ellipsis;
  115. font-family: PingFangSC, PingFang SC;
  116. font-weight: 400;
  117. font-size: 26rpx;
  118. color: #9D9DA0;
  119. line-height: 37rpx;
  120. &.active{
  121. background: #FFFFFF;
  122. font-weight: bold;
  123. color: #1460CA;
  124. }
  125. &.rtb{
  126. border-top-right-radius: 16rpx;
  127. }
  128. }
  129. }
  130. .right{
  131. width: calc(100% - 168rpx);
  132. padding: 0 30rpx 20rpx;
  133. box-sizing: border-box;
  134. .ulist{
  135. height: 100% !important;
  136. .item{
  137. width: 100%;
  138. margin-top: 44rpx;
  139. border-radius: 12rpx 12rpx 0rpx 0rpx;
  140. background: #FFFFFF;
  141. &.item1{
  142. margin-top: 20rpx;
  143. }
  144. .top{
  145. width: 100%;
  146. height: 262rpx;
  147. background: #D8D8D8;
  148. border-radius: 12rpx 12rpx 0rpx 0rpx;
  149. image{
  150. width: 100%;
  151. height: 100%;
  152. border-radius: 12rpx 12rpx 0rpx 0rpx;
  153. }
  154. }
  155. .text{
  156. box-sizing: border-box;
  157. overflow: hidden;
  158. text-overflow: ellipsis;
  159. white-space: nowrap;
  160. font-family: PingFang-SC, PingFang-SC;
  161. font-weight: bold;
  162. font-size: 28rpx;
  163. color: #111111;
  164. line-height: 28rpx;
  165. margin-top: 20rpx;
  166. }
  167. }
  168. }
  169. }
  170. }
  171. </style>