templateK.vue 13 KB

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