index.wxml 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. <view class="lucky-box" style="width: {{width}}; height: {{height}}">
  2. <canvas
  3. type="2d"
  4. class="lucky-canvas"
  5. id="slot-machine"
  6. canvas-id="slot-machine"
  7. style="width: {{width}}; height: {{height}}; visibility: {{showCanvas ? 'visible' : 'hidden'}}"
  8. ></canvas>
  9. <image
  10. wx:if="{{luckyImg}}"
  11. src="{{luckyImg}}"
  12. class="lucky-img"
  13. mode="scaleToFill"
  14. bindload="luckyImgLoad"
  15. bindtouchstart="handleClickOfImg"
  16. style="width: {{width}}; height: {{height}}"
  17. ></image>
  18. <view>
  19. <view wx:if="{{isShow}}" wx:for="{{blocks}}" wx:key="index" wx:for-index="index" wx:for-item="block" style="visibility: hidden; height: 0">
  20. <view wx:for="{{block.imgs}}" wx:key="i" wx:for-index="i" wx:for-item="img">
  21. <image src="{{img.src}}" data-name="blocks" data-index="{{index}}" data-i="{{i}}" bindload="imgBindload"></image>
  22. </view>
  23. </view>
  24. </view>
  25. <view>
  26. <view wx:if="{{isShow}}" wx:for="{{prizes}}" wx:key="index" wx:for-index="index" wx:for-item="prize" style="visibility: hidden; height: 0">
  27. <view wx:for="{{prize.imgs}}" wx:key="i" wx:for-index="i" wx:for-item="img">
  28. <image src="{{img.src}}" data-name="prizes" data-index="{{index}}" data-i="{{i}}" bindload="imgBindload"></image>
  29. </view>
  30. </view>
  31. </view>
  32. </view>