<template>
	<view class="container safe-area-inset-bottom">
		<MessageNotification />
		<!-- 隐私内容 -->
		<view class="card">
			<view class="box">
				<view class="title" @click="toCell(msg)">
					客服热线
				</view>
				<text>{{msg}}</text>
			</view>
			
			<button type="default" open-type="contact" class="btn">
				<u-icon name="kefu-ermai" color="#fff" size="36" style="margin-right: 8rpx;"></u-icon>
				咨询客服
			</button>
		</view>
	</view>
</template>

<script>
	import {
		serviceOnline
	} from '../../request/api/api'

	export default {
		data() {
			return {
				// 号码
				msg: ""
			}
		},
		onLoad() {

		},
		methods: {
			// 客服热线
			getInfo() {
				serviceOnline({
					method: "post",
					data: {
						store_id: uni.getStorageSync('store_id') || '11001',
					}
				}).then((res) => {
					// console.log(res, 'dh');
					this.msg = res.data.data.msg
				})
			},
			// 拨号-客服热线
			toCell(e) {
				let phone = e
				uni.makePhoneCall({
					phoneNumber: phone
				});
			},
		},
		mounted() {
			this.getInfo()
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		width: 100vw;
		min-height: 100vh;
		max-height: 100%;
		background: #F5F5F5;
		padding-bottom: env(safe-area-inset-bottom);

		.card {

			.box {
				width: 750rpx;
				height: 98rpx;
				background: #FFFFFF;
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 0 40rpx;
				margin: 20rpx 0;

				.title {
					font-size: 28rpx;
					font-family: PingFang SC-Bold, PingFang SC;
					font-weight: bold;
					color: #232323;
					margin: 10rpx 0;
					line-height: 46rpx;
					letter-spacing: 1rpx;
				}

				text {
					font-size: 28rpx;
					font-family: PingFang SC-Regular, PingFang SC;
					font-weight: 400;
					color: #475569;
				}
			}
			
			.btn {
				width: 686rpx;
				height: 86rpx;
				background: #569afe;
				border-radius: 68rpx;
				color: #fff;
				position: fixed;
				bottom: env(safe-area-inset-bottom);
				left: 4%;
				margin: 10rpx auto;
				line-height: 86rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				z-index: 9999;
			}
		}
	}
</style>