search.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="one">
  5. <input type="text" v-model="searchInfo.name" @input="toInput" placeholder="搜索商品">
  6. </view>
  7. <view class="two">
  8. <scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
  9. <view class="list-scroll-view">
  10. <view class="two_1">
  11. 商品筛选
  12. </view>
  13. <view class="two_2">
  14. <view class="list" v-for="(item,index) in list" :key="index">
  15. <image class="image" :src="item.url" mode=""></image>
  16. <view class="name">
  17. {{item.name}}
  18. </view>
  19. <view class="other">
  20. <view class="money">
  21. <text>¥</text>
  22. <text>{{item.money}}</text>
  23. </view>
  24. <view class="btn">
  25. <text class="iconfont icon-gouwuche"></text>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </scroll-view>
  32. </view>
  33. </view>
  34. </mobile-frame>
  35. </template>
  36. <script>
  37. export default {
  38. data() {
  39. return {
  40. searchInfo: {},
  41. list: [ //商品列表
  42. {
  43. url: require('@/static/test.png'),
  44. name: '商品名称',
  45. money: '10.00'
  46. },
  47. {
  48. url: require('@/static/test.png'),
  49. name: '商品名称',
  50. money: '10.00'
  51. },
  52. {
  53. url: require('@/static/test.png'),
  54. name: '商品名称',
  55. money: '10.00'
  56. },
  57. ]
  58. };
  59. },
  60. onShow: function() {},
  61. methods: {
  62. // 分页
  63. toPage(e) {
  64. },
  65. // 输入框
  66. toInput(e) {
  67. const that = this;
  68. that.$set(that.searchInfo, `name`, e.detail.value)
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss">
  74. .main {
  75. display: flex;
  76. flex-direction: column;
  77. width: 100vw;
  78. height: 100vh;
  79. .one {
  80. border-bottom: 1px solid var(--f85Color);
  81. padding: 2vw;
  82. input {
  83. padding: 2vw;
  84. background-color: var(--f1Color);
  85. font-size: var(--font14Size);
  86. border-radius: 5px;
  87. }
  88. }
  89. .two {
  90. position: relative;
  91. flex-grow: 1;
  92. .two_1 {}
  93. .two_2 {
  94. display: flex;
  95. flex-direction: row;
  96. .list {
  97. border: 1px solid #ff0000;
  98. .image {
  99. width: 100%;
  100. height: 10vw;
  101. }
  102. .name {
  103. font-size: 16px;
  104. margin: 0 0 1vw 0;
  105. }
  106. .other {}
  107. }
  108. }
  109. }
  110. }
  111. .scroll-view {
  112. position: absolute;
  113. top: 0;
  114. left: 0;
  115. right: 0;
  116. bottom: 0;
  117. .list-scroll-view {
  118. display: flex;
  119. flex-direction: column;
  120. }
  121. }
  122. </style>