<template>
	<view class="topcon" @click="goservice">
		<image class="topimg" src="/static/image/kf.png" mode="aspectFill" lazy-load></image>
	</view>
</template>

<script> 
import { myCache } from '../../utils/utils.js';
export default {
	data() {
		return {
		};
	}, 
	methods: {
		goservice(){
			var shop=myCache('shop');
			var phone=shop&&shop.phone?shop.phone:"";
			myCache('linemobile',phone)
			// 在线客服
			if(myCache('linemobile')){
				// 在线客服
				uni.makePhoneCall({
					phoneNumber: String(myCache('linemobile')),
					success:function(){
						console.log('拨打电话成功');
					},
					fail() {
						console.log('打电话失败了');
					}
				}); 
			}
			this.$emit("goservice", "goservice");
		}
	}
}
</script>

<style lang="scss" scoped>
	.topcon{
		position: fixed;
		right: 20rpx;
		bottom: 280rpx;
		width: 66rpx;
		height: 66rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: rgba(228, 249, 247, 0.8);
		border-radius: 100% 100%;
		border: 1rpx solid #00a89b;
		z-index: 998;
		.topimg{
			width: 40rpx;
			height: 40rpx;
			opacity: 1;
		}
	}
</style>
 