app-product-list.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <view class="app-product-list">
  3. <view class="app-item dir-left-nowrap" v-for="(item, index) in list" :key="index" @click="route_go(item)">
  4. <image class="app-image" :src="item.goods.cover_pic"></image>
  5. <view class="out-dialog" v-if="item.miaosha_num == 0 && appSetting.is_show_stock == '1'">
  6. <image :src="appSetting.is_use_stock == '1' ? appImg.plugins_out : appSetting.sell_out_pic"></image>
  7. </view>
  8. <view class="app-content">
  9. <text class="app-name">{{item.goods.name}}</text>
  10. <view class="app-percentage">
  11. <view :style="{width: `${item.goods.miaosha_percentage}`}"></view>
  12. </view>
  13. <view class="app-text dir-left-nowrap main-between cross-center">
  14. <text class="app-already">已抢购{{item.goods.miaosha_count}}{{item.goods.unit}}</text>
  15. <text class="app-past">仅剩{{item.goods.miaosha_num}}{{item.goods.unit}}</text>
  16. </view>
  17. <view class="price-button dir-left-nowrap main-between cross-bottom">
  18. <view class="price app-price dir-top-nowrap main-right cross-top">
  19. <view v-if="item.is_level">
  20. <app-member-price :theme="themeObject" :price="item.level_price"></app-member-price>
  21. </view>
  22. <app-sup-vip :is_vip_card_user="item.vip_card_appoint.is_vip_card_user" margin="4rpx 0 0" v-if="item.vip_card_appoint.discount" :discount="item.vip_card_appoint.discount"></app-sup-vip>
  23. <view class="app-min-price" :class="[theme + '-m-text', theme]">¥{{item.goods.min_price}}</view>
  24. <view class="app-original-price">¥{{item.goods.original_price}}</view>
  25. </view>
  26. <view class="app-button" style="color: #ffffff;" :class="[theme + '-m-back', theme]" v-if="status === 1 && item.miaosha_num > 0">马上抢购</view>
  27. <view class="app-button no-button" :class="[theme + '-m-text', theme + '-m-border',theme]" v-if="(status === 0 || status === 2) && item.miaosha_num > 0">查看商品</view>
  28. <view class="app-button" style="background-color: #CDCDCD;color: #fff;" v-if="item.miaosha_num == 0">下次再来</view>
  29. </view>
  30. </view>
  31. </view>
  32. <view :style="{width: `100%`, height: `${botHeight}rpx`}" v-if="empty"></view>
  33. </view>
  34. </template>
  35. <script>
  36. import {mapState, mapGetters} from 'vuex';
  37. export default {
  38. name: 'app-product-list',
  39. data() {
  40. return {
  41. is_vip: true,
  42. }
  43. },
  44. computed: {
  45. ...mapState({
  46. appImg: state => state.mallConfig.__wxapp_img.mall,
  47. appSetting: state => state.mallConfig.mall.setting,
  48. }),
  49. ...mapGetters('mallConfig', {
  50. getVideo: 'getVideo'
  51. }),
  52. },
  53. props: {
  54. list: {
  55. type: Array,
  56. default() {
  57. return [];
  58. }
  59. },
  60. status: {
  61. type: Number
  62. },
  63. empty: Boolean,
  64. botHeight: Number,
  65. theme: {
  66. type: String,
  67. default() {
  68. return 'a';
  69. }
  70. },
  71. themeObject: Object
  72. },
  73. methods: {
  74. route_go(data) {
  75. // #ifndef MP-BAIDU
  76. if (data.goods.video_url && this.getVideo == 1) {
  77. uni.navigateTo({
  78. url: `/pages/goods/video?goods_id=${data.goods_id}&sign=miaosha`
  79. });
  80. } else {
  81. uni.navigateTo({
  82. url: `/plugins/miaosha/goods/goods?id=${data.goods_id}`,
  83. });
  84. }
  85. // #endif
  86. // #ifdef MP-BAIDU
  87. uni.navigateTo({
  88. url: `/plugins/miaosha/goods/goods?id=${data.goods_id}`,
  89. });
  90. // #endif
  91. }
  92. }
  93. }
  94. </script>
  95. <style scoped lang="scss">
  96. .app-product-list {
  97. width: #{750rpx};
  98. background-color:white;
  99. overflow: hidden;
  100. .app-item {
  101. width: #{750rpx};
  102. padding: #{12rpx} #{24rpx} 0 0;
  103. border-bottom: #{1rpx} solid #e2e2e2;
  104. background-color: white;
  105. position: relative;
  106. .app-image {
  107. width: #{262rpx};
  108. height: #{262rpx};
  109. }
  110. .out-dialog {
  111. width: #{262rpx};
  112. height: #{262rpx};
  113. position: absolute;
  114. top: #{12rpx};
  115. left: 0;
  116. background-color: rgba(0,0,0,.5);
  117. image {
  118. width: #{262rpx};
  119. height: #{262rpx};
  120. }
  121. }
  122. .app-content {
  123. width: #{440rpx};
  124. margin-left: #{24rpx};
  125. padding-top: #{18rpx};
  126. margin-bottom: #{10rpx};
  127. .app-name {
  128. font-size: #{28rpx};
  129. color: #353535;
  130. word-break: break-all;
  131. text-overflow: ellipsis;
  132. display: -webkit-box;
  133. -webkit-box-orient: vertical;
  134. -webkit-line-clamp: 1;
  135. overflow: hidden;
  136. }
  137. .app-percentage {
  138. width: #{440rpx};
  139. height: #{24rpx};
  140. border-radius: #{12rpx};
  141. background-color: #ffb7b7;
  142. margin-top: #{16rpx};
  143. overflow: hidden;
  144. >view {
  145. height: #{24rpx};
  146. border-radius: #{12rpx};
  147. background-color: #ff4544;
  148. }
  149. }
  150. .app-text {
  151. font-size: #{24rpx};
  152. margin-top: #{4rpx};
  153. }
  154. .app-already {
  155. color: #666666;
  156. }
  157. .app-past {
  158. color: #ff4544;
  159. }
  160. .price-button {
  161. width: #{440rpx};
  162. min-height: #{132rpx};
  163. .price {
  164. width: #{440-164rpx};
  165. height: #{132rpx};
  166. }
  167. .app-price {
  168. .app-min-price {
  169. font-size: #{40rpx};
  170. height: #{40rpx};
  171. margin-top: #{-4rpx};
  172. }
  173. .app-original-price {
  174. font-size: #{24rpx};
  175. color: #999999;
  176. text-decoration: line-through;
  177. }
  178. }
  179. .app-button {
  180. width: #{164rpx};
  181. height: #{68rpx};
  182. font-size: #{26rpx};
  183. text-align: center;
  184. line-height: #{68rpx};
  185. border-radius: #{34rpx};
  186. margin-bottom: #{5rpx};
  187. }
  188. .no-button {
  189. background-color: white;
  190. border: #{1rpx} solid;
  191. }
  192. }
  193. }
  194. }
  195. }
  196. </style>