<template>
	<view   v-if="CustomerService.suspension == '1'" >
		<view class="col-f f-42 zooms" id="id" :style="{position: 'fixed',left:CustomerService.logoleft + 'px',bottom: CustomerService.logobottom + 'px'}"
		 v-if="CustomerService.logoloca == '1' && btndata" >
			<drag-button :isDock="true" :existTabBar="true" :btndata="btndata" @btnClick="gourl" @btnTouchstart="btnTouchstart" @btnTouchend="btnTouchend" />
			<!-- <image :src="CustomerService.susicon" class="img" :style="{width: CustomerService.logowidth + 'px',height:CustomerService.logowidth + 'px'}"  mode="aspectFit"></image> -->
		</view>
		<view class="col-f f-42 zooms" id="id"  v-if="CustomerService.logoloca == '0' && btndata" :style="{position: 'fixed',bottom: CustomerService.logobottom + 'px',right:CustomerService.logoleft + 'px'}"
		 >
		 <!-- <image :src="CustomerService.susicon" class="img" :style="{width: CustomerService.logowidth + 'px',height:CustomerService.logowidth + 'px'}"  mode="aspectFit"></image> -->
			<drag-button :btndata="btndata" :isDock="true" :existTabBar="true" @btnClick="gourl" @btnTouchstart="btnTouchstart" @btnTouchend="btnTouchend" />
		</view>
		<popup-view :show="showCommunity" type="center" @clickmask="showCommunity = false">
			<view class="mainView marT30Auto textC" style="width: 80vw;height: 80vh;">
				<view class="title textC marT80Auto backImg" :style="{ background: 'url(' + backImg + ')' }"><text class="font30">在线咨询</text></view>
				<view class="body marT50Auto" @click="checkImg">
					<view class="p20">
						<image :src="CustomerService.qrcode" class="qrCode"></image>
					</view>
				</view>
				<view class=" textC marT50 marT50Auto">
					<text class="font30 color333333">{{CustomerService.tel}}</text>
				</view>
				<view class="phoneButton textC marT19Auto f-22" style="color: #999999;" @click="kfPhone">
					点击拨打电话
				</view>
				<!-- #ifdef H5 -->
					    <!-- <view v-html="wxOpenTags"></view> -->
				
					<!-- #endif --> 
				<view class="marT30">
					<text class="font24 color666666">长按保存二维码或者点击拔打电话</text>
				</view>
				<view>
					<text class="font24 color666666">添加客服微信</text>
				</view>
				<view>
					<text class="font24 color666666">我们会尽快回复您</text>
				</view>
				<!-- <navigator class="searchbox2-l" url="/pages/subPages/search/search" hover-class="none">
					经历抽奖
				</navigator> -->
				<!-- <view class="f-20" @click="qqqq">
					经历抽奖
				</view>
				<view class="f-20" @click="wwww">
					获奖列表
				</view>
				<view class="f-20" @click="ssss">
					抽奖码
				</view> -->
				<!-- <view class="f-20" @click="aaaa">
					发布服务
				</view>
				<view class="f-20" @click="eeee">
					入驻
				</view> -->
				<!-- <view class="f-20" @click="xxxx">
					发布招聘
				</view>
				<view class="f-20" @click="rrrr">
					添加简历
				</view>
				<view class="f-20" @click="tttt">
					招聘详情
				</view>
				<view class="f-20" @click="yyyy">
					企业列表
				</view> -->
			</view>
		</popup-view>
	
	</view>
</template>

<script>
	import App from '@/common/js/app.js';
	import dragButton from "@/components/drag-button/drag-button.vue";
	import PopupView from '@/components/template/PopManager.vue';
	export default {
		data() {
			return {
				CustomerService: {},
				showCommunity: false,
				btndata:{}
			}
		},
		components: {
			PopupView,
			dragButton
		},
		mounted() {
			let _this = this;
			this.CustomerService = uni.getStorageSync('CustomerService');
			setTimeout(()=>{
				const query = uni.createSelectorQuery().in(_this);
					query.select('#id').boundingClientRect(data => {
						// console.log(data)
						_this.btndata = data;
					}).exec();
			})
			//#ifdef H5  
				    setTimeout(()=>{  
				        this.wxOpenTags=`<wx-open-launch-weapp path="pages/mainPages/index/index.html" id="launch-wxapp" username="gh_59d3d43b1c12">  
				            <template>  
				                <view class="btn-open-weapp"><image src="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1178643745,283795116&fm=26&gp=0.jpg" mode=""></image></view>  
				            </template>  
				        </wx-open-launch-weapp>`;  
				    },1000);  
			//#endif
		},
		computed: {
			backImg() {
				return this.imageRoot + 'zxzx.png';
			}
		},
		methods: {
			xxxx(){
				App.navigationTo({
					url: "pages/subPages2/hirePlatform/postRecruitment/postRecruitment"
				});
			},
			yyyy(){
				App.navigationTo({
					url: "pages/subPages2/hirePlatform/companiesList/companiesList"
				});
			},
			tttt(){
				App.navigationTo({
					url: "pages/subPages2/hirePlatform/recruitmentDetails/recruitmentDetails"
				});
			},
			rrrr(){
				// App.navigationTo({
				// 	url: "pages/subPages2/booked/bookedInformation/bookedInformation"
				// });
			},
			qqqq(){
				App.navigationTo({
					url: "pages/subPages2/lottery/lotteryIndex/lotteryIndex?i=1&aid=125&head_id=51&recordid=24&id=5"
				});
			},
			wwww(){
				App.navigationTo({
					url: "pages/subPages2/lottery/lotteryList/lotteryList?i=1&aid=125&sharemid=51&recordid=21"
				});
			},
			ssss(){
				App.navigationTo({
					url: "pages/subPages2/lottery/lotteryCode/lotteryCode"
				});
			},
			aaaa(){
				App.navigationTo({
					url: "pages/subPages2/homemaking/pubService/pubService"
				});
				
				
			},
			eeee(){
				App.navigationTo({
					url: "pages/subPages2/homemaking/serviceIn/serviceIn"
				});
			},
			btnTouchend() {

			},
			btnTouchstart() {

			},
			checkImg() {
				let _this = this
				let a = []
				a.push(_this.CustomerService.qrcode)
				uni.previewImage({
					urls: a
				})
			},
			kfPhone() {
				let _this = this
				uni.makePhoneCall({
					phoneNumber: _this.CustomerService.tel //仅为示例
				});
			},
			gourl() {
				if (this.CustomerService.type == '0') {
					this.showCommunity = true;
					// debugger
					// App.navigationTo({
					// 	url: "pages/subPages2/phoneBook/phoneClass/phoneClass"
					// })
					// App.navigationTo({
					// 	url: "pages/subPages2/coursegoods/localindex/localindex"
					// });
					
					// App.navigationTo({
					// 	url: "pages/subPages2/newBuyOrderOrder"
					// })
					// App.navigationTo({
					// 	url: 'pages/subPages/orderList/orderList?type=' + 10
					// });
				} else {
					let url = encodeURIComponent(this.CustomerService.url);
					// App.navigationTo({
					// 	url: `pages/subPages/webview/webview?urlsrc=${url}`
					// })
					// App.navigationTo({
					// 	url: "pages/subPages2/drawGame/drawGame1"
					// });
					// App.navigationTo({
					// 	url: "pages/subPages2/coursegoods/localindex/localindex"
					// });
					
					if(this.CustomerService.url.indexOf('https://work.weixin.qq.com') != -1){
						App.navigationTo({
							url:this.CustomerService.url
						});
					}else{
						uni.navigateTo({
							url: `/pages/subPages/webview/webview?urlsrc=${url}`
						});
					}
					
				}
			}
		}
	}
</script>

<style lang="less" scoped>
	.img {
		// border-radius: 50%;
	}

	.zooms {
		z-index: 997;
	}

	.customer {
		font-size: 0;
	}

	.customer {
		background: #eeeeee;
	}

	.mainView {
		border: 1upx solid rgba(0, 0, 0, 0);
		width: 690upx;
		height: 840upx;
		background: rgba(255, 255, 255, 1);
		border-radius: 10upx;
	}

	.marT30Auto {
		margin: 30upx auto 0 auto;
	}

	.textC {
		text-align: center;
	}

	.title {
		width: 271upx;
		height: 41upx;
	}

	.font30 {
		font-size: 30upx;
	}

	.marT80Auto {
		margin: 80upx auto 0 auto;
	}

	.backImg {
		background-size: 100% !important;
	}

	.body {
		width: 340upx;
		height: 340upx;
		border: 2upx solid rgba(255, 68, 68, 1);
		border-radius: 10upx;
	}

	.marT50Auto {
		margin: 50upx auto 0 auto;
	}

	.qrCode {
		width: 300upx;
		height: 300upx;
	}

	.phoneButton {
		width: 164upx;
		height: 40upx;
		background: rgba(245, 245, 245, 1);
		border: 1upx solid rgba(204, 204, 204, 1);
		border-radius: 4upx;
	}

	.font30 {
		font-size: 30upx;
	}

	.lineHeight40 {
		line-height: 40upx;
	}

	.color333333 {
		color: rgba(51, 51, 51, 1);
	}

	.font22 {
		font-size: 22upx;
	}

	.marT19Auto {
		margin: 19upx auto 0 auto;
	}

	.font24 {
		font-size: 24upx;
	}

	.marT30 {
		margin: 30upx 0 0 0;
	}

	.color666666 {
		color: rgba(102, 102, 102, 1);
	}

	.p20 {
		padding: 20upx;
	}
	.btn-open-weapp{
	    background: linear-gradient(to right, #ffd52e 0%, #ffef93 50%, #ffd52e 100%);  
	    border: 0;  
	    color: #424242;  
	    text-shadow: 0px 1px 1px #fff;  
	    border-radius: 50px;  
	    text-align: center;  
	    width: 120px;  
	    height: 35px;  
	    line-height: 35px;  
	    outline:none;  
	} 
</style>
