job-detail.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <view class="detail-container">
  3. <!-- 核心信息 -->
  4. <view class="header-box">
  5. <view class="title-row">
  6. <text class="title">高级审计师</text>
  7. <text class="salary">13K-23K</text>
  8. </view>
  9. <view class="tag-row">
  10. <text class="urgent-tag">急招</text>
  11. </view>
  12. <view class="meta-row">
  13. <text class="meta-text">上海市·黄浦区 | 招1人 | 2025-12-12 截止</text>
  14. </view>
  15. </view>
  16. <!-- 说明文字 -->
  17. <view class="content-box">
  18. <view class="section-title">岗位详情</view>
  19. <view class="tags-cloud">
  20. <text class="tag">全职</text>
  21. <text class="tag">五险一金</text>
  22. <text class="tag">本科</text>
  23. <text class="tag">CPA</text>
  24. </view>
  25. <view class="desc-text">
  26. 我们需要一位经验丰富的审计师。您将负责执行复杂的财务和运营审计,识别流程改进机会。
  27. </view>
  28. </view>
  29. <!-- 底部按钮 -->
  30. <view class="bottom-bar">
  31. <view class="consult-btn" @click="goToChat">
  32. <text>咨询</text>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script setup>
  38. import { createOrGetSession } from '../../api/message.js';
  39. const goToChat = async () => {
  40. try {
  41. uni.showLoading({ title: '正在连接客服...' });
  42. const userInfo = uni.getStorageSync('userInfo') || {};
  43. const userId = userInfo.studentId || null;
  44. const userName = userInfo.name || '用户';
  45. const userAvatar = userInfo.avatarUrl || '/static/images/user_avatar.svg';
  46. const currentPage = getCurrentPages().pop();
  47. const jobId = currentPage?.options?.id || '';
  48. const res = await createOrGetSession({
  49. sessionType: 1,
  50. fromUserId: userId,
  51. fromUserName: userName,
  52. fromUserAvatar: userAvatar,
  53. sourceId: 'job_' + jobId
  54. });
  55. uni.hideLoading();
  56. if (res.data) {
  57. const session = res.data;
  58. uni.navigateTo({
  59. url: `/pages/chat/chat?sessionId=${session.sessionId}&sessionNo=${session.sessionNo || ''}&fromUserId=${userId || ''}&userName=${encodeURIComponent(userName)}`
  60. });
  61. } else {
  62. uni.showToast({ title: '创建会话失败', icon: 'none' });
  63. }
  64. } catch (err) {
  65. uni.hideLoading();
  66. console.error('创建会话失败:', err);
  67. uni.showToast({ title: '连接失败,请重试', icon: 'none' });
  68. }
  69. };
  70. </script>
  71. <style lang="scss">
  72. .detail-container {
  73. min-height: 100vh;
  74. background-color: #F8F9FB;
  75. padding-bottom: 120rpx;
  76. }
  77. .header-box {
  78. background: #fff;
  79. padding: 40rpx 30rpx;
  80. margin-bottom: 20rpx;
  81. .title-row {
  82. display: flex;
  83. justify-content: space-between;
  84. margin-bottom: 20rpx;
  85. .title { font-size: 40rpx; font-weight: bold; }
  86. .salary { font-size: 36rpx; color: #1F6CFF; font-weight: bold; }
  87. }
  88. .urgent-tag {
  89. background: #FFF2F0; color: #FF4D4F; font-size: 22rpx; padding: 4rpx 12rpx; border-radius: 4rpx;
  90. }
  91. .meta-row { margin-top: 20rpx; font-size: 24rpx; color: #999; }
  92. }
  93. .content-box {
  94. background: #fff;
  95. padding: 40rpx 30rpx;
  96. .section-title { font-size: 32rpx; font-weight: bold; margin-bottom: 20rpx; border-left: 8rpx solid #1F6CFF; padding-left: 20rpx; }
  97. .tags-cloud { display: flex; gap: 16rpx; margin-bottom: 30rpx; .tag { background: #F0F2F5; font-size: 24rpx; padding: 8rpx 20rpx; color: #666; } }
  98. .desc-text { font-size: 28rpx; color: #666; line-height: 1.6; }
  99. }
  100. .bottom-bar {
  101. position: fixed; bottom: 0; left: 0; right: 0; height: 110rpx; background: #fff; display: flex; align-items: center; padding: 0 40rpx; border-top: 1rpx solid #eee;
  102. .consult-btn { flex: 1; background: #1F6CFF; height: 80rpx; border-radius: 40rpx; display: flex; align-items: center; justify-content: center; text { color: #fff; font-weight: bold; } }
  103. }
  104. </style>