cube.wxml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <!-- 魔方图 -->
  2. <template name="cube">
  3. <view class="cube" wx:if="{{data.length}}">
  4. <block wx:for="{{data}}" wx:key="id">
  5. <!-- 1张 -->
  6. <view class='cube-item' wx:if="{{item.type==1}}">
  7. <button class="nav-contact" openType="contact" wx:if="{{item.thumb.linktype[0]==7}}">
  8. <image src="{{item.thumb.cover[0]}}" class="cube-one rounded" mode="widthFix"></image>
  9. </button>
  10. <image wx:else src="{{item.thumb.cover[0]}}" class="cube-one rounded" mode="widthFix" data-index="{{index}}" data-idx="0" bindtap="goCube"></image>
  11. </view>
  12. <!-- 2张 -->
  13. <view class='cube-item' wx:if="{{item.type==2}}">
  14. <button class="cube-left nav-contact" openType="contact" wx:if="{{item.thumb.linktype[0]==7}}">
  15. <i-img iClass="cube-left rounded" loadImage="{{item.thumb.cover[0]}}" width="295" height="365"></i-img>
  16. </button>
  17. <i-img wx:else iClass="cube-left rounded" loadImage="{{item.thumb.cover[0]}}" width="295" height="365" data-index="{{index}}" data-idx="0" bindtap="goCube"></i-img>
  18. <button class="cube-two nav-contact" openType="contact" wx:if="{{item.thumb.linktype[1]==7}}">
  19. <i-img iClass="cube-two rounded" loadImage="{{item.thumb.cover[1]}}" width="450" height="365"></i-img>
  20. </button>
  21. <i-img wx:else iClass="cube-two rounded" loadImage="{{item.thumb.cover[1]}}" width="450" height="365" data-index="{{index}}" data-idx="1" bindtap="goCube"></i-img>
  22. </view>
  23. <!-- 3张 -->
  24. <view class='cube-item' wx:if="{{item.type==3}}">
  25. <button class="nav-contact" openType="contact" wx:if="{{item.thumb.linktype[0]==7}}">
  26. <i-img iClass="cube-left rounded" loadImage="{{item.thumb.cover[0]}}" width="275" height="365"></i-img>
  27. </button>
  28. <i-img wx:else iClass="cube-left rounded" loadImage="{{item.thumb.cover[0]}}" width="275" height="365" data-index="{{index}}" data-idx="0" bindtap="goCube"></i-img>
  29. <view class="i-flex-col i-flex-spb">
  30. <button class="nav-contact" openType="contact" wx:if="{{item.thumb.linktype[1]==7}}">
  31. <i-img iClass="cube-three rounded" loadImage="{{item.thumb.cover[1]}}" width="430" height="180"></i-img>
  32. </button>
  33. <i-img wx:else iClass="cube-three rounded" loadImage="{{item.thumb.cover[1]}}" width="430" height="180" data-index="{{index}}" data-idx="1" bindtap="goCube"></i-img>
  34. <button class="nav-contact" openType="contact" wx:if="{{item.thumb.linktype[2]==7}}">
  35. <i-img iClass="cube-three rounded" loadImage="{{item.thumb.cover[2]}}" width="430" height="180"></i-img>
  36. </button>
  37. <i-img wx:else iClass="cube-three rounded" loadImage="{{item.thumb.cover[2]}}" width="430" height="180" data-index="{{index}}" data-idx="2" bindtap="goCube"></i-img>
  38. </view>
  39. </view>
  40. <!-- 4张 -->
  41. <view class='cube-item' wx:if="{{item.type==4}}">
  42. <button class="nav-contact" openType="contact" wx:if="{{item.thumb.linktype[0]==7}}">
  43. <i-img iClass="cube-left rounded" loadImage="{{item.thumb.cover[0]}}" width="275" height="365"></i-img>
  44. </button>
  45. <i-img wx:else iClass="cube-left rounded" loadImage="{{item.thumb.cover[0]}}" width="275" height="365" data-index="{{index}}" data-idx="0" bindtap="goCube"></i-img>
  46. <view class="i-flex-col i-flex-spb">
  47. <button class="nav-contact" openType="contact" wx:if="{{item.thumb.linktype[1]==7}}">
  48. <i-img iClass="cube-three rounded" loadImage="{{item.thumb.cover[1]}}" width="430" height="180"></i-img>
  49. </button>
  50. <i-img wx:else iClass="cube-three rounded" loadImage="{{item.thumb.cover[1]}}" width="430" height="180" data-index="{{index}}" data-idx="1" bindtap="goCube"></i-img>
  51. <view class="i-flex i-flex-spb w450">
  52. <button class="nav-contact" openType="contact" wx:if="{{item.thumb.linktype[2]==7}}">
  53. <i-img iClass="cube-four rounded" loadImage="{{item.thumb.cover[2]}}" width="212.5" height="180"></i-img>
  54. </button>
  55. <i-img wx:else iClass="cube-four rounded" loadImage="{{item.thumb.cover[2]}}" width="212.5" height="180" data-index="{{index}}" data-idx="2" bindtap="goCube"></i-img>
  56. <button class="nav-contact" openType="contact" wx:if="{{item.thumb.linktype[3]==7}}">
  57. <i-img iClass="cube-four rounded" loadImage="{{item.thumb.cover[3]}}" width="212.5" height="180"></i-img>
  58. </button>
  59. <i-img wx:else iClass="cube-four rounded" loadImage="{{item.thumb.cover[3]}}" width="212.5" height="180" data-index="{{index}}" data-idx="3" bindtap="goCube"></i-img>
  60. </view>
  61. </view>
  62. </view>
  63. <!-- 均分 -->
  64. <!-- 2张 -->
  65. <view class='cube-item' wx:if="{{item.type==5}}">
  66. <block wx:for="{{item.thumb.cover}}" wx:for-index="idx" wx:for-item="imgItem" wx:key="idx">
  67. <button class="cube-w nav-contact" openType="contact" wx:if="{{item.thumb.linktype[idx]==7}}">
  68. <image src="{{imgItem}}" class="w100p" mode="widthFix"></image>
  69. </button>
  70. <image wx:else src="{{imgItem}}" class="cube-w" mode="widthFix" data-index="{{index}}" data-idx="{{idx}}" bindtap="goCube"></image>
  71. </block>
  72. </view>
  73. <!-- 3张 -->
  74. <view class='cube-item' wx:if="{{item.type==6}}">
  75. <block wx:for="{{item.thumb.cover}}" wx:for-index="idx" wx:for-item="imgItem" wx:key="idx">
  76. <button class="cube-w nav-contact" openType="contact" wx:if="{{item.thumb.linktype[idx]==7}}">
  77. <image src="{{imgItem}}" class="w100p" mode="widthFix"></image>
  78. </button>
  79. <image wx:else src="{{imgItem}}" class="cube-w" mode="widthFix" data-index="{{index}}" data-idx="{{idx}}" bindtap="goCube"></image>
  80. </block>
  81. </view>
  82. <!-- 1*4张 -->
  83. <view class='cube-item' wx:if="{{item.type==7}}">
  84. <block wx:for="{{item.thumb.cover}}" wx:for-index="idx" wx:for-item="imgItem" wx:key="idx">
  85. <button class="cube-w nav-contact" openType="contact" wx:if="{{item.thumb.linktype[idx]==7}}">
  86. <image src="{{imgItem}}" class="w100p" mode="widthFix"></image>
  87. </button>
  88. <image wx:else src="{{imgItem}}" class="cube-w" mode="widthFix" data-index="{{index}}" data-idx="{{idx}}" bindtap="goCube"></image>
  89. </block>
  90. </view>
  91. <!-- 2*2 -->
  92. <view class='cube-item two-row' wx:if="{{item.type==8}}">
  93. <block wx:for="{{item.thumb.cover}}" wx:for-index="idx" wx:for-item="imgItem" wx:key="idx">
  94. <button class="cube-w nav-contact" openType="contact" wx:if="{{item.thumb.linktype[idx]==7}}">
  95. <image src="{{imgItem}}" class="w100p" mode="widthFix"></image>
  96. </button>
  97. <image wx:else src="{{imgItem}}" class="cube-w" mode="widthFix" data-index="{{index}}" data-idx="{{idx}}" bindtap="goCube"></image>
  98. </block>
  99. </view>
  100. </block>
  101. </view>
  102. </template>