detail.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. toCommon(route, e) {
  71. uni.navigateTo({
  72. url: `${route}?id=${e && e._id ? e._id : ''}`
  73. })
  74. },
  75. }
  76. }
  77. </script>
  78. <style lang="scss">
  79. .main {
  80. display: flex;
  81. flex-direction: column;
  82. width: 96vw;
  83. height: 97.5vh;
  84. padding: 2vw;
  85. background-color: #0D2576;
  86. .one {
  87. margin: 0 0 2vw 0;
  88. .image {
  89. width: 100%;
  90. height: 50vw;
  91. }
  92. }
  93. .two {
  94. position: relative;
  95. flex-grow: 1;
  96. .list {
  97. margin: 0 2vw 2vw 0;
  98. background-color: var(--fffColor);
  99. padding: 2vw;
  100. width: 43vw;
  101. border-radius: 5px;
  102. .image {
  103. width: 100%;
  104. height: 49vw;
  105. margin: 0 0 1vw 0;
  106. }
  107. .name {
  108. font-size: var(--font15Size);
  109. margin: 0 0 2vw 0;
  110. }
  111. .other {
  112. display: flex;
  113. flex-direction: row;
  114. justify-content: space-between;
  115. .money {
  116. color: var(--ff0Color);
  117. text:nth-child(1) {
  118. font-size: var(--font12Size);
  119. }
  120. }
  121. .btn {
  122. button {
  123. border-radius: 25px;
  124. color: var(--fffColor);
  125. background-color: var(--ff0Color);
  126. font-size: var(--font12Size);
  127. }
  128. }
  129. }
  130. }
  131. .list:nth-child(2n) {
  132. margin: 0 0 2vw 0;
  133. }
  134. }
  135. }
  136. .scroll-view {
  137. position: absolute;
  138. top: 0;
  139. left: 0;
  140. right: 0;
  141. bottom: 0;
  142. .list-scroll-view {
  143. display: flex;
  144. flex-direction: row;
  145. flex-wrap: wrap;
  146. }
  147. }
  148. </style>