shareEmployment.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <view>
  3. <u-navbar back-text="共享用工" back-icon-size="28" back-icon-color="#ffffff" :background="{backgroundColor: '#2795FD',}"
  4. :back-text-style="{color: '#ffffff'}"></u-navbar>
  5. <view class="tabs">
  6. <u-tabs :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
  7. </view>
  8. <view class="info-card" v-for="(item,i) in list[current].list" :key="i"
  9. @click="gotoUrl('pages/packages/shareEmployment/articleDetail?id='+item.id)">
  10. <!-- 卡片信息 -->
  11. <view class="detail">
  12. 企业现急需熟练机床车工5名,如有资源请联系0716-8818118 刘女士。
  13. </view>
  14. <view class="tag">
  15. <view class="item1">
  16. 急需用工
  17. </view>
  18. <view class="date-item">
  19. 2023-06-12
  20. </view>
  21. </view>
  22. </view>
  23. <u-divider v-if="formList[current].recordsTotal==list[current].list.length"
  24. :isnone="formList[current].recordsTotal==0" nonetext="没有找到相关内容" border-color="#CFD2D5">已经到底了</u-divider>
  25. <!-- 底部按钮 -->
  26. </view>
  27. </template>
  28. <script>
  29. import * as API from '@/apis/pagejs/packages.js'
  30. export default {
  31. data() {
  32. return {
  33. formList: [{
  34. pageIndex: 1,
  35. pageSize: 20,
  36. recordsTotal: 1,
  37. type: "1",
  38. },
  39. {
  40. pageIndex: 1,
  41. pageSize: 20,
  42. recordsTotal: 1,
  43. type: "2",
  44. }
  45. ],
  46. list: [{
  47. name: '急需用工',
  48. list: []
  49. },
  50. {
  51. name: '资源共享',
  52. list: []
  53. }
  54. ],
  55. current: 0
  56. }
  57. },
  58. onReachBottom() {
  59. var obj = this.list[this.current]
  60. var objf = this.formList[this.current]
  61. if (obj.list.length < objf.recordsTotal) {
  62. this.myLoadmore();
  63. }
  64. },
  65. onReady() {
  66. this.getList()
  67. },
  68. methods: {
  69. getList() {
  70. uni.showLoading({
  71. title: "加载中",
  72. mask: true,
  73. })
  74. var list = this.list[this.current].list
  75. var listForm = this.formList[this.current]
  76. API.shareWorksList(listForm).then((res) => {
  77. if (listForm.pageIndex == 1) {
  78. list = res.data.data;
  79. } else {
  80. list = [
  81. ...list,
  82. ...res.data.data
  83. ];
  84. }
  85. this.list[this.current].list = list
  86. this.formList[this.current].recordsTotal = res.data.recordsTotal;
  87. uni.hideLoading();
  88. }).catch(error => {
  89. uni.showToast({icon: 'none',
  90. title: error,
  91. icon: "none"
  92. })
  93. })
  94. },
  95. myLoadmore() {
  96. this.formList[this.current].pageIndex += 1;
  97. this.getList();
  98. },
  99. change(index) {
  100. this.current = index;
  101. var list = this.list[this.current].list
  102. if (list.length == 0) {
  103. this.getList();
  104. }
  105. }
  106. }
  107. }
  108. </script>
  109. <style>
  110. page {
  111. background: #F0F0F2;
  112. padding-bottom: 100px;
  113. }
  114. </style>
  115. <style scoped lang="scss">
  116. .info-card {
  117. margin: 24rpx 32rpx 0;
  118. padding: 24rpx;
  119. background-color: #fff;
  120. border-radius: 24rpx;
  121. // 卡片信息
  122. .detail {
  123. color: rgba(16, 16, 16, 1);
  124. line-height: 40rpx;
  125. }
  126. .tag {
  127. display: flex;
  128. justify-content: space-between;
  129. margin-top: 16rpx;
  130. margin-bottom: 24rpx;
  131. .item1 {
  132. color: rgba(39, 149, 253, 1);
  133. font-size: 24rpx;
  134. }
  135. .item2 {
  136. color: rgba(0, 185, 98, 1);
  137. font-size: 24rpx;
  138. }
  139. }
  140. // 审核
  141. .check {
  142. display: flex;
  143. justify-content: space-between;
  144. align-items: center;
  145. margin-top: 32rpx;
  146. .state {
  147. color: rgba(51, 51, 51, 1);
  148. font-weight: 600;
  149. }
  150. .handle {
  151. display: flex;
  152. align-items: center;
  153. .unamend {
  154. width: 120rpx;
  155. height: 56rpx;
  156. line-height: 56rpx;
  157. text-align: center;
  158. font-family: Microsoft Yahei;
  159. border: 1px solid rgba(231, 232, 234, 1);
  160. border-radius: 50px;
  161. opacity: 0.4;
  162. }
  163. .amend {
  164. width: 120rpx;
  165. height: 56rpx;
  166. line-height: 56rpx;
  167. text-align: center;
  168. font-family: Microsoft Yahei;
  169. border: 1px solid rgba(231, 232, 234, 1);
  170. border-radius: 50px;
  171. }
  172. .delete {
  173. width: 120rpx;
  174. height: 56rpx;
  175. line-height: 56rpx;
  176. text-align: center;
  177. font-family: Microsoft Yahei;
  178. border: 1px solid rgba(231, 232, 234, 1);
  179. border-radius: 50px;
  180. margin-left: 24rpx;
  181. color: #E60012;
  182. }
  183. }
  184. }
  185. }
  186. // 底部按钮
  187. .btn {
  188. position: fixed;
  189. bottom: 32rpx;
  190. left: 0;
  191. right: 0;
  192. background-color: #F0F0F2;
  193. padding: 0 32rpx;
  194. border-radius: 50px;
  195. background-color: rgba(34, 149, 255, 1);
  196. color: rgba(241, 241, 241, 1);
  197. font-size: 36rpx;
  198. margin: 0 32rpx;
  199. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.03);
  200. }
  201. </style>