index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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. <view class="money">
  52. <text>总价¥</text>
  53. <text>{{item.money}}</text>
  54. </view>
  55. </view>
  56. <view class="list_4">
  57. <button type="default" size="mini" plain="true"
  58. @click="toCancel(item)">取消订单</button>
  59. <button type="warn" size="mini" plain="true" @click="toPay(item)">付款</button>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </scroll-view>
  65. </view>
  66. </view>
  67. </mobile-frame>
  68. </template>
  69. <script>
  70. export default {
  71. data() {
  72. return {
  73. searchInfo: {},
  74. list: [ //商品列表
  75. {
  76. url: require('@/static/test.png'),
  77. shop: '官方自营店',
  78. name: '商品名称',
  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. url: require('@/static/test.png'),
  93. name: '商品名称',
  94. shop: '官方自营店',
  95. money: '10.00',
  96. status: '0',
  97. num: 2,
  98. },
  99. ]
  100. };
  101. },
  102. onShow: function() {},
  103. methods: {
  104. // 分页
  105. toPage(e) {
  106. },
  107. // 输入框
  108. toInput(e) {
  109. const that = this;
  110. that.$set(that.searchInfo, `name`, e.detail.value)
  111. },
  112. // 取消订单
  113. toCancel(e) {
  114. console.log(e);
  115. },
  116. // 付款
  117. toPay(e) {
  118. console.log(e);
  119. }
  120. }
  121. }
  122. </script>
  123. <style lang="scss">
  124. .main {
  125. display: flex;
  126. flex-direction: column;
  127. width: 100vw;
  128. height: 100vh;
  129. .one {
  130. padding: 2vw;
  131. input {
  132. padding: 2vw;
  133. background-color: var(--f1Color);
  134. font-size: var(--font14Size);
  135. border-radius: 5px;
  136. }
  137. }
  138. .two {
  139. position: relative;
  140. flex-grow: 1;
  141. background-color: var(--f9Color);
  142. .two_1 {
  143. background-color: var(--fffColor);
  144. padding: 2vw;
  145. display: flex;
  146. flex-direction: row;
  147. }
  148. .two_2 {
  149. display: flex;
  150. flex-direction: column;
  151. .list {
  152. width: 100vw;
  153. margin: 2vw 0 0 0;
  154. background-color: var(--mainColor);
  155. .list_1 {
  156. display: flex;
  157. flex-direction: row;
  158. justify-content: space-between;
  159. padding: 2vw;
  160. .name {
  161. font-size: var(--font14Size);
  162. text {
  163. margin: 0 1vw 0 0;
  164. }
  165. }
  166. .status {
  167. font-size: var(--font14Size);
  168. color: var(--ff0Color);
  169. }
  170. }
  171. .list_2 {
  172. display: flex;
  173. flex-direction: row;
  174. justify-content: space-between;
  175. padding: 2vw;
  176. background-color: var(--f8Color);
  177. .image {
  178. width: 20vw;
  179. height: 20vw;
  180. margin: 0 2vw 0 0;
  181. }
  182. .other {
  183. display: flex;
  184. flex-direction: column;
  185. flex-grow: 1;
  186. .name {
  187. font-size: var(--font14Size);
  188. font-weight: bold;
  189. margin: 0 0 2vw 0;
  190. }
  191. .other_1 {
  192. font-size: var(--font12Size);
  193. color: var(--f85Color);
  194. }
  195. }
  196. .money {
  197. font-size: var(--font12Size);
  198. .num {
  199. text-align: right;
  200. }
  201. }
  202. }
  203. .list_3 {
  204. display: flex;
  205. justify-content: flex-end;
  206. padding: 2vw;
  207. border-bottom: 0.5vw solid var(--f9Color);
  208. font-size: var(--font12Size);
  209. text {
  210. margin: 0 1vw;
  211. }
  212. }
  213. .list_4 {
  214. padding: 2vw;
  215. text-align: right;
  216. button {
  217. margin: 0 1vw 0 2vw;
  218. }
  219. }
  220. }
  221. }
  222. }
  223. }
  224. .scroll-view {
  225. position: absolute;
  226. top: 0;
  227. left: 0;
  228. right: 0;
  229. bottom: 0;
  230. .list-scroll-view {
  231. display: flex;
  232. flex-direction: column;
  233. }
  234. }
  235. </style>