铝交易,微信公众号
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.

142 lines
2.6 KiB

4 months ago
  1. <template>
  2. <view class="list">
  3. <view class="item" v-for="(item, index) in list"
  4. @click="immediatePurchase(item)" :key="index">
  5. <image class="image" :src="item.pic" mode="aspectFill"></image>
  6. <view class="info">
  7. <view class="title">
  8. {{ $t('other.aluminumProducts') }}
  9. </view>
  10. <view class="price">
  11. <text>{{item.price}}</text>
  12. {{ $t('components.unitPrice2') }}
  13. </view>
  14. <view class="num">
  15. <!-- 最多批发*快速下单 -->
  16. 库存数量{{ item.num }}
  17. </view>
  18. </view>
  19. <view class="btn">
  20. <view class="change">
  21. {{ $t('components.immediatePurchase') }}
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. name: "productList",
  30. props: {
  31. list: {
  32. type: Array,
  33. default: false
  34. },
  35. },
  36. data() {
  37. return {};
  38. },
  39. methods: {
  40. // 立即购买
  41. immediatePurchase(item) {
  42. console.log("====")
  43. // var itemStr = encodeURIComponent(JSON.stringify(item));
  44. this.$store.state.productDetail = item
  45. uni.navigateTo({
  46. url: `/pages_order/tradingPlatform/nowOrder`,
  47. });
  48. }
  49. },
  50. }
  51. </script>
  52. <style scoped lang="scss">
  53. .list {
  54. display: flex;
  55. justify-content: center;
  56. flex-wrap: wrap;
  57. .item {
  58. position: relative;
  59. width: 300rpx;
  60. padding: 20rpx;
  61. background-color: #fff;
  62. border-radius: 20rpx;
  63. margin-top: 20rpx;
  64. &:nth-child(odd) {
  65. margin-right: 20rpx;
  66. }
  67. .image {
  68. width: 300rpx;
  69. height: 250rpx;
  70. border-radius: 20rpx;
  71. }
  72. .info {
  73. font-size: 26rpx;
  74. .title {
  75. font-size: 30rpx;
  76. color: #000;
  77. }
  78. .price {
  79. color: #D03F25;
  80. margin-top: 6rpx;
  81. text {
  82. font-size: 34rpx;
  83. font-weight: 900;
  84. }
  85. }
  86. .favorable {
  87. display: flex;
  88. background-image: url(/static/image/product/favorable.png);
  89. background-size: 100% 100%;
  90. width: fit-content;
  91. padding: 5rpx 10rpx;
  92. font-size: 18rpx;
  93. margin-top: 6rpx;
  94. .p {
  95. color: #fff;
  96. margin-left: 10rpx;
  97. }
  98. }
  99. .num {
  100. margin-top: 6rpx;
  101. font-size: 22rpx;
  102. color: #888;
  103. }
  104. }
  105. .btn {
  106. position: absolute;
  107. right: 0rpx;
  108. bottom: 0rpx;
  109. padding: 10rpx;
  110. border-radius: 50%;
  111. //background-color: $uni-color;
  112. .change {
  113. display: flex;
  114. align-items: center;
  115. justify-content: center;
  116. border-radius: 40rpx;
  117. color: white;
  118. font-size: 22rpx;
  119. //margin: 20rpx 10rpx 0 0;
  120. padding: 10rpx 10rpx;
  121. background: #2b467a;
  122. border: 1px solid #757986;
  123. //margin-top: 20rpx;
  124. //border-radius: 40rpx;
  125. }
  126. }
  127. }
  128. }
  129. </style>