66 lines
1.6 KiB
Vue
66 lines
1.6 KiB
Vue
<template>
|
|
<view>
|
|
<view @tap="lianK" :style="{background:publicColor || '#e00c34',right:nright+'rpx',bottom:nbottom+'rpx'}" :class="isSmall?'smallImg':''" class="fw posir customer-box disjcac">
|
|
<image src="/static/public/icon-customer.png" style="width: 118rpx;height: 120rpx;" mode="" lazy-load></image>
|
|
<button class="fon24 posia" style="opacity: 0;top: 0;left: 0;right: 0;bottom: 0;" open-type="contact">客服</button>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name:"customer-one",
|
|
props:{
|
|
nright:{//距离右边多宽
|
|
type:Number,
|
|
default:30
|
|
},
|
|
nbottom:{//距离底部多高
|
|
type:Number,
|
|
default:170
|
|
},
|
|
isSmall:{//是否是大图
|
|
type:Boolean,
|
|
default:false
|
|
},
|
|
nid:{//内容id
|
|
type:String,
|
|
default:'0'
|
|
}
|
|
},
|
|
computed: {
|
|
// 主题颜色
|
|
publicColor() {
|
|
return 'linear-gradient(to right top,#df0b33 0%,#fe4a69 100%)'
|
|
}
|
|
},
|
|
data() {
|
|
return {};
|
|
},
|
|
methods:{
|
|
lianK(){
|
|
// wx.openCustomerServiceChat({
|
|
// extInfo: {url: `https://work.weixin.qq.com/kfid/kfcb3bba5b57d9a42ba?enc_scene=ENC616HXDjLYNcmsR49PBE75UERg8Ncv3dygpYjfnh3XVvA&scene_param=${uni.getStorageSync('openid')}`},
|
|
// corpId: 'ww1f86f258d4ff5817',
|
|
// success(res) {}
|
|
// })
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.smallImg{transform: scale(.8);margin-right: -10rpx;}
|
|
.customer-box {
|
|
position: fixed;z-index: 2;
|
|
width: 135rpx;height: 135rpx;
|
|
border-radius: 40%;
|
|
box-shadow: 0rpx 0rpx 10rpx rgba(0,0,0,.5);
|
|
animation: scale_name 1s linear alternate infinite;
|
|
}
|
|
@keyframes scale_name{
|
|
from{transform: scale(1);}
|
|
to{transform: scale(1.2);}
|
|
}
|
|
</style>
|