IndexProdItem.vue 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <view class="div main-content">
  3. <view class="div goods-item" @click="goPointsgoodsDetail(item.pgoods_id)">
  4. <view class="div goods-img">
  5. <view class="div img-content">
  6. <image mode="aspectFit" class="img" :src="item.pgoods_image" />
  7. </view>
  8. </view>
  9. <view class="div info-wrap">
  10. <view class="div name-wrap">
  11. <view class="div goods-name">
  12. {{item.pgoods_name}}
  13. </view>
  14. </view>
  15. <view class="div bottom-wrapper">
  16. <view class="div lineheight-clear">
  17. <view class="div discount-price">
  18. <text class="span text-content unit color-base-text">
  19. <text class="span">{{item.pgoods_points}}</text>
  20. </text>
  21. <text class="span text-content unit color-base-text font-size-tag">
  22. <text class="span">积分</text>
  23. </text>
  24. </view>
  25. </view>
  26. <view class="div pro-info">
  27. <view class="div font-size-activity-tag color-tip">
  28. 库存{{item.pgoods_storage}}
  29. </view>
  30. <view class="div sale font-size-activity-tag color-tip"></view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import { urlencode } from '@/util/common'
  39. export default {
  40. name: 'index',
  41. data () {
  42. return {
  43. shareVisible: false,
  44. goodsList: []
  45. }
  46. },
  47. props: ['item'],
  48. components: {
  49. },
  50. methods: {
  51. // 积分兑换详情页
  52. goPointsgoodsDetail (pgoods_id) {
  53. uni.navigateTo({ url: '/pages/home/pointsgoods/Detail'+'?'+urlencode( { pgoods_id: pgoods_id } )})
  54. }
  55. }
  56. }
  57. </script>
  58. <style scoped lang="scss">
  59. .main-content{font-size:$subFontSize;line-height: 1.8;}
  60. .font-size-activity-tag {font-size:$h6!important;}
  61. .color-tip { color: #909399!important; }
  62. .color-base-text {color: #ff4544!important;}
  63. .goods-item {position: relative;background-color: #fff;border-radius: 5px;margin-bottom:.5rem;}
  64. .goods-item .goods-img {position: relative;overflow: hidden;padding-top: 100%;border-top-left-radius: 5px;border-top-right-radius: 5px}
  65. .goods-item .goods-img .img-content {width: 100%;height:100%;position: absolute;top: 50%;left: 0;-webkit-transform: translateY(-50%);transform: translateY(-50%)}
  66. .goods-item .goods-tag {color: #fff;line-height: 1;padding: 4px 8px;position: absolute;border-bottom-right-radius: 5px;top: 0;left: 0;font-size:$fontSize}
  67. .goods-item .goods-tag-img {position: absolute;border-top-left-radius: 5px;width: 40px;height: 40px;top: 0;left: 0;z-index: 5;overflow: hidden}
  68. .goods-item .goods-tag-img .img-content {width: 100%;height: 100%}
  69. .goods-item .info-wrap {padding: 0 13px 13px 13px}
  70. .goods-item .goods-name {font-size:$subFontSize;line-height: 1.3;overflow: hidden;text-overflow: ellipsis;-webkit-line-clamp: 1;-webkit-box-orient: vertical;margin-top: 10px;height: 18px}
  71. .goods-item .discount-price {display: inline-block;font-weight: 700;line-height: 1;margin-top: 8px}
  72. .goods-item .discount-price .unit {margin-right: 3px}
  73. .goods-item .pro-info {display: flex;margin-top: 8px}
  74. .goods-item .pro-info > .view-content {line-height: 1;-webkit-box-flex: 1;-webkit-flex: 1;flex: 1;display: flex;align-items: center}
  75. .goods-item .pro-info > .view-content:nth-child(2) {-webkit-box-pack: end;-webkit-justify-content: flex-end;justify-content: flex-end}
  76. .img-content >img{width: 100%;height: 100%;}
  77. .bottom-wrapper{display: flex;
  78. .lineheight-clear{flex:1}
  79. }
  80. </style>