index.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <!-- 屏蔽企业 -->
  2. <template>
  3. <view>
  4. <!-- 搜索条 -->
  5. <view class="white-bgc stick ss-p-t-10">
  6. <view style="position: relative;">
  7. <uni-search-bar
  8. v-model="name"
  9. placeholder="请输入公司关键字"
  10. cancelButton="none"
  11. :focus="false"
  12. bgColor="#fff"
  13. @confirm="getData($event.value)"
  14. @clear="query.content = ''"
  15. >
  16. </uni-search-bar>
  17. <button class="search-btn" @click.stop="getData" :loading="loading">搜索</button>
  18. </view>
  19. </view>
  20. <uni-popup ref="popup" type="bottom" background-color="#fff">
  21. <uni-card v-for="(item, index) in list" :key="index" :is-shadow="true" :border='false' shadow="0px 0px 3px 1px rgba(0,0,0,0.1)">
  22. <view class="d-flex align-center">
  23. <view @click="preview(item.url)" style="flex: 1;">
  24. <view class="font-size-14" style="font-weight: bold; margin: 15rpx 0; color: #777;">{{ item.title }}</view>
  25. </view>
  26. </view>
  27. </uni-card>
  28. </uni-popup>
  29. </view>
  30. </template>
  31. <script setup>
  32. import { ref } from 'vue'
  33. import {
  34. getBlockEnterpriseList,
  35. // handleBlockEnterprise,
  36. // handleUnBlockEnterprise,
  37. } from '@/api/vip'
  38. const popup = ref()
  39. const loading = ref(false)
  40. const name = ref('')
  41. const list = ref()
  42. const getData = async () => {
  43. try {
  44. loading.value = true
  45. const res = await getBlockEnterpriseList()
  46. list.value = res?.data || []
  47. popup.value.open()
  48. } catch (error) {
  49. uni.showToast({
  50. title: '搜索失败',
  51. icon: 'none'
  52. })
  53. loading.value = false
  54. }
  55. }
  56. </script>
  57. <style lang="scss" scoped>
  58. .stick {
  59. z-index: 1;
  60. position: sticky;
  61. top: 0;
  62. }
  63. .search-btn {
  64. position: absolute;
  65. right: 11px;
  66. top: 10px;
  67. width: 110px;
  68. height: 40px;
  69. font-size: 16px;
  70. background-color: #00897B;
  71. color: #fff;
  72. border-radius: 0 5px 5px 0;
  73. z-index: 9;
  74. }
  75. :deep(.uni-searchbar__box) {
  76. width: calc(100% - 105px);
  77. height: 40px !important;
  78. border: 1px solid #00897B;
  79. padding-right: 20px;
  80. flex: none;
  81. }
  82. </style>