detail.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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. toCommon(route, e) {
  51. uni.navigateTo({
  52. url: `${route}?id=${e && e._id ? e._id : ''}`
  53. })
  54. },
  55. }
  56. }
  57. </script>
  58. <style lang="scss">
  59. .main {
  60. display: flex;
  61. flex-direction: column;
  62. width: 96vw;
  63. height: 97.5vh;
  64. padding: 2vw;
  65. background-color: #0D2576;
  66. .one {
  67. margin: 0 0 2vw 0;
  68. .image {
  69. width: 100%;
  70. height: 50vw;
  71. }
  72. }
  73. .two {
  74. position: relative;
  75. flex-grow: 1;
  76. .list {
  77. margin: 0 2vw 2vw 0;
  78. background-color: var(--fffColor);
  79. padding: 2vw;
  80. width: 43vw;
  81. border-radius: 5px;
  82. .image {
  83. width: 100%;
  84. height: 49vw;
  85. margin: 0 0 1vw 0;
  86. }
  87. .name {
  88. font-size: var(--font15Size);
  89. margin: 0 0 2vw 0;
  90. }
  91. .other {
  92. display: flex;
  93. flex-direction: row;
  94. justify-content: space-between;
  95. .money {
  96. color: var(--ff0Color);
  97. text:nth-child(1) {
  98. font-size: var(--font12Size);
  99. }
  100. }
  101. .btn {
  102. button {
  103. border-radius: 25px;
  104. color: var(--fffColor);
  105. background-color: var(--ff0Color);
  106. font-size: var(--font12Size);
  107. }
  108. }
  109. }
  110. }
  111. .list:nth-child(2n) {
  112. margin: 0 0 2vw 0;
  113. }
  114. }
  115. }
  116. .scroll-view {
  117. position: absolute;
  118. top: 0;
  119. left: 0;
  120. right: 0;
  121. bottom: 0;
  122. .list-scroll-view {
  123. display: flex;
  124. flex-direction: row;
  125. flex-wrap: wrap;
  126. }
  127. }
  128. </style>