search.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <view>
  3. <view class="search">
  4. <view class="box">
  5. <view class="icon">
  6. <uni-icons type="search" size="16" color="#BBBBBB"></uni-icons>
  7. </view>
  8. <view class="text">
  9. <input type="text" v-model="search_text" value="" placeholder="搜索" confirm-type="search"
  10. placeholder-style="font-size: 30rpx;color: #BBBBBB;" @input="get_list()" />
  11. </view>
  12. </view>
  13. </view>
  14. <view class="content">
  15. <view class="title">
  16. <view class="text">搜索结果:</view>
  17. </view>
  18. <view class="list">
  19. <view class="item" v-for="(item,index) in list" :key="index">
  20. <view class="left">
  21. <view class="text">{{item.name}}</view>
  22. </view>
  23. <view class="right">
  24. <uni-icons type="compose"></uni-icons>
  25. </view>
  26. </view>
  27. <view v-if="list.length == 0" style="font-size: 32rpx;text-align: center;line-height: 400rpx;">暂无搜索结果
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. data() {
  36. return {
  37. mine_code: "",
  38. search_text: "",
  39. list: [
  40. ],
  41. };
  42. },
  43. onLoad() {
  44. },
  45. methods: {
  46. get_list() {
  47. this.list = [
  48. {
  49. name:"工单名称1",
  50. },
  51. {
  52. name:"工单名称2",
  53. },
  54. {
  55. name:"工单名称3"
  56. }
  57. ]
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="scss">
  63. page {
  64. background-color: #F3F8F7;
  65. }
  66. .search {
  67. margin-bottom: 20rpx;
  68. background-color: #FFFFFF;
  69. box-sizing: border-box;
  70. padding: 25rpx 30rpx;
  71. .box {
  72. height: 80rpx;
  73. background-color: #F4F4F4;
  74. border-radius: 50rpx;
  75. display: flex;
  76. align-items: center;
  77. box-sizing: border-box;
  78. padding: 0 25rpx;
  79. .icon {
  80. margin-right: 10rpx;
  81. }
  82. .text {
  83. font-size: 30rpx;
  84. color: #BBBBBB;
  85. }
  86. }
  87. }
  88. .content {
  89. background-color: #FFFFFF;
  90. .title {
  91. height: 110rpx;
  92. display: flex;
  93. align-items: center;
  94. box-sizing: border-box;
  95. padding: 0 36rpx;
  96. border-bottom: 1rpx solid #F3F8F7;
  97. .text {
  98. margin-left: 20rpx;
  99. font-size: 36rpx;
  100. font-weight: 700;
  101. }
  102. }
  103. .list {
  104. box-sizing: border-box;
  105. padding: 0 20rpx;
  106. .item {
  107. height: 110rpx;
  108. display: flex;
  109. justify-content: space-between;
  110. align-items: center;
  111. margin-left: 58rpx;
  112. border-bottom: 1rpx solid #F3F8F7;
  113. box-sizing: border-box;
  114. padding-right: 20rpx;
  115. .left {
  116. display: flex;
  117. .text {
  118. margin-left: 18rpx;
  119. font-size: 30rpx;
  120. }
  121. }
  122. .right {
  123. }
  124. }
  125. }
  126. }
  127. </style>