exit.uvue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <!--
  2. http://localhost:5173/custom/#/pages/tpl/challenge/index?pagetype=challenge_result&status=fail
  3. https://oss-mbh5.colormaprun.com/custom/#/pages/tpl/challenge/index?pagetype=challenge_result&status=fail
  4. -->
  5. <template>
  6. <view :class="tplStyle">
  7. <view class="body">
  8. <view class="content uni-column">
  9. <view class="top uni-column">
  10. <image v-if="logo.length > 0 && sublogo.length > 0" class="logo-small" mode="aspectFit" :src="logo">
  11. </image>
  12. <image v-if="logo.length > 0 && sublogo.length == 0" class="logo" mode="aspectFit" :src="logo">
  13. </image>
  14. <image v-if="sublogo.length > 0" class="sublogo" mode="aspectFit" :src="sublogo"></image>
  15. <text class="subTitle">{{subTitle}}</text>
  16. <text class="gameName">{{ecName}}</text>
  17. </view>
  18. <view class="main uni-column uni-jcsa">
  19. <view class="fail failBg"></view>
  20. <view class="nostop nostopBg"></view>
  21. </view>
  22. <view class="btnRankList btnRankListBg" @click="btnRankList">点击查看排行榜</view>
  23. </view>
  24. <my-fab></my-fab>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import tools from '/common/tools';
  30. import {
  31. token,
  32. apiCardUrlQuery,
  33. checkResCode
  34. } from '/common/api';
  35. export default {
  36. data() {
  37. return {
  38. token: "",
  39. matchType: 0, // 游戏类型 1 普通活动 2 线下赛 3 线上赛
  40. ecId: 0, // 卡片id
  41. ecName: "", // 卡片名称
  42. tplStyle: "", //模板类型 对应tplConfigs的key
  43. logo: "",
  44. sublogo: "",
  45. subTitle: "",
  46. urlRs: [], // Url集合
  47. }
  48. },
  49. computed: {
  50. },
  51. onLoad(event) { // 类型非必填,可自动推导
  52. this.token = event["token"] ?? token;
  53. this.actId = event["id"] ?? 0;
  54. this.matchType = event["matchType"] ?? 0;
  55. this.tplStyle = event["tplStyle"] ?? "orange";
  56. this.logo = event["logo"] ?? "";
  57. this.sublogo = event["sublogo"] ?? "";
  58. this.subTitle = event["subTitle"] ?? "";
  59. // console.log("event:", JSON.stringify(event));
  60. // uni.showToast({
  61. // title: 'event:' + JSON.stringify(event),
  62. // icon: 'none',
  63. // duration: 10000
  64. // });
  65. this.cardUrlQuery();
  66. },
  67. methods: {
  68. // 根据游戏id查询卡片信息
  69. cardUrlQuery() {
  70. uni.request({
  71. url: apiCardUrlQuery,
  72. header: {
  73. "Content-Type": "application/x-www-form-urlencoded",
  74. "token": this.token,
  75. },
  76. method: "POST",
  77. data: {
  78. actId: this.actId,
  79. matchType: this.matchType
  80. },
  81. success: (res) => {
  82. // console.log("cardUrlQuery", res);
  83. if (res.data.code == 0) {
  84. const data = res.data.data;
  85. this.ecId = data.ecId;
  86. this.ecName = data.ecName;
  87. this.urlRs = data.urlRs;
  88. }
  89. },
  90. fail: (err) => {
  91. console.log("cardUrlQuery err", err);
  92. },
  93. });
  94. },
  95. btnRankList() {
  96. // console.log("urlRs", this.urlRs);
  97. // const rankListUrl = this.urlRs.find(item => item.name === 'rankListUrl');
  98. const rankListUrl = this.urlRs.rankListUrl;
  99. // console.log("rankListUrl", rankListUrl);
  100. if (rankListUrl != null) {
  101. let url = "";
  102. if (rankListUrl.indexOf('?') !== -1) {
  103. url = rankListUrl + '&token=' + this.token + '&id=' + this.ecId;
  104. } else {
  105. url = rankListUrl + '?token=' + this.token + '&id=' + this.ecId;
  106. }
  107. console.log("url", url);
  108. // uni.navigateTo({
  109. // url: url
  110. // });
  111. window.location.href = url;
  112. } else {
  113. uni.showToast({
  114. // title: '网址错误:' + rankListUrl,
  115. title: '请升级APP到最新版才能查看排行榜',
  116. icon: 'none',
  117. duration: 3000
  118. });
  119. }
  120. }
  121. }
  122. }
  123. </script>
  124. <style lang="scss">
  125. .orange {
  126. .body {
  127. background-color: #FF5E00;
  128. }
  129. .subTitle {
  130. color: #FFF45E;
  131. }
  132. .gameName {
  133. color: #FFF45E;
  134. }
  135. .failBg {
  136. background-image: url("/static/tpl/challenge/fail.png");
  137. }
  138. .nostopBg {
  139. background-image: url("/static/tpl/challenge/nostop.png");
  140. }
  141. .btnRankListBg {
  142. background: #FFFFFF;
  143. color: #E05200;
  144. }
  145. }
  146. .body {
  147. width: 100vw;
  148. min-height: 100vh;
  149. }
  150. .content {
  151. width: 750rpx;
  152. min-height: 100vh;
  153. }
  154. .top {
  155. width: 100%;
  156. padding-top: 90rpx;
  157. }
  158. .logo {
  159. width: 105px;
  160. height: 105px;
  161. }
  162. .logo-small {
  163. width: 86px;
  164. height: 86px;
  165. }
  166. .sublogo {
  167. width: 100%;
  168. height: 36px;
  169. margin-top: 10px;
  170. }
  171. .subTitle {
  172. padding-top: 15px;
  173. /* padding-bottom: 30rpx; */
  174. font-family: Source Han Sans CN;
  175. font-weight: 400;
  176. font-size: 23px;
  177. color: #FFEE0B;
  178. // text-shadow: 2.21px 2.21px 0px #640008;
  179. white-space: nowrap;
  180. }
  181. .gameName {
  182. padding-top: 30rpx;
  183. padding-bottom: 30rpx;
  184. font-family: Source Han Sans CN;
  185. font-weight: 500;
  186. font-size: 50rpx;
  187. color: #ffffff;
  188. white-space: nowrap;
  189. }
  190. .main {
  191. width: 100%;
  192. height: 39vh;
  193. // background-color: #b0352e;
  194. }
  195. .fail {
  196. width: 100%;
  197. height: 120rpx;
  198. background-repeat: no-repeat;
  199. background-position: center;
  200. background-size: contain;
  201. }
  202. .nostop {
  203. width: 100%;
  204. height: 100rpx;
  205. background-repeat: no-repeat;
  206. background-position: center;
  207. background-size: contain;
  208. }
  209. .btnRankList {
  210. // opacity: 30%;
  211. width: 194px;
  212. height: 35px;
  213. margin-top: 90rpx;
  214. margin-bottom: 60rpx;
  215. background: #b0352e;
  216. border-radius: 18px;
  217. align-items: center;
  218. color: #ffffff;
  219. font-size: 16px;
  220. line-height: 35px;
  221. }
  222. </style>