guidePage.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <view class="guide-page">
  3. <view class="guide-item">
  4. <view class="guide-img">
  5. <image src="@/static/images/jobApplicant/woyaozhaogongzuo.svg" mode="aspectFix" />
  6. </view>
  7. <view class="guide-btn" @click="goWork">我要找工作</view>
  8. </view>
  9. <view class="guide-item">
  10. <view class="guide-img">
  11. <image src="@/static/images/jobApplicant/woyaozhaoren.svg" mode="aspectFix" />
  12. </view>
  13. <view class="guide-btn" @click="gotocompany">我要招人</view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. companyinfo: ""
  22. };
  23. },
  24. onLoad() {
  25. this.getcompanystatus()
  26. },
  27. methods: {
  28. goWork() {
  29. //修改当前用户身份
  30. this.updateUserResumes(1,function(res){
  31. if (!res) {
  32. return uni.showToast({
  33. title: "登录信息过期,请重新登录",
  34. icon: "none"
  35. });
  36. }
  37. uni.navigateTo({
  38. // url: '/pages/my/jobApplicant/welcomePage'
  39. url: '/pages/public/improvePrompt'
  40. })
  41. })
  42. },
  43. // 查询用户企业状态
  44. getcompanystatus() {
  45. this.$Request.get("/app/company/selectCompanyByUserId", "")
  46. .then((res) => {
  47. if (res.code != 0) {
  48. /* uni.showToast({
  49. title: res.msg || "查询状态失败",
  50. icon: "none"
  51. }); */
  52. uni.hideToast()//因为现在get所有异常均会抛出了
  53. return;
  54. }
  55. this.companyinfo = res.data || {};
  56. console.log("查询用户企业状态", res)
  57. })
  58. .catch((err) => {
  59. console.error("查询失败:", err);
  60. uni.showToast({
  61. title: "网络异常",
  62. icon: "none"
  63. });
  64. });
  65. },
  66. gotocompany() {
  67. // 获取公司状态,用户新用户进入APP判断是否进入选择角色页面
  68. this.$queue.setData('companyStatus', this.companyinfo.status)
  69. var that=this
  70. //修改当前用户身份
  71. this.updateUserResumes(2,function(res){
  72. if (!res) {
  73. return uni.showToast({
  74. title: "登录信息过期,请重新登录",
  75. icon: "none"
  76. });
  77. }
  78. console.log("ssss");
  79. //应该要判断这个人有没有公司,
  80. var status = that.companyinfo.status || ""
  81. if (!status) { //没有企业,那就是第一次进来,走企业注册流程
  82. uni.navigateTo({
  83. url: '/pages/my/businessLicense'
  84. })
  85. } else if (status == 2) { //审核通过,如果有职位,跳首页、如果没职位跳职位发布页。
  86. uni.setStorageSync("firstLogin",true)
  87. if (status == 2) {
  88. uni.preloadPage({
  89. url: "/pages/index/index"
  90. });
  91. uni.switchTab({
  92. url: '/pages/index/index'
  93. })
  94. } else {
  95. uni.redirectTo({
  96. url: '/pages/index/index.vue'
  97. })
  98. }
  99. } else if (status == 1) { //审核未通过,跳审核信息页。
  100. uni.setStorageSync("firstLogin",true)
  101. uni.navigateTo({
  102. url: '/package/jobIntention/underReview'
  103. })
  104. } else {
  105. uni.showToast({
  106. title: "网络异常",
  107. icon: "none"
  108. });
  109. }
  110. })
  111. },
  112. //修改用户身份状态
  113. updateUserResumes(userType,callback) {
  114. var that=this
  115. // 调用接口提交
  116. uni.showLoading({
  117. title: "提交中..."
  118. });
  119. this.$Request.postT("/app/user/updateUserEntity", {
  120. userType: userType
  121. })
  122. .then((res) => {
  123. uni.hideLoading();
  124. if (res.code === 0) {
  125. uni.setStorageSync('userType', userType)
  126. that.$queue.changeTabbar(userType)
  127. callback(true)
  128. } else {
  129. callback(false)
  130. }
  131. })
  132. .catch((err) => {
  133. uni.hideLoading();
  134. console.error("提交失败:", err);
  135. uni.showToast({
  136. title: "网络异常",
  137. icon: "none"
  138. });
  139. callback(false)
  140. });
  141. },
  142. },
  143. };
  144. </script>
  145. <style scoped lang="scss">
  146. .guide-page {
  147. background: linear-gradient(90deg, rgba(13, 39, 247, 1), rgba(19, 193, 234, 1) 100%);
  148. position: absolute;
  149. left: 0;
  150. right: 0;
  151. top: 0;
  152. bottom: 0;
  153. padding: 120rpx 76rpx;
  154. display: flex;
  155. flex-direction: column;
  156. box-sizing: border-box;
  157. gap: 36rpx;
  158. .guide-item {
  159. width: 100%;
  160. height: 100%;
  161. border-radius: 28rpx;
  162. background: rgba(255, 255, 255, 0.851);
  163. display: flex;
  164. flex-direction: column;
  165. justify-content: center;
  166. align-items: center;
  167. padding: 0 56rpx;
  168. box-sizing: border-box;
  169. gap: 72rpx;
  170. .guide-img {
  171. width: 364rpx;
  172. height: 364rpx;
  173. overflow: hidden;
  174. image {
  175. width: 100%;
  176. height: 100%;
  177. }
  178. }
  179. .guide-btn {
  180. border-radius: 100rpx;
  181. background: rgba(255, 255, 255, 1);
  182. color: #016bf6;
  183. font-family: DM Sans;
  184. font-size: 32rpx;
  185. font-weight: 400;
  186. line-height: 48rpx;
  187. letter-spacing: 0%;
  188. text-align: center;
  189. width: 100%;
  190. padding: 16rpx;
  191. box-sizing: border-box;
  192. }
  193. }
  194. }
  195. </style>