templateK.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  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
  12. ? floorData.floorContent.linkParam1.id
  13. : '',
  14. floorData.floorContent.adsLink1,
  15. floorData.floorContent.linkParam1.keyword
  16. ? floorData.floorContent.linkParam1.keyword
  17. : ''
  18. )
  19. "
  20. mode="aspectFill"
  21. >
  22. </image>
  23. </view>
  24. <view class="floor_item_right">
  25. <image
  26. class="item-img-gg"
  27. :src="floorData.floorContent.appletsAdsImage2"
  28. @click="
  29. BannerNavigateTo(
  30. floorData.floorContent.linkType2,
  31. floorData.floorContent.linkParam2.id
  32. ? floorData.floorContent.linkParam2.id
  33. : '',
  34. floorData.floorContent.adsLink2,
  35. floorData.floorContent.linkParam2.keyword
  36. ? floorData.floorContent.linkParam2.keyword
  37. : ''
  38. )
  39. "
  40. mode="aspectFill"
  41. >
  42. </image>
  43. <image
  44. class="item-img-gg"
  45. :src="floorData.floorContent.appletsAdsImage3"
  46. @click="
  47. BannerNavigateTo(
  48. floorData.floorContent.linkType3,
  49. floorData.floorContent.linkParam3.id
  50. ? floorData.floorContent.linkParam3.id
  51. : '',
  52. floorData.floorContent.adsLink3,
  53. floorData.floorContent.linkParam3.keyword
  54. ? floorData.floorContent.linkParam3.keyword
  55. : ''
  56. )
  57. "
  58. mode="aspectFill"
  59. >
  60. </image>
  61. </view>
  62. </view>
  63. <view class="floor-item-ad ad-row2 clearfix">
  64. <image
  65. class="item-img-gg"
  66. :src="floorData.floorContent.appletsAdsImage2"
  67. @click="
  68. BannerNavigateTo(
  69. floorData.floorContent.linkType2,
  70. floorData.floorContent.linkParam2.id
  71. ? floorData.floorContent.linkParam2.id
  72. : '',
  73. floorData.floorContent.adsLink2,
  74. floorData.floorContent.linkParam2.keyword
  75. ? floorData.floorContent.linkParam2.keyword
  76. : ''
  77. )
  78. "
  79. mode="aspectFill"
  80. >
  81. </image>
  82. <image
  83. class="item-img-gg"
  84. :src="floorData.floorContent.appletsAdsImage3"
  85. @click="
  86. BannerNavigateTo(
  87. floorData.floorContent.linkType3,
  88. floorData.floorContent.linkParam3.id
  89. ? floorData.floorContent.linkParam3.id
  90. : '',
  91. floorData.floorContent.adsLink3,
  92. floorData.floorContent.linkParam3.keyword
  93. ? floorData.floorContent.linkParam3.keyword
  94. : ''
  95. )
  96. "
  97. mode="aspectFill"
  98. >
  99. </image>
  100. </view>
  101. <view
  102. class="floor-item ad_04 clearfix"
  103. v-for="(item, idx) in floorData.floorImageList"
  104. :key="idx"
  105. @click.stop="navToDetailPage(item)"
  106. >
  107. <image class="item-img tui-skeleton-fillet" :src="item.image" mode="aspectFill"></image>
  108. <view class="floor-item_tag" v-if="item.listType == 2">
  109. <text>{{ item.label }}</text>
  110. </view>
  111. <view class="floor-item-content">
  112. <view class="title tui-skeleton-rect">
  113. <text class="mclap-tag" v-if="item.product.beautyActFlag == '1'">美博会</text>
  114. <text class="mclap" :class="item.product.beautyActFlag == '1' ? 'indent' : ''"
  115. >{{ item.name }}
  116. </text>
  117. </view>
  118. <view class="floor-item-price" v-if="item.listType == 1">
  119. <view class="floor-item-act">
  120. <view class="coupon-tags">优惠券</view>
  121. <template v-if="userIdentity === 3">
  122. <template v-if="item.product.actStatus === 1">
  123. <view
  124. class="floor-tags"
  125. v-if="PromotionsFormat(item.product.promotions)"
  126. >
  127. {{ item.product.promotions.name }}
  128. <text
  129. v-if="
  130. hasLogin &&
  131. item.product.priceFlag != 1 &&
  132. item.product.shopID == shopId
  133. "
  134. >:¥{{ item.product.price | NumFormat }}</text
  135. >
  136. </view>
  137. <view class="floor-tags" v-else>{{
  138. item.product.promotions.name
  139. }}</view>
  140. </template>
  141. <template
  142. v-if="
  143. item.product.actStatus === 0 &&
  144. item.product.ladderPriceFlag === 1
  145. "
  146. >
  147. <view class="floor-tags">阶梯价格</view>
  148. </template>
  149. </template>
  150. <template v-else>
  151. <template v-if="item.product.actStatus === 1">
  152. <view
  153. class="floor-tags"
  154. v-if="PromotionsFormat(item.product.promotions)"
  155. >
  156. {{ item.product.promotions.name }}
  157. <text v-if="hasLogin && item.product.priceFlag != 1"
  158. >:¥{{ item.product.price | NumFormat }}</text
  159. >
  160. </view>
  161. <view class="floor-tags" v-else>{{
  162. item.product.promotions.name
  163. }}</view>
  164. </template>
  165. <template
  166. v-if="
  167. item.product.actStatus === 0 &&
  168. item.product.ladderPriceFlag === 1
  169. "
  170. >
  171. <view class="floor-tags">阶梯价格</view>
  172. </template>
  173. </template>
  174. </view>
  175. <view v-if="hasLogin">
  176. <template v-if="item.product.productCategory == 1">
  177. <template v-if="userIdentity == 3">
  178. <template v-if="item.product.shopID == shopId">
  179. <view
  180. class="title-none"
  181. v-if="item.product.priceFlag === 1"
  182. >
  183. <text class="p big">¥未公开价格</text>
  184. </view>
  185. <view
  186. class="price tui-skeleton-rect"
  187. v-else
  188. :class="
  189. PromotionsFormat(item.product.promotions) ? 'none' : ''
  190. "
  191. >
  192. <text class="p sm">¥</text>
  193. <text class="p big">{{
  194. (PromotionsFormat(item.product.promotions)
  195. ? item.product.originalPrice
  196. : item.product.price) | NumFormat
  197. }}</text>
  198. </view>
  199. </template>
  200. <template v-else>
  201. <view class="no-price">
  202. <view class="p-stars">
  203. <text class="p-no">¥</text>
  204. <uni-grader
  205. :grade="Number(item.product.priceGrade)"
  206. :margin="14"
  207. ></uni-grader>
  208. </view>
  209. </view>
  210. </template>
  211. </template>
  212. <template v-else-if="userIdentity === 4">
  213. <view class="title-none" v-if="item.product.priceFlag === 1">
  214. <text class="p big">¥未公开价格</text>
  215. </view>
  216. <view class="title-none" v-if="item.product.priceFlag === 2">
  217. <text class="p big">¥价格仅会员可见</text>
  218. </view>
  219. <view
  220. class="price tui-skeleton-rect"
  221. v-if="item.product.priceFlag === 0"
  222. :class="PromotionsFormat(item.product.promotions) ? 'none' : ''"
  223. >
  224. <text class="p sm">¥</text>
  225. <text class="p big">{{
  226. (PromotionsFormat(item.product.promotions)
  227. ? item.product.originalPrice
  228. : item.product.price) | NumFormat
  229. }}</text>
  230. </view>
  231. </template>
  232. <template v-else>
  233. <view class="title-none" v-if="item.product.priceFlag === 1">
  234. <text class="p big">¥未公开价格</text>
  235. </view>
  236. <view
  237. class="price tui-skeleton-rect"
  238. v-else
  239. :class="PromotionsFormat(item.product.promotions) ? 'none' : ''"
  240. >
  241. <text class="p sm">¥</text>
  242. <text class="p big">{{
  243. (PromotionsFormat(item.product.promotions)
  244. ? item.product.originalPrice
  245. : item.product.price) | NumFormat
  246. }}</text>
  247. </view>
  248. </template>
  249. </template>
  250. <template v-else>
  251. <view
  252. class="price tui-skeleton-rect"
  253. v-if="item.product.detailTalkFlag == '2'"
  254. >
  255. <text class="p sm">¥</text> <text class="p big">价格详聊</text>
  256. </view>
  257. <view class="price tui-skeleton-rect" v-else>
  258. <text class="p sm">¥</text>
  259. <text class="p big">{{
  260. item.product.price | NumFormat
  261. }}</text>
  262. </view>
  263. </template>
  264. </view>
  265. <view v-else class="no-price">
  266. <template v-if="item.product.productCategory == 1">
  267. <view class="p-stars">
  268. <text class="p-no">¥</text>
  269. <uni-grader
  270. :grade="Number(item.product.priceGrade)"
  271. :margin="14"
  272. ></uni-grader>
  273. </view>
  274. </template>
  275. <template v-else>
  276. <view class="p-stars"> <text class="p-no">¥登录可见</text> </view>
  277. </template>
  278. </view>
  279. </view>
  280. </view>
  281. </view>
  282. </view>
  283. </template>
  284. <script>
  285. import { mapState, mapMutations } from 'vuex'
  286. import uniGrader from '@/components/uni-grade/uni-grade.vue'
  287. export default {
  288. name: 'templateD',
  289. components: {
  290. uniGrader
  291. },
  292. props: {
  293. pageData: {
  294. type: Object
  295. },
  296. userIdentity: {
  297. type: Number
  298. }
  299. },
  300. data() {
  301. return {
  302. shopId: 0,
  303. floorData: {}
  304. }
  305. },
  306. filters: {
  307. NumFormat: function(text) {
  308. //处理金额
  309. return Number(text).toFixed(2)
  310. }
  311. },
  312. created() {
  313. this.initData(this.pageData)
  314. },
  315. computed: {
  316. ...mapState(['hasLogin', 'userInfo', 'isActivity'])
  317. },
  318. watch: {
  319. pageData: {
  320. handler: function(el) {
  321. //监听对象的变换使用 function,箭头函数容易出现this指向不正确
  322. this.pageData = el
  323. this.initData(this.pageData)
  324. },
  325. deep: true
  326. }
  327. },
  328. methods: {
  329. initData(data) {
  330. this.$api.getStorage().then(resolve => {
  331. this.shopId = resolve.shopId ? resolve.shopId : 0
  332. })
  333. this.floorData = data
  334. // console.log(this.floorData)
  335. },
  336. PromotionsFormat(promo) {
  337. //促销活动类型数据处理
  338. if (promo != null) {
  339. if (promo.type == 1 && promo.mode == 1) {
  340. return true
  341. } else {
  342. return false
  343. }
  344. }
  345. return false
  346. },
  347. navToDetailPage(pros) {
  348. //跳转商品详情页
  349. this.$api.FlooryNavigateTo(pros)
  350. },
  351. BannerNavigateTo(linkType, linkId, linkHref, keyword) {
  352. //跳转商品详情页
  353. this.$api.BannerNavigateTo(linkType, linkId, linkHref, keyword)
  354. }
  355. }
  356. }
  357. </script>
  358. <style lang="scss">
  359. .section_page_main {
  360. width: 100%;
  361. height: auto;
  362. box-sizing: border-box;
  363. .floor-item-ad{
  364. width: 100%;
  365. margin-bottom: 20rpx;
  366. .floor-item-left,.floor_item_right{
  367. width: 339rpx;
  368. height: 516rpx;
  369. }
  370. .floor-item-left{
  371. margin-right: 20rpx;
  372. float: left;
  373. .item-img-gg{
  374. width: 339rpx;
  375. height: 516rpx;
  376. border-radius: 16rpx;
  377. }
  378. }
  379. .floor_item_right{
  380. float: left;
  381. .item-img-gg {
  382. width: 100%;
  383. height: 246rpx;
  384. display: block;
  385. border-radius: 16rpx;
  386. &:nth-child(1){
  387. margin-bottom:24rpx;
  388. }
  389. }
  390. }
  391. &.ad-row2{
  392. width: 100%;
  393. margin: 24rpx 0;
  394. .item-img-gg {
  395. width: 339rpx;
  396. height: 246rpx;
  397. float: left;
  398. display: block;
  399. border-radius: 16rpx;
  400. &:nth-child(1){
  401. margin-right: 20rpx;
  402. }
  403. }
  404. }
  405. }
  406. .floor-item {
  407. width: 339rpx;
  408. height: 516rpx;
  409. margin-right: 20rpx;
  410. font-size: $font-size-24;
  411. color: $text-color;
  412. background: #ffffff;
  413. line-height: 36rpx;
  414. border-radius: 16rpx;
  415. margin-bottom: 20rpx;
  416. float: left;
  417. box-sizing: border-box;
  418. position: relative;
  419. &:nth-child(even) {
  420. margin-right: 0;
  421. }
  422. .item-img-gg {
  423. width: 339rpx;
  424. height: 516rpx;
  425. display: block;
  426. border-radius: 16rpx;
  427. }
  428. .item-img {
  429. width: 339rpx;
  430. height: 339rpx;
  431. border-radius: 16rpx 16rpx 0 0;
  432. display: block;
  433. margin-bottom: 8rpx;
  434. }
  435. .floor-item_tag {
  436. width: 100%;
  437. height: 32rpx;
  438. float: left;
  439. margin: 20rpx 0;
  440. padding: 0 20rpx;
  441. box-sizing: border-box;
  442. text {
  443. display: inline-block;
  444. padding: 0 8rpx;
  445. border: 1px solid #e3ebf7;
  446. border-radius: 8rpx;
  447. color: #9aa5b5;
  448. font-size: $font-size-22;
  449. line-height: 32rpx;
  450. text-align: center;
  451. float: left;
  452. }
  453. }
  454. .floor-item-content {
  455. width: 100%;
  456. padding: 0 20rpx;
  457. box-sizing: border-box;
  458. }
  459. .floor-item-act{
  460. display: block;
  461. width: 100%;
  462. height: 32rpx;
  463. text-align: center;
  464. box-sizing: border-box;
  465. .coupon-tags{
  466. height: 32rpx;
  467. box-sizing: border-box;
  468. border-radius: 8rpx;
  469. background-color: #fff1eb;
  470. line-height: 28rpx;
  471. color: #f94b4b;
  472. text-align: center;
  473. display: inline-block;
  474. padding:0 10rpx;
  475. font-size: $font-size-20;
  476. border: 1px solid #f94b4b;
  477. float: left;
  478. margin-right: 12rpx;
  479. }
  480. .floor-tags{
  481. height: 32rpx;
  482. box-sizing: border-box;
  483. border-radius: 8rpx;
  484. background-color: #FFFFFF;
  485. line-height: 28rpx;
  486. color: $color-system;
  487. text-align: center;
  488. display: inline-block;
  489. padding:0 16rpx;
  490. font-size: $font-size-20;
  491. border: 1px solid #E15616;
  492. float: left;
  493. }
  494. }
  495. .title-none {
  496. font-size: $font-size-26;
  497. color: #ff2a2a;
  498. line-height: 54rpx;
  499. }
  500. .title {
  501. width: 100%;
  502. height: 70rpx;
  503. display: flex;
  504. line-height: 35rpx;
  505. flex-direction: column;
  506. margin: 8rpx 0;
  507. padding: 0;
  508. position: relative;
  509. .mclap {
  510. width: 100%;
  511. line-height: 35rpx;
  512. text-overflow: ellipsis;
  513. display: -webkit-box;
  514. word-break: break-all;
  515. -webkit-box-orient: vertical;
  516. -webkit-line-clamp: 2;
  517. overflow: hidden;
  518. font-size: 26rpx;
  519. &.indent {
  520. text-indent: 95rpx;
  521. }
  522. }
  523. .mclap-tag {
  524. display: block;
  525. width: 84rpx;
  526. height: 32rpx;
  527. background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
  528. border-radius: 4rpx 48rpx 4px 4px;
  529. line-height: 32rpx;
  530. font-size: $font-size-22;
  531. color: #ffffff;
  532. text-align: center;
  533. position: absolute;
  534. left: 0;
  535. top: 0;
  536. }
  537. }
  538. .no-price {
  539. height: 54rpx;
  540. line-height: 54rpx;
  541. display: flex;
  542. box-sizing: border-box;
  543. .p-no {
  544. font-size: $font-size-28;
  545. color: $text-color;
  546. display: block;
  547. float: left;
  548. }
  549. .p-stars {
  550. float: left;
  551. }
  552. }
  553. .price {
  554. color: #ff2a2a;
  555. line-height: 54rpx;
  556. &.none {
  557. text-decoration: line-through;
  558. color: #999999;
  559. }
  560. .sm {
  561. font-size: $font-size-24;
  562. }
  563. .big {
  564. font-size: $font-size-28;
  565. }
  566. }
  567. }
  568. }
  569. </style>