templateK.vue 9.1 KB

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