checkTopWrap.vue
3.3 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
<template>
<view>
<view class="topWrap" :style="{background:bgColor}">
<view class="searchWrap">
<view class="search" :style="{background:searchBgColor}" @click="search">
<image src="../static/image/search@2x.png" mode=""></image>
<input type="text" v-model="keyword" placeholder="搜索" placeholder-style="font-size: 28rpx;color: #969799;"/>
</view>
</view>
<view class="paramWrap">
<view class="tabList">
<view class="tabItem" :class="{active:tabIndex == -1}" @click="changeTabIndex(-1)">
全部 ({{check.sum}})
</view>
<view class="tabItem" :class="{active:tabIndex == 0}" @click="changeTabIndex(0)">
待督查 ({{check.uncomplete}})
</view>
<view class="tabItem" :class="{active:tabIndex == 1}" @click="changeTabIndex(1)">
已督查 ({{check.complete}})
</view>
</view>
<view class="selectList">
<view class="selectItem" @click="showPicker('year')">
{{yearVal == '全' ? '全部' : yearVal+'年'}}<image src="../static/image/ic_arrowdown.png" mode=""></image>
</view>
<view class="selectItem" @click="showPicker('region')">
{{cityVal}}<image src="../static/image/ic_arrowdown.png" mode=""></image>
</view>
</view>
</view>
</view>
<view style="height:302rpx"></view>
</view>
</template>
<script>
export default {
data() {
return {
check:{},
topHeight:0,
tabIndex:-1,
bgColor:'#4bb377',
searchBgColor:"#fff",
}
},
props:{
yearVal:{
type:String
},
cityVal:{
type:String
},
keyword:{
type:String
}
},
watch:{
cityVal(e){
this.cityVal = e
}
},
mounted() {
if(this.keyword != ''){
this.bgColor = '#fff'
this.searchBgColor = '#f2f3f5'
}
this.getData()
},
methods: {
getData(){
uni.request({
url:this.apiUrl + 'license/count',
method:'post',
success: (res) => {
this.check = res.data.data
}
})
},
search(){
uni.navigateTo({
url:'/pages/index/license/search'
})
},
showPicker(pickerType){
this.$emit('showPicker',{'pickerType':pickerType})
},
changeTabIndex(tabIndex){
this.tabIndex = tabIndex
this.$emit('changeParamType',{tabIndex:tabIndex})
}
}
}
</script>
<style>
/* 顶部区域 */
.topWrap{position: fixed;width: 100%;z-index: 1;}
.topWrap .searchWrap{padding: 16rpx 32rpx 32rpx 32rpx;}
.searchWrap .search{border-radius: 68rpx;height: 72rpx;display: flex;align-items: center;padding: 0 29rpx;}
.search image{width: 32rpx;height: 32rpx;}
.search input{padding-left: 8rpx;font-size: 28rpx;width: 100%;}
.topWrap .paramWrap{padding: 28rpx 36rpx 24rpx 36rpx;background: #fff;border-radius: 20rpx 20rpx 0 0;}
.paramWrap .tabList{display: flex;border-radius: 16rpx;background: #f2f3f5;font-size: 26rpx;height: 72rpx;align-items: center;padding: 0 4rpx;}
.tabList .tabItem{flex: 1;text-align: center;line-height: 64rpx;height: 64rpx;}
.tabItem.active{background: #fff;border-radius: 14rpx;box-shadow: 0rpx 6rpx 16rpx 0rpx rgba(0,0,0,0.15), 0rpx 2rpx 2rpx 0rpx rgba(0,0,0,0.06);transition: 0.5s;}
.paramWrap .selectList{display: flex;padding-top: 24rpx;font-size: 26rpx;}
.selectList .selectItem{display: flex;justify-content: center;align-items: center;flex: 1;}
.selectItem image{width: 32rpx;height: 32rpx;margin-left: 8rpx;}
</style>