瑶都万能墙
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
1.7 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <template>
  2. <uv-popup
  3. ref="popup"
  4. :round="30">
  5. <view class="content">
  6. <uv-search
  7. placeholder="请输入搜索内容"
  8. @search="getData"
  9. @custom="getData"
  10. @clear="getData"
  11. height="70rpx"
  12. v-model="queryParams[searchKey]"></uv-search>
  13. <scroll-view
  14. scroll-y="true"
  15. :style="{height: '50vh'}"
  16. @scrolltolower="loadMoreData">
  17. <view class="list">
  18. <view class="item"
  19. :key="index"
  20. @click="select(item)"
  21. v-for="(item, index) in list">
  22. <view class="title">
  23. {{ item[keyName] }}
  24. </view>
  25. <view class="desc"
  26. v-if="descKeyName">
  27. {{ item[descKeyName] }}
  28. </view>
  29. </view>
  30. </view>
  31. </scroll-view>
  32. </view>
  33. </uv-popup>
  34. </template>
  35. <script>
  36. import mixinsList from '@/mixins/list.js'
  37. export default {
  38. mixins: [mixinsList],
  39. props: {
  40. keyName : {//展示信息的字段
  41. default : 'name',
  42. },
  43. descKeyName : {
  44. default : ''
  45. },
  46. placeholder : {//搜索框提示词
  47. default : '请输入搜索内容'
  48. },
  49. isPage : {//是否分页
  50. default : true,
  51. },
  52. searchKey : {//搜索参数字段
  53. default : 'name'
  54. },
  55. mixinsListApi : {
  56. default : '',
  57. },
  58. },
  59. data() {
  60. return {
  61. }
  62. },
  63. watch: {
  64. },
  65. methods: {
  66. open(){
  67. this.$refs.popup.open('bottom')
  68. this.getData()
  69. },
  70. close(){
  71. this.$refs.popup.close()
  72. },
  73. select(item){
  74. this.$emit('select', item)
  75. },
  76. },
  77. }
  78. </script>
  79. <style lang="scss" scoped>
  80. .content{
  81. padding: 20rpx;
  82. .list{
  83. .item{
  84. padding: 30rpx;
  85. border: 1rpx solid #00000009;
  86. .title{
  87. font-size: 28rpx;
  88. }
  89. .desc{
  90. margin-top: 10rpx;
  91. color: #888;
  92. font-size: 24rpx;
  93. }
  94. }
  95. }
  96. }
  97. </style>