index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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. <view class="cond_1">
  12. 默认
  13. </view>
  14. <view class="cond_1">
  15. 默认
  16. </view>
  17. <view class="cond_1">
  18. 默认
  19. </view>
  20. <view class="cond_1">
  21. 默认
  22. </view>
  23. </view>
  24. <view class="two_2">
  25. <view class="list" v-for="(item,index) in list" :key="index">
  26. <view class="list_1">
  27. <view class="name">
  28. <text @click="toDel(item)" class="iconfont icon-shangdian"></text>
  29. <text>{{item.shop}}</text>
  30. </view>
  31. <view class="status">{{item.status=='0'?'待付款':'已付款'}}</view>
  32. </view>
  33. <view class="list_2">
  34. <image class="image" :src="item.url" mode=""></image>
  35. <view class="other">
  36. <view class="name">{{item.name}}</view>
  37. <view class="other_1">
  38. 口味: {{item.num||'暂无'}}
  39. </view>
  40. </view>
  41. <view class="money">
  42. <text>¥</text>
  43. <text>{{item.money}}</text>
  44. <view class="num">
  45. ×{{item.num}}
  46. </view>
  47. </view>
  48. </view>
  49. <view class="list_3">
  50. <text>共{{item.num}}件商品</text>
  51. <text>总价¥{{item.money}}</text>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </scroll-view>
  57. </view>
  58. </view>
  59. </mobile-frame>
  60. </template>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. searchInfo: {},
  66. list: [ //商品列表
  67. {
  68. url: require('@/static/test.png'),
  69. shop: '官方自营店',
  70. name: '商品名称',
  71. money: '10.00',
  72. status: '0',
  73. num: 2,
  74. },
  75. {
  76. url: require('@/static/test.png'),
  77. name: '商品名称',
  78. shop: '官方自营店',
  79. money: '10.00',
  80. status: '0',
  81. num: 2,
  82. },
  83. {
  84. url: require('@/static/test.png'),
  85. name: '商品名称',
  86. shop: '官方自营店',
  87. money: '10.00',
  88. status: '0',
  89. num: 2,
  90. },
  91. ]
  92. };
  93. },
  94. onShow: function() {},
  95. methods: {
  96. // 分页
  97. toPage(e) {
  98. },
  99. // 输入框
  100. toInput(e) {
  101. const that = this;
  102. that.$set(that.searchInfo, `name`, e.detail.value)
  103. }
  104. }
  105. }
  106. </script>
  107. <style lang="scss">
  108. .main {
  109. display: flex;
  110. flex-direction: column;
  111. width: 100vw;
  112. height: 100vh;
  113. .one {
  114. padding: 2vw;
  115. input {
  116. padding: 2vw;
  117. background-color: var(--f1Color);
  118. font-size: var(--font14Size);
  119. border-radius: 5px;
  120. }
  121. }
  122. .two {
  123. position: relative;
  124. flex-grow: 1;
  125. .two_1 {
  126. background-color: var(--fffColor);
  127. padding: 2vw;
  128. display: flex;
  129. flex-direction: row;
  130. }
  131. .two_2 {
  132. display: flex;
  133. flex-direction: column;
  134. padding: 2vw 2vw 0 2vw;
  135. .list {
  136. width: 95vw;
  137. border-radius: 5px;
  138. border: 1px solid red;
  139. margin: 2vw 0 0 0;
  140. .list_1 {
  141. display: flex;
  142. flex-direction: row;
  143. justify-content: space-between;
  144. padding: 2vw;
  145. .name {
  146. font-size: var(--font16Size);
  147. text {
  148. margin: 0 1vw 0 0;
  149. }
  150. }
  151. .status {
  152. font-size: var(--font16Size);
  153. color: var(--ff0Color);
  154. }
  155. }
  156. .list_2 {
  157. display: flex;
  158. flex-direction: row;
  159. justify-content: space-between;
  160. padding: 2vw;
  161. background-color: var(--f1Color);
  162. .image {
  163. width: 25vw;
  164. height: 25vw;
  165. margin: 0 2vw 0 0;
  166. }
  167. .other {
  168. display: flex;
  169. flex-direction: column;
  170. flex-grow: 1;
  171. .name {
  172. font-size: var(--font16Size);
  173. font-weight: bold;
  174. margin: 0 0 2vw 0;
  175. }
  176. .other_1 {
  177. font-size: var(--font14Size);
  178. color: var(--f85Color);
  179. }
  180. }
  181. .money {
  182. font-size: var(--font14Size);
  183. .num {
  184. text-align: right;
  185. }
  186. }
  187. }
  188. }
  189. }
  190. }
  191. }
  192. .scroll-view {
  193. position: absolute;
  194. top: 0;
  195. left: 0;
  196. right: 0;
  197. bottom: 0;
  198. .list-scroll-view {
  199. display: flex;
  200. flex-direction: column;
  201. }
  202. }
  203. </style>