promotionList.vue 4.4 KB

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