index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="one">
  5. <image class="image" :src="oneUrl" mode=""></image>
  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="list" v-for="(item,index) in list" :key="index">
  11. <image class="image" :src="item.url" mode=""></image>
  12. <view class="name">
  13. {{item.name}}
  14. </view>
  15. <view class="other">
  16. <view class="money">
  17. <text>¥</text>
  18. <text>{{item.money}}</text>
  19. </view>
  20. <view class="btn">
  21. <button type="default" size="mini">购买</button>
  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. oneUrl: require('@/static/test.png'),
  36. list: [ //
  37. {
  38. url: require('@/static/test.png'),
  39. name: '商品名称',
  40. money: 100,
  41. },
  42. {
  43. url: require('@/static/test.png'),
  44. name: '商品名称',
  45. money: 100,
  46. },
  47. {
  48. url: require('@/static/test.png'),
  49. name: '商品名称',
  50. money: 100,
  51. },
  52. {
  53. url: require('@/static/test.png'),
  54. name: '商品名称',
  55. money: 100,
  56. },
  57. {
  58. url: require('@/static/test.png'),
  59. name: '商品名称',
  60. money: 100,
  61. },
  62. ]
  63. };
  64. },
  65. onShow: function() {},
  66. methods: {
  67. // 分页
  68. toPage() {}
  69. }
  70. }
  71. </script>
  72. <style lang="scss">
  73. .main {
  74. display: flex;
  75. flex-direction: column;
  76. width: 96vw;
  77. height: 97.5vh;
  78. padding: 2vw;
  79. background-color: #0D2576;
  80. .one {
  81. margin: 0 0 2vw 0;
  82. .image {
  83. width: 100%;
  84. height: 50vw;
  85. }
  86. }
  87. .two {
  88. position: relative;
  89. flex-grow: 1;
  90. .list {
  91. margin: 0 2vw 2vw 0;
  92. background-color: var(--fffColor);
  93. padding: 2vw;
  94. width: 43vw;
  95. border-radius: 5px;
  96. .image {
  97. width: 100%;
  98. height: 49vw;
  99. margin: 0 0 1vw 0;
  100. }
  101. .name {
  102. font-size: var(--font15Size);
  103. margin: 0 0 2vw 0;
  104. }
  105. .other {
  106. display: flex;
  107. flex-direction: row;
  108. justify-content: space-between;
  109. .money {
  110. color: var(--ff0Color);
  111. text:nth-child(1) {
  112. font-size: var(--font12Size);
  113. }
  114. }
  115. .btn {
  116. button {
  117. border-radius: 25px;
  118. color: var(--fffColor);
  119. background-color: var(--ff0Color);
  120. font-size: var(--font12Size);
  121. }
  122. }
  123. }
  124. }
  125. .list:nth-child(2n) {
  126. margin: 0 0 2vw 0;
  127. }
  128. }
  129. }
  130. .scroll-view {
  131. position: absolute;
  132. top: 0;
  133. left: 0;
  134. right: 0;
  135. bottom: 0;
  136. .list-scroll-view {
  137. display: flex;
  138. flex-direction: row;
  139. flex-wrap: wrap;
  140. }
  141. }
  142. </style>