toolbar.vue 3.27 KB
<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>