templateC.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <scroll-view scroll-x="true" class="picture">
  3. <view class="section" v-for="(item , index) in productList" @click="navigaitionTo(item)" :key="index">
  4. <image :src="item.appletsImage" ></image>
  5. <view class="cm-cover" v-if="pageData.floorContent.templateClassify === 4"></view>
  6. </view>
  7. </scroll-view>
  8. </template>
  9. <script>
  10. import caimeiApi from '@/common/config/caimeiApi.js'
  11. export default{
  12. data(){
  13. return{
  14. productList:[]
  15. }
  16. },
  17. props:{
  18. pageData: {
  19. type: Object
  20. },
  21. userIdentity: {
  22. type: Number
  23. }
  24. },
  25. created() {
  26. this.initData(this.pageData)
  27. },
  28. methods:{
  29. initData(data){
  30. this.productList = data.floorImageList
  31. },
  32. navigaitionTo(item){
  33. if (item.adsImage === '' && item.linkType === -1) {
  34. return
  35. }else if(item.linkType === -1){
  36. uni.navigateTo({
  37. url:`/pages/h5/activity/activity-detail?adsImage=${item.adsImage}&title=${item.name}`
  38. })
  39. }else{
  40. caimeiApi.FlooryNavigateTo(item)
  41. }
  42. }
  43. }
  44. }
  45. </script>
  46. <style lang="scss">
  47. .picture{
  48. width: 750rpx;
  49. margin-left: -24rpx;
  50. white-space: nowrap;
  51. .section{
  52. position: relative;
  53. display: inline-block;
  54. margin-right: 24rpx;
  55. width: 310rpx;
  56. height: 240rpx;
  57. overflow: hidden;
  58. border-radius: 16rpx;
  59. image{
  60. width: 310rpx;
  61. height: 240rpx;
  62. }
  63. &:first-child{
  64. margin-left: 24rpx;
  65. }
  66. .cm-cover{
  67. z-index: 99;
  68. top: 0;
  69. left: 0;
  70. position: absolute;
  71. width: 100%;
  72. height: 100%;
  73. background:url(https://static.caimei365.com/app/img/icon2/cm_player.png) no-repeat center;
  74. background-size: 40rpx 40rpx;
  75. }
  76. }
  77. }
  78. </style>