chooseDev.vue
4.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<template>
<view>
<view >
<u-search class="search-box" placeholder="搜索" border-color="#c1ddedff" shape="round" bgColor="#f7f8faff" :showAction="false"
v-model="keyword"></u-search>
</view>
<view class="page">
<scroll-view id="left-scroll" class="left-box" :scroll-y="true" :scroll-top="leftTop">
<view class="left-box_item" :class="{'left-box_active':index==current}" v-for="(item,index) in category"
@click="changeIndex(index)">
{{item.name}}
</view>
</scroll-view>
<scroll-view class="right-box" :scroll-y="true">
<swiper class="swiper" :current="current" :vertical="true" @change="changeSwiper">
<swiper-item v-for="(item,index) in category">
<u-grid :border="false" col="3" >
<u-grid-item :customStyle="{marginBottom:'24rpx'}" v-for="(tool,toolIndex) in item.list"
:key="toolIndex" @click="jumpUrl(tool.url)">
<image class="grid-icon" src="@/static/huo.png" mode=""></image>
<text class="grid-text">{{tool.name}}</text>
</u-grid-item>
<!-- <block v-if="index==0">
<u-grid-item :customStyle="{marginBottom:'24rpx'}" @click="addTool()">
<image class="grid-icon" src="@/static/images/ic_tj.png" mode=""></image>
<text class="grid-text">添加功能</text>
</u-grid-item>
</block> -->
</u-grid>
</swiper-item>
</swiper>
</scroll-view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
keyword: '',
current: 0,
leftTop: 0,
category: [{
name:'主题管理',
list:[
{
name:'档案搜索',
url:'/pages2/mainManage/search'
},
{
name:'特种设备单位',
url:'/pages2/mainManage/device'
},{
name:'无照主体',
url:'/pages2/mainManage/noPhoto'
},{
name:'地图分布',
url:'/pages2/mainManage/map'
},{
name:'严重失信名录',
url:'/pages2/mainManage/warning'
},{
name:'经营异常名录',
url:'/pages2/mainManage/unusually'
},{
name:'信用修复记录',
url:'/pages2/mainManage/fix'
},
]
}, {name:'证照管理'}, {name:'日常监督'}, {name:'明厨亮灶'}, {name:'综合市场'}, {name:'互动监督'}, {name:'执法办案'}, {name:'抽检处置'}, {name:'特种设备'}, {name:'统计分析'}, {name:'常用工具'}, {name:'我的数据'}],
};
},
methods: {
jumpUrl(url) {
uni.navigateTo({
url: url
})
},
changeSwiper(e) {
this.changeIndex(e.detail.current);
},
changeIndex(val) {
this.current = val;
let count = this.category.length;
const query = uni.createSelectorQuery().in(this);
let nodesRef = query.select('#left-scroll');
let that = this;
nodesRef.boundingClientRect(res => {
this.$nextTick(() => {
var height = res.height || 0;
if (height > 0 && count > 0) {
that.leftTop = val / count * height;
}
});
}).exec();
}
}
}
</script>
<style lang="scss">
.page {
display: flex;
flex-direction: row;
justify-content: space-between;
padding-right: 28rpx;
box-sizing: border-box;
}
.left-box {
width: 160rpx;
height: calc(100vh - 100px);
&_item {
width: 160rpx;
height: 104rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
padding: 0 24rpx;
box-sizing: border-box;
color: rgb(100, 101, 102);
font-size: 26rpx;
}
&_active {
width: 160rpx;
height: 104rpx;
font-weight: 600;
font-size: 28rpx;
color: rgba(46, 122, 253, 1);
border-radius: 32rpx 0 0 32rpx;
background: rgb(255, 255, 255);
}
}
/deep/ .u-search__content{
margin: 16rpx 24rpx;
}
.search-box{
margin: 24rpx!important;
}
.right-box {
width: 542rpx;
height: calc(100vh - 100px);
border-radius: 16rpx;
background: rgb(255, 255, 255);
padding: 28rpx 0;
box-sizing: border-box;
.swiper {
height: 100%;
}
.grid-icon {
display: block;
margin-bottom: 16rpx;
width: 88rpx;
height: 88rpx;
border-radius: 24rpx;
background: rgb(242, 246, 254);
}
.grid-text {
color: rgba(0, 0, 0, 0.9);
font-size: 24rpx;
}
}
</style>