search.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view class="back">
  3. <!-- 搜索 -->
  4. <view class="u-flex u-row-between">
  5. <view class="" style="width: 622rpx;">
  6. <u-search @blur='blur' @focus='focus' @click="search" placeholder="请输入物品名称" v-model="keyword"
  7. :showAction='false'></u-search>
  8. </view>
  9. <text @click="clear" v-if="keyword==''">{{i18n.Cancel}}</text>
  10. <text @click="enter" v-else>{{i18n.enter}}</text>
  11. </view>
  12. <view v-if="blurshow==false && keyword==''" class="title" style="margin-top: 32rpx;">
  13. {{i18n.Popularshipment}}
  14. </view>
  15. <view v-if="blurshow==false && keyword==''" class="u-flex " style="column-gap: 20rpx;flex-wrap: wrap;">
  16. <view class="tabs" v-for="(item,idx) in 8" :key="idx" @click="select">
  17. 行李
  18. </view>
  19. </view>
  20. <scroll-view v-if="blurshow && keyword" :scroll-y='true'>
  21. <view class="searchitem" v-for="(item,index) in 6">草莓</view>
  22. </scroll-view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. keyword: '',
  30. blurshow: false, //是否显示热门寄件
  31. };
  32. },
  33. computed: {
  34. i18n() {
  35. return this.$t('index')
  36. }
  37. },
  38. methods: {
  39. //取消
  40. clear() {
  41. uni.navigateBack()
  42. },
  43. enter() {
  44. },
  45. search() {
  46. },
  47. // 失去焦点
  48. blur() {
  49. this.blurshow = false
  50. },
  51. //获取焦点
  52. focus() {
  53. this.blurshow = true
  54. },
  55. //选中
  56. select() {
  57. }
  58. }
  59. }
  60. </script>
  61. <style lang="scss" scoped>
  62. .searchitem{
  63. height: 98rpx;
  64. border-bottom: 2rpx solid rgba(151, 151, 151, 0.1);
  65. line-height: 98rpx;
  66. }
  67. .title {
  68. font-family: PingFangSC, PingFang SC;
  69. font-weight: 500;
  70. font-size: 28rpx;
  71. color: #222222;
  72. line-height: 40rpx;
  73. text-align: left;
  74. font-style: normal;
  75. }
  76. .tabs {
  77. height: 58rpx;
  78. background: #F5F5F5;
  79. border-radius: 36rpx;
  80. font-family: PingFangSC, PingFang SC;
  81. font-weight: 400;
  82. font-size: 24rpx;
  83. color: #333333;
  84. // line-height: 58rpx;
  85. text-align: center;
  86. font-style: normal;
  87. display: inline;
  88. padding: 12rpx 24rpx;
  89. box-sizing: border-box;
  90. margin-top: 24rpx;
  91. }
  92. .back {
  93. padding: 28rpx 20rpx !important;
  94. background-color: #fff;
  95. min-height: calc(100vh - 44rpx);
  96. }
  97. </style>