123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- <template>
- <view class="page" :style="{'height':h+'px'}">
- <view class="left">
- <view class="item" :class="[(index===nIndex)?'active':'',index===(nIndex+1)?'rtb':'']"
- v-for="(item,index) in navList" :key="index" @click="changeType(index,item.name)">
- {{item.name}}
- </view>
- </view>
- <view class="right">
- <block v-if="solutionList.length">
- <u-list class="ulist" @scrolltolower="scrolltolower">
- <u-list-item class="item" :class="index===0?'item1':''" v-for="(item, index) in solutionList" :key="index">
- <view @click="toDetails(item)">
- <view class="top">
- <image :src="item.img"></image>
- </view>
- <view class="text">
- {{item.name}}
- </view>
- </view>
- </u-list-item>
- </u-list>
- </block>
- <block v-else></block>
- </view>
- <tabbar :tabbarIndex="1"></tabbar>
- </view>
- </template>
- <script>
- import { data } from '../plan/data.js'
- export default {
- data(){
- return {
- navList:[
- {name:'全部'},
- {name:'智能仓储'},
- {name:'能耗管理'},
- {name:'智慧工厂'},
- {name:'智慧文旅'},
- {name:'3D可视化'},
- {name:'智慧运维'},
- {name:'智慧安防'},
- {name:'楼宇自控'},
- {name:'智能照明'},
- {name:'智慧通行'}
- ],
- nIndex:0,
- key:'全部',
- solutionList:[],
- isOver:false
- }
- },
- onLoad() {
- this.getList('全部');
- },
- methods:{
- changeType(index,key){
- this.nIndex = index;
- this.key = key;
- this.getList();
- },
- scrolltolower() {
- // if (this.isOver) return;
- // this.getList();
- },
- getList(){
- if(this.key=='全部'){
- this.solutionList = [];
- for (let d in data) {
- this.solutionList = [...this.solutionList,...data[d]];
- };
- }else{
- this.solutionList = data[this.key] || [];
- }
- },
- toDetails(item){
- if(!item.details) return
- uni.navigateTo({
- url:`/pages/plan/details?id=${item.id}&key=${item.parent}`
- })
- }
- }
- }
- </script>
- <style scoped lang="less">
- .page{
- background: #FFFFFF;
- box-sizing: border-box;
- display: flex;
-
- .left{
- width: 168rpx;
- height: 100%;
- overflow-y: auto;
- .item{
- width: 100%;
- height: 98rpx;
- background: #F3F4F8;
- display: flex;
- align-items: center;
- justify-content: center;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 26rpx;
- color: #9D9DA0;
- line-height: 37rpx;
- &.active{
- background: #FFFFFF;
- font-weight: bold;
- color: #1460CA;
- }
- &.rtb{
- border-top-right-radius: 6rpx;
- }
- }
- }
-
- .right{
- width: calc(100% - 168rpx);
- padding: 0 30rpx 20rpx;
- box-sizing: border-box;
-
- .ulist{
- height: 100% !important;
- .item{
- width: 100%;
- margin-top: 44rpx;
- border-radius: 12rpx 12rpx 0rpx 0rpx;
- background: #FFFFFF;
-
- &.item1{
- margin-top: 20rpx;
- }
-
- .top{
- width: 100%;
- height: 262rpx;
- background: #D8D8D8;
- border-radius: 12rpx 12rpx 0rpx 0rpx;
- image{
- width: 100%;
- height: 100%;
- border-radius: 12rpx 12rpx 0rpx 0rpx;
- }
- }
- .text{
- box-sizing: border-box;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 28rpx;
- color: #111111;
- line-height: 28rpx;
- margin-top: 20rpx;
- }
- }
- }
- }
- }
- </style>
|