| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- <template>
- <view class="guide-page">
- <view class="guide-item">
- <view class="guide-img">
- <image src="@/static/images/jobApplicant/woyaozhaogongzuo.svg" mode="aspectFix" />
- </view>
- <view class="guide-btn" @click="goWork">我要找工作</view>
- </view>
- <view class="guide-item">
- <view class="guide-img">
- <image src="@/static/images/jobApplicant/woyaozhaoren.svg" mode="aspectFix" />
- </view>
- <view class="guide-btn" @click="gotocompany">我要招人</view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- companyinfo: ""
- };
- },
- onLoad() {
- this.getcompanystatus()
- },
- methods: {
- goWork() {
- //修改当前用户身份
- this.updateUserResumes(1,function(res){
- if (!res) {
- return uni.showToast({
- title: "登录信息过期,请重新登录",
- icon: "none"
- });
- }
- uni.navigateTo({
- // url: '/pages/my/jobApplicant/welcomePage'
- url: '/pages/public/improvePrompt'
- })
- })
-
- },
- // 查询用户企业状态
- getcompanystatus() {
- this.$Request.get("/app/company/selectCompanyByUserId", "")
- .then((res) => {
- if (res.code != 0) {
- /* uni.showToast({
- title: res.msg || "查询状态失败",
- icon: "none"
- }); */
- uni.hideToast()//因为现在get所有异常均会抛出了
- return;
- }
- this.companyinfo = res.data || {};
- console.log("查询用户企业状态", res)
- })
- .catch((err) => {
- console.error("查询失败:", err);
- uni.showToast({
- title: "网络异常",
- icon: "none"
- });
- });
- },
- gotocompany() {
- // 获取公司状态,用户新用户进入APP判断是否进入选择角色页面
- this.$queue.setData('companyStatus', this.companyinfo.status)
- var that=this
- //修改当前用户身份
- this.updateUserResumes(2,function(res){
- if (!res) {
- return uni.showToast({
- title: "登录信息过期,请重新登录",
- icon: "none"
- });
- }
- console.log("ssss");
- //应该要判断这个人有没有公司,
- var status = that.companyinfo.status || ""
- if (!status) { //没有企业,那就是第一次进来,走企业注册流程
- uni.navigateTo({
- url: '/pages/my/businessLicense'
- })
- } else if (status == 2) { //审核通过,如果有职位,跳首页、如果没职位跳职位发布页。
- uni.setStorageSync("firstLogin",true)
- if (status == 2) {
- uni.preloadPage({
- url: "/pages/index/index"
- });
- uni.switchTab({
- url: '/pages/index/index'
- })
-
- } else {
- uni.redirectTo({
- url: '/pages/index/index.vue'
- })
- }
- } else if (status == 1) { //审核未通过,跳审核信息页。
- uni.setStorageSync("firstLogin",true)
- uni.navigateTo({
- url: '/package/jobIntention/underReview'
- })
- } else {
- uni.showToast({
- title: "网络异常",
- icon: "none"
- });
- }
- })
- },
- //修改用户身份状态
- updateUserResumes(userType,callback) {
- var that=this
- // 调用接口提交
- uni.showLoading({
- title: "提交中..."
- });
- this.$Request.postT("/app/user/updateUserEntity", {
- userType: userType
- })
- .then((res) => {
- uni.hideLoading();
- if (res.code === 0) {
- uni.setStorageSync('userType', userType)
- that.$queue.changeTabbar(userType)
- callback(true)
- } else {
- callback(false)
- }
- })
- .catch((err) => {
- uni.hideLoading();
- console.error("提交失败:", err);
- uni.showToast({
- title: "网络异常",
- icon: "none"
- });
- callback(false)
- });
- },
- },
- };
- </script>
- <style scoped lang="scss">
- .guide-page {
- background: linear-gradient(90deg, rgba(13, 39, 247, 1), rgba(19, 193, 234, 1) 100%);
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- padding: 120rpx 76rpx;
- display: flex;
- flex-direction: column;
- box-sizing: border-box;
- gap: 36rpx;
- .guide-item {
- width: 100%;
- height: 100%;
- border-radius: 28rpx;
- background: rgba(255, 255, 255, 0.851);
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- padding: 0 56rpx;
- box-sizing: border-box;
- gap: 72rpx;
- .guide-img {
- width: 364rpx;
- height: 364rpx;
- overflow: hidden;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .guide-btn {
- border-radius: 100rpx;
- background: rgba(255, 255, 255, 1);
- color: #016bf6;
- font-family: DM Sans;
- font-size: 32rpx;
- font-weight: 400;
- line-height: 48rpx;
- letter-spacing: 0%;
- text-align: center;
- width: 100%;
- padding: 16rpx;
- box-sizing: border-box;
- }
- }
- }
- </style>
|