index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <view class="hidden-management">
  3. <view>
  4. <nav-bar color="#000" title="屏蔽管理"></nav-bar>
  5. <view class="content">
  6. <view class="title">屏蔽管理</view>
  7. <view class="tip">请设置指定公司不可看见你的简历,屏蔽后双向不被推荐</view>
  8. <view class="search-bar flex align-center" @click="toHiddenCompany">
  9. <image src="@/static/images/svg/search.svg" class="search-icon"></image>
  10. 搜索需要屏蔽的公司
  11. </view>
  12. </view>
  13. </view>
  14. <scroll-view
  15. class="company-list"
  16. :scroll-y="true"
  17. :refresher-threshold="80"
  18. :refresher-enabled="true"
  19. :refresher-triggered="isRefreshing"
  20. scroll-with-animation="true"
  21. @refresherrefresh="handleRefresh"
  22. @scrolltolower="loadMore"
  23. >
  24. <view class="scroll-wrapper">
  25. <view class="company-item" v-for="item in hideCompanys" :key="item.companyId">
  26. <siwper-delete @delete="handleDelete(item)">
  27. <view class="company-content flex align-center">
  28. <image :src="item.company.companyLogo ? item.company.companyLogo : '/static/images/logo.jpg'" class="company-icon"></image>
  29. <view class="company-info">
  30. <view class="company-name">{{ item.companyName }}</view>
  31. <view class="text">{{ item.company.companyPeople }} <template v-if="item.company.type == '0'">· 跨境电商</template></view>
  32. </view>
  33. </view>
  34. </siwper-delete>
  35. </view>
  36. </view>
  37. </scroll-view>
  38. <u-modal
  39. v-model="showDeleteModal"
  40. :async-close="true"
  41. :content="content"
  42. :show-cancel-button="true"
  43. @confirm="confirm"
  44. ></u-modal>
  45. </view>
  46. </template>
  47. <script>
  48. import navBar from '@/components/nav-bar/index.vue'
  49. import siwperDelete from '@/components/swiper-delete.vue'
  50. export default {
  51. components: {
  52. navBar,
  53. siwperDelete
  54. },
  55. data() {
  56. return {
  57. hideCompanys: [],
  58. loading: false,
  59. page: 1,
  60. isRefreshing: false,
  61. showDeleteModal: false,
  62. selectCompany: {},
  63. content: '是否确定删除屏蔽',
  64. total: 0
  65. };
  66. },
  67. onLoad() {
  68. this.getHideCompany()
  69. // 添加屏蔽后返回刷新数据
  70. uni.$on('refreshList', () => {
  71. this.page = 1
  72. this.getHideCompany()
  73. })
  74. },
  75. onUnload() {
  76. uni.$off('refreshList')
  77. },
  78. methods: {
  79. // 获取屏蔽公司列表数据
  80. getHideCompany() {
  81. uni.showLoading({
  82. title: '加载中'
  83. })
  84. this.loading = true
  85. this.$Request
  86. .getT('/app/shieldCompany/selectShieldList', {
  87. page: this.page,
  88. limit: 10,
  89. })
  90. .then(res => {
  91. if (res.code === 0) {
  92. this.hideCompanys = this.page != 1 ? [...this.hideCompanys, ...res.data.list] : res.data.list
  93. this.total = res.data.totalCount
  94. }
  95. })
  96. .finally(() => {
  97. this.isRefreshing = false
  98. this.loading = false
  99. uni.hideLoading()
  100. })
  101. },
  102. // 删除屏蔽
  103. deleteCompany() {
  104. uni.showLoading({
  105. title: '删除中'
  106. })
  107. this.$Request
  108. .postJson('/app/shieldCompany/deleteShieldCompany', {
  109. shieldCompanyId: this.selectCompany.shieldCompanyId,
  110. })
  111. .then(res => {
  112. this.$queue.showToast('删除成功')
  113. this.page = 1
  114. this.getHideCompany()
  115. })
  116. .finally(() => {
  117. this.showDeleteModal = false
  118. uni.hideLoading()
  119. })
  120. },
  121. handleDelete(item) {
  122. this.showDeleteModal = true
  123. this.selectCompany = item
  124. },
  125. confirm() {
  126. this.deleteCompany()
  127. },
  128. toHiddenCompany() {
  129. uni.navigateTo({
  130. url: '/package/my/hiddenManagement/hiddenCompany'
  131. })
  132. },
  133. handleRefresh() {
  134. if (this.isRefreshing) return
  135. this.isRefreshing = true
  136. this.page = 1
  137. this.getHideCompany()
  138. },
  139. loadMore() {
  140. if (this.loading || this.hideCompanys.length >= this.total) return
  141. this.page++
  142. this.getHideCompany()
  143. }
  144. }
  145. }
  146. </script>
  147. <style lang="scss" scoped>
  148. .hidden-management {
  149. height: 100vh;
  150. display: flex;
  151. flex-direction: column;
  152. justify-content: space-between;
  153. font-family: DM Sans;
  154. .content {
  155. padding: 32rpx 40rpx 0;
  156. .title {
  157. font-size: 48rpx;
  158. font-weight: 700;
  159. line-height: 60rpx;
  160. color: rgba(51, 51, 51, 1);
  161. margin-bottom: 20rpx;
  162. }
  163. .tip {
  164. font-size: 24rpx;
  165. line-height: 32rpx;
  166. color: rgba(102, 102, 102, 1);
  167. margin-bottom: 28rpx;
  168. }
  169. .search-bar {
  170. border: 1px solid rgba(231, 230, 228, 1);
  171. border-radius: 12rpx;
  172. background: rgba(237, 237, 237, 1);
  173. padding: 16rpx 24rpx;
  174. color: rgba(188, 188, 188, 1);
  175. font-size: 28rpx;
  176. margin-bottom: 28rpx;
  177. .search-icon {
  178. width: 32rpx;
  179. height: 32rpx;
  180. margin-right: 16rpx;
  181. }
  182. }
  183. }
  184. .company-list {
  185. height: 300px;
  186. flex: 1;
  187. padding: 0 40rpx;
  188. .scroll-wrapper {
  189. padding-bottom: 20rpx;
  190. }
  191. .company-item {
  192. border: 1px solid rgba(227, 231, 236, 1);
  193. border-radius: 12rpx;
  194. box-sizing: border-box;
  195. margin-bottom: 20rpx;
  196. overflow: hidden;
  197. }
  198. .company-content {
  199. padding: 20rpx 32rpx;
  200. .company-icon {
  201. display: block;
  202. width: 60rpx;
  203. height: 60rpx;
  204. margin-right: 24rpx;
  205. border: 1px solid #eee;
  206. border-radius: 60rpx;
  207. }
  208. }
  209. }
  210. }
  211. </style>