templateK.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. <template>
  2. <view class="section_page_main clearfix">
  3. <view class="floor-item-ad clearfix">
  4. <view class="floor-item-left">
  5. <image
  6. class="item-img-gg"
  7. :src="floorData.floorContent.appletsAdsImage1"
  8. @click="
  9. BannerNavigateTo(
  10. floorData.floorContent.linkType1,
  11. floorData.floorContent.linkParam1.id ? floorData.floorContent.linkParam1.id : '',
  12. floorData.floorContent.adsLink1,
  13. floorData.floorContent.linkParam1.keyword ? floorData.floorContent.linkParam1.keyword : ''
  14. )
  15. "
  16. mode="aspectFill"
  17. >
  18. </image>
  19. </view>
  20. <view class="floor_item_right">
  21. <image
  22. class="item-img-gg"
  23. :src="floorData.floorContent.appletsAdsImage2"
  24. @click="
  25. BannerNavigateTo(
  26. floorData.floorContent.linkType2,
  27. floorData.floorContent.linkParam2.id ? floorData.floorContent.linkParam2.id : '',
  28. floorData.floorContent.adsLink2,
  29. floorData.floorContent.linkParam2.keyword ? floorData.floorContent.linkParam2.keyword : ''
  30. )
  31. "
  32. mode="aspectFill"
  33. >
  34. </image>
  35. <image
  36. class="item-img-gg"
  37. :src="floorData.floorContent.appletsAdsImage3"
  38. @click="
  39. BannerNavigateTo(
  40. floorData.floorContent.linkType3,
  41. floorData.floorContent.linkParam3.id ? floorData.floorContent.linkParam3.id : '',
  42. floorData.floorContent.adsLink3,
  43. floorData.floorContent.linkParam3.keyword ? floorData.floorContent.linkParam3.keyword : ''
  44. )
  45. "
  46. mode="aspectFill"
  47. >
  48. </image>
  49. </view>
  50. </view>
  51. <view class="floor-item-ad ad-row2 clearfix">
  52. <image
  53. class="item-img-gg"
  54. :src="floorData.floorContent.appletsAdsImage2"
  55. @click="
  56. BannerNavigateTo(
  57. floorData.floorContent.linkType2,
  58. floorData.floorContent.linkParam2.id ? floorData.floorContent.linkParam2.id : '',
  59. floorData.floorContent.adsLink2,
  60. floorData.floorContent.linkParam2.keyword ? floorData.floorContent.linkParam2.keyword : ''
  61. )
  62. "
  63. mode="aspectFill"
  64. >
  65. </image>
  66. <image
  67. class="item-img-gg"
  68. :src="floorData.floorContent.appletsAdsImage3"
  69. @click="
  70. BannerNavigateTo(
  71. floorData.floorContent.linkType3,
  72. floorData.floorContent.linkParam3.id ? floorData.floorContent.linkParam3.id : '',
  73. floorData.floorContent.adsLink3,
  74. floorData.floorContent.linkParam3.keyword ? floorData.floorContent.linkParam3.keyword : ''
  75. )
  76. "
  77. mode="aspectFill"
  78. >
  79. </image>
  80. </view>
  81. <view
  82. class="floor-item ad_04 clearfix"
  83. v-for="(item, idx) in floorData.floorImageList"
  84. :key="idx"
  85. @click.stop="navToDetailPage(item)"
  86. >
  87. <image class="item-img tui-skeleton-fillet" :src="item.image" mode="aspectFill"></image>
  88. <template-Type :product="item.product"></template-Type>
  89. <view class="floor-item_tag" v-if="item.listType == 2">
  90. <text>{{ item.label }}</text>
  91. </view>
  92. <view class="floor-item-content">
  93. <view class="title tui-skeleton-rect">
  94. <text class="mclap-tag" v-if="item.product.beautyActFlag == '1'">美博会</text>
  95. <text class="mclap" :class="item.product.beautyActFlag == '1' ? 'indent' : ''"
  96. >{{ item.name }}
  97. </text>
  98. </view>
  99. <view class="floor-item-price" v-if="item.listType == 1">
  100. <template>
  101. <template-Tags :product="item.product"></template-Tags>
  102. </template>
  103. <view v-if="hasLogin">
  104. <template v-if="item.product.productCategory == 1">
  105. <template-Price :product="item.product"></template-Price>
  106. </template>
  107. <template v-else>
  108. <view class="price tui-skeleton-rect" v-if="item.product.detailTalkFlag == '2'">
  109. <text class="p sm">¥</text> <text class="p big">价格详聊</text>
  110. </view>
  111. <view class="price tui-skeleton-rect" v-else>
  112. <text class="p sm">¥</text>
  113. <text class="p big">{{ item.product.price | NumFormat }}</text>
  114. </view>
  115. </template>
  116. </view>
  117. <view v-else class="no-price">
  118. <template v-if="item.product.productCategory == 1">
  119. <view class="p-stars">
  120. <text class="p-no">¥</text>
  121. <uni-grader :grade="Number(item.product.priceGrade)" :margin="14"></uni-grader>
  122. </view>
  123. </template>
  124. <template v-else>
  125. <view class="p-stars"> <text class="p-no">¥登录可见</text> </view>
  126. </template>
  127. </view>
  128. </view>
  129. </view>
  130. </view>
  131. </view>
  132. </template>
  133. <script>
  134. import { mapState, mapMutations } from 'vuex'
  135. import uniGrader from '@/components/uni-grade/uni-grade.vue'
  136. import templateTags from '@/components/cm-module/pageTemplate/templateTags.vue'
  137. import templatePrice from '@/components/cm-module/pageTemplate/templatePrice.vue'
  138. import templateType from '@/components/cm-module/pageTemplate/templateType.vue'
  139. export default {
  140. name: 'templateD',
  141. components: {
  142. uniGrader,
  143. templateTags,
  144. templatePrice,
  145. templateType
  146. },
  147. props: {
  148. pageData: {
  149. type: Object
  150. },
  151. userIdentity: {
  152. type: Number
  153. }
  154. },
  155. data() {
  156. return {
  157. shopId: 0,
  158. floorData: {}
  159. }
  160. },
  161. filters: {
  162. NumFormat: function(text) {
  163. //处理金额
  164. return Number(text).toFixed(2)
  165. }
  166. },
  167. created() {
  168. this.initData(this.pageData)
  169. },
  170. computed: {
  171. ...mapState(['hasLogin', 'userInfo', 'isActivity'])
  172. },
  173. watch: {
  174. pageData: {
  175. handler: function(el) {
  176. //监听对象的变换使用 function,箭头函数容易出现this指向不正确
  177. this.pageData = el
  178. this.initData(this.pageData)
  179. },
  180. deep: true
  181. }
  182. },
  183. methods: {
  184. initData(data) {
  185. this.$api.getStorage().then(resolve => {
  186. this.shopId = resolve.shopId ? resolve.shopId : 0
  187. })
  188. this.floorData = data
  189. // console.log(this.floorData)
  190. },
  191. PromotionsFormat(promo) {
  192. //促销活动类型数据处理
  193. if (promo != null) {
  194. if (promo.type == 1 && promo.mode == 1) {
  195. return true
  196. } else {
  197. return false
  198. }
  199. }
  200. return false
  201. },
  202. navToDetailPage(pros) {
  203. //跳转商品详情页
  204. this.$api.FlooryNavigateTo(pros)
  205. },
  206. BannerNavigateTo(linkType, linkId, linkHref, keyword) {
  207. //跳转商品详情页
  208. this.$api.BannerNavigateTo(linkType, linkId, linkHref, keyword)
  209. }
  210. }
  211. }
  212. </script>
  213. <style lang="scss">
  214. .section_page_main {
  215. width: 100%;
  216. height: auto;
  217. box-sizing: border-box;
  218. .floor-item-ad {
  219. width: 100%;
  220. margin-bottom: 20rpx;
  221. .floor-item-left,
  222. .floor_item_right {
  223. width: 339rpx;
  224. height: 516rpx;
  225. }
  226. .floor-item-left {
  227. margin-right: 20rpx;
  228. float: left;
  229. .item-img-gg {
  230. width: 339rpx;
  231. height: 516rpx;
  232. border-radius: 16rpx;
  233. }
  234. }
  235. .floor_item_right {
  236. float: left;
  237. .item-img-gg {
  238. width: 100%;
  239. height: 246rpx;
  240. display: block;
  241. border-radius: 16rpx;
  242. &:nth-child(1) {
  243. margin-bottom: 24rpx;
  244. }
  245. }
  246. }
  247. &.ad-row2 {
  248. width: 100%;
  249. margin: 24rpx 0;
  250. .item-img-gg {
  251. width: 339rpx;
  252. height: 246rpx;
  253. float: left;
  254. display: block;
  255. border-radius: 16rpx;
  256. &:nth-child(1) {
  257. margin-right: 20rpx;
  258. }
  259. }
  260. }
  261. }
  262. .floor-item {
  263. width: 339rpx;
  264. height: 516rpx;
  265. margin-right: 20rpx;
  266. font-size: $font-size-24;
  267. color: $text-color;
  268. background: #ffffff;
  269. line-height: 36rpx;
  270. border-radius: 16rpx;
  271. margin-bottom: 20rpx;
  272. float: left;
  273. box-sizing: border-box;
  274. position: relative;
  275. &:nth-child(even) {
  276. margin-right: 0;
  277. }
  278. .item-img-gg {
  279. width: 339rpx;
  280. height: 516rpx;
  281. display: block;
  282. border-radius: 16rpx;
  283. }
  284. .item-img {
  285. width: 339rpx;
  286. height: 339rpx;
  287. border-radius: 16rpx 16rpx 0 0;
  288. display: block;
  289. margin-bottom: 8rpx;
  290. }
  291. .floor-item_tag {
  292. width: 100%;
  293. height: 32rpx;
  294. float: left;
  295. margin: 20rpx 0;
  296. padding: 0 20rpx;
  297. box-sizing: border-box;
  298. text {
  299. display: inline-block;
  300. padding: 0 8rpx;
  301. border: 1px solid #e3ebf7;
  302. border-radius: 8rpx;
  303. color: #9aa5b5;
  304. font-size: $font-size-22;
  305. line-height: 32rpx;
  306. text-align: center;
  307. float: left;
  308. }
  309. }
  310. .floor-item-content {
  311. width: 100%;
  312. padding: 0 20rpx;
  313. box-sizing: border-box;
  314. }
  315. .floor-item-act {
  316. display: block;
  317. width: 100%;
  318. height: 32rpx;
  319. text-align: center;
  320. box-sizing: border-box;
  321. }
  322. .title-none {
  323. font-size: $font-size-26;
  324. color: #ff2a2a;
  325. line-height: 54rpx;
  326. }
  327. .title {
  328. width: 100%;
  329. height: 70rpx;
  330. display: flex;
  331. line-height: 35rpx;
  332. flex-direction: column;
  333. margin: 8rpx 0;
  334. padding: 0;
  335. position: relative;
  336. .mclap {
  337. width: 100%;
  338. line-height: 35rpx;
  339. text-overflow: ellipsis;
  340. display: -webkit-box;
  341. word-break: break-all;
  342. -webkit-box-orient: vertical;
  343. -webkit-line-clamp: 2;
  344. overflow: hidden;
  345. font-size: 26rpx;
  346. &.indent {
  347. text-indent: 95rpx;
  348. }
  349. }
  350. .mclap-tag {
  351. display: block;
  352. width: 84rpx;
  353. height: 32rpx;
  354. background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
  355. border-radius: 4rpx 48rpx 4px 4px;
  356. line-height: 32rpx;
  357. font-size: $font-size-22;
  358. color: #ffffff;
  359. text-align: center;
  360. position: absolute;
  361. left: 0;
  362. top: 0;
  363. }
  364. }
  365. .no-price {
  366. height: 54rpx;
  367. line-height: 54rpx;
  368. display: flex;
  369. box-sizing: border-box;
  370. .p-no {
  371. font-size: $font-size-28;
  372. color: $text-color;
  373. display: block;
  374. float: left;
  375. }
  376. .p-stars {
  377. float: left;
  378. }
  379. }
  380. .price {
  381. color: #ff2a2a;
  382. line-height: 54rpx;
  383. &.none {
  384. text-decoration: line-through;
  385. color: #999999;
  386. }
  387. .sm {
  388. font-size: $font-size-24;
  389. }
  390. .big {
  391. font-size: $font-size-28;
  392. }
  393. }
  394. }
  395. }
  396. </style>