success.uvue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <!--
  2. http://localhost:5173/custom/#/pages/shanda/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/shanda/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="content">
  8. <view class="top">
  9. <image class="logo" mode="aspectFit" src="/static/shanda/logo.webp"></image>
  10. <text class="gameName">山大24级新生校园定向赛</text>
  11. </view>
  12. <view class="main">
  13. <view class="main-content">
  14. <view class="rank">
  15. <view class="statistic">
  16. <text class="statistic-title">打点数:</text>
  17. <view class="statistic-right">
  18. <text class="statistic-value">{{syscount}}</text><text class="statistic-unit">个</text>
  19. </view>
  20. </view>
  21. <view class="statistic">
  22. <text class="statistic-title">里程:</text>
  23. <view class="statistic-right">
  24. <text class="statistic-value">{{distanceKm}}</text><text
  25. class="statistic-unit">Km</text>
  26. </view>
  27. </view>
  28. <view class="statistic">
  29. <text class="statistic-title">校园文化:</text>
  30. <view class="statistic-right">
  31. <text class="statistic-value">{{accuracy}}</text><text class="statistic-unit">%</text>
  32. </view>
  33. </view>
  34. <view class="statistic">
  35. <text class="statistic-title">总用时:</text>
  36. <view class="statistic-right">
  37. <text class="statistic-value">{{durationMin}}</text><text
  38. class="statistic-unit">min</text>
  39. </view>
  40. </view>
  41. </view>
  42. <text class="name">{{nameSub}}</text>
  43. </view>
  44. </view>
  45. <view class="btnRankList" @click="btnRankList">点击查看排行榜</view>
  46. </view>
  47. <my-fab></my-fab>
  48. </view>
  49. </template>
  50. <script>
  51. import tools from '../../../common/tools';
  52. export default {
  53. data() {
  54. return {
  55. status: "", // success: 挑战成功, ok: 挑战完成(没在规定时间完成,但打了所有点), fail: 挑战结束
  56. name: "", // 用户名
  57. duration: 0, // 总用时,秒
  58. distance: 0, // 总里程,米
  59. cal: 0, // 卡路里,卡 int
  60. accuracy: 0, // 脑力值百分比
  61. syscount: 0 // 点数
  62. }
  63. },
  64. computed: {
  65. nameSub() {
  66. // const maxlen = 8;
  67. const nameLen = tools.calStrLen(this.name);
  68. console.log('nameLen', nameLen);
  69. if (nameLen <= 10) {
  70. return '选手: ' + this.name;
  71. }
  72. // else if (nameLen >= maxlen) {
  73. // return this.name.substring(0,maxlen-1) + '...';
  74. // }
  75. else {
  76. return this.name;
  77. }
  78. },
  79. durationMin() {
  80. return Math.round(this.duration * 10 / 60) / 10;
  81. },
  82. distanceKm() {
  83. return Math.round(this.distance * 10 / 1000) / 10;
  84. }
  85. },
  86. onLoad(event) { // 类型非必填,可自动推导
  87. console.log('[challenge result] onLoad');
  88. this.status = event["status"] ?? "";
  89. this.name = event["name"] ?? "";
  90. this.duration = event["duration"] ?? 0;
  91. this.distance = event["distance"] ?? 0;
  92. this.cal = event["cal"] ?? 0;
  93. this.accuracy = event["accuracy"] ?? 0;
  94. this.syscount = event["syscount"] ?? 0;
  95. },
  96. methods: {
  97. btnRankList() {
  98. // uni.navigateTo({
  99. // url: '/pages/bm/style1/rankList?' + this.queryString
  100. // });
  101. }
  102. }
  103. }
  104. </script>
  105. <style>
  106. .body {
  107. background-color: #8d2117;
  108. /* background-image: url("/static/shanda/challenge/success_bg.webp");
  109. background-repeat: no-repeat;
  110. background-position-x: center;
  111. background-position-y: top;
  112. background-size: cover; */
  113. }
  114. .content {
  115. width: 750rpx;
  116. min-height: 100vh;
  117. /* margin: 0 auto; */
  118. display: flex;
  119. flex-direction: column;
  120. align-items: center;
  121. justify-content: space-around;
  122. }
  123. .top {
  124. width: 100%;
  125. /* height: 600rpx; */
  126. padding-top: 100rpx;
  127. flex-direction: column;
  128. align-items: center;
  129. justify-content: center;
  130. }
  131. .logo {
  132. width: 210rpx;
  133. height: 210rpx;
  134. }
  135. .gameName {
  136. padding-top: 30rpx;
  137. padding-bottom: 30rpx;
  138. font-family: Source Han Sans CN;
  139. font-weight: 500;
  140. font-size: 50rpx;
  141. color: #ffffff;
  142. }
  143. .main {
  144. width: 100%;
  145. flex-direction: column;
  146. justify-content: flex-start;
  147. align-items: center;
  148. }
  149. .main-content {
  150. /* margin-top: 25rpx; */
  151. /* margin-bottom: 60rpx; */
  152. width: 100%;
  153. height: 830rpx;
  154. /* background-image: url("/static/shanda/challenge/rank_bg.webp"); */
  155. background-image: url("/static/shanda/challenge/rank_bg2.png");
  156. background-repeat: no-repeat;
  157. background-position-x: center;
  158. background-position-y: top;
  159. background-size: contain;
  160. }
  161. .rank {
  162. width: 380rpx;
  163. /* height: 500rpx; */
  164. margin-left: 180rpx;
  165. margin-top: 140rpx;
  166. }
  167. .name {
  168. width: 330rpx;
  169. /* 确保文本在一行内显示 */
  170. white-space: nowrap;
  171. /* 超出容器部分的文本隐藏起来 */
  172. overflow: hidden;
  173. /* 使用省略号表示被截断的文本 */
  174. /* text-overflow: ellipsis; */
  175. text-align: center;
  176. margin-left: 250rpx;
  177. margin-top: 30rpx;
  178. font-family: Source Han Sans CN;
  179. font-weight: 500;
  180. font-size: 36rpx;
  181. color: #000000;
  182. }
  183. .statistic {
  184. height: 112rpx;
  185. margin-bottom: 16rpx;
  186. flex-direction: row;
  187. align-items: center;
  188. justify-content: space-between;
  189. }
  190. .statistic-right {
  191. flex-direction: row;
  192. align-items: baseline;
  193. }
  194. .statistic-title {
  195. font-family: Source Han Sans CN;
  196. font-weight: 500;
  197. font-size: 46rpx;
  198. color: #ffffff;
  199. }
  200. .statistic-value {
  201. font-family: Source Han Sans CN;
  202. font-size: 56rpx;
  203. color: #ffffff;
  204. font-weight: bold;
  205. }
  206. .statistic-unit {
  207. font-family: Source Han Sans CN;
  208. font-size: 40rpx;
  209. color: #ffffff;
  210. padding-left: 10rpx;
  211. }
  212. .btnRankList {
  213. /* opacity: 30%; */
  214. width: 194px;
  215. height: 35px;
  216. margin-bottom: 60rpx;
  217. background: #b0352e;
  218. border-radius: 18px;
  219. align-items: center;
  220. color: #ffffff;
  221. font-size: 16px;
  222. line-height: 32px;
  223. }
  224. </style>