template-product.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <view class="floor-item ad_04 clearfix" @click.stop="navToDetailPage(data)">
  3. <image class="item-img tui-skeleton-fillet" :src="data.image" mode="aspectFill"></image>
  4. <template-Type :product="data"></template-Type>
  5. <view class="floor-item-content">
  6. <view class="title tui-skeleton-rect">
  7. <text class="mclap-tag" v-if="data.beautyActFlag == '1'">美博会</text>
  8. <text class="mclap" :class="data.beautyActFlag == '1' ? 'indent' : ''"
  9. >{{ data.name }}
  10. </text>
  11. </view>
  12. <view class="floor-item-price">
  13. <template>
  14. <template-Tags :product="data"></template-Tags>
  15. </template>
  16. <view v-if="hasLogin">
  17. <template-Price :product="data"></template-Price>
  18. </view>
  19. <view v-else class="no-price">
  20. <view class="p-stars">
  21. <text class="p-no">¥</text>
  22. <uni-grader
  23. :grade="Number(data.priceGrade)"
  24. :margin="14"
  25. ></uni-grader>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import { mapState, mapMutations } from 'vuex'
  34. import uniGrader from '@/components/uni-grade/uni-grade.vue'
  35. import templateTags from '@/components/cm-module/pageTemplate/templateTags.vue'
  36. import templatePrice from '@/components/cm-module/pageTemplate/templatePrice.vue'
  37. import templateType from '@/components/cm-module/pageTemplate/templateType.vue'
  38. import cmsMixins from '@/mixins/cmsMixins.js'
  39. export default{
  40. mixins: [cmsMixins],
  41. name: 'TemplateProduct',
  42. components: {
  43. uniGrader,
  44. templateTags,
  45. templatePrice,
  46. templateType
  47. },
  48. props: {
  49. data: {
  50. type: Object,
  51. default: () => {}
  52. }
  53. },
  54. computed: {
  55. ...mapState(['hasLogin', 'userInfo', 'isActivity']),
  56. },
  57. methods: {
  58. // 跳转商品详情ss
  59. navToDetailPage(pros) {
  60. this.cmsSysStatistics(5,pros.productId)
  61. this.$api.navigateTo(`/pages/goods/product?id=${pros.productId}&typeId=5`)
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="scss" scoped>
  67. .floor-item {
  68. width: 332rpx;
  69. height: 516rpx;
  70. font-size: $font-size-24;
  71. color: $text-color;
  72. background: #ffffff;
  73. line-height: 36rpx;
  74. border-radius: 16rpx;
  75. margin-right: 10rpx;
  76. margin-bottom: 10rpx;
  77. float: left;
  78. box-sizing: border-box;
  79. position: relative;
  80. &:nth-child(2n) {
  81. margin-right: 0;
  82. }
  83. .item-img {
  84. width: 332rpx;
  85. height: 332rpx;
  86. border-radius: 16rpx 16rpx 0 0;
  87. display: block;
  88. margin-bottom: 8rpx;
  89. }
  90. .floor-item_tag {
  91. width: 100%;
  92. height: 32rpx;
  93. float: left;
  94. margin: 20rpx 0;
  95. padding: 0 20rpx;
  96. box-sizing: border-box;
  97. text {
  98. display: inline-block;
  99. padding: 0 8rpx;
  100. border: 1px solid #e3ebf7;
  101. border-radius: 8rpx;
  102. color: #9aa5b5;
  103. font-size: $font-size-22;
  104. line-height: 32rpx;
  105. text-align: center;
  106. float: left;
  107. }
  108. }
  109. .floor-item-content {
  110. width: 100%;
  111. padding: 0 20rpx;
  112. box-sizing: border-box;
  113. }
  114. .floor-item-act {
  115. display: block;
  116. width: 100%;
  117. height: 32rpx;
  118. text-align: center;
  119. box-sizing: border-box;
  120. }
  121. .title-none {
  122. font-size: $font-size-26;
  123. color: #ff2a2a;
  124. line-height: 54rpx;
  125. }
  126. .title {
  127. width: 100%;
  128. height: 70rpx;
  129. display: flex;
  130. line-height: 35rpx;
  131. flex-direction: column;
  132. margin: 8rpx 0;
  133. padding: 0;
  134. position: relative;
  135. .mclap {
  136. width: 100%;
  137. line-height: 35rpx;
  138. text-overflow: ellipsis;
  139. display: -webkit-box;
  140. word-break: break-all;
  141. -webkit-box-orient: vertical;
  142. -webkit-line-clamp: 2;
  143. overflow: hidden;
  144. font-size: 26rpx;
  145. &.indent {
  146. text-indent: 95rpx;
  147. }
  148. }
  149. .mclap-tag {
  150. display: block;
  151. width: 84rpx;
  152. height: 32rpx;
  153. background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
  154. border-radius: 4rpx 48rpx 4px 4px;
  155. line-height: 32rpx;
  156. font-size: $font-size-22;
  157. color: #ffffff;
  158. text-align: center;
  159. position: absolute;
  160. left: 0;
  161. top: 0;
  162. }
  163. }
  164. .no-price {
  165. height: 54rpx;
  166. line-height: 54rpx;
  167. display: flex;
  168. box-sizing: border-box;
  169. .p-no {
  170. line-height: 54rpx;
  171. font-size: $font-size-28;
  172. color: $text-color;
  173. display: inline-block;
  174. float: left;
  175. }
  176. .p-stars {
  177. float: left;
  178. }
  179. }
  180. .price {
  181. color: #ff2a2a;
  182. line-height: 54rpx;
  183. &.none {
  184. text-decoration: line-through;
  185. color: #999999;
  186. }
  187. .sm {
  188. font-size: $font-size-24;
  189. }
  190. .big {
  191. font-size: $font-size-28;
  192. }
  193. }
  194. }
  195. </style>