index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view class="page" :style="{'height':h+'px'}">
  3. <view class="left" data-aos="slide-right">
  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. <view class="ulist">
  12. <view class="item" :class="index===0?'item1':''" v-for="(item, index) in solutionList" :key="index" data-aos="slide-left" :data-aos-delay="150*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. </view>
  22. </view>
  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. position: fixed;
  95. left: 0;
  96. top: 0;
  97. z-index: 2;
  98. .item{
  99. width: 100%;
  100. height: 98rpx;
  101. background: #F3F4F8;
  102. display: flex;
  103. align-items: center;
  104. justify-content: center;
  105. overflow: hidden;
  106. white-space: nowrap;
  107. text-overflow: ellipsis;
  108. font-family: PingFangSC, PingFang SC;
  109. font-weight: 400;
  110. font-size: 26rpx;
  111. color: #9D9DA0;
  112. line-height: 37rpx;
  113. &.active{
  114. background: #FFFFFF;
  115. font-weight: bold;
  116. color: #1460CA;
  117. }
  118. &.rtb{
  119. border-top-right-radius: 6rpx;
  120. }
  121. }
  122. }
  123. .right{
  124. width: calc(100% - 168rpx);
  125. padding: 0 30rpx 20rpx;
  126. box-sizing: border-box;
  127. position: relative;
  128. left: 168rpx;
  129. .ulist{
  130. // height: 100% !important;
  131. padding-bottom: 200rpx;
  132. box-sizing: border-box;
  133. overflow-y: hidden;
  134. .item{
  135. width: 100%;
  136. margin-top: 44rpx;
  137. border-radius: 12rpx 12rpx 0rpx 0rpx;
  138. background: #FFFFFF;
  139. &.item1{
  140. margin-top: 20rpx;
  141. }
  142. .top{
  143. width: 100%;
  144. height: 262rpx;
  145. background: #D8D8D8;
  146. border-radius: 12rpx 12rpx 0rpx 0rpx;
  147. image{
  148. width: 100%;
  149. height: 100%;
  150. border-radius: 12rpx 12rpx 0rpx 0rpx;
  151. }
  152. }
  153. .text{
  154. box-sizing: border-box;
  155. overflow: hidden;
  156. text-overflow: ellipsis;
  157. white-space: nowrap;
  158. font-family: PingFang-SC, PingFang-SC;
  159. font-weight: bold;
  160. font-size: 28rpx;
  161. color: #111111;
  162. line-height: 28rpx;
  163. margin-top: 20rpx;
  164. }
  165. }
  166. }
  167. }
  168. }
  169. </style>