success.uvue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <!--
  2. http://localhost:5173/custom/#/pages/xfl/challenge/index?pagetype=challenge_result&distance=1320&status=success&name=天生我材必有用&cal=13500100&duration=3600&accuracy=50&syscount=25
  3. https://oss-mbh5.colormaprun.com/custom/#/pages/xfl/challenge/index?pagetype=challenge_result&distance=1320&status=success&name=天生我材必有用&cal=13500100&duration=3600&accuracy=50&syscount=25
  4. -->
  5. <template>
  6. <view class="body">
  7. <view class="main">
  8. <view class="main-content">
  9. <view class="rank">
  10. <view class="statistic">
  11. <view class="statistic-left">
  12. <image class="statistic-ico" mode="aspectFit" src="../../../static/xfl/challenge/ico1.png">
  13. </image>
  14. <text class="statistic-title">总用时:</text>
  15. </view>
  16. <view class="statistic-right">
  17. <text class="statistic-value">{{durationMin}}</text><text class="statistic-unit">min</text>
  18. </view>
  19. </view>
  20. <view class="statistic">
  21. <view class="statistic-left">
  22. <image class="statistic-ico" mode="aspectFit" src="../../../static/xfl/challenge/ico2.png">
  23. </image>
  24. <text class="statistic-title">总里程:</text>
  25. </view>
  26. <view class="statistic-right">
  27. <text class="statistic-value">{{distanceKm}}</text><text class="statistic-unit">Km</text>
  28. </view>
  29. </view>
  30. <view class="statistic">
  31. <view class="statistic-left">
  32. <image class="statistic-ico" mode="aspectFit" src="../../../static/xfl/challenge/ico3.png">
  33. </image>
  34. <text class="statistic-title">脑力值:</text>
  35. </view>
  36. <view class="statistic-right">
  37. <text class="statistic-value">{{accuracy}}</text><text class="statistic-unit">分</text>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="line"></view>
  42. <text class="name">选手: {{nameSub}}</text>
  43. </view>
  44. <text class="memo">请至活动查看排名详情</text>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import tools from '../../../common/tools';
  50. export default {
  51. data() {
  52. return {
  53. status: "", // success: 挑战成功, ok: 挑战完成(没在规定时间完成,但打了所有点), fail: 挑战结束
  54. name: "", // 用户名
  55. duration: 0, // 总用时,秒
  56. distance: 0, // 总里程,米
  57. cal: 0, // 卡路里,卡 int
  58. accuracy: 0, // 脑力值百分比
  59. syscount: 0 // 点数
  60. }
  61. },
  62. computed: {
  63. nameSub() {
  64. return this.name;
  65. /* const maxlen = 8;
  66. const nameLen = tools.calStrLen(this.name);
  67. console.log('nameLen', nameLen);
  68. if (nameLen <= 6) {
  69. return '选手: ' + this.name;
  70. }
  71. else {
  72. return this.name;
  73. } */
  74. },
  75. durationMin() {
  76. return Math.round(this.duration * 10 / 60) / 10;
  77. },
  78. distanceKm() {
  79. return Math.round(this.distance * 10 / 1000) / 10;
  80. }
  81. },
  82. onLoad(event) { // 类型非必填,可自动推导
  83. console.log('[challenge result] onLoad');
  84. this.status = event["status"] ?? "";
  85. this.name = event["name"] ?? "";
  86. this.duration = event["duration"] ?? 0;
  87. this.distance = event["distance"] ?? 0;
  88. this.cal = event["cal"] ?? 0;
  89. this.accuracy = event["accuracy"] ?? 0;
  90. this.syscount = event["syscount"] ?? 0;
  91. },
  92. methods: {
  93. }
  94. }
  95. </script>
  96. <style>
  97. .body {
  98. display: flex;
  99. width: 100vw;
  100. height: 100vh;
  101. flex-direction: column;
  102. align-items: center;
  103. justify-content: flex-end;
  104. /* background-color: black; */
  105. background-image: url("/static/xfl/challenge/success_bg.jpg");
  106. background-repeat: no-repeat;
  107. background-position-x: center;
  108. background-position-y: bottom;
  109. background-size: cover;
  110. /* background-size: 100% 100%; */
  111. }
  112. .main {
  113. margin-bottom: 430rpx;
  114. align-items: center;
  115. }
  116. .main-content {
  117. width: 80vw;
  118. height: 375rpx;
  119. background-color: #ffffff;
  120. border-radius: 25rpx;
  121. align-items: center;
  122. }
  123. .rank {
  124. width: 500rpx;
  125. /* height: 500rpx; */
  126. margin-top: 20rpx;
  127. }
  128. .statistic {
  129. height: 86rpx;
  130. /* margin-bottom: 16rpx; */
  131. flex-direction: row;
  132. align-items: center;
  133. justify-content: space-between;
  134. }
  135. .statistic-left {
  136. flex-direction: row;
  137. align-items: center;
  138. }
  139. .statistic-right {
  140. flex-direction: row;
  141. align-items: baseline;
  142. }
  143. .statistic-ico {
  144. width: 50rpx;
  145. height: 50rpx;
  146. margin-right: 10rpx;
  147. }
  148. .statistic-title {
  149. font-family: Source Han Sans CN;
  150. font-weight: 500;
  151. font-size: 36rpx;
  152. color: #333333;
  153. }
  154. .statistic-value {
  155. font-family: Source Han Sans CN;
  156. font-size: 50rpx;
  157. color: #333333;
  158. font-weight: bold;
  159. }
  160. .statistic-unit {
  161. font-family: Source Han Sans CN;
  162. font-size: 20rpx;
  163. color: #333333;
  164. padding-left: 10rpx;
  165. }
  166. .line {
  167. width: 500rpx;
  168. height: 3rpx;
  169. margin-top: 12rpx;
  170. background-color: #e6e6e6;
  171. }
  172. .name {
  173. width: 500rpx;
  174. /* 确保文本在一行内显示 */
  175. white-space: nowrap;
  176. /* 超出容器部分的文本隐藏起来 */
  177. overflow: hidden;
  178. /* 使用省略号表示被截断的文本 */
  179. text-overflow: ellipsis;
  180. text-align: center;
  181. margin-top: 18rpx;
  182. font-family: Source Han Sans CN;
  183. font-weight: 500;
  184. font-size: 28rpx;
  185. color: #9e9e9e;
  186. }
  187. .memo {
  188. margin-top: 30rpx;
  189. font-family: Source Han Sans CN;
  190. font-weight: 500;
  191. color: #ffffff;
  192. font-size: 36rpx;
  193. text-align: center;
  194. }
  195. </style>