rankOverview.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242
  1. <!--
  2. [报名] 样式3 - 排名总览
  3. http://localhost:5173/card/#/pages/bm/style4/rankOverview
  4. https://oss-mbh5.colormaprun.com/card/#/pages/bm/style4/rankOverview
  5. -->
  6. <template>
  7. <view class="body">
  8. <view v-if="pageReady" class="content uni-column">
  9. <view class="uni-column" :class="cssTop">
  10. <my-topbar :mcName="mcName" :class="cssTopbarColor"
  11. @btnBackClick="btnBack" @btnInfoClick="btnInfo"></my-topbar>
  12. <view class="topcontent uni-column uni-jcsa">
  13. <view class="logo"></view>
  14. <text v-if="configParam.subTitle.length > 0" class="top-acttime">{{configParam.subTitle}}</text>
  15. <text v-else class="top-acttime">{{fmtMcTime2(beginSecond, endSecond)}}</text>
  16. </view>
  17. </view>
  18. <view v-if="configParam.midType == 0" class="midType0 uni-column">
  19. <view class="mid-0 uni-row uni-jcc">
  20. <view class="mid-0-select">
  21. <e-select v-model="ocaId" :options="mapList" :search="false" :inputClick="true"
  22. maxHeight="300px" :clearable="false" @change="eSelectChange"></e-select>
  23. </view>
  24. <text v-if="popupHelpList.length > 0" class="mid-0-help" @click="btnHelp">帮助</text>
  25. </view>
  26. <view class="midType0-mid-1 uni-row uni-jcsa">
  27. <view class="uni-row">
  28. <image v-if="popupWarnList.length > 0" class="mid-1-yellowCard" mode="aspectFit"
  29. @click="btnWarn" src="/static/common/card_yellow.gif"></image>
  30. <text class="mid-1-text">{{nickName}}</text>
  31. </view>
  32. <text class="mid-1-text">{{coiName}}</text>
  33. <text class="mid-1-text" style="color: #aaaaaa;" v-if="mcState==1 && allowMcSignUp"
  34. @click="btnReGroup">修改</text>
  35. </view>
  36. <view class="mid-2 uni-row uni-jcsa">
  37. <view class="uni-column">
  38. <text class="mid-2-value">{{regionTotalNum}}</text>
  39. <text class="mid-2-text">总场次</text>
  40. </view>
  41. <view class="mid-line"></view>
  42. <view class="uni-column">
  43. <text class="mid-2-value">{{regionTotalCp}}</text>
  44. <text class="mid-2-text">总打点数</text>
  45. </view>
  46. <view class="mid-line"></view>
  47. <view class="uni-column">
  48. <text class="mid-2-value">{{regionTotalCpRankNum}}</text>
  49. <text class="mid-2-text">个人排名</text>
  50. </view>
  51. </view>
  52. </view>
  53. <view v-if="configParam.midType == 1" class="midType1 uni-column">
  54. <view class="mid-0 uni-row uni-jcc">
  55. <view class="mid-0-select">
  56. <e-select v-model="ocaId" :options="mapList" :search="false" :inputClick="true"
  57. maxHeight="300px" :clearable="false" @change="eSelectChange"></e-select>
  58. </view>
  59. <view class="mid-0-right uni-row uni-jcsa">
  60. <text class="" style="" v-if="mcState==1 && allowMcSignUp"
  61. @click="btnReGroup">修改</text>
  62. <text v-if="popupHelpList.length > 0" class="" @click="btnHelp">帮助</text>
  63. </view>
  64. </view>
  65. <view class="midType1-mid-1 uni-row uni-jcsb">
  66. <view class="uni-row">
  67. <image v-if="popupWarnList.length > 0" class="mid-1-yellowCard" mode="aspectFit"
  68. @click="btnWarn" src="/static/common/card_yellow.gif"></image>
  69. <text class="mid-1-name">{{nickName}}</text>
  70. </view>
  71. <text class="mid-1-name">{{coiName}}</text>
  72. <text class="uni-nowrap">总场次:{{regionTotalNum}}</text>
  73. </view>
  74. <view class="mid-2 uni-row uni-jcsa">
  75. <view class="uni-column">
  76. <text class="mid-2-value" style="color: #ff0045;">{{regionTotalSysPoint}}</text>
  77. <text class="mid-2-text">百味豆(个)</text>
  78. </view>
  79. <view class="mid-line"></view>
  80. <view class="uni-column">
  81. <text class="mid-2-value">{{fmtDistanct(regionTotalDictance)}}</text>
  82. <text class="mid-2-text">总里程km</text>
  83. </view>
  84. <view class="mid-line"></view>
  85. <view class="uni-column">
  86. <text class="mid-2-value">{{regionTotalCp}}</text>
  87. <text class="mid-2-text">打点数(个)</text>
  88. </view>
  89. <view class="mid-line"></view>
  90. <view class="uni-column">
  91. <text class="mid-2-value">{{fmtPace(regionFastPace)}}</text>
  92. <text class="mid-2-text">最快配速</text>
  93. </view>
  94. </view>
  95. </view>
  96. <view class="main uni-column">
  97. <text class="main-title">选择比赛路线</text>
  98. <my-pathList :style="pathListStyle.style" :pathList="pathList"
  99. :selectedPath="ocaId" :mcState="mcState" :showLine="pathListStyle.showLine"
  100. @onPathClick="onPathClick"></my-pathList>
  101. </view>
  102. <view class="bottom uni-column">
  103. <button class="btnStartGame" @click="btnStartGame">开始比赛</button>
  104. </view>
  105. <my-popup ref="mypopup" :config="popupRuleConfig" :dataList="popupDataList" :acttime="acttime"></my-popup>
  106. <my-popup ref="mypopupHelp" :config="popupHelpConfig" :dataList="popupHelpList"></my-popup>
  107. <my-popup ref="mypopupWarn" :config="popupWarnConfig" :dataList="popupWarnList"></my-popup>
  108. <!-- <my-popup-map ref="mypopupmap" :point="navPoint"></my-popup-map> -->
  109. </view>
  110. </view>
  111. </template>
  112. <script>
  113. import tools from '/common/tools';
  114. import {
  115. defaultPopUpDataList,
  116. defaultPopUpDataList2
  117. } from '/common/define';
  118. import {
  119. token,
  120. apiMapListQuery,
  121. apiMatchRsDetailQuery,
  122. apiCardConfigQuery,
  123. apiIsAllowMcSignUp,
  124. apiWarnMessageQuery,
  125. checkResCode
  126. } from '/common/api';
  127. export default {
  128. data() {
  129. return {
  130. pageReady: false,
  131. // audioSrc: "/static/audio/2.mp3",
  132. // audioSrc: "https://oss-mbh5.colormaprun.com/card/static/audio/2.mp3",
  133. // audioSrc: "http://t-oss-mbh5.colormaprun.com/card/static/audio/2.mp3",
  134. pageName: "rankOverview",
  135. firstEnterKey: 'firstEnter-bm-style4',
  136. rankKey: "rank-bm-style4",
  137. mapKey: "rank-bm-style4-map",
  138. queryObj: {},
  139. queryString: "",
  140. token: "",
  141. ecId: 0, // 卡片id
  142. mcId: 0, // 赛事id
  143. mcType: 0, // 赛事类型 1 普通活动 2 线下赛 3 线上赛
  144. mcName: "", // 赛事名称
  145. coiName: "", // 已报名单位名称
  146. acttime: "", // 活动时间
  147. beginSecond: null, // 活动或赛事开始时间戳,单位秒
  148. endSecond: null, // 活动或赛事结束时间戳,单位秒
  149. ocaId: 0, // 关联id,带入到App活动详情页面
  150. nickName: "", // 昵称
  151. totalNum: null, // 总场次
  152. totalDistanct: null, // 总距离,单位米
  153. totalDistanctRankNum: null, // 总距离排名
  154. totalCp: null, // 总打点数
  155. totalCpRankNum: null, // 总打点数排名
  156. totalSysPoint: null, // 总百味豆
  157. totalSysPointRankNum: null, // 总百味豆排名
  158. fastPace: null, // 个人最快配速
  159. fastPaceRankNum: null, // 个人最快配速排名
  160. regionTotalNum: null, // 地图内总场次
  161. regionTotalCp: null, // 地图内打点数
  162. regionTotalCpRankNum: null, // 地图内个人打点排名
  163. regionTotalSysPoint: null, // 地图内积分(百味豆)
  164. regionTotalDictance: null, // 地图内里程(单位米)
  165. regionFastPace: null, // 地图内最快配速
  166. ocaRs: [], // 卡片对应活动集合
  167. mapList: [], // 地图列表
  168. interval: null,
  169. mcState: 0, // 赛事/活动状态 0: 未开始 1: 进行中 2: 已结束
  170. allowMcSignUp: false, // 是否允许重新分组
  171. cssTop: "",
  172. cssTopbarColor: "",
  173. pathList: {},
  174. pathListStyle: {},
  175. popupRuleConfig: {}, // 规则弹窗配置
  176. popupHelpConfig: {}, // 帮助弹窗配置
  177. // popupWarnConfig: {}, // 警告弹窗配置
  178. popupWarnConfig: {
  179. "height": "550px"
  180. },
  181. popupDataList: [],
  182. popupHelpList: [],
  183. popupWarnList: [],
  184. navPoint: {},
  185. configParam: {
  186. subTitle: "",
  187. midType: 0
  188. },
  189. }
  190. },
  191. computed: {
  192. pathListLen() {
  193. return Object.keys(this.pathList).length;
  194. }
  195. },
  196. onLoad(query) { // 类型非必填,可自动推导
  197. // uni.showLoading({
  198. // title: '加载中'
  199. // });
  200. // console.log("query:", query);
  201. this.queryObj = query;
  202. this.queryString = tools.objectToQueryString(this.queryObj);
  203. // console.log(queryString);
  204. this.token = query["token"] ?? token;
  205. this.ecId = query["id"] ?? 0;
  206. this.firstEnterKey += "-" + this.ecId;
  207. console.log("firstEnterKey:", this.firstEnterKey);
  208. this.rankKey += "-" + this.ecId;
  209. console.log("rankKey:", this.rankKey);
  210. this.mapKey += "-" + this.ecId;
  211. console.log("mapKey:", this.mapKey);
  212. tools.removeCssCode();
  213. const mapValue = uni.getStorageSync(this.mapKey);
  214. if (mapValue) {
  215. console.log("mapValue:", mapValue);
  216. this.ocaId = mapValue;
  217. }
  218. this.getCardConfigQuery();
  219. },
  220. // 页面初次渲染完成,此时组件已挂载完成,DOM 树($el)已可用
  221. onReady() {
  222. // this.dealFirstEnter();
  223. // this.playMusic();
  224. },
  225. onShow() {
  226. // uni.showToast({
  227. // icon: "none",
  228. // title: "[rankOverview] onShow"
  229. // })
  230. // if (this.$audio.audioStatus == 2 && this.$audio.audioSrc == this.audioSrc) {
  231. // this.$audio.play();
  232. // }
  233. },
  234. onUnload() {
  235. this.clear();
  236. },
  237. methods: {
  238. playMusic() {
  239. return;
  240. // uni.showToast({
  241. // title: 'playMusic',
  242. // icon: 'none',
  243. // duration: 2000
  244. // });
  245. // if (this.$audio.audioStatus == 0 || this.$audio.audioSrc != this.audioSrc) {
  246. // this.$audio.playAudio(this.audioSrc);
  247. // }
  248. },
  249. dealNotice(rank) {
  250. // console.log('[dealFirstEnter]');
  251. let that = this;
  252. uni.getStorage({
  253. key: that.rankKey,
  254. success: (res) => {
  255. console.log('[getStorage]', that.rankKey, res.data);
  256. const oldRank = res.data;
  257. if (oldRank != rank) {
  258. // that.notice = true;
  259. that.setRankValue(rank);
  260. }
  261. },
  262. fail: (e) => {
  263. console.log('[getStorage] fail', that.rankKey, e);
  264. // that.notice = false;
  265. that.setRankValue(rank);
  266. },
  267. })
  268. },
  269. setRankValue(data) {
  270. let that = this;
  271. uni.setStorage({
  272. key: that.rankKey,
  273. data: data,
  274. success: () => {
  275. console.log('[setStorage] success', that.rankKey, data);
  276. },
  277. fail: (e) => {
  278. console.log('[setStorage] fail', that.rankKey, e);
  279. },
  280. })
  281. },
  282. dealFirstEnter() {
  283. // console.log('[dealFirstEnter]');
  284. let that = this;
  285. uni.getStorage({
  286. key: that.firstEnterKey,
  287. success: (res) => {
  288. console.log('[getStorage]', that.firstEnterKey, res.data);
  289. },
  290. fail: (e) => {
  291. console.log('[getStorage] fail', that.firstEnterKey, e);
  292. that.btnInfo();
  293. that.setFirstEnterValue(true);
  294. },
  295. })
  296. },
  297. setFirstEnterValue(data) {
  298. let that = this;
  299. uni.setStorage({
  300. key: that.firstEnterKey,
  301. data: data,
  302. success: () => {
  303. console.log('[setStorage] success', that.firstEnterKey, data);
  304. },
  305. fail: (e) => {
  306. console.log('[setStorage] fail', that.firstEnterKey, e);
  307. },
  308. })
  309. },
  310. clear() {
  311. if (this.interval != null) {
  312. clearInterval(this.interval);
  313. this.interval = null;
  314. }
  315. },
  316. loadConfig(config) {
  317. // console.log("config", config);
  318. // 加载CSS样式
  319. const css = config.css;
  320. if (css != undefined && css.length > 0) {
  321. tools.loadCssCode(css);
  322. if (css.indexOf(".top{") >= 0) {
  323. this.cssTop = "top";
  324. }
  325. if (css.indexOf(".topbar-color{") >= 0) {
  326. this.cssTopbarColor = "topbar-color";
  327. }
  328. }
  329. if (this.cssTop == "") {
  330. this.cssTop = "top-default";
  331. }
  332. if (this.cssTopbarColor == "") {
  333. this.cssTopbarColor = "topbar-color-default";
  334. }
  335. // console.log("[loadConfig] cssTop:", this.cssTop);
  336. // console.log("[loadConfig] cssTopbarColor:", this.cssTopbarColor);
  337. // 加载比赛路线数据
  338. const pathList = config.pathList;
  339. // console.log("[loadConfig] pathList:", pathList);
  340. if (pathList != undefined) {
  341. this.pathList = pathList;
  342. }
  343. // 加载比赛路线样式
  344. const pathListStyle = config.pathListStyle;
  345. // console.log("[loadConfig] pathList:", pathList);
  346. if (pathListStyle != undefined) {
  347. this.pathListStyle = pathListStyle;
  348. }
  349. // 加载规则弹窗配置
  350. const popupRuleConfig = config.popupRuleConfig;
  351. if (popupRuleConfig != undefined) {
  352. this.popupRuleConfig = popupRuleConfig;
  353. }
  354. // console.log("[loadConfig] popupRuleConfig:", this.popupRuleConfig);
  355. // 加载帮助弹窗配置
  356. const popupHelpConfig = config.popupHelpConfig;
  357. if (popupHelpConfig != undefined) {
  358. this.popupHelpConfig = popupHelpConfig;
  359. }
  360. // console.log("[loadConfig] popupHelpConfig:", this.popupHelpConfig);
  361. // 加载警告弹窗配置
  362. const popupWarnConfig = config.popupWarnConfig;
  363. if (popupWarnConfig != undefined) {
  364. this.popupWarnConfig = popupWarnConfig;
  365. }
  366. // console.log("[loadConfig] popupWarnConfig:", this.popupWarnConfig);
  367. // 加载弹窗数据
  368. const popupDataList = config.popupDataList;
  369. // console.log("[loadConfig] popupDataList:", popupDataList);
  370. if (popupDataList != undefined && popupDataList.length > 0) {
  371. for (var i = 0; i < popupDataList.length; i++) {
  372. // console.log("[loadConfig] popupDataList", i, popupDataList[i]);
  373. if (popupDataList[i] == 'default') {
  374. for (var j = 0; j < defaultPopUpDataList.length; j++) {
  375. this.popupDataList.push(defaultPopUpDataList[j]);
  376. }
  377. } else if (popupDataList[i] == 'default2') {
  378. for (var j = 0; j < defaultPopUpDataList2.length; j++) {
  379. this.popupDataList.push(defaultPopUpDataList2[j]);
  380. }
  381. } else {
  382. this.popupDataList.push(popupDataList[i]);
  383. }
  384. }
  385. } else {
  386. this.popupDataList = defaultPopUpDataList;
  387. console.log("[loadConfig] popupDataList 加载默认列表");
  388. }
  389. // console.log("[loadConfig] popupDataList:", this.popupDataList);
  390. // 加载弹窗(帮助)数据
  391. const popupHelpList = config.popupHelpList;
  392. if (popupHelpList != undefined && popupHelpList.length > 0) {
  393. for (var i = 0; i < popupHelpList.length; i++) {
  394. // console.log("[loadConfig] popupHelpList", i, popupHelpList[i]);
  395. this.popupHelpList.push(popupHelpList[i]);
  396. }
  397. }
  398. // console.log("[loadConfig] popupHelpList:", this.popupHelpList);
  399. // 加载页面参数
  400. const param = config.param;
  401. if (param != undefined) {
  402. if (param.subTitle != undefined && param.subTitle.length > 0) {
  403. this.configParam.subTitle = param.subTitle;
  404. }
  405. if (param.midType != undefined && param.midType >= 0) {
  406. this.configParam.midType = param.midType;
  407. }
  408. }
  409. // console.log("[loadConfig] param:", this.configParam);
  410. this.pageReady = true;
  411. // uni.hideLoading();
  412. },
  413. // 获取倒计时
  414. getCountdown() {
  415. // console.log(this.endSecond)
  416. if (this.endSecond > 0) {
  417. const now = Date.now() / 1000;
  418. const dif = this.endSecond - now;
  419. // const dif = 3600*24 - 60;
  420. if (dif > 0) {
  421. this.countdown = '距结束 ' + tools.convertSecondsToDHM(dif);
  422. } else {
  423. this.countdown = "活动已结束";
  424. }
  425. // this.countdown = tools.convertSecondsToHMS(dif);
  426. } else {
  427. this.countdown = "距结束 --天--小时";
  428. }
  429. },
  430. // 格式化 距离
  431. fmtDistanct(val) {
  432. if (val >= 0) {
  433. return Math.round(val * 100 / 1000) / 100;
  434. } else {
  435. return '--';
  436. }
  437. /* if (val < 1000)
  438. return Math.round(val * 10 / 1000) / 10;
  439. else
  440. return Math.round(val / 1000); */
  441. },
  442. // 格式化 配速
  443. fmtPace(val) {
  444. if (val >= 0) {
  445. return tools.convertSecondsToHMS(val, 2);
  446. } else {
  447. return '--';
  448. }
  449. },
  450. fmtMcTime(timestamp) {
  451. return tools.fmtMcTime(timestamp);
  452. },
  453. // 获取活动时间
  454. getActtime() {
  455. this.acttime = tools.getActtime(this.beginSecond, this.endSecond);
  456. },
  457. fmtMcTime2(timestamp1, timestamp2) {
  458. return tools.fmtMcTime2(timestamp1, timestamp2);
  459. },
  460. getCardConfigQuery() {
  461. uni.request({
  462. url: apiCardConfigQuery,
  463. header: {
  464. "Content-Type": "application/x-www-form-urlencoded",
  465. "token": this.token,
  466. },
  467. method: "POST",
  468. data: {
  469. ecId: this.ecId,
  470. pageName: this.pageName
  471. },
  472. success: (res) => {
  473. // console.log("getCardConfigQuery", res)
  474. const data = res.data.data;
  475. // console.log("configJson", data.configJson);
  476. const config = data.configJson != "" ? JSON.parse(data.configJson) : "";
  477. // console.log("configJson", data.configJson);
  478. /* const config = {
  479. "css": `
  480. .top{
  481. position: relative;
  482. width: 100%;
  483. height: 220px;
  484. padding-top: 36px;
  485. justify-content: space-between;
  486. background-image: url('static/backgroud/top_bg_sddx2.png');
  487. background-repeat: no-repeat;
  488. background-position-x: center;
  489. background-position-y: center;
  490. background-size: cover;
  491. }
  492. .topbar-rule {
  493. color: #FFFFFF;
  494. border-radius: 4px;
  495. background: #FF870D;
  496. }
  497. .logo{
  498. width: 180.5px !important;
  499. height: 130.5px !important;
  500. background-image: url('static/logo/sddx_jjyjy.png');
  501. }
  502. .top-acttime{
  503. display: flex !important;
  504. font-size: 20px !important;
  505. line-height: 30px !important;
  506. }
  507. .topbar-color{
  508. color: #ffffff;
  509. }
  510. .midType0{
  511. margin-top: -20px !important;
  512. }
  513. .main-title {
  514. display: none !important;
  515. }
  516. .btnStartGame{
  517. background-color: #a43a07 !important;
  518. }
  519. .e-select{
  520. background-color: #a43a07 !important;
  521. }
  522. .swiper-item-button{
  523. background-color: #a43a07 !important;
  524. }
  525. .uni-swiper-dot-active{
  526. background: #a43a07 !important;
  527. }
  528. `,
  529. "pathList": {
  530. "row1": [{
  531. "type": 4,
  532. "pathImg": "/static/common/sdzxxq2.png",
  533. "pathName": "山东大学中心校区",
  534. "path": {
  535. "ocaId": 1,
  536. "mcType": 3
  537. },
  538. "navImg": "/static/common/nav3.png",
  539. "point": {
  540. "longitude": 117.022194,
  541. "latitude": 36.661612,
  542. "name": "山东大学中心校区起始点"
  543. }
  544. }
  545. ]
  546. },
  547. "pathListStyle" : {
  548. "showLine" : true,
  549. "style": "justify-content: center;"
  550. },
  551. "popupRuleConfig": {
  552. "height": "560px"
  553. },
  554. "popupDataList": [
  555. {
  556. "type": 7,
  557. "data": {
  558. "topLogo": {
  559. "src": "/static/logo/sddx.png",
  560. "width": "80px",
  561. "height": "80px"
  562. },
  563. "title": "“筑梦宿州·创赢未来 ”特训营",
  564. "content": "<span style='display:block; text-align: center; margin: 20px; font-weight: bold;'>欢乐定向赛</span>  欢迎加入“筑梦宿州·创赢未来”特训营定向赛!在这里,你将亲历百年奥运精英运动——定向运动,体验个人与团队目标的完美融合,过程中运动与智慧并重。完赛即享奖励,最佳团队更享奖上奖!让我们携手加油吧!<br><br><span style='display:block; text-align: right;'>山东大学经济研究院</span>",
  565. "imageList": []
  566. }
  567. },
  568. {
  569. "type": 7,
  570. "data": {
  571. "topLogo": {
  572. "src": "/static/logo/sddx.png",
  573. "width": "80px",
  574. "height": "80px"
  575. },
  576. "title": "活动流程",
  577. "content": "<span style='line-height: 30px;'>① 选择战队赛事报名 ↓ <br>② 选择场地导航至起点 ↓ <br>③ 进入活动起点打点 ↓ <br>④ 按序号依次打点 ↓ <br>⑤ 知识问答 ↓ <br>⑥ 终点打点 ↓ <br>⑦ 查看成绩 ↓ <br>⑧ 获得奖励</span>",
  578. "imageList": []
  579. }
  580. },
  581. {
  582. "type": 7,
  583. "data": {
  584. "topLogo": {
  585. "src": "/static/logo/sddx.png",
  586. "width": "80px",
  587. "height": "80px"
  588. },
  589. "title": "定向运动怎么玩?",
  590. "content": "",
  591. "imageList": [{
  592. "src": "/static/common/qrcode_spjc.png",
  593. "width": "140.5px",
  594. "height": "163.5px"
  595. }]
  596. }
  597. },
  598. {
  599. "type": 7,
  600. "data": {
  601. "topLogo": {
  602. "src": "/static/logo/sddx.png",
  603. "width": "80px",
  604. "height": "80px"
  605. },
  606. "title": "赛事规则及奖励",
  607. "content": "<br><span style='line-height: 22px;'>规则:<br>1. 选择心仪战队,共筑个人与战队荣耀。<br>2. 在规定的时间内,<span style='color: #FF8D1A;'>不限完赛次数</span>,最终成绩以完赛累计积分计算。<br>3. 途经点成功打点1积分,正确答题1积分。<br>4. 未成功完赛(未打结束点)积分不计入。<br><br>奖励:<br><span style='color: #FF8D1A;'>完赛奖、最佳战队奖、个人前三名</span></span>",
  608. "imageList": []
  609. }
  610. },
  611. "default2"
  612. ],
  613. "popupWarnConfig": {
  614. "height": "550px"
  615. },
  616. "popupHelpConfig": {
  617. "height": "539px"
  618. },
  619. "popupHelpList": [
  620. ],
  621. "param": {
  622. "subTitle": "“筑梦宿州·创赢未来 ”特训营",
  623. "midType": 0
  624. }
  625. }; */
  626. this.loadConfig(config);
  627. this.matchRsDetailQuery();
  628. this.warnMessageQuery();
  629. setTimeout(this.dealFirstEnter, 500);
  630. },
  631. fail: (err) => {
  632. console.log("getCardConfigQuery err", err)
  633. },
  634. });
  635. },
  636. // 卡片对应地图列表详情查询
  637. mapListQuery() {
  638. uni.request({
  639. url: apiMapListQuery,
  640. header: {
  641. "Content-Type": "application/x-www-form-urlencoded",
  642. "token": this.token,
  643. },
  644. method: "POST",
  645. data: {
  646. mcId: this.mcId
  647. },
  648. success: (res) => {
  649. // console.log("mapListQuery", res);
  650. if (res.data.code == 0) {
  651. const data = res.data.data;
  652. this.mapList = data;
  653. let mapItems = [];
  654. for (var i = 0; i < data.length; i++) {
  655. let map = {};
  656. map.text = data[i].mapName;
  657. map.value = data[i].ocaId;
  658. mapItems.push(map);
  659. if (i == 0 && this.ocaId == 0) {
  660. this.ocaId = data[i].ocaId;
  661. this.matchRsDetailQuery();
  662. uni.setStorageSync(this.mapKey, this.ocaId);
  663. }
  664. }
  665. this.mapList = mapItems;
  666. // console.log("mapList", this.mapList);
  667. }
  668. },
  669. fail: (err) => {
  670. console.log("mapListQuery err", err);
  671. },
  672. });
  673. },
  674. // 卡片对应线上赛多个活动查询
  675. matchRsDetailQuery() {
  676. uni.request({
  677. url: apiMatchRsDetailQuery,
  678. header: {
  679. "Content-Type": "application/x-www-form-urlencoded",
  680. "token": this.token,
  681. },
  682. method: "POST",
  683. data: {
  684. ecId: this.ecId,
  685. ocaId: this.ocaId
  686. },
  687. success: (res) => {
  688. // console.log("matchRsDetailQuery", res);
  689. if (checkResCode(res)) {
  690. const data = res.data.data;
  691. this.mcType = data.mcType;
  692. this.mcId = data.mcId;
  693. this.mcName = data.mcName;
  694. this.coiName = data.coiName;
  695. this.beginSecond = data.beginSecond;
  696. this.endSecond = data.endSecond;
  697. this.nickName = data.nickName;
  698. this.totalNum = data.totalNum;
  699. this.totalDistanct = data.totalDistanct;
  700. this.totalDistanctRankNum = data.totalDistanctRankNum;
  701. this.totalCp = data.totalCp;
  702. this.totalCpRankNum = data.totalCpRankNum;
  703. this.totalSysPoint = data.totalSysPoint;
  704. this.totalSysPointRankNum = data.totalSysPointRankNum;
  705. this.fastPace = data.fastPace;
  706. this.fastPaceRankNum = data.fastPaceRankNum;
  707. this.regionTotalNum = data.regionTotalNum;
  708. this.regionTotalCp = data.regionTotalCp;
  709. this.regionTotalCpRankNum = data.regionTotalCpRankNum;
  710. this.regionTotalSysPoint = data.regionTotalSysPoint;
  711. this.regionTotalDictance = data.regionTotalDictance;
  712. this.regionFastPace = data.regionFastPace;
  713. this.ocaRs = data.ocaRs;
  714. this.mcState = tools.checkMcState(this.beginSecond, this.endSecond);
  715. const rank = JSON.stringify(data);
  716. this.dealNotice(rank);
  717. this.getCountdown();
  718. this.getActtime();
  719. this.isAllowMcSignUp();
  720. this.mapListQuery();
  721. this.clear();
  722. this.interval = setInterval(this.getCountdown, 60000);
  723. }
  724. },
  725. fail: (err) => {
  726. console.log("matchRsDetailQuery err", err)
  727. },
  728. });
  729. },
  730. // 是否允许重新分组(报名)
  731. isAllowMcSignUp() {
  732. uni.request({
  733. url: apiIsAllowMcSignUp,
  734. header: {
  735. "Content-Type": "application/x-www-form-urlencoded",
  736. "token": this.token,
  737. },
  738. method: "POST",
  739. data: {
  740. ecId: this.ecId
  741. },
  742. success: (res) => {
  743. // console.log("isAllowMcSignUp", res)
  744. if (res.data.code == 0) {
  745. const data = res.data.data;
  746. this.allowMcSignUp = data.allowSignUp;
  747. }
  748. },
  749. fail: (err) => {
  750. console.log("isAllowMcSignUp err", err)
  751. },
  752. });
  753. },
  754. // 警告列表查询
  755. warnMessageQuery() {
  756. uni.request({
  757. url: apiWarnMessageQuery,
  758. header: {
  759. "Content-Type": "application/x-www-form-urlencoded",
  760. "token": this.token,
  761. },
  762. method: "POST",
  763. data: {
  764. ecId: this.ecId
  765. },
  766. success: (res) => {
  767. // console.log("warnMessageQuery", res);
  768. if (checkResCode(res)) {
  769. const warnRs = res.data.data;
  770. this.popupWarnList.length = 0;
  771. for (var i = 0; i < warnRs.length; i++) {
  772. let popupData = {
  773. type: 9, // 9: 警告
  774. data: {}
  775. };
  776. popupData.data.warnType = warnRs[i].warnType;
  777. popupData.data.title = warnRs[i].warnTitle;
  778. popupData.data.iconUrl = warnRs[i].iconUrl;
  779. popupData.data.iconNum = warnRs[i].iconNum;
  780. popupData.data.message = warnRs[i].warnMessage;
  781. popupData.data.qrCodeUrl = warnRs[i].qrCodeUrl;
  782. this.popupWarnList.push(popupData);
  783. }
  784. /* this.popupWarnList.push(
  785. {
  786. type: 9, // 9: 警告
  787. data: {
  788. warnType: 1,
  789. title: "黄牌",
  790. iconUrl: "/static/common/card_yellows.png",
  791. iconNum: 1,
  792. message: `亲爱的参赛者:
  793.   收到此黄牌,说明您的比赛数据被系统判定为存在异常,此次比赛(活动)为徒步定向校园文化主题活动,请自觉遵守规则,如果您收到的黄牌数量过多<span style='color: red'>(超过2张)</span>,您的成绩将影响到您的院系/单位成绩,同时您的个人成绩也有可能根据规则被取消。如果您坚持您的比赛数据没有问题,请联系我们的客服人员,谢谢!
  794.   让我们一起创造文明、和谐的校园生活,感谢您的支持!`,
  795. qrCodeUrl: "https://orienteering.beswell.com/shanda/%E8%AD%A6%E5%91%8A%E4%BA%8C%E7%BB%B4%E7%A0%81%402x.png"
  796. }
  797. }
  798. ); */
  799. // console.log("popupMessageList", this.popupMessageList);
  800. }
  801. },
  802. fail: (err) => {
  803. console.log("warnMessageQuery err", err)
  804. },
  805. });
  806. },
  807. btnBack() {
  808. // const url = `action://to_home/`;
  809. // tools.appAction(url);
  810. // uni.navigateTo({
  811. // url: "/pages/bm/style4/rankList?" + this.queryString
  812. // });
  813. const url = "/pages/bm/style4/rankList?" + this.queryString;
  814. tools.appAction(url, "uni.navigateTo");
  815. },
  816. btnInfo() {
  817. // console.log(this.$refs.mypopup);
  818. this.$refs.mypopup.popupOpen();
  819. },
  820. btnHelp() {
  821. this.$refs.mypopupHelp.popupOpen();
  822. },
  823. btnWarn() {
  824. this.$refs.mypopupWarn.popupOpen();
  825. },
  826. btnReGroup() {
  827. this.queryObj.from = "rankOverview";
  828. this.queryString = tools.objectToQueryString(this.queryObj);
  829. // uni.navigateTo({
  830. // url: '/pages/bm/style4/signup?' + this.queryString
  831. // });
  832. const url = '/pages/bm/style4/signup?' + this.queryString;
  833. tools.appAction(url, "uni.navigateTo");
  834. },
  835. onOverviewClick(ovtype) {
  836. this.queryObj.ovtype = ovtype;
  837. this.queryString = tools.objectToQueryString(this.queryObj);
  838. // uni.navigateTo({
  839. // url: "/pages/bm/style4/rankList?" + this.queryString
  840. // });
  841. const url = "/pages/bm/style4/rankList?" + this.queryString;
  842. tools.appAction(url, "uni.navigateTo");
  843. },
  844. eSelectChange(data) {
  845. // console.log("eSelectChange:", data);
  846. this.ocaId = data.value;
  847. this.matchRsDetailQuery();
  848. uni.setStorageSync(this.mapKey, this.ocaId);
  849. },
  850. onPathClick(data) {
  851. console.log("onPathClick:", data);
  852. if (this.ocaId != data.path.ocaId) {
  853. this.ocaId = data.path.ocaId;
  854. this.matchRsDetailQuery();
  855. uni.setStorageSync(this.mapKey, data.path.ocaId);
  856. }
  857. },
  858. btnStartGame() {
  859. // 赛事/活动状态 0: 未开始 1: 进行中 2: 已结束
  860. if (this.mcState == 1) {
  861. const url = `action://to_detail/?id=${this.ocaId}&matchType=${this.mcType}`;
  862. tools.appAction(url);
  863. } else if (this.mcState == 0) {
  864. uni.showToast({
  865. title: '比赛尚未开始',
  866. icon: 'none',
  867. duration: 3000
  868. });
  869. } else if (this.mcState == 2) {
  870. uni.showToast({
  871. title: '比赛已结束',
  872. icon: 'none',
  873. duration: 3000
  874. });
  875. }
  876. }
  877. }
  878. }
  879. </script>
  880. <style scoped>
  881. .content {
  882. width: 100vw;
  883. min-height: 100vh;
  884. overflow-x: scroll;
  885. }
  886. .top-default {
  887. position: relative;
  888. z-index: 10;
  889. width: 100%;
  890. height: 270px;
  891. padding-top: 36px;
  892. justify-content: space-between;
  893. background-image: url("/static/backgroud/top_bg_egg2.png");
  894. background-repeat: no-repeat;
  895. background-position-x: center;
  896. background-position-y: -8px;
  897. background-size: 100% 100%;
  898. /* background-size: cover; */
  899. }
  900. .topbar-color-default {
  901. color: #333333;
  902. }
  903. .topcontent {
  904. height: 90%;
  905. margin-bottom: 50px;
  906. }
  907. .logo {
  908. width: 80px;
  909. height: 80px;
  910. margin-top: 10px;
  911. /* background-image: url('/static/logo/sddx.png'); */
  912. background-repeat: no-repeat;
  913. background-position-x: center;
  914. background-position-y: center;
  915. background-size: contain;
  916. }
  917. .top-acttime {
  918. display: none;
  919. text-shadow: 3px 3px 0px #640008;
  920. font-family: YouSheBiaoTiHei;
  921. /* font-family: Arial, Helvetica, sans-serif; */
  922. font-weight: bold;
  923. color: #ffee0b;
  924. font-size: 26px;
  925. }
  926. .topbtm {
  927. width: 100%;
  928. /* height: 60rpx; */
  929. margin-bottom: 40px;
  930. justify-content: space-evenly;
  931. }
  932. .topbtm-name {
  933. /* width: 320rpx; */
  934. /* height: 28px; */
  935. padding: 5px 12px;
  936. background-color: #9fda39;
  937. border-radius: 5px;
  938. /* backdrop-filter: blur(30px); */
  939. text-align: center;
  940. font-weight: 500;
  941. color: #497400;
  942. font-size: 14px;
  943. }
  944. .midType0 {
  945. width: 90%;
  946. height: 150px;
  947. position: relative;
  948. z-index: 20;
  949. margin-top: -40px;
  950. background: #ffffff;
  951. border-radius: 9px;
  952. box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.13);
  953. font-family: Source Han Sans CN;
  954. }
  955. .midType1 {
  956. width: 90%;
  957. /* height: 112px; */
  958. height: 150px;
  959. position: relative;
  960. z-index: 20;
  961. margin-top: -70px;
  962. background: #ffffff;
  963. border-radius: 9px;
  964. box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.13);
  965. font-family: Source Han Sans CN;
  966. }
  967. .mid-0 {
  968. width: 90%;
  969. margin: 12px;
  970. }
  971. .mid-0-select {
  972. width: 60%;
  973. font-weight: 500;
  974. color: #8e8e8e;
  975. font-size: 14px;
  976. }
  977. .mid-0-help {
  978. position: absolute;
  979. right: 30px;
  980. font-size: 12px;
  981. font-weight: 500;
  982. color: #992900;
  983. }
  984. .mid-0-right {
  985. position: absolute;
  986. width: 60px;
  987. /* background-color: #81cd00; */
  988. right: 10px;
  989. font-size: 12px;
  990. font-weight: 500;
  991. color: #992900;
  992. }
  993. .midType0-mid-1 {
  994. width: 90%;
  995. margin-bottom: 12px;
  996. }
  997. .midType1-select {
  998. /* width: 46%; */
  999. min-width: 46%;
  1000. max-width: 50%;
  1001. margin: 0 5px;
  1002. font-weight: 500;
  1003. color: #8e8e8e;
  1004. font-size: 14px;
  1005. }
  1006. .midType1-mid-1 {
  1007. width: 90%;
  1008. margin-bottom: 12px;
  1009. font-weight: 500;
  1010. color: #8e8e8e;
  1011. font-size: 14px;
  1012. }
  1013. .mid-1-yellowCard {
  1014. width: 15px;
  1015. height: 20px;
  1016. margin-right: 10px;
  1017. }
  1018. .mid-1-name {
  1019. max-width: 360rpx;
  1020. white-space: nowrap;
  1021. overflow: hidden;
  1022. text-overflow: ellipsis;
  1023. }
  1024. .mid-1-text {
  1025. /* min-width: 60px; */
  1026. font-weight: 500;
  1027. color: #9a300e;
  1028. font-size: 12px;
  1029. }
  1030. .mid-2 {
  1031. width: 92%;
  1032. /* margin: 0 10px; */
  1033. }
  1034. .mid-2-value {
  1035. font-weight: 900;
  1036. font-size: 22px;
  1037. line-height: 25px;
  1038. }
  1039. .mid-2-text {
  1040. color: #989898;
  1041. font-size: 12px;
  1042. }
  1043. .mid-line {
  1044. width: 0px;
  1045. height: 40px;
  1046. border: 1px solid;
  1047. border-color: #e6e6e6;
  1048. }
  1049. .overview-1 {
  1050. width: 111px;
  1051. height: 54px;
  1052. background: #ffb40b;
  1053. border-radius: 50%;
  1054. box-shadow: 3px 3px 0px rgba(140, 140, 140, 1);
  1055. pointer-events: auto;
  1056. }
  1057. .overview-2 {
  1058. margin-top: -43px;
  1059. color: #ffffff;
  1060. font-size: 18px;
  1061. pointer-events: auto;
  1062. }
  1063. .overview-3 {
  1064. width: 111px;
  1065. height: 54px;
  1066. background: #f39509;
  1067. border-radius: 50%;
  1068. box-shadow: 3px 3px 0px rgba(140, 140, 140, 1);
  1069. pointer-events: auto;
  1070. }
  1071. .overview-4 {
  1072. width: 111px;
  1073. height: 54px;
  1074. background: #81cd00;
  1075. border-radius: 50%;
  1076. box-shadow: 3px 3px 0px rgba(140, 140, 140, 1);
  1077. pointer-events: auto;
  1078. }
  1079. .overview-5 {
  1080. width: 111px;
  1081. height: 54px;
  1082. background: #64cbb0;
  1083. border-radius: 50%;
  1084. box-shadow: 3px 3px 0px rgba(140, 140, 140, 1);
  1085. pointer-events: auto;
  1086. }
  1087. .ovline1 {
  1088. margin-top: 9px;
  1089. color: #ffffff;
  1090. font-size: 12px;
  1091. }
  1092. .ovline2 {
  1093. color: #ffffff;
  1094. font-size: 16px;
  1095. }
  1096. .main {
  1097. width: 100%;
  1098. margin-top: 20px;
  1099. margin-bottom: 20px;
  1100. /* height: 70vh; */
  1101. justify-content: space-around;
  1102. /* justify-content: space-between; */
  1103. }
  1104. .main-title {
  1105. margin-bottom: 10px;
  1106. font-weight: 550;
  1107. color: #333333;
  1108. font-size: 16px;
  1109. }
  1110. .bottom {
  1111. width: 100%;
  1112. flex-grow: 1;
  1113. justify-content: flex-end;
  1114. }
  1115. .btnStartGame {
  1116. width: 70%;
  1117. height: 80rpx;
  1118. /* margin-top: 50rpx; */
  1119. margin-bottom: 20rpx;
  1120. /* font-weight: bold; */
  1121. color: white;
  1122. font-size: 32rpx;
  1123. line-height: 80rpx;
  1124. border-radius: 27px;
  1125. background-color: #2e85ec;
  1126. }
  1127. /deep/ .e-select {
  1128. /* width: 60%; */
  1129. height: 60rpx;
  1130. background: #2e85ec;
  1131. color: #ffffff;
  1132. border-radius: 18px;
  1133. justify-content: space-around;
  1134. font-size: 16px;
  1135. font-weight: 500;
  1136. line-height: 60rpx;
  1137. text-align: center;
  1138. border: none !important;
  1139. }
  1140. /deep/ .e-select-input-text {
  1141. color: inherit !important;
  1142. }
  1143. /deep/ .e-select-selector-item {
  1144. color: #818181;
  1145. }
  1146. /deep/ .uni-icons {
  1147. color: inherit !important;
  1148. }
  1149. /deep/ .e-select-icon {
  1150. width: 26px !important;
  1151. }
  1152. </style>