用工小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

186 lines
6.1 KiB

  1. <template>
  2. <view class="u-page se-w-vw-100">
  3. <!-- 求职信息头部 -->
  4. <view class="se-m-20 se-br-20 se-bs-b se-bgc-white se-py-20 se-px-30" v-if="seekInfo">
  5. <view class="se-flex se-flex-h-sb se-mb-10">
  6. <view class="se-flex">
  7. <view class="se-a-80">
  8. <image class="se-a-80 se-br-p-50 se-bgc-f5" :src="seekInfo.employResume.headImage" mode=""></image>
  9. </view>
  10. <view class="se-ml-20 se-flex se-flex-v-c se-flex-ai-fs">
  11. <text class="se-fw-6 se-c-black se-fs-30">{{seekInfo.employResume.name?seekInfo.employResume.name:seekInfo.hanHaiMember.nickName}}</text>
  12. <text class="se-mx-10 se-b-l"></text>
  13. <text class="se-fs-28 se-c-orange">日薪:{{seekInfo.dayMoney}}</text>
  14. <text class="se-fs-24 se-c-text-third se-mt-5">{{seekInfo.employResume.sex==1?"男":"女"}}-{{seekInfo.employResume.nation?seekInfo.employResume.nation:"未知"}}-{{seekInfo.employResume.age}}</text>
  15. </view>
  16. </view>
  17. <view class="se-c-orange se-fs-32 se-fw-6">
  18. {{seekInfo.salaryMin}}-{{seekInfo.salaryMax}}
  19. </view>
  20. </view>
  21. <view class="se-py-10">
  22. <text class="se-c-text-sub se-fs-22 se-mr-10 se-py-5 se-px-20 se-br-5 se-bgc-f5"
  23. v-if="seekInfo.categoryOne_dictText">{{seekInfo.categoryOne_dictText}}</text>
  24. <text class="se-c-text-sub se-fs-22 se-mr-10 se-py-5 se-px-20 se-br-5 se-bgc-f5"
  25. v-if="seekInfo.categoryTwo_dictText">{{seekInfo.categoryTwo_dictText}}</text>
  26. </view>
  27. <view class="se-flex se-flex-h-sb">
  28. <view class="se-flex se-flex-h-c">
  29. <u-icon name="map"></u-icon>
  30. <text class="se-c-text-sub se-fs-24 se-pl-10 se-toe-3">{{seekInfo.address}}</text>
  31. </view>
  32. <view
  33. style="flex-shrink: 0;"
  34. class="se-c-orange se-fs-24 se-fw-6">
  35. {{orderList.length}}个订单
  36. </view>
  37. </view>
  38. </view>
  39. <view class="se-p-40">
  40. <view class="se-px-40 se-mb-30 se-py-30 se-bgc-white se-br-40 se-bs-b"
  41. v-for="(item, index) in orderList"
  42. :key="index"
  43. @click="onOrderDetail(item)">
  44. <view class="se-flex se-flex-h-sb se-fw-6 se-fs-32 se-pb-20">
  45. <view class="se-flex">
  46. </view>
  47. <view class="se-c-red">
  48. {{ getStatusText(item) }}
  49. </view>
  50. </view>
  51. <view class="se-flex se-bgc-f5 se-br-20 se-p-20">
  52. <view class="se-w-160 se-h-160">
  53. <image class="se-w-160 se-h-160 se-br-10" :src="item.employAuthenticationCompany ?
  54. item.employAuthenticationCompany.headImg
  55. : '/static/image/logo.png'" mode="aspectFill"></image>
  56. </view>
  57. <view class="se-ml-20 se-flex se-flex-v-sa se-flex-ai-fs se-flex-1">
  58. <view class="se-fw-6 se-c-black se-fs-30 se-display-ib se-mb-10"
  59. v-if="item.employAuthenticationCompany">
  60. 企业{{item.employAuthenticationCompany.name}}
  61. </view>
  62. <view class="se-fs-24 se-c-text-third se-display-ib se-mb-5"
  63. v-if="item.employAuthenticationCompany">
  64. 联系电话{{item.employAuthenticationCompany.phone}}
  65. </view>
  66. <view class="se-fs-24 se-c-text-third se-display-ib se-mb-5">
  67. 聘用时间{{item.createTime | formatTime}}
  68. </view>
  69. <view class="se-fs-24 se-c-text-third se-display-ib se-mb-5"
  70. v-if="item.employAuthenticationCompany">
  71. 公司地址{{item.employAuthenticationCompany.address}}
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. <u-empty v-if="orderList && orderList.length==0" mode="list" text="暂无订单信息"></u-empty>
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. import {
  82. querySeekById
  83. } from "@/common/api.js"
  84. import {
  85. getStatusText
  86. } from "@/utils/statusText.js"
  87. export default {
  88. data() {
  89. return {
  90. orderList: [],
  91. seekInfo: null,
  92. seekId: null
  93. }
  94. },
  95. filters: {
  96. formatTime(time) {
  97. if (!time) return '';
  98. // 处理时间戳格式(可能是毫秒或字符串)
  99. let timestamp;
  100. if (typeof time === 'number') {
  101. // 如果是数字,直接使用
  102. timestamp = time;
  103. } else {
  104. // 如果是字符串,转换为时间戳
  105. timestamp = new Date(time).getTime();
  106. }
  107. const currentTime = new Date().getTime();
  108. const diff = (currentTime - timestamp) / 1000; // 时间差,单位:秒
  109. // 计算月差,判断是否超过一个月
  110. const oneMonthInSeconds = 30 * 24 * 60 * 60;
  111. if (diff > oneMonthInSeconds) {
  112. let date = new Date(timestamp);
  113. let year = date.getFullYear();
  114. let month = date.getMonth() + 1;
  115. let day = date.getDate();
  116. if (month < 10) month = "0" + month;
  117. if (day < 10) day = "0" + day;
  118. return `${year}-${month}-${day}`;
  119. } else {
  120. // 计算秒、分钟、小时的差值
  121. if (diff < 60) {
  122. return `${Math.floor(diff)}秒钟前`;
  123. } else if (diff < 60 * 60) {
  124. return `${Math.floor(diff / 60)}分钟前`;
  125. } else if (diff < 60 * 60 * 24) {
  126. return `${Math.floor(diff / 60 / 60)}小时前`;
  127. } else {
  128. // 显示天数
  129. return `${Math.floor(diff / 60 / 60 / 24)}天前`;
  130. }
  131. }
  132. }
  133. },
  134. onLoad(options) {
  135. if (options.seekId) {
  136. this.seekId = options.seekId;
  137. }
  138. },
  139. onShow(){
  140. this.getSeekDetail();
  141. },
  142. methods: {
  143. getStatusText,
  144. getSeekDetail() {
  145. querySeekById({ id: this.seekId }).then(response => {
  146. if (response.success) {
  147. this.seekInfo = response.result;
  148. this.orderList = this.seekInfo.employOrder || [];
  149. // 设置页面标题
  150. uni.setNavigationBarTitle({
  151. title: `${this.seekInfo.employResume.name || this.seekInfo.hanHaiMember.nickName} - 订单列表`
  152. });
  153. } else {
  154. uni.showToast({
  155. title: '获取求职详情失败',
  156. icon: 'none'
  157. });
  158. }
  159. }).catch(error => {
  160. console.error('获取求职详情失败:', error);
  161. uni.showToast({
  162. title: '网络错误',
  163. icon: 'none'
  164. });
  165. });
  166. },
  167. onOrderDetail(order) {
  168. uni.navigateTo({
  169. url: `/pages_subpack/job-order-detail/index?orderId=${order.id}&type=true`
  170. });
  171. }
  172. }
  173. }
  174. </script>
  175. <style>
  176. </style>