templateC.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <scroll-view scroll-x="true" class="picture">
  3. <view class="section" v-for="(item , index) in productList" @click="navigaitionTo(item)">
  4. <image :src="item.appletsImage" mode="heightFix"></image>
  5. </view>
  6. </scroll-view>
  7. </template>
  8. <script>
  9. import caimeiApi from '@/common/config/caimeiApi.js'
  10. export default{
  11. data(){
  12. return{
  13. productList:[]
  14. }
  15. },
  16. props:{
  17. pageData: {
  18. type: Object
  19. },
  20. userIdentity: {
  21. type: Number
  22. }
  23. },
  24. created() {
  25. this.initData(this.pageData);
  26. },
  27. methods:{
  28. initData(data){
  29. this.productList = data.floorImageList;
  30. },
  31. navigaitionTo(item){
  32. if (item.adsImage === '' && item.linkType === -1) {
  33. return
  34. }else if(item.linkType === -1){
  35. uni.navigateTo({
  36. url:`/h5/pages/activity/activity-detail?adsImage=${item.adsImage}&title=${item.name}`
  37. })
  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. display: inline-block;
  52. margin-right: 24rpx;
  53. width: 310rpx;
  54. height: 240rpx;
  55. overflow: hidden;
  56. border-radius: 16rpx;
  57. image{
  58. width: 310rpx;
  59. height: 240rpx;
  60. }
  61. &:first-child{
  62. margin-left: 24rpx;
  63. }
  64. }
  65. }
  66. </style>