<template>
	<view>
		<view class="goods-head" :style="'background:rgba(255,255,255,' + PageScrollTop / 100 + ')'">
			<!-- 返回 -->
			<view class="back" @click="onBack">
				<view class="back-one" :class="{ action: PageScrollTop > 120 }">
					<image class="back-one-left1" src="../../static/left1.png"></image>
					<image class="back-one-left" src="../../static/left.png"></image>
				</view>
			</view>
			<view class="head-title" :class="{ action: PageScrollTop > 120 }">招聘信息</view>
			<!-- tab切换 -->
		</view>
		<!-- banner -->
		<view class="banner">
			<image src="../../static/img/img3.png"></image>
		</view>
		<view class="banner-text">
			<view>
				<view class="banner-text-title">{{Info.jopName}}</view>
				<view>{{Info.pay}}</view>
				<view>{{Info.jop}}</view>
				<view class="company">
					<image src="../../static/img/head.jpg"></image>{{Info.companyName}}
				</view>
			</view>
			<!-- <view>
				<view class="time">{{formatDateTime(Info.lastModifyTime)}}</view>
				<view class="tousu">我要投诉<image src="../../static/tousu.png"></image>
				</view>
			</view> -->
		</view>
		<!-- 评价 -->
		<view class="evaluate-data" ref="evaluate">
			<view class="title-more">
				<view class="title">
					<view class="titleall-left-line"></view>招聘要求
				</view>
			</view>
			<view class="evaluate-list">
				<view class="content">
					<view class="character">
						<text class="character-icon" v-for="item in Info.lable.split('|')" v-if="item">{{item}}</text>
					</view>
				</view>
			</view>
			<view class="evaluate-list-line"></view>
			<view class="title-more">
				<view class="title">
					<view class="titleall-left-line"></view>职位介绍
				</view>
			</view>
			<view class="evaluate-list">
				<view class="content">
					<view class="character" v-html="Info.introduce">

					</view>
				</view>
			</view>
			<view class="evaluate-list-line"></view>
			<view class="title-more">
				<view class="title">
					<view class="titleall-left-line"></view>工作内容
				</view>
			</view>
			<view class="evaluate-list">
				<view class="content">
					<view class="character" v-html="Info.content">

					</view>
				</view>
			</view>
		</view>

		<view class="my-phone">
			<view>客服电话：654564</view>
			<view>彭州市人社局监督电话：541516</view>
			<view>备案号：6556121212</view>
		</view>
		<!-- 底部 -->
		<view class="page-footer">
			<view class="footer-fn">
				<!-- <view class="list1"> -->
				<!-- <button open-type="share">cnm</button> -->
				<!-- </view> -->
				<button class="share-btn" open-type="share">
					<view class="shareBtn-textUP">
						分享岗位
					</view>
					<text class="shareBtn-text">分享可获得录用优先</text>
				</button>
				<!-- 				<view class="list">
					<text>分享可获得录用优先</text>
				</view> -->
			</view>
			<view class="footer-buy" @click="PostApplyL()">
				<view class="buy-at">
					<view class="buy-top">提交审核</view>
					<view>{{Info.peopleNum}}人已投递</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				isMore: false,
				AttentionShow: 0,
				swiperList: [{
					id: 0,
					type: 'image',
					url: '/static/img/goods_banner_01.png'
				}, ],
				PageScrollTop: 0,
				id: 0,
				Info: []
			};
		},
		onLoad(params) {
			this.id = params.id;
			this.GettbrecruitById();

			wx.showShareMenu({
				withShareTicket: true, //设置下方的Menus菜单，才能够让发送给朋友与分享到朋友圈两个按钮可以点击 
				menus: ["shareAppMessage", "shareTimeline"]
			})
		},
		onPageScroll(e) {
			this.PageScrollTop = e.scrollTop;
		}, 
		methods: {
			Open() {
				wx.showShareMenu({
					withShareTicket: true, //设置下方的Menus菜单，才能够让发送给朋友与分享到朋友圈两个按钮可以点击 
					menus: ["shareAppMessage", "shareTimeline"]
				})
			},
			PostApplyL() {
				this.API.PostApplyL(this.id).then(res => {
					if (res.code == 200) {
						uni.showToast({
							title: '申请岗位成功，请等待公司联系！',
							icon: 'none'
						});
					}
				});
			},
			formatDateTime(value) { // 时间戳转换日期格式方法
				if (value == null) {
					return ''
				} else {
					const date = new Date(value)
					const y = date.getFullYear() // 年
					let MM = date.getMonth() + 1 // 月
					MM = MM < 10 ? ('0' + MM) : MM
					let d = date.getDate() // 日
					d = d < 10 ? ('0' + d) : d
					let h = date.getHours() // 时
					h = h < 10 ? ('0' + h) : h
					let m = date.getMinutes() // 分
					m = m < 10 ? ('0' + m) : m
					let s = date.getSeconds() // 秒
					s = s < 10 ? ('0' + s) : s
					return y + '-' + MM + '-' + d;
				}
			},
			GettbrecruitById() {
				this.API.GettbrecruitById(this.id).then(res => {
					this.Info = res.data;
				});
			},
			/**
			 * 返回
			 */
			onBack() {
				3.
				uni.navigateBack();
			},
		}
	};
</script>

<style scoped lang="scss">
	@import 'JobsDetails.scss';

	::v-deep.share-btn {
		position: relative;
		background-color: rgba(0, 0, 0, 0);
		border-radius: 0;
		height: 100%;
		color: rgb(124, 126, 255);

		.shareBtn-textUP {
			position: absolute;
			left: 50%;
			top: -5rpx;
			transform: translate(-50%);
			padding-top: -10rpx !important;
			font-size: 32rpx
		}

		// 分享按钮里面的文字使用定位
		.shareBtn-text {
			position: absolute;
			bottom: 10rpx;
			left: 50%;
			transform: translate(-50%);
			width: 100%;
			font-size: 24rpx;
		}
	}
</style>
