<template>
	<view class="u-page">
		<view class="se-pt-50 se-pb-120 se-px-40 se-bgc-orange se-c-white se-pos">
			<view class="se-flex">
				<image :src="user.headImage" class="se-br-p-50 se-bgc-f5 se-w-100 se-h-100" mode=""></image>
				<view class="se-ml-20 se-flex se-flex-v-sa se-flex-ai-fs">
					<view class="se-flex">
						<text class="se-fw-6 se-fs-30">{{user.nickName}}</text>
						<view class="se-flex se-flex-ai-c se-ml-20" @click="onEdit()">
							<image class="se-a-25 se-mr-10" src="@/static/image/pencil.png" mode=""></image>
							<text class="se-fs-22">修改资料</text>
						</view>
					</view>
					<view class="se-fs-24 se-display-ib">
						<text>手机号:</text>
						<text class="se-ml-20">{{user.phone}}</text>
					</view>
					<view class="se-fs-24 se-display-ib">
						<text class="se-tag se-bgc-gray" v-if="companyAuthenticationStatus==2">企业认证-未通过</text>
						<text class="se-tag se-bgc-green" v-if="companyAuthenticationStatus==1">企业认证-已通过</text>
						<text class="se-tag se-bgc-active" v-if="companyAuthenticationStatus==0">企业认证-审核中</text>
						<text class="se-tag se-bgc-gray" v-if="personAuthenticationStatus==2">个人认证-未通过</text>
						<text class="se-tag se-bgc-green" v-if="personAuthenticationStatus==1">个人认证-已通过</text>
						<text class="se-tag se-bgc-active" v-if="personAuthenticationStatus==0">个人认证-审核中</text>
					</view>
				</view>
			</view>
			<view class="se-pos-cb se-flex se-flex-h-sb se-w-vw-82 se-br-10 se-bgc-white se-py-30 se-px-30"
				style="bottom: -80rpx;">
				<view class="se-flex se-flex-h-fs se-b-r se-flex-1">
					<view class="se-pos se-w-130">
						<image src="@/static/image/wall.png" class="se-w-120 se-h-120" mode=""></image>
						<view @click="onNavigateTo()" class="se-w-80 se-ta-c se-b-orange se-br-30 se-bgc-orange se-py-5 se-px-22 se-c-white se-fs-20 se-pos-cb">
							钱包
						</view>
					</view>
					<view class="se-flex se-flex-v-sa se-flex-ai-fs">
						<view class="se-flex se-fs-28 se-c-black">
							我的余额
						</view>
						<view class="se-fs-30 se-display-ib se-pt-20" style="color: #DC2828;">
							￥{{amount}}
						</view>
					</view>
				</view>
				<view class="se-flex se-flex-h-fe se-flex-1 se-pr-20">
					<image src="@/static/image/piao.png" class="se-w-120 se-h-120" mode=""></image>
					<view class="se-flex se-flex-v-sa se-flex-ai-fs ">
						<view class="se-flex se-fs-28 se-c-black">
							金额记录
						</view>
						<view class="se-fs-30 se-display-ib se-pt-20" @click="onRecord()">
							<view class="se-b-orange se-fs-22 se-c-orange se-br-30 se-py-5 se-px-20">
								去查看
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="se-px-40 se-py-30 se-mt-80">
			<u-swiper height="200rpx" style="background-color: #f5f5f5;height: 200rpx;" :indicator="true" :list="swiperList" keyName="image" @change="changeSwiper" @click="click"></u-swiper>
			<!-- <u-swiper :height="100" :list="list" @click="swiperClick"></u-swiper> -->
			<!-- <image class="se-h-200 se-w-p-100" src="@/static/image/59.png" mode=""></image> -->
		</view>
		<view class="se-p-20 se-mx-40 se-mt-20 se-br-20 se-bgc-white">
			<view class="se-flex se-flex-ai-c se-pb-20">
				<view class="line-orange se-ml-10"></view>
				<view class="se-ml-10 se-fs-32 se-c-black se-fw-5">
					我的服务
				</view>
			</view>
			<view class="se-grid">
				<view class="se-flex-v-c se-mb-20 se-mt-20 se-cursor-p" @click="onHire()">
					<view class="se-w-80 se-h-80 se-flex se-flex-v-c">
						<image class="se-a-70" src="@/static/image/hire.png" mode=""></image>
					</view>
					<text class="se-h-60 se-lh-60 se-c-33 se-fs-26 se-ta-c se-mt-10 se-toe-2">我的招聘</text>
				</view>
				<view class="se-flex-v-c se-mb-20 se-mt-20 se-cursor-p" @click="onJobHunt()">
					<view class="se-w-80 se-h-80 se-flex se-flex-v-c">
						<image class="se-a-70" src="@/static/image/jobhunt.png" mode=""></image>
					</view>
					<text class="se-h-60 se-lh-60 se-c-33 se-fs-26 se-ta-c se-mt-10 se-toe-2">我的求职</text>
				</view>
				<view class="se-flex-v-c se-mb-20 se-mt-20 se-cursor-p" @click="onEnterprise()">
					<view class="se-w-80 se-h-80 se-flex se-flex-v-c">
						<image class="se-a-70" src="@/static/image/user1.png" mode=""></image>
					</view>
					<text class="se-h-60 se-lh-60 se-c-33 se-fs-26 se-ta-c se-mt-10 se-toe-2">企业入驻</text>
				</view>
				<view class="se-flex-v-c se-mb-20 se-mt-20 se-cursor-p" @click="onPerson()">
					<view class="se-w-80 se-h-80 se-flex se-flex-v-c">
						<image class="se-a-70" src="@/static/image/user2.png" mode=""></image>
					</view>
					<text class="se-h-60 se-lh-60 se-c-33 se-fs-26 se-ta-c se-mt-10 se-toe-2">个人入驻</text>
				</view>
				<view class="se-flex-v-c se-mb-20 se-mt-20 se-cursor-p" @click="onResume()">
					<view class="se-w-80 se-h-80 se-flex se-flex-v-c">
						<image class="se-a-70" src="@/static/image/user3.png" mode=""></image>
					</view>
					<text class="se-h-60 se-lh-60 se-c-33 se-fs-26 se-ta-c se-mt-10 se-toe-2">我的简历</text>
				</view>
				<view class="se-flex-v-c se-mb-20 se-mt-20 se-cursor-p" @click="onCustomerService()">
					<view class="se-w-80 se-h-80 se-flex se-flex-v-c">
						<image class="se-a-70" src="@/static/image/user4.png" mode=""></image>
					</view>
					<text class="se-h-60 se-lh-60 se-c-33 se-fs-26 se-ta-c se-mt-10 se-toe-2">联系客服</text>
				</view>
				<view class="se-flex-v-c se-mb-20 se-mt-20 se-cursor-p" @click="onSystem()">
					<view class="se-w-80 se-h-80 se-flex se-flex-v-c">
						<image class="se-a-70" src="@/static/image/user5.png" mode=""></image>
					</view>
					<text class="se-h-60 se-lh-60 se-c-33 se-fs-26 se-ta-c se-mt-10 se-toe-2">系统设置</text>
				</view>
				<view class="se-flex-v-c se-mb-20 se-mt-20 se-cursor-p"  @click="onFeedback()">
					<view class="se-w-80 se-h-80 se-flex se-flex-v-c">
						<image class="se-a-70" src="@/static/image/user6.png" mode=""></image>
					</view>
					<text class="se-h-60 se-lh-60 se-c-33 se-fs-26 se-ta-c se-mt-10 se-toe-2">帮助与反馈</text>
				</view>
				<view class="se-flex-v-c se-mb-20 se-mt-20 se-cursor-p" @click="onVersion()">
					<view class="se-w-80 se-h-80 se-flex se-flex-v-c">
						<image class="se-a-70" src="@/static/image/user7.png" mode=""></image>
					</view>
					<text class="se-h-60 se-lh-60 se-c-33 se-fs-26 se-ta-c se-mt-10 se-toe-2">关于本程序</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		userInfo,
		userInfoDetail,
		bannerList
	} from "@/common/api.js"
	export default {
		data() {
			return {
				amount:0,
				companyAuthenticationStatus:null,//企业认证
				personAuthenticationStatus:null,//个人认证
				user:{},
				swiperList:[],
				list: [
					'@/static/image/59.png'
				],
				id:"",
				headImage:"",
				myMoney:0,
				nickName:"",
				phone:"",
				worker:{},
				boss:{},
				company:{},
				
			}
		},
		mounted() {
			
		},
		onShow() {
			this.onUserInfo()
			this.onBannerList()
			this.onUserInfoDetail()
		},
		methods: {
			onHire(){
				uni.navigateTo({
					url:"/pages_subpack/hire/index"
				})
			},
			onJobHunt(){
				uni.navigateTo({
					url:"/pages_subpack/job-hunt/index"
				})
			},
			onEdit(){
				uni.navigateTo({
					url:"/pages/login/index?back=1"
				})
			},
			onBannerList(){
				bannerList({type:1}).then(response=>{
					this.swiperList = response.result.records
				}).catch(error=>{
					
				})
			},
			onUserInfoDetail(){
				let params = {}
				userInfoDetail(params).then(response=>{
					console.info("userInfoDetail",response)
					this.user = response.result
				}).catch(error=>{
					
				})
			},
			onUserInfo(){
				let params={}
				userInfo(params).then(response=>{
					this.amount = response.result.amount;
					this.companyAuthenticationStatus = response.result.companyAuthenticationStatus;
					this.personAuthenticationStatus = response.result.personAuthenticationStatus;
					console.info("userInfo",response.result)
					// this.id=response.result.id
					// this.headImage=response.result.headImage
					// this.myMoney=response.result.myMoney?response.result.myMoney:0
					// this.nickName=response.result.nickName?response.result.nickName:"微信昵称"
					// this.phone=response.result.phone?response.result.phone:""
					// this.worker=response.result.worker?response.result.worker:""
					// this.boss=response.result.boss?response.result.boss:""
					// this.company=response.result.company?response.result.company:""
					// uni.setStorageSync('company', response.result.company)
					// uni.setStorageSync('boss', response.result.boss)
					// uni.setStorageSync('worker', response.result.worker)
				}).catch(error=>{
					
				})
			},
			swiperClick(event) {
				console.info(event);
			},
			onNavigateTo(){
				uni.navigateTo({
					url:"/pages_subpack/wallet/index"
				})
			},
			onRecord(){
				uni.navigateTo({
					url:"/pages_subpack/record/index"
				})
			},
			onSystem(){
				uni.navigateTo({
					url:"/pages_subpack/system/index"
				})
			},
			onFeedback(){
				uni.navigateTo({
					url:"/pages_subpack/feedback/index"
				})
			},
			onVersion(){
				uni.navigateTo({
					url:"/pages_subpack/version/index"
				})
			},
			onBusinessSettled(){
				uni.navigateTo({
					url:"/pages_subpack/business-settled/index"
				})
			},
			// 个人
			onPerson(){
				uni.navigateTo({
					url:"/pages_subpack/person/index"
				})
			},
			// 企业
			onEnterprise(){
				uni.navigateTo({
					url:"/pages_subpack/enterprise/index"
				})
			},
			onResume(){
				uni.navigateTo({
					url:"/pages_subpack/resume/index"
				})
			},
			changeSwiper(event){
				console.info("event",event)
			},
			onCustomerService(){
				uni.makePhoneCall({
				    phoneNumber: '13185644852',
				    success: () => {
				      console.log("拨打成功");
				    },
				    fail: (err) => {
				      console.error("拨打失败", err);
				    },
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #f5f5f5 !important;
	}

	.se-grid {
		display: grid;
		grid-template-columns: 1fr 1fr 1fr 1fr;
		gap: 10rpx;
		padding-bottom: 4rpx;
	}
	.se-tag{
		margin-right: 10rpx;
		margin-top: 5px;
		padding: 5rpx 10rpx;
		border-radius: 4rpx;
		border: 2rpx solid rgba(0,0,0,0.00);
		font-size: 16rpx;
		font-family: PingFang SC, PingFang SC-Bold;
		font-weight: 700;
		text-align: center;
	}
</style>