templateB.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 || item.image" ></image>
  5. <view class="cm-cover"></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.link === '' && item.linkType === -1) {
  34. return
  35. }else if(item.linkType === -1){
  36. const url = `/pages/h5/activity/activity-detail?type=video&videoUrl=${item.link}&title=${item.name}`
  37. return uni.navigateTo({ url })
  38. }else{
  39. caimeiApi.FlooryNavigateTo(item)
  40. }
  41. }
  42. }
  43. }
  44. </script>
  45. <style lang="scss">
  46. .picture{
  47. width: 750rpx;
  48. margin-left: -24rpx;
  49. white-space: nowrap;
  50. .section{
  51. position: relative;
  52. display: inline-block;
  53. margin-right: 24rpx;
  54. width: 310rpx;
  55. height: 240rpx;
  56. overflow: hidden;
  57. border-radius: 16rpx;
  58. image{
  59. width: 310rpx;
  60. height: 240rpx;
  61. }
  62. &:first-child{
  63. margin-left: 24rpx;
  64. }
  65. .cm-cover{
  66. z-index: 99;
  67. top: 0;
  68. left: 0;
  69. position: absolute;
  70. width: 100%;
  71. height: 100%;
  72. background:url(https://static.caimei365.com/app/img/icon2/cm_player.png) no-repeat center;
  73. background-size: 40rpx 40rpx;
  74. }
  75. }
  76. }
  77. </style>