<template>
	<v-page>
		<v-header :title="$t('common.service')"></v-header>
		<view class="onsczone" v-if="isLoad">
			<web-view :src="csurl" style="margin-top: 3rem;"></web-view>
		</view>
		
	</v-page>
</template>

<script>
	import Member from "@/api/member";
	export default {
		data() {
			return {
				csurl:"",
				isLoad:false
			}
		},
		mounted() {
			this.mkcslinks()
		},
		methods: {
			// build
			mkcslinks(){
				let user = uni.getStorageSync('user')
				if(user){
					// console.log(user)
					// let ustr = JSON.parse(user)
					// console.log(ustr)
					// this.csurl += ustr.referrer+"&room_id="+ustr.account;
					// console.log("user",this.csurl)
					let ustr = JSON.parse(user)
					Member.getUnameByUid({user_id:ustr.referrer}).then(rfres=>{
						let rfu = rfres.data
						this.csurl += rfres.username+"&room_id="+ustr.account+"&usid="+ustr.user_id;
						let chaturl="https://cs.qntcoin.com/chat/?toid="+rfu.username+"&room_id="+ustr.account+"&usid="+ustr.user_id;
						this.csurl = chaturl
						this.isLoad = true;
					})
				}
			}
		}
	}
</script>

<style lang="less" scoped>
.onsczone{
	margin-top: 12rem;
	
}
</style>