金诚优选前端代码
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.

181 lines
4.9 KiB

4 years ago
  1. <template>
  2. <view>
  3. <view class="recommend-box" >
  4. <view class="goods-rom" v-for="(item,index) of list" :key="index" v-if="list.length" @click="$url('/pages/shop/goodsdetail?id='+item.id)">
  5. <image :src="item.picture" mode="aspectFill" style="width: 332rpx;height: 332rpx;border-radius: 20rpx 20rpx 0 0;"></image>
  6. <view class="lf-p-20">
  7. <view class="list-title">
  8. {{item.title}}
  9. </view>
  10. <view class="list-price">
  11. <!-- <text>{{item.price}}</text> -->
  12. <lf-price :price="item.price"></lf-price>
  13. <text class="lf-m-l-20 lf-font-24 lf-color-666 lf-line-through">{{item.original_price}}</text>
  14. </view>
  15. </view>
  16. </view>
  17. <lf-nocontent src="/static/images/empty.png" v-else></lf-nocontent>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. props: {
  24. list: {
  25. type: Array,
  26. default: []
  27. }
  28. },
  29. }
  30. </script>
  31. <style lang="scss" scoped>
  32. .recommend-box{
  33. display: flex;
  34. justify-content: space-between;
  35. padding: 30rpx 32rpx;
  36. flex-wrap: wrap;
  37. }
  38. .goods-rom {
  39. border-radius: 20rpx;
  40. width: 333rpx;
  41. height: max-content;
  42. background-color: white;
  43. box-shadow: 0px 2rpx 8rpx 1rpx rgba(0, 0, 0, 0.1);
  44. &:nth-child(2n) {
  45. margin-right: 0;
  46. }
  47. &:nth-child(n + 3) {
  48. margin-top: 20rpx;
  49. }
  50. }
  51. .introduct {
  52. padding: 30rpx 32rpx;
  53. }
  54. .com{
  55. width: 100%;
  56. height: 100%;
  57. box-sizing: border-box;
  58. padding: 0rpx 28rpx;
  59. }
  60. .shop-head {
  61. width: 100%;
  62. height: 400rpx;
  63. position: relative;
  64. }
  65. .shop-flex {
  66. display: flex;
  67. padding: 30rpx;
  68. }
  69. // loading加载
  70. .loading-more {
  71. align-items: center;
  72. justify-content: center;
  73. padding-top: 10px;
  74. padding-bottom: 10px;
  75. text-align: center;
  76. font-size: 28rpx;
  77. color: #999;
  78. }
  79. .loading-more-text::before {
  80. content: '';
  81. width: 20px;
  82. height: 20px;
  83. display: inline-block;
  84. vertical-align: middle;
  85. -webkit-animation: weuiLoading 1s steps(12, end) infinite;
  86. animation: weuiLoading 1s steps(12, end) infinite;
  87. background-repeat: no-repeat;
  88. background-image: url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E9E9E9' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23989697' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%239B999A' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23A3A1A2' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23ABA9AA' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23B2B2B2' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23BAB8B9' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23C2C0C1' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23CBCBCB' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23D2D2D2' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23DADADA' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E2E2E2' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E");
  89. background-size: 100%;
  90. }
  91. @keyframes weuiLoading {
  92. 0% {
  93. transform: rotate3d(0, 0, 1, 0deg);
  94. }
  95. 100% {
  96. transform: rotate3d(0, 0, 1, 360deg);
  97. }
  98. }
  99. .list-warter {
  100. border-radius: 20rpx;
  101. margin: 10px 5px;
  102. margin-top: 0px;
  103. background-color: #ffffff;
  104. // padding: 8px;
  105. position: relative;
  106. overflow: hidden;
  107. box-shadow: 0rpx 2rpx 8rpx 1rpx rgba(0, 0, 0, 0.1);
  108. }
  109. .u-close {
  110. position: absolute;
  111. top: 32rpx;
  112. right: 32rpx;
  113. }
  114. .list-image {
  115. width: 100%;
  116. border-radius: 4px;
  117. }
  118. .list-title {
  119. font-size: 28rpx;
  120. font-weight: bold;
  121. color: $u-main-color;
  122. }
  123. .list-label{
  124. position: absolute;
  125. bottom: 0;
  126. right: 0;
  127. background-color: rgba(0,0,0,0.5);
  128. width: 140rpx;
  129. height: 48rpx;
  130. border-radius: 20rpx 0rpx 0rpx 0rpx;
  131. font-size: 22rpx;
  132. color: #FFFFFF;
  133. line-height: 48rpx;
  134. text-align: center;
  135. }
  136. .list-tag {
  137. display: flex;
  138. margin-top: 5px;
  139. }
  140. .list-tag-owner {
  141. background-color: $u-type-error;
  142. color: #FFFFFF;
  143. display: flex;
  144. align-items: center;
  145. padding: 4rpx 14rpx;
  146. border-radius: 50rpx;
  147. font-size: 20rpx;
  148. line-height: 1;
  149. }
  150. .list-tag-text {
  151. border: 1px solid $u-type-primary;
  152. color: $u-type-primary;
  153. margin-left: 10px;
  154. border-radius: 50rpx;
  155. line-height: 1;
  156. padding: 4rpx 14rpx;
  157. display: flex;
  158. align-items: center;
  159. border-radius: 50rpx;
  160. font-size: 20rpx;
  161. }
  162. .list-price {
  163. font-size: 30rpx;
  164. color: $u-type-error;
  165. margin-top: 5px;
  166. display: flex;
  167. align-items: center;
  168. }
  169. </style>