index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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
  9. scroll-y="true"
  10. class="scroll-view"
  11. @scrolltolower="toPage"
  12. >
  13. <view class="list-scroll-view">
  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. <button type="default" size="mini">购买</button>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </scroll-view>
  31. </view>
  32. </view>
  33. </mobile-frame>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. oneUrl: "",
  40. list: [ //
  41. {
  42. url: "",
  43. name: "商品名称",
  44. money: 100,
  45. },
  46. ],
  47. };
  48. },
  49. onShow: function () {},
  50. methods: {
  51. // 分页
  52. toPage() {},
  53. },
  54. };
  55. </script>
  56. <style lang="scss">
  57. .main {
  58. display: flex;
  59. flex-direction: column;
  60. width: 96vw;
  61. height: 97.5vh;
  62. padding: 2vw;
  63. background-color: #0d2576;
  64. .one {
  65. margin: 0 0 2vw 0;
  66. .image {
  67. width: 100%;
  68. height: 50vw;
  69. }
  70. }
  71. .two {
  72. position: relative;
  73. flex-grow: 1;
  74. .list {
  75. margin: 0 2vw 2vw 0;
  76. background-color: var(--fffColor);
  77. padding: 2vw;
  78. width: 43vw;
  79. border-radius: 5px;
  80. .image {
  81. width: 100%;
  82. height: 49vw;
  83. margin: 0 0 1vw 0;
  84. }
  85. .name {
  86. font-size: var(--font15Size);
  87. margin: 0 0 2vw 0;
  88. }
  89. .other {
  90. display: flex;
  91. flex-direction: row;
  92. justify-content: space-between;
  93. .money {
  94. color: var(--ff0Color);
  95. text:nth-child(1) {
  96. font-size: var(--font12Size);
  97. }
  98. }
  99. .btn {
  100. button {
  101. border-radius: 25px;
  102. color: var(--fffColor);
  103. background-color: var(--ff0Color);
  104. font-size: var(--font12Size);
  105. }
  106. }
  107. }
  108. }
  109. .list:nth-child(2n) {
  110. margin: 0 0 2vw 0;
  111. }
  112. }
  113. }
  114. .scroll-view {
  115. position: absolute;
  116. top: 0;
  117. left: 0;
  118. right: 0;
  119. bottom: 0;
  120. .list-scroll-view {
  121. display: flex;
  122. flex-direction: row;
  123. flex-wrap: wrap;
  124. }
  125. }
  126. </style>