app-product-list.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view>
  3. <view class="bd-item dir-left-nowrap" :class="{'bd-item-border': index !== list.length - 1}" v-for="(item, index) in list" :key="index" @click="route_go(item)">
  4. <view class="out-dialog" v-if="item.goods_stock === 0 && appSetting.is_show_stock === 1">
  5. <image :src="appSetting.is_use_stock == 1 ? appImg.plugins_out : appSetting.sell_out_pic"></image>
  6. </view>
  7. <image class="bd-image" :src="item.cover_pic"></image>
  8. <view class="bd-content dir-top-nowrap main-between cross-top">
  9. <view>
  10. <view class="bd-name u-line-2">{{item.name}}</view>
  11. <view class="app-group" :style="{'color': theme.color}">已团{{item.sales}}件</view>
  12. </view>
  13. <view class="app-price-button dir-left-nowrap main-between cross-bottom">
  14. <view class="price dir-top-nowrap main-right">
  15. <view class="member-price" v-if="item.is_level === 1 && item.level_price != -1" >
  16. <app-member-price :theme="theme" :price="item.level_price"></app-member-price>
  17. </view>
  18. <view v-if="item.vip_card_appoint.discount" class="sup-vip">
  19. <app-sup-vip :is_vip_card_user="item.vip_card_appoint.is_vip_card_user" :discount="item.vip_card_appoint.discount"></app-sup-vip>
  20. </view>
  21. <view class="app-price dir-left-nowrap cross-bottom">
  22. <text class="app-symbol app-now-price" :style="{'color': theme.color}" v-if="item.price > 0">{{item.price}}</text>
  23. <text class="app-now-price" :style="{'color': theme.color}" v-else>免费</text>
  24. <text class="app-symbol app-old-price">{{item.original_price}}</text>
  25. </view>
  26. </view>
  27. <view v-if="item.goods_stock > 0" class="app-button" :style="{'background-color': item.buy_goods_auth ? theme.background : '#999999','color': item.buy_goods_auth ? theme.main_text : ''}">去开团</view>
  28. <view v-else style="background: #DCDCDC;color: #fff" class="app-button">已售罄</view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import {mapState, mapGetters} from 'vuex';
  36. export default {
  37. name: 'app-product-list',
  38. computed: {
  39. ...mapState({
  40. appSetting: state => state.mallConfig.mall.setting,
  41. appImg: state => state.mallConfig.__wxapp_img.mall,
  42. platform: function(state) {
  43. return state.gConfig.systemInfo.platform;
  44. }
  45. }),
  46. // #ifndef MP-BAIDU
  47. ...mapGetters('mallConfig',{
  48. getVideo: 'getVideo'
  49. }),
  50. // #endif
  51. },
  52. props: {
  53. list: {
  54. type: Array,
  55. default() {
  56. return [];
  57. }
  58. },
  59. theme: Object
  60. },
  61. data() {
  62. return {
  63. disable: 'disable'
  64. };
  65. },
  66. methods: {
  67. route_go(data) {
  68. // #ifndef MP-BAIDU
  69. if (data.video_url && this.getVideo == 1) {
  70. // #ifdef MP
  71. uni.navigateTo({
  72. url: `/pages/goods/video?goods_id=${data.id}&sign=pintuan`
  73. });
  74. // #endif
  75. // #ifdef H5
  76. uni.navigateTo({
  77. url: `/plugins/pt/goods/goods?goods_id=${data.id}`,
  78. });
  79. // #endif
  80. } else {
  81. uni.navigateTo({
  82. url: `/plugins/pt/goods/goods?goods_id=${data.id}`,
  83. });
  84. }
  85. // #endif
  86. // #ifdef MP-BAIDU
  87. uni.navigateTo({
  88. url: `/plugins/pt/goods/goods?goods_id=${data.id}`,
  89. });
  90. // #endif
  91. }
  92. }
  93. }
  94. </script>
  95. <style scoped lang="scss">
  96. .bd-item-border {
  97. border-bottom: #{1rpx} solid #e2e2e2;
  98. }
  99. .out-dialog {
  100. width: #{220rpx};
  101. height: #{220rpx};
  102. position: absolute;
  103. z-index: 10;
  104. background-color: rgba(0,0,0,.5);
  105. image {
  106. width: #{220rpx};
  107. height: #{220rpx};
  108. }
  109. }
  110. .bd-image {
  111. width: #{220rpx};
  112. height: #{220rpx};
  113. border-radius: #{4rpx};
  114. }
  115. .bd-name {
  116. font-size: #{28rpx};
  117. color: #353535;
  118. margin-top: #{5rpx};
  119. }
  120. .bd-item {
  121. padding: #{24rpx 24rpx 14rpx 24rpx};
  122. background-color: #ffffff;
  123. position: relative;
  124. .bd-content {
  125. width: #{458rpx};
  126. margin-left: #{24rpx};
  127. position: relative;
  128. .app-group {
  129. font-size: #{22rpx};
  130. margin-bottom: 5upx;
  131. margin-top: -3upx;
  132. }
  133. .app-price-button {
  134. position: absolute;
  135. bottom: #{10rpx};
  136. width: #{458rpx};
  137. padding-top: 5rpx;
  138. .price {
  139. width: #{458-180rpx};
  140. height: #{105rpx};
  141. }
  142. .app-button {
  143. font-size: #{26rpx};
  144. color: #ffffff;
  145. width: #{180rpx};
  146. height: #{64rpx};
  147. line-height: #{64rpx};
  148. text-align: center;
  149. /* #ifndef MP-TOUTIAO */
  150. padding: 0 #{49rpx};
  151. /* #endif */
  152. border-radius: #{32rpx};
  153. }
  154. .default-button {
  155. background: linear-gradient(140deg, #ffa360, #ff5c5c);
  156. }
  157. .app-now-price {
  158. font-size: #{30rpx};
  159. margin-right: #{12rpx};
  160. }
  161. .app-old-price {
  162. font-size: #{25rpx};
  163. color: #999999;
  164. text-decoration:line-through;
  165. }
  166. .app-symbol:before {
  167. content: '¥';
  168. font-size: #{16rpx};
  169. }
  170. }
  171. }
  172. }
  173. .member-price {
  174. margin-top: 5upx;
  175. }
  176. .sup-vip {
  177. margin-top: 5upx;
  178. }
  179. </style>