<template>
	<view class="contactTheCustomerServiceIndex">
		<u-navbar title="联系客服" leftIconColor="#000" rightIcon='../../static/common/white_left_arrrow.png' placeholder
			leftIconSize='38rpx' autoBack="true">
		</u-navbar>
		<view class="content">
			<view class="bgc u-f u-f-jcc">
				<image style="width: 305rpx;height: 315rpx;" src="../../static/icon_kf_rx.png" mode=""></image>
			</view>
			<view class="add_vx">
				<view class="title">
					添加微信
				</view>
				<image :src="ServiceData.vxQrCode" mode="" @click="lookIMG(ServiceData.vxQrCode)"></image>
				<view class="label">
					长按或扫描二维码，添加客服微信
				</view>
			</view>
			<view class="zxkf">
				<text style="font-size: 28rpx;color: #333;font-weight: bold;">在线客服</text>
				<text style="font-size: 24rpx;color: #999 ;">{{ServiceData.cusServiceStartTime}} 至
					{{ServiceData.cusServiceEndTime}}</text>
				<!-- <text style="font-size: 24rpx;color: #999 ;"></text> -->
				<view>
					<button open-type="contact"
						style="color:white;backgroundColor:#FF4502;borderColor:#FF4502;color: #fff;"
						size="mini">联系客服</button>
				</view>

			</view>
			<view class="phone">
				<view class="title">
					客服电话
				</view>
				<view class="icon_cell">
					<image src="../../static/common/phoneImg.png" mode=""></image>
					<view class="cell">
						{{ServiceData.cusServicePhone}}
					</view>
				</view>
				<view class="btn" @click="callOut(ServiceData.cusServicePhone)">
					<view class="p">
						拨打电话
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				ServiceData: "",
			}
		},
		onShow() {
			this.getCustomerServiceData()
		},
		methods: {
			lookIMG(data) {
				uni.previewImage({
					urls: [data]
				})
			},
			callOut(data) {
				console.log("呼叫");
				uni.makePhoneCall({
					phoneNumber: data, //要拨打的手机号
					success: (res) => {
						// console.log("调用成功")
					},
					fail: (res) => {
						// console.log('调用失败!')
					}
				})
			},
			getCustomerServiceData() {
				this.$http.get('/api/client/userInfo/customerService').then(res => {
					this.ServiceData = res.data.data
				})
			}
		},
	}
</script>

<style lang="scss">
	.contactTheCustomerServiceIndex {
		height: 100vh;
		width: 100vw;
		background: #F8F6F6;

		.content {
			.bgc {
				width: 750rpx;
				height: 359rpx;
				background: #eb5528;
				border-radius: 0rpx 0rpx 0rpx 0rpx;
			}

			.add_vx {
				margin: auto;
				margin-top: -46rpx;
				width: 702rpx;
				height: 392rpx;
				background: #FFFFFF;
				border-radius: 8rpx 8rpx 8rpx 8rpx;
				overflow: hidden;

				.title {
					margin: 25rpx 0 0 20rpx;

					height: 37rpx;
					font-family: Microsoft YaHei, Microsoft YaHei;
					font-weight: bold;
					font-size: 28rpx;
					color: #333333;
					font-style: normal;
					text-transform: none;
				}

				image {
					display: block;
					margin: auto;
					margin-top: 30rpx;
					width: 199rpx;
					height: 199rpx;
					background: #F6D8D8;
					border-radius: 0rpx 0rpx 0rpx 0rpx;
				}

				.label {
					margin: auto;
					margin-top: 30rpx;
					width: 380rpx;
					height: 31rpx;
					font-family: Microsoft YaHei, Microsoft YaHei;
					font-weight: 400;
					font-size: 24rpx;
					color: #999999;
					font-style: normal;
					text-transform: none;
				}
			}

			.zxkf {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 30rpx 20rpx;
				background: #FFFFFF;
				border-radius: 8rpx;
				margin: 0 20rpx;
				margin-top: 20rpx;

			}

			.phone {
				margin: auto;
				margin-top: 20rpx;
				width: 702rpx;
				height: 293rpx;
				background: #FFFFFF;
				border-radius: 8rpx 8rpx 8rpx 8rpx;
				overflow: hidden;

				.title {
					margin: 25rpx 0 0 20rpx;
					height: 37rpx;
					font-family: Microsoft YaHei, Microsoft YaHei;
					font-weight: bold;
					font-size: 28rpx;
					color: #333333;
					font-style: normal;
					text-transform: none;
				}

				.icon_cell {
					display: flex;
					margin-top: 35rpx;

					image {
						margin: auto;
						margin-right: 0;
						width: 35rpx;
						height: 35rpx;
					}

					.cell {
						margin: auto;
						margin-left: 0;
						font-family: Microsoft YaHei, Microsoft YaHei;
						font-weight: bold;
						font-size: 28rpx;
						color: #333333;
						font-style: normal;
						text-transform: none;
					}
				}

				.btn {
					display: flex;
					margin: auto;
					margin-top: 33rpx;
					width: 190rpx;
					height: 68rpx;
					background: #eb5528;
					border-radius: 34rpx 34rpx 34rpx 34rpx;

					.p {
						margin: auto;
						font-family: Microsoft YaHei, Microsoft YaHei;
						font-weight: 400;
						font-size: 30rpx;
						color: #FFFFFF;
						font-style: normal;
						text-transform: none;
					}
				}
			}
		}
	}
</style>