PointsGoods.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <view class="flex pointsGoods" :style="[pointsGoodsStyle.boxStyle]">
  3. <view class="product-item " :style="[pointsGoodsStyle.imageBoxStyle]" v-for="(item, index) in integralGood" :key="index" @click="goGoodsDetail(item)">
  4. <view class="relative">
  5. <easy-loadimage
  6. :image-src="item.image"
  7. :width="pointsGoodsStyle._imageWidth"
  8. :height="pointsGoodsStyle._imageHeight"
  9. :radius="10"></easy-loadimage>
  10. <view v-show="item.stock===0" class="sellOut">已售罄</view>
  11. </view>
  12. <view class="info">
  13. <view class="title line1" :style="[pointsGoodsStyle.nameStyle]">{{ item.name }}</view>
  14. <view class="sales text-999 mt-8 mb-20" :style="[pointsGoodsStyle.salesStyle]">已有{{item.sales}}人兑换</view>
  15. <PointsPrice :pointsPrice="item" :pointsGoodsStyle="pointsGoodsStyle" v-model="isShowSamll"></PointsPrice>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import {
  22. goProductDetail
  23. } from "@/libs/order";
  24. import PointsPrice from '@/components/PointsPrice.vue';
  25. import easyLoadimage from '@/components/base/easy-loadimage.vue';
  26. export default {
  27. components: {
  28. easyLoadimage,
  29. PointsPrice
  30. },
  31. props: {
  32. //积分商品列表
  33. integralGood: {
  34. type: Array,
  35. default: function() {
  36. return [];
  37. }
  38. },
  39. //商品大小样式
  40. pointsGoodsStyle: {
  41. type: Object,
  42. default: function() {
  43. return {};
  44. }
  45. },
  46. //视图宽
  47. width: {
  48. type: String,
  49. default: ''
  50. },
  51. marginRight: {
  52. type: String,
  53. default: ''
  54. },
  55. // 积分图标大小
  56. iconWidth: {
  57. type: String,
  58. default: ''
  59. },
  60. isShowSamll: {
  61. type: Boolean,
  62. default: false
  63. }
  64. },
  65. computed: {
  66. boxStyle() {
  67. return {
  68. width: this.width,
  69. marginRight: this.marginRight
  70. }
  71. },
  72. iconStyle() {
  73. return {
  74. width: this.iconWidth,
  75. height: this.iconWidth
  76. }
  77. }
  78. },
  79. data(){
  80. return {
  81. urlDomain: this.$Cache.get("imgHost"),
  82. }
  83. },
  84. methods: {
  85. goGoodsDetail(item){
  86. goProductDetail(item.id, 0, '',1)
  87. },
  88. }
  89. }
  90. </script>
  91. <style scoped lang="scss">
  92. .fs-22{
  93. margin-left: 4rpx;
  94. }
  95. .product-item {
  96. position: relative;
  97. background: #fff;
  98. border-radius: 10rpx;
  99. margin-bottom: 20rpx;
  100. .info {
  101. margin-top: 20rpx;
  102. }
  103. }
  104. </style>