101 lines
2.2 KiB
Vue
101 lines
2.2 KiB
Vue
|
<template>
|
||
|
<view>
|
||
|
<view @tap="lianK"
|
||
|
:style="{
|
||
|
background: backgroundColor,
|
||
|
right:nright+'rpx',
|
||
|
bottom:nbottom+'rpx',
|
||
|
boxShadow: `0rpx 0rpx 30rpx rgba(0,0,0,${shadowNum})`,
|
||
|
borderRadius: radiusNum,
|
||
|
width: widthHeight,
|
||
|
height: widthHeight}"
|
||
|
class="customer-box">
|
||
|
<i class="icon" :style="{color:iconColor}" :class="['icon-customer','icon-customer-black'][iconNum]" style="font-size: 70rpx;"></i>
|
||
|
<!-- <image class="posia" src="/static/public/btnKF.png" style="width: 50rpx;height: 50rpx;top: 20rpx;" mode=""></image> -->
|
||
|
<view v-if="showText" class="fon20" style="margin-top: -20rpx;">在线客服</view>
|
||
|
<button class="fon24 posia-op" open-type="contact"></button>
|
||
|
</view>
|
||
|
</view>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
name:"public-customer",
|
||
|
props:{
|
||
|
// 客服框框大小
|
||
|
widthHeight:{
|
||
|
type:String,
|
||
|
default:'110rpx'
|
||
|
},
|
||
|
// 客服框背景色
|
||
|
backgroundColor:{
|
||
|
type:String,
|
||
|
default:'#000000'
|
||
|
},
|
||
|
// 阴影大小0~1
|
||
|
shadowNum:{
|
||
|
type:Number,
|
||
|
default:0.55
|
||
|
},
|
||
|
// 圆角大小
|
||
|
radiusNum:{
|
||
|
type:String,
|
||
|
default: '26rpx'
|
||
|
},
|
||
|
//距离右边多宽
|
||
|
nright:{
|
||
|
type:Number,
|
||
|
default:20
|
||
|
},
|
||
|
nbottom:{//距离底部多高
|
||
|
type:Number,
|
||
|
default:260
|
||
|
},
|
||
|
// 是否显示在线客服文本
|
||
|
showText:{
|
||
|
type:Boolean,
|
||
|
default:true
|
||
|
},
|
||
|
// 客服图标选中
|
||
|
iconNum:{
|
||
|
type:Number,
|
||
|
default:0
|
||
|
},
|
||
|
// 客服图标颜色
|
||
|
iconColor:{
|
||
|
type:String,
|
||
|
default:'#FFFFFF'
|
||
|
},
|
||
|
nid:{//内容id
|
||
|
type:String,
|
||
|
default:'0'
|
||
|
}
|
||
|
},
|
||
|
data() {
|
||
|
return {
|
||
|
publicColor:uni.getStorageSync('publicColor'),
|
||
|
};
|
||
|
},
|
||
|
methods:{
|
||
|
lianK(){
|
||
|
this.$requst.post('user/rand-bind-service').then(res=>{})
|
||
|
this.$requst.post('user/record',{type:'other',action:'ask',id:this.nid}).then(res=>{},error=>{})
|
||
|
let maiOjb = {
|
||
|
e:5,//内容咨询
|
||
|
t:new Date().getTime()//当前时间戳
|
||
|
}
|
||
|
this.$toolAll.tools.maiDian(maiOjb)
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style scoped>
|
||
|
.customer-box {
|
||
|
position: fixed;z-index: 2;
|
||
|
display: flex;justify-content: center;align-items: center;flex-wrap: wrap;
|
||
|
box-sizing: border-box;
|
||
|
color: #FFFFFF;
|
||
|
}
|
||
|
</style>
|