<template>
	<view>
		<view style="color: #fff;">
		<tn-nav-bar :bottomShadow="false" backgroundColor="#26B3A0">客服中心</tn-nav-bar>
		<view :style="{height: tobheight+'px'}"></view>
		</view>
		<view class="server">
			<image src="/static/images/kefu.png" mode=""></image>
		</view>
		<view v-if="appInfo.kf_tel" class="kefu">
			<view class="dian"></view>
			<view class="">客服手机号：{{appInfo.kf_tel}}</view>
			<view class="yijian"><u-button @click="bohao" color="#26B3A0" size="mini" type="primary" shape="circle" text="一键拨号"></u-button></view>
		</view>
		<view v-if="appInfo.kf_wechat" class="kefu">
			<view class="dian" ></view>
			<view >客服微信号：{{appInfo.kf_wechat}}</view>
			<view class="yijian"><u-button @click="fhuzhi" color="#26B3A0" size="mini" type="primary" shape="circle" text="一键复制"></u-button></view>
			
		</view>
		<!-- <view class="sds">dfhsfsdh25</view> -->
		<block v-if="appInfo.kf_qrcode_path">
			<view class="kefu">
				<view class="dian"></view>
				<view class="">客服二维码</view>
			</view>
			<view class="qrcode_path">
				<image @click="viewsave(appInfo.kf_qrcode_path)" :src="appInfo.kf_qrcode_path" mode="widthFix"></image>
			</view>
		</block>
		
		
		<wike-loading-page :isLoading="isLoading"></wike-loading-page>
	</view>
</template>

<script>
	import { mapMutations, mapActions, mapState, mapGetters } from 'vuex';
	export default {
		data() {
			return {
				tobheight:45,
				platform: this.$platform.get(),
				isLoading:true,
				themeColor:'#007AFF',
				codeBgColor:'#26B3A0',
				content:'if(daur){this.fhdj = fgjf}'
			}
		},
		computed: {
			...mapGetters(['appInfo'])
		},
		watch: {
			appInfo: function(e) {
				let that = this;
				uni.setNavigationBarTitle({
					title: that.appInfo.site_name
				})
			}
		},
		onLoad() {
			if(this.platform == 'wxMiniProgram'){
			var menumtop = uni.getMenuButtonBoundingClientRect().top - uni.getSystemInfoSync().statusBarHeight
			var paddingtop = uni.getSystemInfoSync().statusBarHeight + menumtop
			this.tobheight = (menumtop+paddingtop+uni.getMenuButtonBoundingClientRect().height)
			}
			this.isLoading = false
		},
		methods: {
			viewsave(e){
				uni.previewImage({
					urls:[e],
					current:0
				})
			},
			bohao(){
				var that = this;
				uni.makePhoneCall({
					phoneNumber: that.appInfo.kf_tel
				});
			},
			fhuzhi(){
				var that = this;
				uni.setClipboardData({
					data: that.appInfo.kf_wechat,
					success: function () {
						uni.showToast({
							title:'微信号已复制'
						})
					}
				});
			}
		}
	}
</script>

<style lang="scss">
	page{
		background: #F6F7FB;
	}
	.kefu{
		background: #ffffff;
		padding: 38rpx 30rpx;
		display: flex;
		align-items: center;
		font-weight: bold;
		// margin-top: 38rpx;
		font-size: 32rpx;
		border-bottom: 1px solid #ededed;
		.dian{
			width: 20rpx;
			height: 20rpx;
			border-radius: 50%;
			background: #26B3A0;
			margin-right: 16rpx;
		}
	}
	.qrcode_path{
		width: 100%;
		// height: 800rpx;
		padding: 30rpx;
		background: #ffffff;
		display: flex;
		justify-content: center;
		image{
			width: 92%;
			height: 100%;
			
		}
	}
	.sds{
		background: #ffffff;
		padding: 0 30rpx;
	}
    
	.yijian{
		width: 150rpx;
		margin-left: 30rpx;
	}
	.server{
		display: flex;
		justify-content: center;
		
		margin: 60rpx 0;
		image{
			width: 100px;
			height: 100px;
		}
	}
	
	
</style>
