金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

163 lines
3.1 KiB

  1. <template>
  2. <view>
  3. <lf-nav :showIcon="true" bgColor="transparent" :spreadOut="false"></lf-nav>
  4. <view class="head">
  5. <image class="img" mode="aspectFill" src="https://picsum.photos/200/300?grayscale"></image>
  6. <view class="title">热销榜单</view>
  7. </view>
  8. <view class="content">
  9. <view class="card" v-for="(item, index) in 7" :key="index" @click="$url('/pages/shop/goodsdetail?id='+ item.id)">
  10. <view class="goods-img">
  11. <image class="img" src="https://picsum.photos/200/300"></image>
  12. <view class="ranking">
  13. <view class="top">{{ item+1 }}</view>
  14. <view class="down"></view>
  15. </view>
  16. </view>
  17. <view class="goods-info">
  18. <view>
  19. <view class="lf-line-2 title">SK-II秋日宠粉体验套装</view>
  20. <view class="desc">月销量324</view>
  21. </view>
  22. <view class="lf-row-between">
  23. <view class="price">
  24. <text>¥888</text>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data(){
  35. return {
  36. }
  37. },
  38. onLoad(){
  39. },
  40. methods: {
  41. }
  42. }
  43. </script>
  44. <style>
  45. page{
  46. background-color: #F8F8F8;
  47. }
  48. </style>
  49. <style lang="scss" scoped="scoped">
  50. .head{
  51. width: 750rpx;
  52. height: 430rpx;
  53. position: relative;
  54. .img{
  55. width: 100%;
  56. height: 100%;
  57. }
  58. .title{
  59. position: absolute;
  60. left: 0;
  61. top: 0;
  62. width: 100%;
  63. height: 100%;
  64. display: flex;
  65. justify-content: center;
  66. align-items: center;
  67. font-size: 100rpx;
  68. color: #FFFFFF;
  69. font-weight: bold;
  70. font-family: '楷体';
  71. }
  72. }
  73. .content{
  74. padding: 30rpx 32rpx;
  75. .card{
  76. width: 686rpx;
  77. height: 260rpx;
  78. background: #FFFFFF;
  79. border-radius: 20rpx;
  80. box-sizing: border-box;
  81. padding: 30rpx;
  82. display: flex;
  83. &:nth-child(n+2){
  84. margin-top: 30rpx;
  85. }
  86. .goods-img{
  87. width: 200rpx;
  88. height: 200rpx;
  89. border-radius: 10rpx;
  90. overflow: hidden;
  91. position: relative;
  92. margin-right: 15rpx;
  93. .img{
  94. width: 100%;
  95. height: 100%;
  96. background-color: #EEEEEE;
  97. }
  98. .ranking{
  99. position: absolute;
  100. top: 0;
  101. left: 0;
  102. width: 36rpx;
  103. height: 56rpx;
  104. overflow: hidden;
  105. .top{
  106. width: 36rpx;
  107. height: 36rpx;
  108. background-color: #15716E;
  109. position: relative;
  110. z-index: 3;
  111. text-align: center;
  112. color: #FFFFFF;
  113. font-size: 28rpx;
  114. }
  115. .down{
  116. width: 36rpx;
  117. height: 36rpx;
  118. background-color: #15716E;
  119. transform: rotate(45deg);
  120. margin-top: -26rpx;
  121. position: relative;
  122. z-index: 1;
  123. }
  124. }
  125. }
  126. .goods-info{
  127. width: 410rpx;
  128. height: 200rpx;
  129. display: flex;
  130. flex-direction: column;
  131. justify-content: space-between;
  132. .title{
  133. font-size: 28rpx;
  134. color: #222222;
  135. }
  136. .desc{
  137. width: max-content;
  138. height: 35rpx;
  139. border-radius: 18rpx;
  140. background-color: #E9F2F2;
  141. font-size: 24rpx;
  142. color: #15716E;
  143. display: flex;
  144. justify-content: center;
  145. align-items: center;
  146. margin-top: 10rpx;
  147. padding: 0 10rpx;
  148. }
  149. .price>text:nth-child(1){
  150. font-size: 32rpx;
  151. color: #222222;
  152. font-weight: bold;
  153. }
  154. }
  155. }
  156. }
  157. </style>