特易招,招聘小程序
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.

213 lines
3.7 KiB

9 months ago
5 months ago
9 months ago
9 months ago
9 months ago
9 months ago
7 months ago
9 months ago
9 months ago
9 months ago
7 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
7 months ago
7 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
7 months ago
9 months ago
7 months ago
9 months ago
7 months ago
9 months ago
7 months ago
9 months ago
9 months ago
  1. <template>
  2. <view class="work-item"
  3. :class="{ 'expired': isExpired }"
  4. @click="handledClick">
  5. <view class="top">
  6. <view class="title">
  7. {{ item.title }}
  8. </view>
  9. <view class="price"
  10. v-if="item.salaryLow >= 1000">
  11. <text>
  12. {{ (item.salaryLow / 1000).toFixed(0) }}
  13. </text>
  14. <text
  15. v-if="item.salaryUp">
  16. -{{ (item.salaryUp / 1000).toFixed(0) }}
  17. </text>
  18. K
  19. </view>
  20. <view class="price" v-else>
  21. <text>{{ item.salaryLow }}</text>
  22. <text
  23. v-if="item.salaryUp">-{{ item.salaryUp }}</text>
  24. </view>
  25. </view>
  26. <!-- 过期状态显示 -->
  27. <view class="expired-status" v-if="isExpired">
  28. <text class="expired-text">招聘已截止</text>
  29. </view>
  30. <view class="tag-list">
  31. <view
  32. v-for="(t, i) in lableText"
  33. :key="i">
  34. {{ t }}
  35. </view>
  36. </view>
  37. <view class="bottom">
  38. <view class="address">
  39. <!-- <text>2.5km | 楚河汉区</text> -->
  40. {{ item.workAddress }}
  41. </view>
  42. <view class="time">
  43. <!-- 09月23日 1620 -->
  44. {{ $dayjs(item.createTime).format('YYYY-MM-DD') }}
  45. </view>
  46. <view class="phone"
  47. :class="{ 'disabled': isExpired }"
  48. @click.stop="callPhone">
  49. <image src="/static/image/home/phone.png" mode=""></image>
  50. 联系老板
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. export default {
  57. props : {
  58. item : {
  59. default : {}
  60. }
  61. },
  62. computed : {
  63. lableText(){
  64. let arr =
  65. this.item.tab ?
  66. this.item.tab.split('、')
  67. : []
  68. if(this.item.workAge){
  69. arr.unshift(this.item.workAge)
  70. }
  71. if(this.item.qulification){
  72. arr.unshift(this.item.qulification)
  73. }
  74. return arr
  75. },
  76. // 检查是否过期
  77. isExpired(){
  78. if(!this.item.deadline) return false
  79. const now = this.$dayjs()
  80. const deadline = this.$dayjs(this.item.deadline)
  81. return now.isAfter(deadline)
  82. }
  83. },
  84. data() {
  85. return {
  86. }
  87. },
  88. methods: {
  89. callPhone(){
  90. // 如果过期,禁止拨打电话
  91. if(this.isExpired) {
  92. uni.showToast({
  93. title: '招聘已截止',
  94. icon: 'none'
  95. })
  96. return
  97. }
  98. uni.makePhoneCall({
  99. phoneNumber: this.item.phone,
  100. success() {
  101. console.log('安卓拨打成功');
  102. },
  103. fail() {
  104. console.log('安卓拨打失败');
  105. }
  106. })
  107. },
  108. handledClick(){
  109. // 如果过期,禁止点击
  110. if(this.isExpired) {
  111. uni.showToast({
  112. title: '招聘已截止,无法查看详情',
  113. icon: 'none'
  114. })
  115. return
  116. }
  117. this.$emit('click')
  118. },
  119. }
  120. }
  121. </script>
  122. <style scoped lang="scss">
  123. .work-item{
  124. background-color: #fff;
  125. padding: 20rpx;
  126. border-radius: 20rpx;
  127. position: relative;
  128. // 过期状态样式
  129. &.expired {
  130. opacity: 0.6;
  131. background-color: #f5f5f5;
  132. .title {
  133. color: #999;
  134. }
  135. .price {
  136. color: #999 !important;
  137. }
  138. }
  139. .top{
  140. display: flex;
  141. justify-content: space-between;
  142. font-weight: 900;
  143. .title{
  144. }
  145. .price{
  146. color: $uni-color;
  147. }
  148. }
  149. // 过期状态标识
  150. .expired-status {
  151. position: absolute;
  152. top: 50%;
  153. left: 50%;
  154. transform: translate(-50%, -50%);
  155. z-index: 10;
  156. .expired-text {
  157. background-color: rgba(0, 0, 0, 0.8);
  158. color: #fff;
  159. padding: 16rpx 32rpx;
  160. border-radius: 20rpx;
  161. font-size: 28rpx;
  162. font-weight: 600;
  163. }
  164. }
  165. .bottom{
  166. display: flex;
  167. justify-content: space-between;
  168. align-items: center;
  169. font-size: 24rpx;
  170. gap: 16rpx;
  171. .time{
  172. color: #999999;
  173. flex-shrink: 0;
  174. }
  175. .phone{
  176. background-color: rgba($uni-color, 0.2);
  177. color: $uni-color;
  178. padding: 8rpx 16rpx;
  179. border-radius: 10rpx;
  180. flex-shrink: 0;
  181. image{
  182. width: 20rpx;
  183. height: 20rpx;
  184. }
  185. // 禁用状态样式
  186. &.disabled {
  187. background-color: #f0f0f0;
  188. color: #999;
  189. opacity: 0.6;
  190. }
  191. }
  192. }
  193. }
  194. </style>