market.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="one">
  5. <scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
  6. <view class="list-scroll-view">
  7. <view class="list" v-for="(item, index) in list" :key="index" @click="toView(item)">
  8. <image class="image" :src="item.file" mode=""></image>
  9. <view class="name">
  10. {{item.name||'暂无'}}
  11. </view>
  12. <view class="money">
  13. <text>¥</text>
  14. <text>{{item.money}}</text>
  15. </view>
  16. <view class="other">
  17. <view class="other_1">
  18. {{item.num||0}}人评价
  19. </view>
  20. <view class="other_2">
  21. <text @click="toDel(item)" class="iconfont icon-del"></text>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </scroll-view>
  27. </view>
  28. </view>
  29. </mobile-frame>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. list: [{
  36. file: require('@/static/test.png'),
  37. name: '摩奇桃汁250ml*24盒',
  38. money: 59.90,
  39. num: 0
  40. },
  41. {
  42. file: require('@/static/test.png'),
  43. name: '摩奇桃汁250ml*24盒',
  44. money: 59.90,
  45. num: 0
  46. },
  47. {
  48. file: require('@/static/test.png'),
  49. name: '摩奇桃汁250ml*24盒',
  50. money: 59.90,
  51. num: 0
  52. }
  53. ]
  54. };
  55. },
  56. onShow: function() {
  57. },
  58. methods: {
  59. // 详细信息
  60. toView(e) {
  61. const that = this;
  62. console.log(e);
  63. },
  64. // 删除
  65. toDel(e) {
  66. const that = this;
  67. console.log(e);
  68. },
  69. // 分页
  70. toPage(e) {
  71. },
  72. }
  73. }
  74. </script>
  75. <style lang="scss">
  76. .main {
  77. display: flex;
  78. flex-direction: column;
  79. width: 100vw;
  80. height: 100vh;
  81. .one {
  82. padding: 2vw 0 0 0;
  83. .list {
  84. width: 42vw;
  85. border: 1px solid var(--f1Color);
  86. margin: 2vw 2vw 0 2vw;
  87. padding: 2vw;
  88. border-radius: 5px;
  89. .image {
  90. width: 100%;
  91. height: 40vw;
  92. }
  93. .name {
  94. font-size: var(--font16Size);
  95. margin: 0 0 1vw 0;
  96. }
  97. .money {
  98. color: var(--fFB1Color);
  99. font-size: var(--font14Size);
  100. margin: 0 0 1vw 0;
  101. }
  102. .other {
  103. display: flex;
  104. flex-direction: row;
  105. justify-content: space-between;
  106. .other_1 {
  107. font-size: var(--font14Size);
  108. color: var(--f85Color);
  109. }
  110. }
  111. }
  112. .list:nth-child(2n) {
  113. margin: 2vw 0 0 0;
  114. }
  115. }
  116. }
  117. .scroll-view {
  118. position: absolute;
  119. top: 0;
  120. left: 0;
  121. right: 0;
  122. bottom: 0;
  123. .list-scroll-view {
  124. display: flex;
  125. flex-direction: row;
  126. flex-wrap: wrap;
  127. }
  128. }
  129. </style>