app-product-list.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <view class="goods-list dir-top-nowrap">
  3. <view class="row dir-left-nowrap main-between box-grow-1" v-for="(item, key) in goodsList" :key="key" >
  4. <view class="item box-grow-0" v-for="(good, index) in item" :key="index" @click="route_go(good)">
  5. <view class="image-name dir-top-nowrap main-left">
  6. <view class="out-dialog" v-if="good.goods_stock == 0 && appSetting.is_show_stock == '1'">
  7. <image :src="appSetting.is_use_stock == '1' ? appImg.plugins_out : appSetting.sell_out_pic"></image>
  8. </view>
  9. <image :lazy-load="true" mode="aspectFill" class="cover_pic" :src="good.cover_pic"></image>
  10. <view class="name t-omit">{{good.name}}</view>
  11. </view>
  12. <view class="content dir-top-nowrap main-right">
  13. <view class="price-bottom" v-if="good.is_level == 1">
  14. <app-member-price :theme="theme" :price="good.level_price"></app-member-price>
  15. </view>
  16. <view v-if="good.discount">
  17. <app-sup-vip :is_vip_card_user="good.is_vip_card_user" :discount="good.discount"></app-sup-vip>
  18. </view>
  19. <view class="price-btn dir-left-nowrap main-between cross-center">
  20. <view class="price" :style="{'color': theme.color}">{{good.price_str}}</view>
  21. <view v-if="good.goods_stock != 0" :style="{'color': good.buy_goods_auth ? theme.color : '#9999999'}" class="btn">预约</view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import { mapState, mapGetters } from 'vuex';
  30. export default {
  31. name: "app-product-list",
  32. computed: {
  33. ...mapState({
  34. appImg: state => state.mallConfig.__wxapp_img.mall,
  35. appSetting: state => state.mallConfig.mall.setting,
  36. }),
  37. ...mapGetters('mallConfig', {
  38. getVideo: 'getVideo'
  39. }),
  40. },
  41. data() {
  42. return {
  43. disable: 'disable'
  44. };
  45. },
  46. props: [`goodsList`, `theme`],
  47. methods: {
  48. route_go(data) {
  49. this.$emit('route_go', data);
  50. }
  51. },
  52. }
  53. </script>
  54. <style scoped lang="scss">
  55. .goods-list {
  56. width: calc(100% - #{32upx});
  57. background-color: #f7f7f7;
  58. margin: #{0 16upx};
  59. }
  60. .row {
  61. margin-top: #{16upx};
  62. }
  63. .item {
  64. width: #{350upx};
  65. border-radius: #{15upx};
  66. background-color: #ffffff;
  67. }
  68. .image-name {
  69. height: #{396upx};
  70. margin-bottom: #{10upx};
  71. position: relative;
  72. .out-dialog {
  73. width: #{350upx};
  74. height: #{350upx};
  75. position: absolute;
  76. top: 0;
  77. left: 0;
  78. background-color: rgba(0,0,0,.5);
  79. z-index: 10;
  80. image {
  81. width: #{350upx};
  82. height: #{350upx};
  83. }
  84. }
  85. }
  86. .content {
  87. margin: #{0 20upx};
  88. width: #{310upx};
  89. height: calc(100% - #{405upx});
  90. }
  91. .cover_pic {
  92. width: #{350upx};
  93. height: #{350upx};
  94. margin-bottom: #{20upx};
  95. border-top-right-radius: #{15upx};
  96. border-top-left-radius: #{15upx};
  97. }
  98. .name {
  99. width: #{310upx};
  100. margin: #{0 20upx};
  101. font-size: #{28upx};
  102. color: #353535;
  103. }
  104. .btn {
  105. width: #{110upx};
  106. height: #{45upx};
  107. border-radius: #{22.5upx};
  108. font-size: #{26upx};
  109. line-height: #{45upx};
  110. text-align: center;
  111. border: #{1upx} solid ;
  112. }
  113. .price-bottom {
  114. margin-bottom: #{10upx};
  115. }
  116. .price {
  117. font-size: #{25upx};
  118. }
  119. .price-btn {
  120. margin-top: #{10upx};
  121. margin-bottom: #{16upx};
  122. }
  123. </style>