<template>
	<!-- 信息发布 -->
	<view class="sendInformation" style="padding-top: 90px;background-color: #FFFFFF;">
		<view class="status_bar">
			<!-- 这里是状态栏 -->
		</view>
		<navigationBar custom="true">
			<view :style="{width: '100vw',height: '50px'}" style="background-color: #FFFFFF;position: fixed;z-index: 999;top:40px;">
				<view :style="{padding: '10px', paddingLeft: '20px'}" style="display: flex;">
					<!-- <image :style="{verticalAlign: 'middle', width: 94 + 'px',height: 30 + 'px'}" src="../../../static/logo.png" mode=""></image> -->
					<image :style="{verticalAlign: 'middle', width: 30 + 'px',height: 30 + 'px'}" src="../../../static/logo.png" mode=""></image>
					<view style="font-size: 18px;font-weight: bold;line-height: 30px;margin-left: 4px;">粤职才</view>
				</view>
			</view>
		</navigationBar>
		<far-bottom></far-bottom>
		<!-- 分类列表 -->
		<view class="sendInformationType">
			<view class="sendInformationPackage">
				<view class="typeTips">
					<image :src="imgfixUrls + 'merchant/ts.png'" />
					<span>免责声明：{{mzsmText}}</span>
				</view>

				<!-- 跳转入驻 -->
				<view class="goRz" @click="goSettled" v-if="hidesettle == 0 && 0">
					<view class="goRzPackage">
						<view class="goRzleft">
							<image :src="imgfixUrls + 'merchant/sjrz.png'" />
							<view>
								<view><span> {{korea == 1?'가계,매장,회사 등 업체는 한밥상을 이용하여 사업하세요!':`我是企业，点击入驻${TextSubstitution.sysname}`}} </span></view>
								<view><span>{{korea == 1?'업체홍보 , 상품판매 , 음식배달 , 고객확보':`超低成本、本地宣传、简单有效、方便快捷！`}}</span></view>
							</view>
						</view>
						<view class="goRzRight"><image :src="imgfixUrls + 'merchant/right.svg'" /></view>
					</view>
				</view>
				<!-- 跳转入驻 -->
				
				
				<!-- 选择类型提示 -->
				<view class="checkTips"><span>—— 请选择发布类别 ——</span></view>
				<!-- 选择类型提示 -->

				<!-- 选择分类列表 -->
				<!-- <swiper class="classificationList"> -->
					<!-- 循环模板 -->
					<!-- 如果需要换回滑动切换的菜单，itme标签应循环arr,打开arr的数组切割 -->
					<!-- <swiper-item > -->
						<view class="classificationLists" v-for="(items, indexs) in arrshop" @click="goPostRelease(items)">
							<view><image :src="items.img" /></view>
							<view>
								<span :style="{ color: items.color }">{{ items.title }}</span>
							</view>
						</view>
					<!-- </swiper-item> -->
					<!-- 循环模板 -->
				<!-- </swiper> -->
				<!-- 选择分类列表 -->
			</view>
		</view>
		<!-- 分类列表 -->

		<!-- 二级分类弹窗 -->
		<PopManager :show="show" :type="type" @clickmask="closePop">
			<view class="checkSecond">
				<scroll-view class="checkSecondPackage" :scroll-y="true">
					<view class="checkSeconds" v-for="(item, index) in itemsList" @click="checkSecond(item)">
						<span>{{ item.title }}</span>
					</view>
				</scroll-view>
				<view class="closePopView" @click="closePop"><span>关闭</span></view>
			</view>
		</PopManager>
		<!-- 二级分类弹窗 -->
		<!-- 会员开通提示 -->
		<PopManager :show="showVip" :type="'center'" @clickmask="closeVip">
			<view class="advfei">
				<!-- <view class="iconfont icon-roundclose" style="font-size: 40upx;color: #FFFFFF;font-weight: 700;flex: 0.1;line-height: 70upx;position: absolute;right: 20upx;top: 0upx;"
				 @click="closeadv">
			
				</view> -->
				<view class="col-f t-l" style="flex: 0.6;padding: 30upx 0 40upx;">
					<!-- <view class="f-28 t-c"></view> -->
					<view class="f-28 t-c">此分类为会员专区,请先成为会员</view>
				</view>
				<view class="dis-flex">
					<view class="flex-box">
						<view class="t-c f-28" style="background-color: #ffffff;color: #333333;width: 200upx;height: 70upx;line-height: 70upx;font-size: 28upx;border-radius: 10upx;flex: 0.3;margin: auto;"
						  @click="closeadv">
							取 消
						</view>
					</view>
					<view class="flex-box">
						<view class="t-c f-28" style="background-color: #FFC3C2;color: #B90C1F;width: 200upx;height: 70upx;line-height: 70upx;font-size: 28upx;border-radius: 10upx;flex: 0.3;margin: auto;"
						 @click="gohomefxs">
							开通会员
						</view>
					</view>
					
					
				</view>
				
			</view>
		</PopManager>
		
		<TabBars :tabBarAct="0" :pageType="'9'" /> 
	</view>
</template>

<script>
import App from '@/common/js/app.js';
import PopManager from '@/components/template/PopManager';
import TabBars from '@/components/template/tabBar';


// #ifdef H5
import wxApi from '@/common/js/wxApi.js';
// #endif

export default {
	components: {
		PopManager,
		TabBars
	},
	data() {
		return {
			cateList: [],
			arr: [],
			classificationListsPage: [],
			type: 'bottom',
			show: false,
			showVip:false,
			itemsList: {},
			itemsInfo:{},
			mzsmText:'本平台发布的所有信息展示，内容本身与平台本身无关，平台不负任何责任！',
			TextSubstitution:null,
			phoneHight:null,
			hidesettle:0,
			arrshop:[],
			is_ios:0,
			korea:0,
			height:40,
		};
	},
	onLoad(e) {
		let _this=this
		if(uni.getSystemInfoSync().platform == 'ios'){
			_this.is_ios = 1;
		}
		uni.getStorage({
			key: 'weliam_user_token',
			success: function(res) {
				_this.login = true;
				_this.init();
			},
			fail: function(res) {
				uni.showToast({
					title: '请先登录',
					icon:'none'
				})
				setTimeout(()=>{
					uni.navigateTo({
						url: '/pages/mainPages/login/minLogin'
					})
				}, 2000)
			}
		});
		this.TextSubstitution=uni.getStorageSync('TextSubstitution');
		uni.getSystemInfo({
			success(res) {
				_this.phoneHight = res.windowHeight + 'px';
			}
		});
	},
	onShow(){
		this.init();
	},
	methods: {
		init() {
			let _this = this;
			_this.getHomeInfo();
			_this.getDisclaimer();
		},
		// 关闭弹窗
		closePop() {
			let _this = this;
			_this.show = false;
		},
		closeVip(){
			let _this = this;
			_this.showVip = false;
		},
		gohomefxs(){
			App.navigationTo({
				url: "pages/mainPages/memberCard/getMembership/getMembership?card=nhave"
			})
		},
		closeadv(){
			let _this = this;
			_this.showVip = false;
		},
		// 跳转入驻
		goSettled(){
			App.navigationTo({
				url:'pages/mainPages/Settled/Settled'
			})
		},
		// 获取掌上信息免责声明
		getDisclaimer(){
			let _this=this
			let data={}
			App._post_form('&p=pocket&do=getDisclaimer',data,res=>{
				_this.mzsmText=res.data.disclaimer;
				_this.hidesettle = res.data.hidesettle;
				_this.korea = res.data.korea;
			},
			fail=>{
				if(fail.message=="掌上信息已关闭"){
					App.navigationTo({
						url:'pages/mainPages/index/index'
					})
				}
			})
		},
		// 掌上信息首页信息
		getHomeInfo() {
			let _this = this;
			let data = {
				is_two: 1,
				is_set: 0,
				is_ios:_this.is_ios
			};
			App._post_form('&p=pocket&do=classList', data, res => {
				// for (let i = 0; i < res.data.list.length / 8; i++) {
				// 	_this.classificationListsPage.push(i);
				// }
				// for (let i = 0; i < _this.classificationListsPage.length; i++) {
				// 	_this.arr.push(res.data.list.splice(0, 8));
				// }
				this.arrshop = res.data.list;
			});
		},
		// 选择二级分类
		checkSecond(itemss){
			let _this=this;
			if(itemss.noflag == 1){
				this.showVip = true;
				return
			}
			_this.show=false
			App.navigationTo({
				url:'pages/subPages/postRelease/postRelease?onetype='+_this.itemsInfo.id+'&type='+itemss.id
			})
		},
		// 跳转发布
		goPostRelease(items) {
			console.log(items);
			if(items.noflag == 1){
				this.showVip = true;
				return
			}
			let _this = this;
			_this.itemsList = items.list;
			_this.itemsInfo = items;
			if (items.list.length !== 0) {
				_this.show = true;
			}
			else{
				App.navigationTo({
					url:'pages/subPages/postRelease/postRelease?onetype='+items.id+'&type='+items.id
				})
			}
		}
	}
};
</script>

<style lang="less" scoped>
.checkSecondPackage {
	max-height: 530upx;
}
.closePopView {
	margin: 20upx 0 0 0;
	height: 105upx;
	background: #ffffff;
	border-bottom: 1upx solid rgba(238, 238, 238, 1);
	text-align: center;
	> span {
		line-height: 105upx;
		font-size: 28upx;
		
		font-weight: bold;
		color: rgba(51, 51, 51, 1);
	}
}
.checkSeconds {
	height: 105upx;
	background: #ffffff;
	border-bottom: 1upx solid rgba(238, 238, 238, 1);
	text-align: center;
	> span {
		line-height: 105upx;
		font-size: 28upx;
		
		font-weight: bold;
		color: rgba(51, 51, 51, 1);
	}
}
.checkSecond {
	width: 750upx;
	background: #f8f8f8;
	padding-bottom: 140upx;
	border-radius: 20upx 20upx 0px 0px;
	overflow: hidden;
}
.advfei{
		background: -webkit-linear-gradient(90deg, #ff4444 ,#FF8032 ); /* Safari 5.1 - 6.0 */
		background: -o-linear-gradient(90deg,  #ff4444, #FF8032); /* Opera 11.1 - 12.0 */
		background: -moz-linear-gradient(90deg, #ff4444 , #FF8032); /* Firefox 3.6 - 15 */
		background: linear-gradient(90deg, #ff4444 , #FF8032); /* 标准的语法（必须放在最后） */
		position: relative;
		font-size: 28upx;
		// bottom: 120upx;
		// left: 20upx;
		width: 70vw;
		padding: 20upx 20upx 40upx;
		// background-color: #FFF0B2;
		// display: flex;
		border-radius: 10upx;
		z-index: 99;
}
.classificationLists {
	margin-top: 40upx;
	display: inline-block;
	width: 25%;
	> view:nth-child(1) {
		margin: auto;
		width: 52upx;
		height: 46upx;
		> image {
			width: 52upx;
			height: 52upx;
		}
	}
	> view:nth-child(2) {
		margin: 20upx 0 0 0;
		text-align: center;
		> span {
			font-size: 24upx;
			
			
			color: rgba(0, 0, 0, 1);
		}
	}
}
.checkTips {
	margin: 60upx;
	text-align: center;
	> span {
		font-size: 32upx;
		
		
		color: rgba(51, 51, 51, 1);
	}
}
.goRzPackage {
	display: flex;
	justify-content: space-between;
	padding: 30upx;
}
.goRzRight {
	margin: 25upx 0 0 0;
	display: inline-block;
	vertical-align: middle;
	> image {
		height: 25upx;
		width:25upx;
	}
}
.goRzleft {
	display: inline-block;
	vertical-align: middle;
	> image {
		vertical-align: middle;
		width: 80upx;
		height: 80upx;
	}
	> view {
		margin: 0 0 0 20upx;
		vertical-align: middle;
		display: inline-block;
		> view:nth-child(1) {
			width: 400upx;
			> span {
				font-size: 30upx;
				
				font-weight: bold;
				color: rgba(255, 68, 68, 1);
			}
		}
		> view:nth-child(2) {
			> span {
				font-size: 24upx;
				
				
				color: rgba(153, 153, 153, 1);
			}
		}
	}
}
.goRz {
	margin: 30upx 0 0 0;
	width: 690upx;
	background: rgba(255, 251, 251, 1);
	border-radius: 10upx;
}
.typeTips {
	> span {
		vertical-align: middle;
		font-size: 24upx;
		
		
		color: rgba(153, 153, 153, 1);
	}
	> image {
		vertical-align: middle;
		width: 30upx;
		height: 30upx;
	}
}
.sendInformation {
	font-size: 0;
	background: #f8f8f8;
}
page {
	
}
.sendInformationPackage {
	padding: 30upx;
	padding-bottom: 150upx;
}
.sendInformationType {
	width: 750upx;
	background: rgba(255, 255, 255, 1);
}
// 
.status_bar {
	height: var(--status-bar-height);
	width: 100%;
	background-color: #fff;
	position: fixed;
	padding-bottom: 15px;
	z-index: 99;
	top: 0px;
}
</style>
