学员端小程序
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.

65 lines
1.2 KiB

9 months ago
8 months ago
  1. <template>
  2. <view class="searchBg">
  3. <view class="flex">
  4. <view class="searchIcon">
  5. <image src="@/static/images/index/searchIcon.png" mode=""></image>
  6. </view>
  7. <view class="inputBox">
  8. <u-search :placeholder="placeholder" v-model="keyword" :color="'#fff'" :disabled="disable" placeholderColor="#fff" style="pointer-events: none;" :bgColor="'transparent'" @change="$u.debounce(searchFn, 1500)" :showAction="false" @search="$u.debounce(searchFn, 500)" @clear="clearSearchFn"></u-search>
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. props: ['placeholder', 'disable'],
  16. data() {
  17. return {
  18. keyword: ''
  19. }
  20. },
  21. methods: {
  22. searchFn() {
  23. this.$emit('searchFn', this.keyword)
  24. },
  25. clearSearchFn() {
  26. this.keyword = ''
  27. }
  28. }
  29. }
  30. </script>
  31. <style lang="scss" scoped>
  32. .searchBg {
  33. background: #8ABAED;
  34. width: 100%;
  35. height: 72rpx;
  36. border-radius: 16rpx;
  37. line-height: 72rpx;
  38. .flex {
  39. height: 100%;
  40. padding: 0 28rpx;
  41. .searchIcon {
  42. width: 40rpx;
  43. height: 40rpx;
  44. }
  45. .inputBox {
  46. flex: 1;
  47. color: #fff;
  48. font-size: 28rpx;
  49. }
  50. }
  51. }
  52. .textColor {
  53. font-size: 26rpx;
  54. color: #fff;
  55. line-height: 72rpx;
  56. padding-left: 14rpx;
  57. }
  58. </style>