luban-mall/components/customer/public-customer.vue

68 lines
2.0 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" style="position: fixed;z-index: 2; width: 120rpx;height: 120rpx;border-radius: 100%;display: flex;justify-content: center;align-items: center;box-shadow: 0rpx 0rpx 20rpx rgba(0,0,0,.22);">
<image class="posia" src="/static/public/icon-customer.png" style="width: 50rpx;height: 50rpx;top: 20rpx;" mode="" lazy-load></image>
<view class="colf fon20 posia" style="bottom: 20rpx;">在线客服</view>
<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:"public-customer",
props:{
nright:{//距离右边多宽
type:Number,
default:30
},
nbottom:{//距离底部多高
type:Number,
default:260
},
isSmall:{//是否是大图
type:Boolean,
default:false
},
nid:{//内容id
type:String,
default:'0'
}
},
computed: {
// 主题颜色
publicColor() {
return this.$store.state.publicColor
}
},
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) {}
// })
this.$requst.post('user/rand-bind-service').then(res=>{})
this.$toolAll.tools.closeTimer()//清空埋点倒计时
this.$requst.post('user/record',{type:'other',action:'ask',id:this.nid}).then(res=>{},error=>{})
// 调用tools.js中的种植埋点事件
this.$toolAll.tools.plantPoint(5);
}
}
}
</script>
<style>
.smallImg{transform: scale(.8);margin-right: -10rpx;}
.customer-box {
animation: scale_name 1s linear alternate infinite;
}
@keyframes scale_name{
from{transform: scale(1);}
to{transform: scale(1.2);}
}
</style>