product.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <view class="center">
  3. <view class="top"><image src="https://cgst.liuniu946.com/image//shop-bg.png" mode=""></image></view>
  4. <view class="main-box">
  5. <view class="yuyue-item" v-for="(item, index) in list">
  6. <view class="share" v-if="index <= 2">
  7. <image class="share-img" v-if="index == 0" src="../../static/img/shop-product1.png" mode=""></image>
  8. <image class="share-img" v-if="index == 1" src="../../static/img/shop-product2.png" mode=""></image>
  9. <image class="share-img" v-if="index == 2" src="../../static/img/shop-product3.png" mode=""></image>
  10. <view class="share-font1" v-if="index == 0">NO.1</view>
  11. <view class="share-font2" v-if="index == 1">NO.2</view>
  12. <view class="share-font3" v-if="index == 2">NO.3</view>
  13. </view>
  14. <view class="yuyue-item-left">
  15. <view class="yuyue-item-left-bg"><image src="../../static/img/index-bg.png" mode=""></image></view>
  16. <image class="yuyue-item-left-image" :src="item.image" mode=""></image>
  17. </view>
  18. <view class="yuyue-item-right">
  19. <view class="yuyue-item-title clamp2">{{ item.store_name }}</view>
  20. <view class="yuyue-item-bottom-box">
  21. <view class="yuyue-item-price">¥{{ item.price }}</view>
  22. <view class="yuyue-item-btn">
  23. 销量:
  24. <text>{{ item.sales }}</text>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import { loadIndexs } from '@/api/index.js';
  34. import { product } from '@/api/info.js';
  35. export default {
  36. data() {
  37. return {
  38. list: []
  39. };
  40. },
  41. onLoad(option) {
  42. this.loadData();
  43. },
  44. methods: {
  45. loadData() {
  46. loadIndexs({}).then(({ data }) => {
  47. this.carouselList = data.banner;
  48. });
  49. product({ page: 1, limit: 1000 }).then(({ data }) => {
  50. this.list = data.list;
  51. });
  52. }
  53. }
  54. };
  55. </script>
  56. <style lang="scss">
  57. .center,
  58. page {
  59. min-height: 100%;
  60. height: auto;
  61. }
  62. .top {
  63. width: 750rpx;
  64. height: 414rpx;
  65. image {
  66. width: 100%;
  67. height: 100%;
  68. }
  69. }
  70. .main-box {
  71. position: relative;
  72. z-index: 2;
  73. background: #ffffff;
  74. width: 750rpx;
  75. border-radius: 20rpx;
  76. padding-top: 38rpx;
  77. margin-top: -20rpx;
  78. }
  79. .yuyue-item {
  80. width: 710rpx;
  81. background: #ffffff;
  82. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  83. border-radius: 10rpx;
  84. margin: 20rpx auto 0;
  85. padding: 20rpx 30rpx 20rpx 14rpx;
  86. position: relative;
  87. display: flex;
  88. justify-content: flex-start;
  89. .share {
  90. position: absolute;
  91. top: 0;
  92. right: 30rpx;
  93. line-height: 1;
  94. .share-img {
  95. width: 45rpx;
  96. height: 48rpx;
  97. }
  98. .share-font1 {
  99. margin-top: 8rpx;
  100. font-size: 21rpx;
  101. font-family: Source Han Sans CN;
  102. font-weight: 400;
  103. color: #ffa700;
  104. }
  105. .share-font2 {
  106. margin-top: 8rpx;
  107. font-size: 21rpx;
  108. font-family: Source Han Sans CN;
  109. font-weight: 400;
  110. color: #b5b5b4;
  111. }
  112. .share-font3 {
  113. margin-top: 8rpx;
  114. font-size: 21rpx;
  115. font-family: Source Han Sans CN;
  116. font-weight: 400;
  117. color: #e4865b;
  118. }
  119. }
  120. .yuyue-item-left {
  121. position: relative;
  122. .yuyue-item-left-bg {
  123. position: absolute;
  124. z-index: 2;
  125. top: 0;
  126. right: 0;
  127. left: 0;
  128. width: 236rpx;
  129. height: 236rpx;
  130. image {
  131. width: 100%;
  132. height: 100%;
  133. }
  134. }
  135. .yuyue-item-left-image {
  136. width: 236rpx;
  137. height: 236rpx;
  138. }
  139. }
  140. .yuyue-item-right {
  141. margin-left: 22rpx;
  142. padding: 10rpx 0;
  143. display: flex;
  144. flex-direction: column;
  145. justify-content: space-between;
  146. width: 100%;
  147. .yuyue-item-title {
  148. width: 320rpx;
  149. font-size: 32rpx;
  150. font-family: PingFang SC;
  151. font-weight: bold;
  152. color: #333333;
  153. }
  154. .yuyue-item-bottom-box {
  155. display: flex;
  156. justify-content: space-between;
  157. .yuyue-item-price {
  158. font-size: 36rpx;
  159. font-family: PingFang SC;
  160. font-weight: bold;
  161. color: #ff4c4c;
  162. }
  163. .yuyue-item-btn {
  164. font-size: 28rpx;
  165. font-family: PingFang SC;
  166. font-weight: 500;
  167. color: #999999;
  168. text {
  169. color: #ff4c4c;
  170. }
  171. }
  172. }
  173. }
  174. }
  175. </style>