pingbi.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <view>
  3. <view class="margin-lr-xl">
  4. <view class=" margin-top">
  5. <view class="text-bold" style="font-size: 44upx;color: #333333;">屏蔽公司</view>
  6. <view class="text-sm margin-top-sm" style="color: #999999;">添加屏蔽公司后,你和这些公司Boss,都不会被相互推荐 你的查看行为也不会告知对方
  7. </view>
  8. </view>
  9. <view class="box margin-top">
  10. <view class="margin-left-xs">
  11. <image src="../static/qiye.png" style="width: 36upx;height: 34upx;"></image>
  12. </view>
  13. <view class="text-left" style="width: 70%;">
  14. <u-input v-model="value" @input="change()" type="text" placeholder="输入添加屏蔽公司名称" inputAlign="text-align:left"/>
  15. </view>
  16. <view class="add" @click="addpingbi()">添加</view>
  17. </view>
  18. <view class="searchList" v-if="show">
  19. <view class="searchList-item" @click="selectcompany(item.companyId,item.companyName)" v-for="(item,index) in companyList" :key>
  20. {{item.companyName}}
  21. </view>
  22. </view>
  23. <view class="margin-top-xl">
  24. <view class="flex align-center justify-between" style="margin-bottom: 20rpx;" v-for="(item,index) in pingbiList" :key="index">
  25. <view style="color: #000000;">{{item.company?item.company.companyName:''}}</view>
  26. <view class="btn" @click="jiebang(item.shieldCompanyId)">解除屏蔽</view>
  27. </view>
  28. </view>
  29. <empty v-if="pingbiList.length==0" />
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import empty from '@/components/empty.vue'
  35. export default {
  36. components:{
  37. empty
  38. },
  39. data() {
  40. return {
  41. show:false,
  42. value: '',
  43. page: 1,
  44. limit: 10,
  45. userId: '',
  46. companyList:[],
  47. companyId:'',
  48. pingbiList:[],
  49. cont:'',
  50. }
  51. },
  52. onLoad() {
  53. this.getDataList();
  54. },
  55. onPullDownRefresh() {
  56. this.page = 1
  57. this.getDataList();
  58. },
  59. onReachBottom() {
  60. if(this.page == this.cont){
  61. uni.showToast({
  62. title:'已经到底了',
  63. icon:"none"
  64. })
  65. }else{
  66. this.page += 1
  67. this.getDataList();
  68. }
  69. },
  70. methods: {
  71. //解除屏蔽
  72. jiebang(shieldCompanyId){
  73. let _this = this
  74. uni.showModal({
  75. title:'提示',
  76. content:'确认解除该公司的屏蔽?',
  77. complete(iet) {
  78. if(iet.confirm){
  79. _this.$Request.post('/app/shieldCompany/deleteShieldCompany', {
  80. shieldCompanyId:shieldCompanyId
  81. }).then(res => {
  82. if (res.code == 0) {
  83. uni.showToast({
  84. title:'解除成功'
  85. })
  86. _this.getDataList();
  87. }else{
  88. uni.showToast({
  89. title:res.msg,
  90. icon:"none"
  91. })
  92. }
  93. })
  94. }
  95. }
  96. })
  97. },
  98. //屏蔽公司
  99. addpingbi(){
  100. if(this.companyId==''){
  101. uni.showToast({
  102. title:'请选择公司',
  103. icon:"none"
  104. })
  105. return
  106. }
  107. let _this = this
  108. uni.showModal({
  109. title:'提示',
  110. content:'确认屏蔽该公司吗?',
  111. complete(iet) {
  112. console.log(iet)
  113. if(iet.confirm){
  114. _this.$Request.postJson('/app/shieldCompany/insertShieldCompany', {
  115. companyId:_this.companyId,
  116. shieldType: 1,
  117. userId: uni.getStorageSync('userId')
  118. }).then(res => {
  119. if (res.code == 0) {
  120. uni.showToast({
  121. title:'屏蔽成功'
  122. })
  123. _this.companyId = ''
  124. _this.value = ''
  125. _this.show = false
  126. _this.getDataList();
  127. }else{
  128. uni.showToast({
  129. title:res.msg,
  130. icon:"none"
  131. })
  132. _this.companyId = ''
  133. _this.value = ''
  134. _this.show = false
  135. _this.getDataList();
  136. }
  137. })
  138. }
  139. }
  140. })
  141. },
  142. //选择要屏蔽的公司
  143. selectcompany(companyId,companyName){
  144. this.value = companyName
  145. this.companyId = companyId
  146. this.show = false
  147. },
  148. //搜索公司
  149. change(e){
  150. if(this.value==''){
  151. this.show = false
  152. return
  153. }
  154. let data = {
  155. page:1,
  156. limit:999,
  157. status:2,
  158. companyName:this.value
  159. }
  160. this.$Request.get('/app/company/selectCompanyList', data).then(res => {
  161. if (res.code == 0) {
  162. this.companyList = res.data.records
  163. if(this.companyList.length>0){
  164. this.show = true
  165. }
  166. }
  167. })
  168. },
  169. //查询屏蔽列表
  170. getDataList() {
  171. let data = {
  172. page: this.page,
  173. limit: this.limit,
  174. userId:uni.getStorageSync('userId')
  175. }
  176. this.$Request.get('/app/shieldCompany/selectShieldList', data).then(res => {
  177. uni.stopPullDownRefresh()
  178. if (res.code == 0) {
  179. this.cont = res.data.totalPage
  180. if(this.page==1){
  181. this.pingbiList = res.data.list
  182. }else{
  183. this.pingbiList = [...this.pingbiList,...res.data.list]
  184. }
  185. }
  186. })
  187. },
  188. }
  189. }
  190. </script>
  191. <style lang="less">
  192. page {
  193. background: #FFFFFF;
  194. }
  195. .searchList{
  196. width: 100%;
  197. background-color: #F7F7F7;
  198. padding-left: 10rpx;
  199. padding-right: 10rpx;
  200. }
  201. .searchList-item{
  202. padding: 20rpx;
  203. }
  204. .box {
  205. background: #F7F7F7;
  206. padding: 10upx;
  207. display: flex;
  208. align-items: center;
  209. justify-content: space-around;
  210. }
  211. .add {
  212. background: #00B88F;
  213. color: #FFFFFF;
  214. padding: 15upx 30upx;
  215. border-radius: 8upx;
  216. }
  217. .btn {
  218. background: rgba(0, 184, 143, 0.1);
  219. border-radius: 31upx;
  220. color: #00B88F;
  221. padding: 10rpx 27rpx;
  222. }
  223. </style>