<template>
	<div>
		<web-view :src="url"></web-view>
	</div>
</template>
<script setup lang='ts'>
	import { onShow } from "@dcloudio/uni-app";
	import {
		getOnLineUrlApi
	} from "@/utils/network/api.js";
	import {
		ref
	} from 'vue'
	// let url = ref('https://mcs-ynt.hltgz.com/onekey.html?id=c3pnog1pbnr4dq&appName=gzetc144&appChannel=20001')
	let url = ref('')
	import {getItem} from "@/utils/storage";
	import {request} from "@/utils/network/request.js";
	import {stringToJson} from "@/utils/network/encryption";
	onShow(() => {
		getOnLineUrl()
	});
	// 在线客服请求
	const getOnLineUrl = () => {
		const options = {
			type: 2,
			data: {
				"uid":getItem('openId'),//用户唯一标识(微信公众号openid)
				"phone":getItem('mobile'),
				"chl":"9ZHOUETC"
			},
			method: "POST",
			showLoading: true,
		};
		request(getOnLineUrlApi, options).then((res) => {
			const data = stringToJson(res.bizContent);
			url.value=data.data.rd
			console.log("在线客服请求", stringToJson(res.bizContent))
			
		})
	}
</script>
<style lang='scss' scoped>

</style>