room.wxml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <import src="../../modal/dialogGeneral.wxml" />
  2. <template name="ranking">
  3. <!-- <view wx:if="{{isSelf}}" class="ranking-self-bg" animation="{{animation.answerRightText}}">
  4. <view class="ranking-self">我</view>
  5. <view class="ranking-num" style="color:white;margin-left: 10rpx;">{{index}}</view>
  6. <view class="ranking-name" style="color:white;">{{name}}</view>
  7. <view class="ranking-count" style="color:white">{{count}}</view>
  8. </view> -->
  9. <view class="ranking" style="{{style}}" hidden="{{isSelf}}">
  10. <image class="ranking-avatar" src="{{a}}"></image>
  11. <view class="ranking-num">{{i}}</view>
  12. <view class="ranking-name">{{n}}</view>
  13. <view class="ranking-count">{{c}}</view>
  14. </view>
  15. </template>
  16. <template name="ranking-row">
  17. <view class="ranking-row">
  18. <template is="ranking" data="{{i: indexL, a: avatarL, n: nameL, c: countL, isSelf: isSelfL, name: name, index: index, count: count}}"/>
  19. <template is="ranking" data="{{i: indexR, a: avatarR, n: nameR, isSelf: isSelfR, name: name, index: index, count: count, c: countR, style:'margin-left: auto;'}}"/>
  20. </view>
  21. </template>
  22. <scroll-view scroll-y>
  23. <!-- 头部 -->
  24. <view class="head-{{adapter.animation}}-{{status}}" style="{{adapter.head}}">
  25. <view class="take-part-view">
  26. <block wx:for="012345" wx:for-index="i" wx:key=" ">
  27. <image class="take-part-avatar" src="{{headUser[i].headImg}}"></image>
  28. </block>
  29. </view>
  30. <view class="take-part">当前有{{numOfPeople}}人参与</view>
  31. </view>
  32. <!-- 音乐 -->
  33. <image id="audio" wx:if="{{status == 0}}" class="audioImg-before" src="{{audio.src}}" bindtap="switchAudio"></image>
  34. <image id="audio" wx:else class="audioImg-after" src="{{audio.src}}" style="{{adapter.audio}}" bindtap="switchAudio"></image>
  35. <!-- 开始前赞助块 -->
  36. <image class="sponsor-bg" src="../../resource/room_sponsor.png" hidden="{{status != 0}}"></image>
  37. <view class="sponsor" hidden="{{status != 0}}">
  38. <image class="sponsor-icon" src="{{sponsor.icon}}"></image>
  39. <view class="sponsor-title">{{roomInfo.title}}</view>
  40. <view class="sponsor-name">{{sponsor.name}}</view>
  41. </view>
  42. <!-- 开始前倒计时 -->
  43. <view class="avatar-bg" hidden="{{status != 0}}">
  44. <view class="avatar-middle"></view>
  45. <image class="avatar" src="{{roomInfo.logo}}"></image>
  46. </view>
  47. <view class="answer" hidden="{{status != 0}}">
  48. <view class="answer-bonus-bg">
  49. <view class="answer-bonus-text-bg">
  50. <view class="answer-bonus-small" style="margin-left: 40rpx;">前</view>
  51. <view class="answer-bonus-big">{{roomInfo.awardUser}}</view>
  52. <view class="answer-bonus-small">名有奖,总奖金</view>
  53. <view class="answer-bonus-big">{{roomInfo.awardFee}}</view>
  54. <view class="answer-bonus-small" style="margin-right: 40rpx;">元</view>
  55. </view>
  56. </view>
  57. <view class="answer-count-down-bg">
  58. <view class="answer-count-down-view">
  59. <view class="answer-count-down-title">抢奖金倒计时</view>
  60. <view class="answer-count-down">
  61. <view class="answer-count-down-n" style="{{countDownStyle}}">{{countDown}}</view>
  62. <view class="answer-count-down-u" style="{{countDownStyle}}">秒</view>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="answer-bottom-view">
  67. <view class="answer-bottom-button-bg" open-type="share" >{{invite.shareButton}}
  68. <button class="answer-bottom-button" open-type="share" hover-class="none" plain="true" style="border-color: rgba(0, 0, 0, 0)"></button>
  69. </view>
  70. <view class="answer-bottom-tips-f">{{invite.shareTips1}}</view>
  71. <view class="answer-bottom-tips-s">{{invite.shareTips2}}</view>
  72. </view>
  73. </view>
  74. <!-- 开始后赞助块 -->
  75. <view class="sponsor-begin" style="{{adapter.sponsor}}" hidden="{{status == 0}}">
  76. <image class="sponsor-icon" src="{{sponsor.icon}}"></image>
  77. <view class="sponsor-begin-name">{{roomInfo.title}} {{sponsor.name}}</view>
  78. </view>
  79. <!-- 开始后答题块 -->
  80. <view class="avatar-begin-bg" style="{{adapter.avatar}}" hidden="{{status == 0}}">
  81. <view class="avatar-begin-middle"></view>
  82. <image class="avatar-begin" src="{{roomInfo.logo}}"></image>
  83. </view>
  84. <view class="answer-begin" style="{{adapter.answer}}" hidden="{{status == 0}}">
  85. <view class="answer-begin-bonus-bg">
  86. <view class="answer-begin-bonus-text-bg" style="{{adapter.bonus}}">
  87. <view class="answer-begin-bonus-small" style="margin-left: 40rpx;">前</view>
  88. <view class="answer-begin-bonus-big">{{roomInfo.awardUser}}</view>
  89. <view class="answer-begin-bonus-small">名有奖,总奖金</view>
  90. <view class="answer-begin-bonus-big">{{roomInfo.awardFee}}</view>
  91. <view class="answer-begin-bonus-small" style="margin-right: 40rpx;">元</view>
  92. </view>
  93. </view>
  94. <!-- 答题前 -->
  95. <image class="answer-begin-question-type-bg" src="../../resource/room_q_type.png" hidden="{{status != 4}}"></image>
  96. <view class="answer-begin-question-type" hidden="{{status != 4}}">{{question.t}}</view>
  97. <view wx:if="{{lastQuestion}}" class="answer-begin-last" hidden="{{status != 4}}">{{question.n}}</view>
  98. <view wx:else class="answer-begin-num" hidden="{{status != 4}}">{{question.n}}</view>
  99. <image wx:if="{{lastQuestion}}" class="answer-begin-double-score" src="../../resource/room_double_score.png" hidden="{{status != 4}}"></image>
  100. <!-- 答题 -->
  101. <view class="answer-num" style="{{adapter.num}}" hidden="{{status != 1}}">第 {{questionNum}}/{{roomInfo.questionC}} 题</view>
  102. <view class="answer-begin-count-down-bg">
  103. <view class="answer-begin-count-down" hidden="{{status != 1}}">
  104. <view class="answer-begin-count-down-text">{{answer.tips}}:{{countDown}}秒</view>
  105. </view>
  106. </view>
  107. <view class="answer-options-bg" hidden="{{status != 1}}">
  108. <view class="answer-question-bg">
  109. <view class="answer-question">{{question.q}}</view>
  110. </view>
  111. <view class="answer-options-row-top">
  112. <view class="answer-options-left-{{optionsStyle[0]}}" id="0" bindtap="{{optionsStyle[0] == 'm' ? '' : 'answer'}}">
  113. <view class="answer-options-{{optionsStyle[0]}}" id="0" catchtap="{{optionsStyle[0] == 'm' ? '' : 'answer'}}">{{question.o[0]}}</view>
  114. </view>
  115. <view class="answer-options-right-{{optionsStyle[1]}}" id="1" bindtap="{{optionsStyle[1] == 'm' ? '' : 'answer'}}">
  116. <view class="answer-options-{{optionsStyle[1]}}" id="1" catchtap="{{optionsStyle[1] == 'm' ? '' : 'answer'}}">{{question.o[1]}}</view>
  117. </view>
  118. </view>
  119. <view class="answer-options-row-bottom">
  120. <view class="answer-options-left-{{optionsStyle[2]}}" id="2" bindtap="{{optionsStyle[2] == 'm' ? '' : 'answer'}}">
  121. <view class="answer-options-{{optionsStyle[2]}}" id="2" catchtap="{{optionsStyle[2] == 'm' ? '' : 'answer'}}">{{question.o[2]}}</view>
  122. </view>
  123. <view class="answer-options-right-{{optionsStyle[3]}}" id="3" bindtap="{{optionsStyle[3] == 'm' ? '' : 'answer'}}">
  124. <view class="answer-options-{{optionsStyle[3]}}" id="3" catchtap="{{optionsStyle[3] == 'm' ? '' : 'answer'}}">{{question.o[3]}}</view>
  125. </view>
  126. </view>
  127. </view>
  128. <!-- 答题结束 -->
  129. <view class="result-ranking" style="{{adapter.resultRanking}}" hidden="{{status != 2 && status != 3}}">{{result.tips}}</view>
  130. <view class="result-middle-bg" style="{{adapter.resultMiddle}}" hidden="{{status != 2 && status != 3}}">
  131. <view class="result-bonus-bg" hidden="{{status != 2}}">
  132. <view class="result-bonus">
  133. <view class="result-bonus-small">奖金</view>
  134. <view class="result-bonus-big" animation="{{rollAnimation}}">{{result.bonus}}</view>
  135. <view class="result-bonus-small">元</view>
  136. </view>
  137. </view>
  138. <view class="result-tips" hidden="{{status != 2}}">已存入你的奖金账户</view>
  139. <image class="result-false-img" src="../../resource/brain_doctor.png" mode="aspectFit" hidden="{{status != 3}}"></image>
  140. </view>
  141. <view class="result-share" style="{{adapter.resultShare}}" hidden="{{status != 2 && status != 3}}">{{result.shareButton}}
  142. <button wx:if="{{result.openType == ''}}" class="result-share-button" bindtap="createImage" hover-class="none" plain="true" style="border-color: rgba(0, 0, 0, 0)"></button>
  143. <button wx:else class="result-share-button" open-type="{{result.openType}}" hover-class="none" plain="true" style="border-color: rgba(0, 0, 0, 0)"></button>
  144. </view>
  145. <view class="result-share-tips" hidden="{{status != 2 && status != 3}}">{{result.shareTips}}</view>
  146. <!-- 分享成功 -->
  147. <image class="result-share-bg" src="../../resource/room_bg.png" mode="aspectFit" hidden="{{share.s == 0}}">
  148. <block wx:if="{{share.s == 2}}">
  149. <image class="result-share-double-bg" src="../../resource/room_double_bonus.png"></image>
  150. <view class="result-share-double">+{{share.bonus}}</view>
  151. </block>
  152. <block wx:elif="{{share.s == 1}}">
  153. <image class="result-share-add-bg" src="../../resource/room_add_cell.png"></image>
  154. <view class="result-add-cell-bg">
  155. <view class="result-add-cell">+{{tools.addCell(share.cell)}}</view>
  156. <view class="result-add-cell-unit">{{tools.addCellUnit(share.cell)}}</view>
  157. </view>
  158. </block>
  159. </image>
  160. <!-- 排行榜 -->
  161. <view class="ranking-bg">
  162. <template is="ranking-row" wx:for="{{[0, 1, 2, 3, 4]}}" wx:for-index="i" wx:key=" " data="{{...ranking[i]}}"/>
  163. <view class="ranking-self-view">
  164. <view class="ranking-self-bg" animation="{{animation.selfRanking}}">
  165. <view class="ranking-self">我</view>
  166. <view class="ranking-num" style="color:white;margin-left: 10rpx;">{{selfRanking.rank}}</view>
  167. <view class="ranking-name" style="color:white;">{{selfRanking.name}}</view>
  168. <view class="ranking-count" style="color:white">{{selfRanking.count}}</view>
  169. </view>
  170. </view>
  171. </view>
  172. </view>
  173. <!-- 动画 -->
  174. <!-- 答对 -->
  175. <view class="animation-{{adapter.animation}}" style="{{animation.backgroundStyle}}" hidden="{{animation.status == 0}}">
  176. <!-- <view class="animation-bg-{{adapter.animation}}" animation="{{animation.background}}"></view> -->
  177. <image class="animation-answer-bg" src="../../resource/room_bg.png" mode="aspectFit" animation="{{animation.answerBg}}"></image>
  178. <view class="animation-answer-right-bg">
  179. <image class="animation-answer" src="../../resource/room_right_bg.png" mode="aspectFit" animation="{{animation.answerRightBg}}"></image>
  180. </view>
  181. <view class="animation-answer-star-bg">
  182. <image class="animation-answer" src="../../resource/room_star.png" mode="aspectFit" animation="{{animation.answerRightStar}}"></image>
  183. </view>
  184. <image class="animation-answer-hook" src="../../resource/room_right.png" mode="aspectFit" animation="{{animation.answerRightHook}}" hidden="{{animation.status != 1}}"></image>
  185. <view class="animation-answer-count" animation="{{animation.answerRightText}}" hidden="{{animation.status != 1}}">+{{answer.integral}}积分</view>
  186. </view>
  187. <!-- 答错 -->
  188. <image class="animation-answer-false-bg-{{adapter.animation}}" src="../../resource/room_bg.png" mode="aspectFit" hidden="{{animation.status != 2}}"></image>
  189. <image class="animation-answer-false-{{adapter.animation}}" src="../../resource/room_wrong.png" mode="aspectFit" hidden="{{animation.status != 2}}"></image>
  190. <!-- 排错卡 -->
  191. <view class="misarrange" bindtap="misarrangeAction" hidden="{{misarrange.hidden || status==0}}" style="{{adapter.misarrange}}">
  192. <image src="../../resource/{{misarrange.used ? 'ic_exclude_invalid' : 'ic_exclude_valid'}}.png"></image>
  193. <text style="color:{{misarrange.used ? '#999999' : '#333333'}};">排错卡</text>
  194. </view>
  195. </scroll-view>
  196. <template is="dialogGeneral" data="{{...dialogGeneral}}" />
  197. <wxs module="tools">
  198. var addCell = function(cell) {
  199. if (cell >= 10000) {
  200. return cell / 10000
  201. }
  202. return cell
  203. }
  204. var addCellUnit = function(cell) {
  205. if (cell >= 10000) {
  206. return '亿'
  207. }
  208. return '万'
  209. }
  210. module.exports.addCell = addCell
  211. module.exports.addCellUnit = addCellUnit
  212. </wxs>