rankList.vue 26 KB

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