recommendGoods.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <view class="list">
  3. <view class="recommend">
  4. <view class="top">
  5. <image
  6. src="../../../static/images/recommend.png"
  7. style="width: 124rpx; height: 30rpx"
  8. mode="scaleToFill"
  9. />
  10. </view>
  11. <view class="bottom">
  12. <scroll-view
  13. scroll-x
  14. class="u-flex"
  15. style="column: gap 28rpx; display: flex"
  16. >
  17. <view class="u-flex" style="column-gap: 16rpx">
  18. <view
  19. class=""
  20. v-for="(item, idx) in swiptlist"
  21. :key="idx"
  22. @click="todetail(item.id)"
  23. >
  24. <image
  25. :src="item.image"
  26. style="width: 156rpx; height: 156rpx"
  27. mode=""
  28. >
  29. </image>
  30. <view class="title">
  31. {{ item.name_cn }}
  32. </view>
  33. <view class="title" v-if="language == 'en-US'">
  34. {{ item.name_en }}
  35. </view>
  36. <view class="title" v-if="language == 'es-ES'">
  37. {{ item.name_es }}
  38. </view>
  39. <view class="title" v-if="language == 'it-IT'">
  40. {{ item.name_ita }}
  41. </view>
  42. <view class="money" style="color: #f83224; font-size: 20rpx">
  43. <text>¥</text>
  44. <text style="font-size: 28rpx">{{
  45. item.is_discount == 0
  46. ? item.discount_price.slice(0, -3)
  47. : item.price.slice(0, -3)
  48. }}</text>
  49. <text>{{
  50. item.is_discount == 0
  51. ? item.discount_price.slice(-3)
  52. : item.price.slice(-3)
  53. }}</text>
  54. </view>
  55. </view>
  56. </view>
  57. </scroll-view>
  58. </view>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. export default {
  64. props: {
  65. swiptlist: {
  66. typeof: Array,
  67. default: () => {
  68. return [];
  69. },
  70. },
  71. },
  72. computed: {
  73. i18n() {
  74. return this.$t("index");
  75. },
  76. },
  77. methods: {
  78. //跳转商品详情
  79. todetail(id) {
  80. uni.reLaunch({
  81. url: "/pageA/productdetails?id=" + id,
  82. });
  83. },
  84. },
  85. };
  86. </script>
  87. <style scoped lang="scss">
  88. .list {
  89. .recommend {
  90. margin-top: 20rpx;
  91. .title {
  92. font-family: PingFangSC, PingFang SC;
  93. font-weight: 400;
  94. font-size: 22rpx;
  95. color: #222222;
  96. line-height: 32rpx;
  97. text-align: left;
  98. font-style: normal;
  99. width: 148rpx;
  100. height: 64rpx;
  101. overflow: hidden;
  102. text-overflow: ellipsis;
  103. -webkit-line-clamp: 2;
  104. display: -webkit-box;
  105. -webkit-box-orient: vertical;
  106. word-break: break-all;
  107. }
  108. .top {
  109. width: 702rpx;
  110. height: 64rpx;
  111. background: linear-gradient(
  112. 180deg,
  113. #ffe7e3 0%,
  114. rgba(255, 255, 255, 1) 100%
  115. );
  116. border-radius: 16rpx 16rpx 0 0;
  117. padding: 24rpx 22rpx;
  118. box-sizing: border-box;
  119. }
  120. .bottom {
  121. padding: 0 20rpx 22rpx;
  122. box-sizing: border-box;
  123. background: #fff;
  124. }
  125. .money {
  126. font-family: HarmonyOS_Sans_Medium;
  127. font-size: 48rpx;
  128. color: #f83224;
  129. line-height: 38rpx;
  130. text-align: left;
  131. font-style: normal;
  132. // font-weight: 500;
  133. font-weight: bold;
  134. }
  135. }
  136. }
  137. </style>