index.wxml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <!-- 骰子模版视图 -->
  2. <template name="first">
  3. <view class="first face">
  4. <span class="pip"></span>
  5. </view>
  6. </template>
  7. <template name="second">
  8. <view class="second face">
  9. <span class="pip"></span>
  10. <span class="pip"></span>
  11. </view>
  12. </template>
  13. <template name="third">
  14. <view class="third face">
  15. <span class="pip"></span>
  16. <span class="pip third-item-center"></span>
  17. <span class="pip"></span>
  18. </view>
  19. </template>
  20. <template name="fourth">
  21. <view class="fourth face">
  22. <!--按照列排列两个点-->
  23. <view class="column">
  24. <span class="pip"></span>
  25. <span class="pip"></span>
  26. </view>
  27. <!--按照列排列另外两个点-->
  28. <view class="column">
  29. <span class="pip"></span>
  30. <span class="pip"></span>
  31. </view>
  32. </view>
  33. </template>
  34. <template name="fifth">
  35. <view class="fifth face">
  36. <!--按照列排列两个点-->
  37. <view class="column">
  38. <span class="pip"></span>
  39. <span class="pip"></span>
  40. </view>
  41. <!--按照列排列中间一个点-->
  42. <view class="column fifth-column-center">
  43. <span class="pip"></span>
  44. </view>
  45. <!--按照列排列另外两个点-->
  46. <view class="column">
  47. <span class="pip"></span>
  48. <span class="pip"></span>
  49. </view>
  50. </view>
  51. </template>
  52. <template name="sixth">
  53. <view class="sixth face">
  54. <!--按照列排列三个点-->
  55. <view class="column">
  56. <span class="pip"></span>
  57. <span class="pip"></span>
  58. <span class="pip"></span>
  59. </view>
  60. <!--按照列排列另外三个点-->
  61. <view class="column">
  62. <span class="pip"></span>
  63. <span class="pip"></span>
  64. <span class="pip"></span>
  65. </view>
  66. </view>
  67. </template>
  68. <!-- 展示视图 -->
  69. <view class="flex-container">
  70. <view class="result" style="visibility:{{isShow}}">
  71. <text>恭喜,您摇到的数字是:{{total}}</text>
  72. </view>
  73. <view class="dice-box">
  74. <block>
  75. <template is="{{dice[num1]}}"></template>
  76. </block>
  77. </view>
  78. <view class="second-row">
  79. <view class="dice-box">
  80. <block>
  81. <template is="{{dice[num2]}}"></template>
  82. </block>
  83. </view>
  84. <view class="dice-box">
  85. <block>
  86. <template is="{{dice[num3]}}"></template>
  87. </block>
  88. </view>
  89. </view>
  90. <view class="button-box">
  91. <button type="{{buttonType}}" bindtap="shakeClick" >{{buttonValue}}</button>
  92. </view>
  93. </view>