hua-power-product.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <view>
  3. <view class="wrapper d-flex flex-wrap justify-content-between">
  4. <router-link class="item" v-for="(item,index) in data" :key="index"
  5. :to="{path: '/pages/goods_details/goods_details', query: {id: item.goods_id || item.id}}">
  6. <image :src="item.image" mode="" class="pic"></image>
  7. <view class="cont">
  8. <view class="title">
  9. {{item.name}}
  10. </view>
  11. <view class="desc">
  12. <!-- <image src="../../static/nl.png" mode="heightFix"></image> -->
  13. <text>
  14. <!-- 可用{{item.use_energy}}点抵用券抵扣 -->
  15. 可用{{(item.min_price * item.use_energy / 100 / appConfig.energyprice).toFixed(6) }}抵用券抵扣¥{{(item.min_price * item.use_energy / 100).toFixed(2)}}
  16. </text>
  17. </view>
  18. </view>
  19. </router-link>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. name: "hua-power-product",
  26. props: {
  27. data: {}
  28. },
  29. data() {
  30. return {
  31. };
  32. }
  33. }
  34. </script>
  35. <style lang="scss">
  36. .wrapper {
  37. .item {
  38. background-color: #fff;
  39. border-radius: 20rpx;
  40. margin-bottom: 20rpx;
  41. width: 344rpx;
  42. padding: 10rpx;
  43. box-sizing: border-box;
  44. color: #040404;
  45. .pic {
  46. width: 324rpx;
  47. height: 284rpx;
  48. }
  49. .cont {
  50. padding-bottom: 40rpx;
  51. .title {
  52. font-weight: 500;
  53. line-height: 40rpx;
  54. height: 80rpx;
  55. font-size: 28rpx;
  56. margin: 16rpx auto;
  57. overflow: hidden;
  58. text-overflow: ellipsis;
  59. /* 超出部分省略号 */
  60. word-break: break-all;
  61. /* break-all(允许在单词内换行。) */
  62. display: -webkit-box;
  63. /* 对象作为伸缩盒子模型显示 */
  64. -webkit-box-orient: vertical;
  65. /* 设置或检索伸缩盒对象的子元素的排列方式 */
  66. -webkit-line-clamp: 2;
  67. /* 显示的行数 */
  68. max-height: 80rpx;
  69. /* 设置最大高度,根据行高,要几行乘以几倍 */
  70. }
  71. image {
  72. height: 24rpx;
  73. margin-right: 6rpx;
  74. }
  75. .desc {
  76. font-size: 24rpx;
  77. color: #0EB5F1;
  78. }
  79. }
  80. }
  81. }
  82. </style>