success.uvue 5.1 KB

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