<template>
|
<view class="container">
|
<view class="header">
|
<view class="header-img">
|
<view class="header-image-left" @click='tologin'>
|
<up-avatar :src="userInfo.avatar" shape="circle" size='60'></up-avatar>
|
<view class="header-name">{{ userInfo.nickname || (isLogin ? '暂无信息' : '点击登录') }}</view>
|
</view>
|
<view @tap="changRole" class="header-image-right chuany-flex chuany-align-center chuany-justify-center"
|
data-ptpid="e758-138d-b914-343f">
|
<text>{{ identity=='enterprise' ? '我要找工作' : '我要招人' }}</text>
|
<text class='iconfont icon-qiehuan chuany-font28'></text>
|
</view>
|
</view>
|
<view class="num-box">
|
<view @tap="goWallet" class="num-item" data-ptpid="ef57-17f4-bbea-280f">
|
<view class="num-bold">{{ balance }}元</view>
|
<view class="num-text">
|
<text class="c-m-r-10">{{ identity=='enterprise' ? '企业余额' : '立即提现' }}</text>
|
<up-icon name="arrow-right-double"></up-icon>
|
</view>
|
</view>
|
</view>
|
</view>
|
<view class="money_bag" v-if="identity=='enterprise'">
|
<view class="tool_wrap">
|
<view class="tool_title">
|
企业服务
|
</view>
|
<view class="tool_content">
|
<view class="tool_item" @click="toRelease">
|
<image src="@/static/image/fabu.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
发布职位
|
</view>
|
</view>
|
<view class="tool_item" @click="toOrder">
|
<image src="@/static/image/guanli.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
职位管理
|
</view>
|
</view>
|
<view class="tool_item" @click="toEnterprise">
|
<image src="@/static/image/qiye.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
我的企业
|
</view>
|
</view>
|
<view class="tool_item" @click="toWorkerRecord">
|
<image src="@/static/image/record.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
打卡记录
|
</view>
|
</view>
|
<!-- <view class="tool_item" @click="toPage('/otherPages/member/sendCompany/sendCompany')">
|
<image src="@/static/image/server.png" mode="aspectFit" class="item_img"></image>
|
<view class="tool_label">
|
服务中心
|
</view>
|
</view> -->
|
</view>
|
</view>
|
</view>
|
<!-- <view class="job-box">
|
<view @tap="gotoMyJob" class="job-item jobr" data-index="0" data-ptpid="0d7e-1bd6-8311-5701">
|
<view class="num">{{ userApplyStatistics.allCount }}</view>
|
<view class="text">全部</view>
|
</view>
|
<view @tap="gotoMyJob" class="job-item jobr" data-index="1" data-ptpid="525a-1b59-a630-5431">
|
<view class="num">{{ userApplyStatistics.hasApplyCount }}</view>
|
<view class="text">已报名</view>
|
</view>
|
<view @tap="gotoMyJob" class="job-item jobr" data-index="2" data-ptpid="13ba-13a5-98dc-aba6">
|
<view class="num">{{ userApplyStatistics.applyOngoingCount }}</view>
|
<view class="text">已录取</view>
|
</view>
|
<view @tap="gotoMyJob" class="job-item" data-index="3" data-ptpid="df41-1bae-b01e-8c13">
|
<view class="num">{{ userApplyStatistics.applySuccessCount }}</view>
|
<view class="text">已完成</view>
|
</view>
|
</view> -->
|
<view class="nav-box" v-if="identity=='enterprise'">
|
<view @tap="item.cb" class="nav-item" :data-index="index" data-ptpid="58ac-1481-a7d3-b98e"
|
v-for="(item, index) in navList" :key="item.name">
|
<view class="nav-title">
|
<view :class="'iconfont ' + item.icon"></view>
|
{{ item.name }}
|
</view>
|
|
<view class="nav-icon">
|
<view v-if="item.num || item.num === 0">{{ item.num }}</view>
|
<view class="iconfont iconarrow"></view>
|
</view>
|
</view>
|
</view>
|
<view class="nav-box" v-else>
|
<view @tap="item.cb" class="nav-item" :data-index="index" data-ptpid="58ac-1481-a7d3-b98e"
|
v-for="(item, index) in navList1" :key="item.name">
|
<view class="nav-title">
|
<view :class="'iconfont ' + item.icon"></view>
|
{{ item.name }}
|
</view>
|
|
<view class="nav-icon">
|
<view v-if="item.num || item.num === 0">{{ item.num }}</view>
|
<view class="iconfont iconarrow"></view>
|
</view>
|
</view>
|
</view>
|
|
|
</view>
|
</template>
|
|
<script>
|
var app = getApp();
|
export default {
|
|
data() {
|
return {
|
identity: '',
|
navList: [
|
// {
|
// icon: 'icon-huabanfuben',
|
// name: '工人打卡记录',
|
// cb: function() {
|
// uni.navigateTo({
|
// url: '/pages/company/index'
|
// });
|
// }
|
// },
|
],
|
navList1: [{
|
icon: 'icon-wanshanxinxi',
|
name: '完善资料',
|
cb: function() {
|
uni.navigateTo({
|
url: '/pages/mine/apply'
|
});
|
}
|
},
|
{
|
icon: 'icon-dingdan',
|
name: '我的工作',
|
cb: this.toMyWork
|
},
|
{
|
icon: 'icon-fuwutuandui',
|
name: '工作记录',
|
cb: this.toMyRecord
|
},
|
],
|
isLogin: false,
|
userInfo: {},
|
balance: '0.00'
|
};
|
},
|
onLoad: function() {
|
|
|
},
|
onShow: function() {
|
let that = this
|
this.userInfo = this.$db.get('userInfo') ? JSON.parse(this.$db.get('userInfo')) : {}
|
this.token = this.$db.get('userToken') ? this.$db.get('userToken') : ''
|
uni.getStorage({
|
key: 'identity',
|
success: function(res) {
|
that.identity = res.data
|
if (res.data == 'worker') {
|
if (that.userInfo.userWorker) {
|
that.balance = that.$common.moneySub(that.userInfo.userWorker.tiXianZonge, that
|
.userInfo.userWorker.yiTiXianJine)
|
}
|
} else {
|
if (that.userInfo.userCompany) {
|
that.balance = that.userInfo.userCompany.chongZhiYue ? that.userInfo
|
.userCompany.chongZhiYue : '0.00'
|
}
|
}
|
}
|
});
|
// this.userInfo = this.$db.get('userInfo') ? JSON.parse(this.$db.get('userInfo')) : {}
|
// this.token = this.$db.get('userToken') ? this.$db.get('userToken') : ''
|
this.isLogin = this.token ? true : false;
|
},
|
onPullDownRefresh() {
|
this.$api.getUser().then(res => {
|
this.$db.set('userInfo', JSON.stringify(res.data))
|
this.userInfo = res.data
|
if (this.identity == 'worker') {
|
if (this.userInfo.userWorker) {
|
this.balance = this.$common.moneySub(this.userInfo.userWorker.tiXianZonge, this.userInfo.userWorker
|
.yiTiXianJine)
|
}
|
} else {
|
if (this.userInfo.userCompany) {
|
this.balance = this.userInfo.userCompany.chongZhiYue ? this.userInfo.userCompany.chongZhiYue :
|
'0.00'
|
}
|
}
|
})
|
uni.stopPullDownRefresh();
|
},
|
methods: {
|
tologin() {
|
if (this.isLogin) {
|
uni.navigateTo({
|
url: '/pages/mine/mine'
|
})
|
} else {
|
uni.navigateTo({
|
url: '/pages/login/index'
|
})
|
}
|
},
|
toOrder() {
|
if (!this.userInfo.userCompany) {
|
uni.navigateTo({
|
url: '/pages/enterprise/enterprise'
|
});
|
this.$util.showToast({
|
title: '请先完善企业资料!'
|
})
|
return
|
}
|
uni.navigateTo({
|
url: '/pages/order/order'
|
})
|
},
|
toRelease() {
|
if (!this.userInfo.userCompany) {
|
uni.navigateTo({
|
url: '/pages/enterprise/enterprise'
|
});
|
this.$util.showToast({
|
title: '请先完善企业资料!'
|
})
|
return
|
}
|
uni.navigateTo({
|
url: '/pages/release/index'
|
})
|
},
|
toEnterprise() {
|
uni.navigateTo({
|
url: '/pages/enterprise/index'
|
})
|
},
|
toWorkerRecord() {
|
if (!this.userInfo.userCompany) {
|
uni.navigateTo({
|
url: '/pages/enterprise/enterprise'
|
});
|
this.$util.showToast({
|
title: '请先完善企业资料!'
|
})
|
return
|
}
|
uni.navigateTo({
|
url: '/pages/company/index'
|
});
|
},
|
toMyWork() {
|
if (!this.userInfo.userWorker) {
|
uni.navigateTo({
|
url: '/pages/mine/apply'
|
});
|
this.$util.showToast({
|
title: '请先完善资料!'
|
})
|
return
|
}
|
uni.navigateTo({
|
url: '/pages/order/myorder'
|
});
|
},
|
toMyRecord() {
|
if (!this.userInfo.userWorker) {
|
uni.navigateTo({
|
url: '/pages/mine/apply'
|
});
|
this.$util.showToast({
|
title: '请先完善资料!'
|
})
|
return
|
}
|
uni.navigateTo({
|
url: '/pages/checkin/index'
|
});
|
},
|
changRole() {
|
this.identity = this.identity === 'enterprise' ? 'worker' : 'enterprise'
|
console.log(this.identity, 'this.identity');
|
uni.setStorage({
|
key: 'identity',
|
data: this.identity,
|
});
|
if (this.identity == 'worker') {
|
if (this.userInfo.userWorker) {
|
this.balance = this.$common.moneySub(this.userInfo.userWorker.tiXianZonge, this.userInfo.userWorker
|
.yiTiXianJine)
|
}
|
} else {
|
if (this.userInfo.userCompany) {
|
this.balance = this.userInfo.userCompany.chongZhiYue ? this.userInfo.userCompany.chongZhiYue :
|
'0.00'
|
}
|
}
|
},
|
goWallet() {
|
uni.navigateTo({
|
url: '/pages/wallet/index',
|
fail(err) {
|
console.log(err);
|
}
|
});
|
},
|
}
|
};
|
</script>
|
<style lang="scss">
|
@import './mine.scss';
|
|
.money_bag {
|
background: #fff;
|
border-radius: 16rpx;
|
margin: 20rpx 30rpx;
|
padding: 20rpx 30rpx;
|
position: relative;
|
// top: 25rpx;
|
z-index: 2;
|
|
.up_wrap {
|
padding: 20rpx 0 0;
|
|
.left_img {
|
width: 80rpx;
|
height: 80rpx;
|
flex-shrink: 0;
|
border-radius: 50%;
|
overflow: hidden;
|
margin-right: 20rpx;
|
border: 4rpx solid #39A7FF;
|
|
.header_img {
|
width: 100%;
|
height: 100%;
|
border-radius: 50%;
|
}
|
}
|
|
.user_info_login {
|
.user_name {
|
width: 320rpx;
|
}
|
|
.user_bottom {
|
margin-top: 10rpx;
|
font-size: 24rpx;
|
line-height: 24rpx;
|
}
|
}
|
|
.up_btn {
|
flex-shrink: 0;
|
|
.user_btn {
|
margin-left: 20rpx;
|
flex-shrink: 0;
|
width: 80rpx;
|
height: 80rpx;
|
border-radius: 50%;
|
background-color: #39A7FF;
|
align-items: center;
|
justify-content: center;
|
}
|
|
.user_btn_image {
|
width: 32rpx;
|
height: 32rpx;
|
}
|
|
.btn_text {
|
font-size: 20rpx;
|
line-height: 20rpx;
|
color: #fff;
|
}
|
|
}
|
}
|
|
.serve_item {
|
display: flex;
|
align-items: center;
|
padding: 40rpx 0;
|
border-bottom: 4rpx solid #eee;
|
|
&:last-child {
|
border-bottom: none;
|
}
|
|
.item_icon {
|
width: 40rpx;
|
height: 40rpx;
|
flex-shrink: 0;
|
}
|
|
.item_text {
|
font-size: 32rpx;
|
line-height: 32rpx;
|
color: #666;
|
flex: 1;
|
margin: 0 20rpx;
|
}
|
|
button {
|
background-color: #fff;
|
text-align: left;
|
padding: 0;
|
}
|
|
.icon-youjiantou {
|
font-size: 32rpx;
|
line-height: 32rpx;
|
color: #999;
|
}
|
}
|
|
.bag_header {
|
align-items: center;
|
color: #333;
|
display: flex;
|
font-size: 32rpx;
|
font-weight: 700;
|
justify-content: space-between;
|
padding: 10rpx 0 30rpx;
|
|
.bag_right {
|
color: #999;
|
font-size: 26rpx;
|
}
|
}
|
|
.bag_content {
|
display: flex;
|
justify-content: space-between;
|
padding: 0 0 30rpx;
|
|
.content_item {
|
align-items: center;
|
background: #f8f8f8;
|
border-radius: 8px;
|
display: flex;
|
flex-direction: column;
|
height: 140rpx;
|
justify-content: center;
|
width: 200rpx;
|
|
.num {
|
color: #333;
|
font-size: 36rpx;
|
font-weight: 700;
|
letter-spacing: 0;
|
line-height: 36rpx;
|
text-align: center;
|
}
|
|
.label {
|
color: #999;
|
font-size: 22rpx;
|
letter-spacing: 0;
|
line-height: 28rpx;
|
padding: 10rpx 0 0;
|
text-align: center;
|
}
|
}
|
}
|
|
.tool_wrap {
|
.tool_title {
|
color: #333;
|
font-size: 32rpx;
|
font-weight: 700;
|
padding: 30rpx 0;
|
border-bottom: 2rpx solid #eee;
|
}
|
|
.tool_content {
|
display: flex;
|
padding: 30rpx 0;
|
|
.tool_item {
|
align-items: center;
|
display: flex;
|
flex-direction: column;
|
height: 120rpx;
|
justify-content: center;
|
margin: 0 50rpx 0 0;
|
width: 120rpx;
|
|
&:nth-child(4n) {
|
margin-right: 0;
|
}
|
|
.item_img {
|
height: 53rpx;
|
width: 53rpx;
|
}
|
|
.tool_label {
|
color: #333;
|
font-size: 24rpx;
|
line-height: 24rpx;
|
margin: 16rpx 0 0;
|
}
|
}
|
}
|
}
|
}
|
</style>
|