rankList.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902
  1. <!--
  2. [报名] 样式3 - 排名列表
  3. http://localhost:5173/card/#/pages/bm/style4/rankList
  4. https://oss-mbh5.colormaprun.com/card/#/pages/bm/style4/rankList
  5. -->
  6. <template>
  7. <view class="body">
  8. <view class="content uni-column">
  9. <view class="uni-column" :class="cssTop">
  10. <view class="topbar uni-row" :class="cssTopbarColor">
  11. <uni-icons type="left" class="topbar-back" @click="btnBack"></uni-icons>
  12. <text class="mcName">{{mcName}}</text>
  13. <text class="topbar-rule" @click="btnInfo">规则</text>
  14. <!-- <image mode="aspectFit" class="topbar-info" @click="btnInfo" src="/static/default/info.png"></image> -->
  15. </view>
  16. <view class="topcontent uni-column uni-jcsa">
  17. <view class="logo"></view>
  18. <view class="tcbar uni-row uni-jcsb">
  19. <text class="tcbar-text">赛事总里程:{{fmtDistanct(all_totalDistance)}} 千米</text>
  20. <text class="tcbar-text">{{configParam.labelRightAnswerNum}}:{{all_totalRightAnswerNum}} 次</text>
  21. </view>
  22. </view>
  23. <!-- <view class="topbtm uni-row">
  24. <view class="topbtm-egg" @click="btnMyEgg">蛋叔券</view>
  25. <text class="topbtm-name">{{nickName}}</text>
  26. <view class="topbtm-egg" @click="btnExchg">兑换地址</view>
  27. </view> -->
  28. </view>
  29. <view class="main uni-column">
  30. <my-tab ref="tab1" :tabItems="tab1Items" :type="1" @onTabClick="onTab1Click"
  31. @onSelectChange="onSelectChange"></my-tab>
  32. <my-tab ref="tab2" :tabItems="tab2Items" :tabItemsMark="tab2ItemsMark" :type="0"
  33. @onTabClick="onTab2Click" :fontSize="12"></my-tab>
  34. <view class="tab-view uni-column">
  35. <!-- 团体成绩列表 -->
  36. <template v-if="tab1Current==0" v-for="(item, index) in rank1List" :key="index">
  37. <my-ranklist v-show="tab2Current === index" :rankRs="rankList[item]"
  38. :rank-type="rankTypeList[index]"></my-ranklist>
  39. </template>
  40. <!-- 个人成绩列表 -->
  41. <template v-if="tab1Current==1" v-for="(item, index) in rank2List" :key="index">
  42. <my-ranklist v-show="tab2Current === index" :rankRs="rankList[item]"
  43. :rank-type="rankTypeList[index]"></my-ranklist>
  44. </template>
  45. </view>
  46. <button class="btnBack" @click="btnStartGame">我要比赛</button>
  47. <!-- <button class="btnBack" @click="btnBack">返回</button> -->
  48. </view>
  49. <my-popup ref="mypopup" :dataList="popupDataList" :acttime="acttime"></my-popup>
  50. <my-popup ref="mypopupExchg" :dataList="popupExchgList"></my-popup>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import tools from '/common/tools';
  56. import {
  57. teamName,
  58. defaultPopUpDataList
  59. } from '/common/define';
  60. import {
  61. token,
  62. apiMatchRsDetailQuery,
  63. apiCardRankDetailQuery,
  64. apiCardConfigQuery,
  65. apiUserCurrentRankNumQuery,
  66. apiIsAllowMcSignUp,
  67. apiMapListQuery,
  68. apiCompStatisticQuery,
  69. checkResCode
  70. } from '/common/api';
  71. export default {
  72. data() {
  73. return {
  74. pageName: "rankList",
  75. firstEnterKey: 'firstEnter-bm-style4',
  76. rankKey: "rank-bm-style4",
  77. mapKey: "rank-bm-style4-map",
  78. queryObj: {},
  79. queryString: "",
  80. token: "",
  81. ovtype: "",
  82. ecId: 0, // 卡片id
  83. mcId: 0, // 赛事id
  84. mcType: 0, // 赛事类型 1 普通活动 2 线下赛 3 线上赛
  85. mcName: "", // 赛事名称
  86. acttime: "", // 活动时间
  87. beginSecond: null, // 活动或赛事开始时间戳,单位秒
  88. endSecond: null, // 活动或赛事结束时间戳,单位秒
  89. ocaId: 0, // 关联id,带入到App活动详情页面
  90. nickName: "", // 昵称
  91. mapList: [], // 卡片对应地图列表详情
  92. all_totalDistance: 0, // 赛事所有人累计里程,单位米
  93. all_totalRightAnswerNum: 0, // 赛事所有人正确答题数(校园文化输出)
  94. all_totalCp: 0, // 赛事中所有人打点数
  95. all_totalSysPoint: 0, // 赛事中所有人百味豆
  96. mcState: 0, // 赛事/活动状态 0: 未开始 1: 进行中 2: 已结束
  97. allowMcSignUp: false, // 是否允许重新分组
  98. countdown: "", // 倒计时
  99. rankList: { // 排名列表
  100. // totalDistanceRs: [],
  101. // totalCpRs: [],
  102. // totalSysPointRs: [],
  103. // fastPaceRs: []
  104. },
  105. interval: null,
  106. teamType: 0, // 队伍类型
  107. // dispArrStr: "totalDistance,totalCp,totalSysPoint,fastPace",
  108. dispArrStr: "teamCp,teamDistance,teamRightAnswerPer,teamPace,teamSpeed,regionCp,regionDistance,regionRightAnswerPer,regionPace,regionSpeed", // 要显示的集合范围
  109. tab1Current: 0,
  110. tab2Current: 0,
  111. tab1Items: ["团体"],
  112. // tab1Items: ["团体", {
  113. // selectValue: 1,
  114. // data: [
  115. // {text: "个人(中心校区)", value: 1},
  116. // {text: "个人(千佛山校区南区)", value: 2},
  117. // {text: "个人(兴隆校区)", value: 3}
  118. // ]}
  119. // ],
  120. // tab2Items: ["总距离", "打点数", "百味豆", "配速"],
  121. tab2Items: ["总里程", "累计打点", "校园文化", "最快配速", "单场用时"],
  122. tab2ItemsMark: [{
  123. textColor: "#ff6203",
  124. icon: "static/common/award.png"
  125. }],
  126. tabActiveColor: "#81cd00",
  127. // 成绩类型列表
  128. rankTypeList: ["totalDistance", "totalCp", "rightAnswerPer", "fastPace", "fastPace"],
  129. // 团体成绩列表
  130. rank1List: ["teamDistanceRs", "teamCpRs", "teamRightAnswerPerRs", "teamPaceRs", "teamSpeedRs"],
  131. // 个人成绩列表
  132. rank2List: ["regionDistanceRs", "regionCpRs", "regionRightAnswerPerRs", "regionPaceRs", "regionSpeedRs"],
  133. cssTop: "",
  134. cssTopbarColor: "",
  135. configParam: {
  136. labelRightAnswerNum: "文化输出"
  137. },
  138. // selectedMapId: 0, // 用户选择的地图ID
  139. popupDataList: [],
  140. popupExchgList: []
  141. }
  142. },
  143. computed: {},
  144. onLoad(query) { // 类型非必填,可自动推导
  145. // console.log(query);
  146. this.queryObj = query;
  147. this.queryString = tools.objectToQueryString(this.queryObj);
  148. // console.log(queryString);
  149. this.token = query["token"] ?? token;
  150. this.ecId = query["id"] ?? 0;
  151. this.ovtype = query["ovtype"] ?? "";
  152. this.firstEnterKey += "-" + this.ecId;
  153. console.log("firstEnterKey:", this.firstEnterKey);
  154. this.rankKey += "-" + this.ecId;
  155. console.log("rankKey:", this.rankKey);
  156. this.mapKey += "-" + this.ecId;
  157. console.log("mapKey:", this.mapKey);
  158. tools.removeCssCode();
  159. const mapValue = uni.getStorageSync(this.mapKey);
  160. if (mapValue) {
  161. console.log("mapValue:", mapValue);
  162. // this.selectedMapId = mapValue;
  163. this.ocaId = mapValue;
  164. }
  165. this.getCardConfigQuery();
  166. },
  167. // 页面初次渲染完成,此时组件已挂载完成,DOM 树($el)已可用
  168. onReady() {
  169. // this.dealFirstEnter();
  170. },
  171. onUnload() {
  172. this.clear();
  173. },
  174. methods: {
  175. dealNotice(rank) {
  176. // console.log('[dealFirstEnter]');
  177. let that = this;
  178. uni.getStorage({
  179. key: that.rankKey,
  180. success: (res) => {
  181. console.log('[getStorage]', that.rankKey, res.data);
  182. const oldRank = res.data;
  183. if (oldRank != rank) {
  184. // that.notice = true;
  185. that.setRankValue(rank);
  186. }
  187. },
  188. fail: (e) => {
  189. console.log('[getStorage] fail', that.rankKey, e);
  190. // that.notice = false;
  191. that.setRankValue(rank);
  192. },
  193. })
  194. },
  195. setRankValue(data) {
  196. let that = this;
  197. uni.setStorage({
  198. key: that.rankKey,
  199. data: data,
  200. success: () => {
  201. console.log('[setStorage] success', that.rankKey, data);
  202. },
  203. fail: (e) => {
  204. console.log('[setStorage] fail', that.rankKey, e);
  205. },
  206. })
  207. },
  208. dealFirstEnter() {
  209. // console.log('[dealFirstEnter]');
  210. let that = this;
  211. uni.getStorage({
  212. key: that.firstEnterKey,
  213. success: (res) => {
  214. console.log('[getStorage]', that.firstEnterKey, res.data);
  215. },
  216. fail: (e) => {
  217. console.log('[getStorage] fail', that.firstEnterKey, e);
  218. that.btnInfo();
  219. that.setFirstEnterValue(true);
  220. },
  221. })
  222. },
  223. setFirstEnterValue(data) {
  224. let that = this;
  225. uni.setStorage({
  226. key: that.firstEnterKey,
  227. data: data,
  228. success: () => {
  229. console.log('[setStorage] success', that.firstEnterKey, data);
  230. },
  231. fail: (e) => {
  232. console.log('[setStorage] fail', that.firstEnterKey, e);
  233. },
  234. })
  235. },
  236. clear() {
  237. if (this.interval != null) {
  238. clearInterval(this.interval);
  239. this.interval = null;
  240. }
  241. },
  242. loadConfig(config) {
  243. // console.log("config", config);
  244. // 加载CSS样式
  245. const css = config.css;
  246. if (css != undefined && css.length > 0) {
  247. tools.loadCssCode(css);
  248. if (css.indexOf(".top{") >= 0) {
  249. this.cssTop = "top";
  250. }
  251. if (css.indexOf(".topbar-color{") >= 0) {
  252. this.cssTopbarColor = "topbar-color";
  253. }
  254. }
  255. if (this.cssTop == "") {
  256. this.cssTop = "top-default";
  257. }
  258. if (this.cssTopbarColor == "") {
  259. this.cssTopbarColor = "topbar-color-default";
  260. }
  261. console.log("[loadConfig] cssTop:", this.cssTop);
  262. console.log("[loadConfig] cssTopbarColor:", this.cssTopbarColor);
  263. const tabActiveColor = config.tabActiveColor;
  264. if (tabActiveColor != undefined && tabActiveColor.length > 0) {
  265. this.tabActiveColor = tabActiveColor;
  266. }
  267. // 加载弹窗数据
  268. const popupDataList = config.popupDataList;
  269. // console.log("[loadConfig] popupDataList:", popupDataList);
  270. if (popupDataList != undefined && popupDataList.length > 0) {
  271. for (var i = 0; i < popupDataList.length; i++) {
  272. // console.log("[loadConfig] popupDataList", i, popupDataList[i]);
  273. if (popupDataList[i] == 'default') {
  274. for (var j = 0; j < defaultPopUpDataList.length; j++) {
  275. this.popupDataList.push(defaultPopUpDataList[j]);
  276. }
  277. } else {
  278. this.popupDataList.push(popupDataList[i]);
  279. }
  280. }
  281. } else {
  282. this.popupDataList = defaultPopUpDataList;
  283. console.log("[loadConfig] popupDataList 加载默认列表");
  284. }
  285. // console.log("[loadConfig] popupDataList:", this.popupDataList);
  286. // 加载弹窗(兑换地点)数据
  287. const popupExchgList = config.popupExchgList;
  288. if (popupExchgList != undefined && popupExchgList.length > 0) {
  289. for (var i = 0; i < popupExchgList.length; i++) {
  290. // console.log("[loadConfig] popupExchgList", i, popupExchgList[i]);
  291. this.popupExchgList.push(popupExchgList[i]);
  292. }
  293. }
  294. // console.log("[loadConfig] popupExchgList:", this.popupExchgList);
  295. // 加载页面参数
  296. const param = config.param;
  297. if (param != undefined) {
  298. if (param.labelRightAnswerNum != undefined && param.labelRightAnswerNum.length > 0) {
  299. this.configParam.labelRightAnswerNum = param.labelRightAnswerNum;
  300. }
  301. }
  302. // console.log("[loadConfig] param:", this.configParam);
  303. },
  304. // 获取倒计时
  305. getCountdown() {
  306. // console.log(this.endSecond)
  307. if (this.endSecond > 0) {
  308. const now = Date.now() / 1000;
  309. const dif = this.endSecond - now;
  310. // const dif = 3600*24 - 60;
  311. if (dif > 0) {
  312. this.countdown = '距结束 ' + tools.convertSecondsToDHM(dif);
  313. } else {
  314. this.countdown = "活动已结束";
  315. }
  316. // this.countdown = tools.convertSecondsToHMS(dif);
  317. } else {
  318. this.countdown = "距结束 --天--小时";
  319. }
  320. },
  321. // 格式化 距离
  322. fmtDistanct(val) {
  323. return Math.round(val * 100 / 1000) / 100;
  324. /* if (val < 10000)
  325. return Math.round(val * 10 / 1000) / 10;
  326. else
  327. return Math.round(val / 1000); */
  328. },
  329. fmtMcTime(timestamp) {
  330. return tools.fmtMcTime(timestamp);
  331. },
  332. // 获取活动时间
  333. getActtime() {
  334. this.acttime = tools.getActtime(this.beginSecond, this.endSecond);
  335. },
  336. getTeamName(teamType, teamIndex) {
  337. return teamName[teamType][teamIndex];
  338. },
  339. getCardConfigQuery() {
  340. uni.request({
  341. url: apiCardConfigQuery,
  342. header: {
  343. "Content-Type": "application/x-www-form-urlencoded",
  344. "token": this.token,
  345. },
  346. method: "POST",
  347. data: {
  348. ecId: this.ecId,
  349. pageName: this.pageName
  350. },
  351. success: (res) => {
  352. // console.log("getCardConfigQuery", res)
  353. const data = res.data.data;
  354. // console.log("configJson", data.configJson);
  355. const config = data.configJson != "" ? JSON.parse(data.configJson) : "";
  356. // console.log("configJson", data.configJson);
  357. /* const config = {
  358. "css": `
  359. .top{
  360. width: 100%;
  361. height: 170px;
  362. padding-top: 36px;
  363. justify-content: space-between;
  364. background-image: url('static/backgroud/top_bg_sddx.png');
  365. background-repeat: no-repeat;
  366. background-position-x: center;
  367. background-position-y: bottom;
  368. background-size: cover;
  369. }
  370. .logo{
  371. background-image: url('static/logo/sddx.png');
  372. }
  373. .tcbar{
  374. display: flex !important;
  375. }
  376. .topbar-color{
  377. color: #ffffff;
  378. }
  379. .btnBack{
  380. background-color: #a43a07 !important;
  381. }
  382. .tab-active{
  383. background-color: #a43a07 !important;
  384. }
  385. .swiper-item-button {
  386. background-color: #a43a07 !important;
  387. }
  388. .uni-swiper-dot-active {
  389. background: #a43a07 !important;
  390. }
  391. `,
  392. "tabActiveColor": "#a43a07",
  393. "popupDataList": [{
  394. "type": 1,
  395. "data": {
  396. "title": "山大校园定向赛",
  397. "img": "/static/logo/sddx.png",
  398. "content": "  开学季来袭!山大校园定向赛燃情启幕!探索校园每一个角落,挑战智慧与体能,全校师生共同开启新学期活力篇章!等你来挑战!"
  399. }
  400. },
  401. "default"
  402. ],
  403. "popupExchgList": [{
  404. "type": 5,
  405. "data": {
  406. "title": "兑换地点",
  407. "img": "/static/common/wslgwcs.png",
  408. "point": {
  409. "longitude": 117.022194,
  410. "latitude": 36.661612,
  411. "name": "万盛隆购物超市"
  412. }
  413. }
  414. }],
  415. "param": {
  416. "labelRightAnswerNum": "校园文化输出"
  417. }
  418. }; */
  419. this.loadConfig(config);
  420. this.matchRsDetailQuery();
  421. setTimeout(this.dealFirstEnter, 500);
  422. },
  423. fail: (err) => {
  424. console.log("getCardConfigQuery err", err)
  425. },
  426. });
  427. },
  428. // 卡片对应活动或赛事详情查询
  429. // getCardDetailQuery() {
  430. // uni.request({
  431. // url: apiCardDetailQuery,
  432. // header: {
  433. // "Content-Type": "application/x-www-form-urlencoded",
  434. // "token": this.token,
  435. // },
  436. // method: "POST",
  437. // data: {
  438. // ecId: this.ecId
  439. // },
  440. // success: (res) => {
  441. // // console.log("getCardDetailQuery", res)
  442. // const data = res.data.data;
  443. // this.mcType = data.mcType;
  444. // this.mcId = data.mcId;
  445. // this.mcName = data.mcName;
  446. // this.beginSecond = data.beginSecond;
  447. // this.endSecond = data.endSecond;
  448. // this.coiName = data.coiName;
  449. // this.teamNum = data.teamNum;
  450. // this.mcState = tools.checkMcState(this.beginSecond, this.endSecond);
  451. // this.getCountdown();
  452. // this.getActtime();
  453. // this.getCardRankDetailQuery();
  454. // this.clear();
  455. // this.interval = setInterval(this.getCountdown, 60000);
  456. // },
  457. // fail: (err) => {
  458. // console.log("getCardDetailQuery err", err)
  459. // },
  460. // });
  461. // },
  462. // 卡片对应线上赛多个活动查询
  463. matchRsDetailQuery() {
  464. uni.request({
  465. url: apiMatchRsDetailQuery,
  466. header: {
  467. "Content-Type": "application/x-www-form-urlencoded",
  468. "token": this.token,
  469. },
  470. method: "POST",
  471. data: {
  472. ecId: this.ecId
  473. },
  474. success: (res) => {
  475. // console.log("matchRsDetailQuery", res);
  476. if (checkResCode(res)) {
  477. const data = res.data.data;
  478. this.mcType = data.mcType;
  479. this.mcId = data.mcId;
  480. this.mcName = data.mcName;
  481. this.beginSecond = data.beginSecond;
  482. this.endSecond = data.endSecond;
  483. this.nickName = data.nickName;
  484. // this.totalNum = data.totalNum;
  485. // this.totalDistanct = data.totalDistanct;
  486. // this.totalDistanctRankNum = data.totalDistanctRankNum;
  487. // this.totalCp = data.totalCp;
  488. // this.totalCpRankNum = data.totalCpRankNum;
  489. // this.totalSysPoint = data.totalSysPoint;
  490. // this.totalSysPointRankNum = data.totalSysPointRankNum;
  491. // this.fastPace = data.fastPace;
  492. // this.fastPaceRankNum = data.fastPaceRankNum;
  493. // this.ocaRs = data.ocaRs;
  494. this.mcState = tools.checkMcState(this.beginSecond, this.endSecond);
  495. this.getCountdown();
  496. this.getActtime();
  497. this.mapListQuery();
  498. this.compStatisticQuery();
  499. // this.getCardRankDetailQuery();
  500. this.clear();
  501. this.interval = setInterval(this.getCountdown, 60000);
  502. }
  503. },
  504. fail: (err) => {
  505. console.log("matchRsDetailQuery err", err)
  506. },
  507. });
  508. },
  509. // 卡片对应地图列表详情查询
  510. mapListQuery() {
  511. uni.request({
  512. url: apiMapListQuery,
  513. header: {
  514. "Content-Type": "application/x-www-form-urlencoded",
  515. "token": this.token,
  516. },
  517. method: "POST",
  518. data: {
  519. mcId: this.mcId
  520. },
  521. success: (res) => {
  522. // console.log("mapListQuery", res);
  523. if (res.data.code == 0) {
  524. const data = res.data.data;
  525. this.mapList = data;
  526. let mapItems = {
  527. // selectValue: this.selectedMapId,
  528. selectValue: this.ocaId,
  529. data: []
  530. };
  531. for (var i = 0; i < data.length; i++) {
  532. if (mapItems.selectValue == 0 && i == 0) {
  533. mapItems.selectValue = data[i].ocaId;
  534. // this.selectedMapId = data[i].ocaId;
  535. this.ocaId = data[i].ocaId;
  536. }
  537. let map = {};
  538. map.text = "个人(" + data[i].mapName + ")";
  539. map.value = data[i].ocaId;
  540. mapItems.data.push(map);
  541. }
  542. this.tab1Items.push(mapItems);
  543. this.getCardRankDetailQuery();
  544. }
  545. },
  546. fail: (err) => {
  547. console.log("mapListQuery err", err);
  548. },
  549. });
  550. },
  551. // 赛事总成绩统计查询
  552. compStatisticQuery() {
  553. uni.request({
  554. url: apiCompStatisticQuery,
  555. header: {
  556. "Content-Type": "application/x-www-form-urlencoded",
  557. "token": this.token,
  558. },
  559. method: "POST",
  560. data: {
  561. mcId: this.mcId
  562. },
  563. success: (res) => {
  564. // console.log("compStatisticQuery", res);
  565. if (res.data.code == 0) {
  566. const data = res.data.data;
  567. this.all_totalDistance = data.totalDistance;
  568. this.all_totalRightAnswerNum = data.totalRightAnswerNum;
  569. this.all_totalCp = data.totalCp;
  570. this.all_totalSysPoint = data.totalSysPoint;
  571. }
  572. },
  573. fail: (err) => {
  574. console.log("compStatisticQuery err", err);
  575. },
  576. });
  577. },
  578. // 排名查询
  579. getCardRankDetailQuery() {
  580. uni.request({
  581. url: apiCardRankDetailQuery,
  582. header: {
  583. "Content-Type": "application/x-www-form-urlencoded",
  584. "token": this.token,
  585. },
  586. method: "POST",
  587. data: {
  588. mcIdListStr: this.mcId,
  589. mcType: this.mcType,
  590. ocaId: this.ocaId,
  591. dispArrStr: this.dispArrStr
  592. },
  593. success: (res) => {
  594. // console.log("getCardRankDetailQuery", res);
  595. const rankdata = res.data.data;
  596. // this.rankList.totalDistanceRs = rankdata.totalDistanceRs;
  597. // this.rankList.totalCpRs = rankdata.totalCpRs;
  598. // this.rankList.totalSysPointRs = rankdata.totalSysPointRs;
  599. // this.rankList.fastPaceRs = rankdata.fastPaceRs;
  600. this.rankList = rankdata;
  601. },
  602. fail: (err) => {
  603. console.log("getCardRankDetailQuery err", err)
  604. },
  605. });
  606. },
  607. // 卡片用户当前排名查询
  608. // getUserCurrentRankNumQuery() {
  609. // uni.request({
  610. // url: apiUserCurrentRankNumQuery,
  611. // header: {
  612. // "Content-Type": "application/x-www-form-urlencoded",
  613. // "token": this.token,
  614. // },
  615. // method: "POST",
  616. // data: {
  617. // ecId: this.ecId
  618. // },
  619. // success: (res) => {
  620. // // console.log("getUserCurrentRankNumQuery", res)
  621. // if (res.data.code == 0) {
  622. // const data = res.data.data;
  623. // const rankNum = data.rankNum;
  624. // this.dealNotice(rankNum);
  625. // }
  626. // },
  627. // fail: (err) => {
  628. // console.log("getUserCurrentRankNumQuery err", err)
  629. // },
  630. // });
  631. // },
  632. // 是否允许重新分组(报名)
  633. isAllowMcSignUp() {
  634. uni.request({
  635. url: apiIsAllowMcSignUp,
  636. header: {
  637. "Content-Type": "application/x-www-form-urlencoded",
  638. "token": this.token,
  639. },
  640. method: "POST",
  641. data: {
  642. ecId: this.ecId
  643. },
  644. success: (res) => {
  645. // console.log("isAllowMcSignUp", res)
  646. if (res.data.code == 0) {
  647. const data = res.data.data;
  648. this.allowMcSignUp = data.allowSignUp;
  649. }
  650. },
  651. fail: (err) => {
  652. console.log("isAllowMcSignUp err", err)
  653. },
  654. });
  655. },
  656. btnBack() {
  657. // window.history.back();
  658. /* uni.navigateTo({
  659. url: "/pages/bm/style4/rankOverview?" + this.queryString
  660. }); */
  661. const url = `action://to_home/`;
  662. tools.appAction(url);
  663. },
  664. btnStartGame() {
  665. // uni.navigateTo({
  666. // url: "/pages/bm/style4/rankOverview?" + this.queryString
  667. // });
  668. const url = "/pages/bm/style4/rankOverview?" + this.queryString;
  669. tools.appAction(url, "uni.navigateTo");
  670. },
  671. btnInfo() {
  672. // console.log(this.$refs.mypopup);
  673. this.$refs.mypopup.popupOpen();
  674. },
  675. btnMyEgg() {
  676. // uni.navigateTo({
  677. // url: "/pages/achievement/index2?tabCurrent=2&" + this.queryString
  678. // });
  679. const url = "/pages/achievement/index2?tabCurrent=2&" + this.queryString;
  680. tools.appAction(url, "uni.navigateTo");
  681. },
  682. btnExchg() {
  683. this.$refs.mypopupExchg.popupOpen();
  684. },
  685. onTab1Click(val) {
  686. // console.log("onTab1Click: ", val);
  687. this.tab1Current = val;
  688. },
  689. onTab2Click(val) {
  690. // console.log("onTab2Click: ", val);
  691. this.tab2Current = val;
  692. },
  693. onSelectChange(val) {
  694. console.log("onSelectChange: ", val);
  695. this.ocaId = val.value;
  696. this.getCardRankDetailQuery();
  697. uni.setStorageSync(this.mapKey, this.ocaId);
  698. },
  699. }
  700. }
  701. </script>
  702. <style scoped>
  703. .content {
  704. width: 100vw;
  705. height: 100vh;
  706. }
  707. .top-default {
  708. width: 100%;
  709. height: 170px;
  710. padding-top: 36px;
  711. justify-content: space-between;
  712. background-image: url('static/backgroud/top_bg_sddx.png');
  713. background-repeat: no-repeat;
  714. background-position: center;
  715. background-size: cover;
  716. }
  717. .topbar {
  718. width: 90%;
  719. justify-content: space-between;
  720. }
  721. .topbar-color-default {
  722. color: #ffffff !important;
  723. }
  724. .topbar-back {
  725. width: 43rpx;
  726. height: 43rpx;
  727. color: inherit !important;
  728. font-size: 48rpx !important;
  729. /* opacity: 0; */
  730. }
  731. .topbar-info {
  732. width: 46rpx;
  733. height: 46rpx;
  734. }
  735. .topbar-rule {
  736. font-size: 32rpx;
  737. }
  738. .topcontent {
  739. width: 90%;
  740. /* height: 90%; */
  741. margin-bottom: 20px;
  742. }
  743. .logo {
  744. width: 80px;
  745. height: 80px;
  746. margin-top: 10px;
  747. margin-bottom: 10px;
  748. /* background-image: url('/static/logo/sddx.png'); */
  749. background-repeat: no-repeat;
  750. background-position-x: center;
  751. background-position-y: center;
  752. background-size: contain;
  753. }
  754. .tcbar {
  755. display: none;
  756. width: 92%;
  757. padding: 6px 12px;
  758. background: #9a300e;
  759. border-radius: 6px;
  760. }
  761. .tcbar-text {
  762. font-family: Source Han Sans CN;
  763. font-weight: 500;
  764. color: #f3d809;
  765. font-size: 13px;
  766. }
  767. .mcName {
  768. font-size: 40rpx;
  769. font-weight: 550;
  770. }
  771. .topbtm {
  772. width: 100%;
  773. margin-bottom: 5px;
  774. justify-content: space-around;
  775. }
  776. .topbtm-name {
  777. padding: 3px 12px;
  778. background-color: #9fda39;
  779. border-radius: 5px;
  780. text-align: center;
  781. font-weight: 500;
  782. color: #497400;
  783. font-size: 14px;
  784. }
  785. .topbtm-egg {
  786. width: 60px;
  787. padding: 3px 12px;
  788. background-color: #c6690a;
  789. border-radius: 50px;
  790. text-align: center;
  791. color: #ffffff;
  792. font-size: 14px;
  793. }
  794. .topbtm-null {
  795. width: 60px;
  796. padding: 3px 12px;
  797. }
  798. .cal {
  799. width: 46rpx;
  800. height: 46rpx;
  801. margin-right: 20rpx;
  802. }
  803. .main {
  804. width: 100%;
  805. /* height: 70vh; */
  806. flex-grow: 1;
  807. justify-content: space-around;
  808. /* justify-content: space-between; */
  809. }
  810. /* /deep/ .tab-active {
  811. background-color: #a43a07 !important;
  812. } */
  813. .main-tab {
  814. width: 90%;
  815. margin-top: 20rpx;
  816. }
  817. .tab-view {
  818. width: 100%;
  819. /* height: 69vh; */
  820. flex-grow: 1;
  821. }
  822. .btnBack {
  823. width: 70%;
  824. height: 80rpx;
  825. margin-bottom: 20rpx;
  826. /* font-weight: bold; */
  827. color: white;
  828. font-size: 32rpx;
  829. line-height: 80rpx;
  830. border-radius: 27px;
  831. background-color: #2e85ec;
  832. }
  833. /* .swiper-item-button {
  834. background-color: #ff870e !important;
  835. }
  836. .uni-swiper-dot-active {
  837. background: #ff870e !important;
  838. } */
  839. </style>