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

59 lines
1.2 KiB

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