promotionList.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <view class="index-product-wrapper" :class="iSshowH?'on':''" :style="'margin-top:'+mbConfig*2+'rpx;'"
  3. v-show="!isSortType">
  4. <view class="nav-bd"
  5. :style="{justifyContent:titleConfig===0?'flex-start':titleConfig===1?'space-around':'flex-end'}">
  6. <view class="item" v-for="(item,index) in explosiveMoney" :index="index"
  7. @click="ProductNavTab(item.link.activeVal,index)">
  8. <view class="txt" :style="{ 'color': index==ProductNavindex ? themeColor : '' }">
  9. {{$t(item.chiild[0].val)}}</view>
  10. <view class="label"
  11. :style="{ 'background': index==ProductNavindex ? themeColor : '','color': index==ProductNavindex ? '#fff' : '' }">
  12. {{$t(item.chiild[1].val)}}</view>
  13. </view>
  14. </view>
  15. <!-- 首发新品 -->
  16. <view class="list-box animated" :class='tempArr.length > 0?"fadeIn on":""'>
  17. <view class="item" v-for="(item,index) in tempArr" :key="index" @click="goDetail(item)">
  18. <view class="pictrue">
  19. <span class="pictrue_log pictrue_log_class" :style="'background-color:'+labelColor"
  20. v-if="item.activity && item.activity.type === '1'">{{$t(`秒杀`)}}</span>
  21. <span class="pictrue_log pictrue_log_class" :style="'background-color:'+labelColor"
  22. v-if="item.activity && item.activity.type === '2'">{{$t(`砍价`)}}</span>
  23. <span class="pictrue_log pictrue_log_class" :style="'background-color:'+labelColor"
  24. v-if="item.activity && item.activity.type === '3'">{{$t(`拼团`)}}</span>
  25. <!-- <image :src="item.image" mode="aspectFit"></image> -->
  26. <easy-loadimage mode="widthFix" :image-src="item.image"></easy-loadimage>
  27. </view>
  28. <view class="text-info">
  29. <view class="title line1" v-if="titleShow">{{item.store_name}}</view>
  30. <view class="old-price" v-if="opriceShow"><text>{{$t(`¥`)}}</text>{{item.ot_price}}</view>
  31. <view class="price" :style="{color:fontColor}">
  32. <view v-if="priceShow">
  33. <text>{{$t(`¥`)}}</text>{{item.price}}
  34. </view>
  35. <view class="txt" :style="'border:1px solid '+labelColor+';color:'+labelColor"
  36. :class="priceShow?'':'on'" v-if="item.checkCoupon && couponShow">{{$t(`券`)}}</view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. export default {
  45. name: 'promotionList',
  46. props: {
  47. dataConfig: {
  48. type: Object,
  49. default: () => {}
  50. },
  51. tempArr: {
  52. type: Array,
  53. default: []
  54. },
  55. iSshowH: {
  56. type: Boolean,
  57. default: false
  58. },
  59. isSortType: {
  60. type: String | Number,
  61. default: 0
  62. }
  63. },
  64. data() {
  65. return {
  66. ProductNavindex: 0,
  67. explosiveMoney: this.dataConfig.tabConfig.list,
  68. numConfig: this.dataConfig.numConfig.val,
  69. // imgStyle: this.dataConfig.imgStyle.type,
  70. mbConfig: this.dataConfig.mbConfig.val,
  71. themeColor: this.dataConfig.themeColor.color[0].item,
  72. titleShow: this.dataConfig.titleShow.val, //标题是否显示
  73. opriceShow: this.dataConfig.opriceShow.val, //原价是否显示
  74. priceShow: this.dataConfig.priceShow.val, //价格是否显示
  75. couponShow: this.dataConfig.couponShow.val, //优惠券标签是否显示
  76. titleConfig: this.dataConfig.titleConfig.type, //标题位置
  77. fontColor: this.dataConfig.fontColor.color[0].item,
  78. labelColor: this.dataConfig.labelColor.color[0].item
  79. };
  80. },
  81. created() {},
  82. methods: {
  83. // 首发新品切换
  84. ProductNavTab(type, index) {
  85. this.ProductNavindex = index;
  86. this.$emit('changeTab', type);
  87. },
  88. goDetail(item) {
  89. this.$emit('detail', item);
  90. }
  91. }
  92. }
  93. </script>
  94. <style lang="scss">
  95. .index-product-wrapper {
  96. margin: 30rpx 20rpx 0 20rpx;
  97. &.on {
  98. min-height: 1500rpx;
  99. }
  100. .nav-bd {
  101. display: flex;
  102. align-items: center;
  103. margin-top: 30rpx;
  104. .item {
  105. display: flex;
  106. flex-direction: column;
  107. align-items: center;
  108. justify-content: center;
  109. width: 25%;
  110. &.on {
  111. border-radius: 0;
  112. }
  113. .txt {
  114. font-size: 32rpx;
  115. color: #282828;
  116. }
  117. .label {
  118. display: flex;
  119. align-items: center;
  120. justify-content: center;
  121. width: 124rpx;
  122. height: 32rpx;
  123. margin-top: 5rpx;
  124. font-size: 24rpx;
  125. color: #999;
  126. border-radius: 16rpx;
  127. }
  128. }
  129. }
  130. .list-box {
  131. display: flex;
  132. flex-wrap: wrap;
  133. justify-content: space-between;
  134. margin-top: 30rpx;
  135. .item {
  136. width: 345rpx;
  137. margin-bottom: 20rpx;
  138. background-color: #fff;
  139. border-radius: 20rpx;
  140. overflow: hidden;
  141. position: relative;
  142. /deep/.easy-loadimage image {
  143. width: 100%;
  144. height: 346rpx;
  145. border-radius: 20rpx 20rpx 0 0;
  146. }
  147. .pictrue_log {
  148. width: 92rpx;
  149. height: 44rpx;
  150. font-size: 26rpx;
  151. line-height: 44rpx;
  152. }
  153. image {
  154. width: 100%;
  155. height: 346rpx;
  156. display: block;
  157. border-radius: 20rpx 20rpx 0 0;
  158. }
  159. .text-info {
  160. padding: 10rpx 20rpx 15rpx;
  161. .title {
  162. color: #222222;
  163. }
  164. .old-price {
  165. margin-top: 4rpx;
  166. font-size: 26rpx;
  167. color: #AAAAAA;
  168. text-decoration: line-through;
  169. text {
  170. margin-right: 2px;
  171. font-size: 20rpx;
  172. }
  173. }
  174. .price {
  175. display: flex;
  176. align-items: flex-end;
  177. font-size: 36rpx;
  178. font-weight: 550;
  179. text {
  180. padding-bottom: 4rpx;
  181. font-size: 26rpx;
  182. font-weight: normal;
  183. }
  184. .txt {
  185. display: flex;
  186. align-items: center;
  187. justify-content: center;
  188. width: 28rpx;
  189. height: 28rpx;
  190. margin-left: 15rpx;
  191. margin-bottom: 10rpx;
  192. border-radius: 4rpx;
  193. font-size: 20rpx;
  194. font-weight: normal;
  195. &.on {
  196. margin-left: 0;
  197. }
  198. }
  199. }
  200. }
  201. }
  202. &.on {
  203. display: flex;
  204. }
  205. }
  206. }
  207. </style>