index.vue 3.6 KB

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