index.vue 2.3 KB

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