toolbar.vue
3.27 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
<style>
/*star 9-14*/
.toolbar_div1{width:57px;position:fixed;z-index: 100;
right:0px;
bottom:0%;background:#fff;}
.toolbar_div1 span{height:22px;line-height: 22px;display: block;
cursor: pointer;text-align: center;background:#86b8bc;color:#fff;
font-size:14px;margin-top:2px;}
.toolbar_div1 span i{
display:block;height:20px;
transition:all 0.3s linear;
background: url(/images/s914c_03.png) center center no-repeat;
}
.toolbar_div1 ul{margin:0px;padding:0px;background:#86b8bc;
overflow: hidden;height:0px;
padding:1px;-webkit-transition:all 0.3s linear;}
.toolbar_div1.show ul{height:281px;}
.toolbar_div1.show span i{
transform:rotate(-180deg);
}
.toolbar_div1 ul li{list-style: none;margin-bottom:1px;height:55px;
line-height: 55px;background:#fff;}
.toolbar_div1 em{display:block;cursor: pointer;margin:0px;padding:0px;
height:57px;}
.toolbar_div1 ul li a{display: block;height:55px;transform:scale(1);
-webkit-transition:all .2s linear;}
.toolbar_div1 ul li:nth-child(1) a{
background-image: url(/images/s928b1.gif)
}
.toolbar_div1 ul li:nth-child(2) a{
background-image: url(/images/s_914b_06.png)
}
.toolbar_div1 ul li:nth-child(3) a{
background-image: url(/images/s_914b_08.png)
}
.toolbar_div1 ul li:nth-child(4) a{
background-image: url(/images/s_914b_11.png)
}
.toolbar_div1 ul li:nth-child(5) a{
background-image: url(/images/s_914b_15.png)
}
.toolbar_div1 ul li:nth-child(5){margin-bottom:0px;}
.toolbar_div1 ul li:nth-child(1).disabled a{
background-image: url(/images/s928b2.gif)
}
.toolbar_div1 ul li:hover a{
transform:scale(1);
}
</style>
<template>
<div class="toolbar_div1" :class="{'show':show}" >
<em v-on:click="top"><img src="/images/s_914b_01.png"></em>
<ul>
<li :class="{'disabled':disabled}">
<a :href="href" target="_blank">
</a>
</li>
<li>
<a href="javascript:">
</a>
</li>
<li>
<a href="javascript:">
</a>
</li>
<li>
<a href="javascript:">
</a>
</li>
<li>
<a href="javascript:">
</a>
</li>
</ul>
<span v-on:click="toggle()"><i></i></span>
</div>
</template>
<script>
module.exports={
data:function(){
return {
href:'javascript:',title:'',show:true,
localpath:'',path:'',disabled:true
}
},props:{
class:{
type:String,default:'sitecolumnlink'
}
},
watch:{
'$route.path':function(val){
this.getData();
}
},methods:{
getData:function(){
var that=this;
Ajax.get('/platform/sitedata/links/1',{
path:this.$route.path
}).then(function(res){
var result=res.data;
console.log(result);
if(result.errorCode==0 && result.data){
that.href=result.data.link;
that.title=result.data.title;
that.path=result.data.path;
that.disabled=false;
var path=that.$route.path;
var reg=new RegExp(that.path,'gim');
if(!reg.test(path)){
that.href='javascript:'
that.disabled=true;
console.log(path,that.path,reg.test(path))
}
}
})
},toggle:function(){
this.show=!this.show;
},top:function(){
$('html,body').animate({scrollTop:'0px'},400)
}
},ready:function(){
this.getData();
}
}
</script>