shareEmployment.vue 4.5 KB

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