app-product-list.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <view class="goods-list dir-top-nowrap">
  3. <view v-if="goodsList.length > 0" 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" 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 :price="good.level_price"></app-member-price>
  15. </view>
  16. <view v-if="good.discount > 0">
  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">{{good.price_str}}</view>
  21. <view v-if="good.goods_stock != 0" class="btn">预约</view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import {mapState, mapGetters} from 'vuex';
  30. import appButton from '../components/app-button.vue';
  31. import appMemberPrice from "../../../components/page-component/app-member-mark/app-member-price.vue";
  32. import appSupVip from "../../../components/page-component/app-sup-vip/app-sup-vip.vue";
  33. export default {
  34. name: "app-product-list",
  35. components: {
  36. 'app-button': appButton,
  37. 'app-member-price': appMemberPrice,
  38. 'app-sup-vip': appSupVip,
  39. },
  40. computed: {
  41. ...mapState({
  42. appImg: state => state.mallConfig.__wxapp_img.mall,
  43. appSetting: state => state.mallConfig.mall.setting,
  44. }),
  45. ...mapGetters('mallConfig', {
  46. getVideo: 'getVideo'
  47. }),
  48. },
  49. props: [`goodsList`],
  50. methods: {
  51. route_go(data) {
  52. console.log(data);
  53. // #ifndef MP-BAIDU
  54. if (data.video_url && this.getVideo == 1) {
  55. uni.navigateTo({
  56. url: `/pages/goods/video?goods_id=${data.goods_id}&sign=booking`
  57. });
  58. } else {
  59. uni.navigateTo({
  60. url: `/plugins/book/goods/goods?goods_id=${data.goods_id}`,
  61. });
  62. }
  63. // #endif
  64. // #ifdef MP-BAIDU
  65. uni.navigateTo({
  66. url: `/plugins/book/goods/goods?goods_id=${data.goods_id}`,
  67. });
  68. // #endif
  69. }
  70. },
  71. }
  72. </script>
  73. <style scoped lang="scss">
  74. .goods-list {
  75. width: calc(100% - #{32upx});
  76. background-color: #f7f7f7;
  77. margin: #{0 16upx};
  78. }
  79. .row {
  80. margin-bottom: #{16upx};
  81. }
  82. .item {
  83. width: #{350upx};
  84. border-radius: #{15upx};
  85. background-color: #ffffff;
  86. }
  87. .image-name {
  88. height: #{396upx};
  89. margin-bottom: #{10upx};
  90. position: relative;
  91. .out-dialog {
  92. width: #{350upx};
  93. height: #{350upx};
  94. position: absolute;
  95. top: 0;
  96. left: 0;
  97. background-color: rgba(0,0,0,.5);
  98. image {
  99. width: #{350upx};
  100. height: #{350upx};
  101. }
  102. }
  103. }
  104. .content {
  105. margin: #{0 20upx};
  106. width: #{310upx};
  107. height: calc(100% - #{405upx});
  108. }
  109. .cover_pic {
  110. width: #{350upx};
  111. height: #{350upx};
  112. margin-bottom: #{20upx};
  113. border-top-right-radius: #{15upx};
  114. border-top-left-radius: #{15upx};
  115. }
  116. .name {
  117. width: #{310upx};
  118. margin: #{0 20upx};
  119. font-size: #{28upx};
  120. line-height: 1;
  121. color: #353535;
  122. }
  123. .btn {
  124. width: #{110upx};
  125. height: #{45upx};
  126. border-radius: #{22.5upx};
  127. border: #{1upx} solid #ff4544;
  128. font-size: #{26upx};
  129. color: #ff4544;
  130. line-height: 1;
  131. padding: #{9upx 0};
  132. text-align: center;
  133. background-color: #fff5f5;
  134. }
  135. .price-bottom {
  136. margin-bottom: #{10upx};
  137. }
  138. .price {
  139. font-size: #{25upx};
  140. color: #ff4544;
  141. }
  142. .price-btn {
  143. margin-top: #{10upx};
  144. margin-bottom: #{16upx};
  145. }
  146. </style>