ToolBox.vue
4.42 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<template>
<view class="tool-box" :style="toolStyle">
<view
:class="['btn', {hideIcon:!show}]"
@click="show = false"
>
<view class="icon sprite-icon icon-tool-file">
</view>
文件夹
</view>
<view :class="['list',{showList:!show}]">
<view
class="title"
@click="show = true"
>文件夹</view>
<template v-for="(i,index) in data">
<view
:class="['item', {active: i[idKey] == id} ]"
:key="index"
@click="jump(i)"
>
<image
class="icon"
:src="i.shortTitleUrl"
mode="scaleToFill"
/>
{{i.shortTitle}}
</view>
</template>
<template v-if="showPayBtn">
<view
class="item"
@click="toPay"
>
<view class="icon">
<view class="sprite-icon icon-tool-pay"></view>
</view>
付款方式
</view>
</template>
<template v-if="type != 'preview'">
<view
class="item"
@click="finish"
>
<view class="icon">
<view class="sprite-icon icon-tool-finish"></view>
</view>
完成接待
</view>
</template>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'ToolBox',
props: {
type: String,
data: Array,
id: [String, Number],
showPayBtn: Boolean,
idKey: {
type: String,
default: 'id'
},
toolStyle:String
},
data () {
return {
show: true
}
},
computed: {
watchStatus () {
return this.$store.state.user.historyStatus
},
},
watch: {
watchStatus: {
immediate: true,
handler (newval) {
this.show = true
}
},
},
methods: {
hide () {
this.show = true
},
jump (item) {
this.show = true
this.$emit('choose', item)
},
finish () {
this.$emit('finish')
},
// 选择付款方式
toPay () {
this.$emit('toPay')
},
}
}
</script>
<style scoped lang='scss'>
.tool-box {
position: fixed;
right: toRpx(40);
top: calc(5% + #{toRpx(140)});
z-index: 998;
width: toRpx(120);
.btn {
width: 100%;
height: toRpx(120);
background-image: linear-gradient(180deg, #ffffff 0%, #f8f9fb 100%);
border: toRpx(2) solid #ffffff;
box-shadow: 0 toRpx(8) toRpx(24) 0 #00000033;
border-radius: toRpx(16);
font-size: toRpx(24);
color: #292d33;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.icon {
width: toRpx(60);
height: toRpx(60);
margin-bottom: toRpx(8);
transition: all 0.05s;
}
}
.hideIcon {
height: 0;
overflow: hidden;
opacity: 0;
.icon {
height: 0;
margin-bottom: 0;
}
}
.list {
width: 100%;
border: toRpx(2) solid #ffffff;
box-shadow: 0 toRpx(8) toRpx(22) 0 #0000001a;
border-radius: toRpx(16);
flex-direction: column;
align-items: center;
transition: all 0.05s;
overflow: hidden;
opacity: 0;
position: relative;
background: rgba(255, 255, 255, 0.6);
visibility: hidden;
height: 0;
&::after {
position: absolute;
content: "";
background: inherit;
top: 0;
left: 0;
right: 0;
bottom: 0;
filter: blur(toRpx(8));
z-index: -1;
}
.title {
width: toRpx(120);
height: toRpx(56);
background: #f4f4f5;
border: toRpx(2) solid #ffffff;
border-radius: toRpx(16) toRpx(16) 0 0;
display: flex;
align-items: center;
justify-content: center;
}
.item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: toRpx(20);
color: #666666;
// height: toRpx(120);
width: 100%;
padding-top: toRpx(16);
.icon {
width: toRpx(60);
height: toRpx(60);
margin-bottom: toRpx(8);
}
}
.active {
color: #2c66f7;
}
}
.showList {
display: flex;
opacity: 1;
padding-bottom: toRpx(16);
animation: scale-up-top-right 0.4s;
visibility: visible;
height: auto;
}
@keyframes scale-up-top-right {
0% {
transform: scale(0.5);
transform-origin: top right;
}
100% {
transform: scale(1);
transform-origin: top right;
}
}
}
</style>