rankList.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. <!--
  2. [报名] 样式2 - 排名列表
  3. http://localhost:5173/card/#/pages/bm/style2/rankList
  4. https://oss-mbh5.colormaprun.com/card/#/pages/bm/style2/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="topbtm uni-column">
  13. <text class="topbtm-name">姓名:{{nickName}}</text>
  14. </view>
  15. </view>
  16. <view class="main uni-column">
  17. <uni-segmented-control class="main-tab" :current="tabCurrent" :values="tabItems"
  18. @clickItem="onClickTabItem" styleType="button" :activeColor="tabActiveColor"></uni-segmented-control>
  19. <view class="tab-view uni-column">
  20. <!-- 总距离 -->
  21. <my-ranklist v-show="tabCurrent === 0" :rankRs="rankList.totalDistanceRs" rank-type="totalDistance"></my-ranklist>
  22. <!-- 打点数 -->
  23. <my-ranklist v-show="tabCurrent === 1" :rankRs="rankList.totalCpRs" rank-type="totalCp"></my-ranklist>
  24. <!-- 百味豆 -->
  25. <my-ranklist v-show="tabCurrent === 2" :rankRs="rankList.totalSysPointRs" rank-type="totalSysPoint"></my-ranklist>
  26. <!-- 配速 -->
  27. <my-ranklist v-show="tabCurrent === 3" :rankRs="rankList.fastPaceRs" rank-type="fastPace"></my-ranklist>
  28. </view>
  29. <button class="btnBack" @click="btnStartGame">{{btnStartGameText}}</button>
  30. <!-- <button class="btnBack" @click="btnBack">返回</button> -->
  31. </view>
  32. <my-popup ref="mypopup" :config="popupRuleConfig" :dataList="popupDataList" :acttime="acttime"></my-popup>
  33. <my-popup ref="mypopupMessage" :config="popupMessageConfig" :dataList="popupMessageList" @noMoreRemindersClick="onNoMoreRemindersClick"></my-popup>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import tools from '/common/tools';
  39. import { teamName, defaultPopUpDataList } from '/common/define';
  40. import {
  41. token,
  42. apiMatchRsDetailQuery,
  43. apiCardRankDetailQuery,
  44. apiCardConfigQuery,
  45. apiUserCurrentRankNumQuery,
  46. apiIsAllowMcSignUp,
  47. apiUserJoinCardQuery,
  48. apiUnReadMessageQuery,
  49. apiReadMessage,
  50. checkResCode
  51. } from '/common/api';
  52. export default {
  53. data() {
  54. return {
  55. pageName: "rankList",
  56. firstEnterKey: 'firstEnter-bm-style2',
  57. rankKey: "rank-bm-style2",
  58. messageKey: "message-bm-style2",
  59. queryObj: {},
  60. queryString: "",
  61. token: "",
  62. ovtype: "",
  63. ecId: 0, // 卡片id
  64. mcId: 0, // 赛事id
  65. mcType: 0, // 赛事类型 1 普通活动 2 线下赛 3 线上赛
  66. mcName: "", // 赛事名称
  67. acttime: "", // 活动时间
  68. beginSecond: null, // 活动或赛事开始时间戳,单位秒
  69. endSecond: null, // 活动或赛事结束时间戳,单位秒
  70. ocaId: 0, // 关联id,带入到App活动详情页面
  71. nickName: "", // 昵称
  72. // totalNum: null, // 总场次
  73. // totalDistanct: null, // 总距离,单位米
  74. // totalDistanctRankNum: null, // 总距离排名
  75. // totalCp: null, // 总打点数
  76. // totalCpRankNum: null, // 总打点数排名
  77. // totalSysPoint: null, // 总百味豆
  78. // totalSysPointRankNum: null, // 总百味豆排名
  79. // fastPace: null, // 个人最快配速
  80. // fastPaceRankNum: null, // 个人最快配速排名
  81. // ocaRs: [], // 卡片对应活动集合
  82. isJoin: null, // 是否报名
  83. btnStartGameText: "",
  84. mcState: 0 , // 赛事/活动状态 0: 未开始 1: 进行中 2: 已结束
  85. allowMcSignUp: false, // 是否允许重新分组
  86. countdown: "", // 倒计时
  87. rankList: { // 排名列表
  88. totalDistanceRs: [],
  89. totalCpRs: [],
  90. totalSysPointRs: [],
  91. fastPaceRs: []
  92. },
  93. interval: null,
  94. teamType: 0, // 队伍类型
  95. dispArrStr: "totalDistance,totalCp,totalSysPoint,fastPace", // 要显示的集合范围
  96. tabItems: ["里程", "打点数", "百味豆", "配速"],
  97. tabCurrent: 0,
  98. tabActiveColor: "#81cd00",
  99. cssTop: "",
  100. cssTopbarColor: "",
  101. popupRuleConfig: {}, // 规则弹窗配置
  102. popupMessageConfig: {}, // 通知弹窗配置
  103. popupDataList: [],
  104. popupMessageList: [],
  105. // mqIdListStr: "", // 已读消息id列表 逗号分隔
  106. }
  107. },
  108. computed: {},
  109. onLoad(query) { // 类型非必填,可自动推导
  110. // console.log(query);
  111. this.queryObj = query;
  112. this.queryString = tools.objectToQueryString(this.queryObj);
  113. // console.log(queryString);
  114. this.token = query["token"] ?? token;
  115. this.ecId = query["id"] ?? 0;
  116. this.ovtype = query["ovtype"] ?? "";
  117. this.firstEnterKey += "-" + this.ecId;
  118. console.log("firstEnterKey:", this.firstEnterKey);
  119. this.rankKey += "-" + this.ecId;
  120. console.log("rankKey:", this.rankKey);
  121. this.messageKey += "-" + this.ecId;
  122. console.log("messageKey:", this.messageKey);
  123. tools.removeCssCode();
  124. this.getCardConfigQuery();
  125. this.dealOvtype();
  126. },
  127. // 页面初次渲染完成,此时组件已挂载完成,DOM 树($el)已可用
  128. onReady() {
  129. // this.dealFirstEnter();
  130. },
  131. onShow() {
  132. this.getUserJoinCardQuery();
  133. },
  134. onUnload() {
  135. this.clear();
  136. },
  137. methods: {
  138. dealOvtype() {
  139. if (this.ovtype == "totalDistance") {
  140. this.tabCurrent = 0;
  141. } else if (this.ovtype == "totalCp") {
  142. this.tabCurrent = 1;
  143. } else if (this.ovtype == "totalSysPoint") {
  144. this.tabCurrent = 2;
  145. } else if (this.ovtype == "fastPace") {
  146. this.tabCurrent = 3;
  147. }
  148. console.log(`dealOvtype: ${this.ovtype} tabCurrent: ${this.tabCurrent}`);
  149. },
  150. dealNotice(rank) {
  151. // console.log('[dealFirstEnter]');
  152. let that = this;
  153. uni.getStorage({
  154. key: that.rankKey,
  155. success: (res) => {
  156. console.log('[getStorage]', that.rankKey, res.data);
  157. const oldRank = res.data;
  158. if (oldRank != rank) {
  159. // that.notice = true;
  160. that.setRankValue(rank);
  161. }
  162. },
  163. fail: (e) => {
  164. console.log('[getStorage] fail', that.rankKey, e);
  165. // that.notice = false;
  166. that.setRankValue(rank);
  167. },
  168. })
  169. },
  170. setRankValue(data) {
  171. let that = this;
  172. uni.setStorage({
  173. key: that.rankKey,
  174. data: data,
  175. success: () => {
  176. console.log('[setStorage] success', that.rankKey, data);
  177. },
  178. fail: (e) => {
  179. console.log('[setStorage] fail', that.rankKey, e);
  180. },
  181. })
  182. },
  183. dealFirstEnter() {
  184. // console.log('[dealFirstEnter]');
  185. let that = this;
  186. uni.getStorage({
  187. key: that.firstEnterKey,
  188. success: (res) => {
  189. console.log('[getStorage]', that.firstEnterKey, res.data);
  190. },
  191. fail: (e) => {
  192. console.log('[getStorage] fail', that.firstEnterKey, e);
  193. that.btnInfo();
  194. that.setFirstEnterValue(true);
  195. },
  196. })
  197. },
  198. setFirstEnterValue(data) {
  199. let that = this;
  200. uni.setStorage({
  201. key: that.firstEnterKey,
  202. data: data,
  203. success: () => {
  204. console.log('[setStorage] success', that.firstEnterKey, data);
  205. },
  206. fail: (e) => {
  207. console.log('[setStorage] fail', that.firstEnterKey, e);
  208. },
  209. })
  210. },
  211. clear() {
  212. if (this.interval != null) {
  213. clearInterval(this.interval);
  214. this.interval = null;
  215. }
  216. },
  217. loadConfig(config) {
  218. // console.log("config", config);
  219. // 加载CSS样式
  220. const css = config.css;
  221. if (css != undefined && css.length > 0) {
  222. tools.loadCssCode(css);
  223. if (css.indexOf(".top{") >= 0) {
  224. this.cssTop = "top";
  225. }
  226. if (css.indexOf(".topbar-color{") >= 0) {
  227. this.cssTopbarColor = "topbar-color";
  228. }
  229. }
  230. if (this.cssTop == "") {
  231. this.cssTop = "top-default";
  232. }
  233. if (this.cssTopbarColor == "") {
  234. this.cssTopbarColor = "topbar-color-default";
  235. }
  236. console.log("[loadConfig] cssTop:", this.cssTop);
  237. console.log("[loadConfig] cssTopbarColor:", this.cssTopbarColor);
  238. const tabActiveColor = config.tabActiveColor;
  239. if (tabActiveColor != undefined && tabActiveColor.length > 0) {
  240. this.tabActiveColor = tabActiveColor;
  241. }
  242. // 加载规则弹窗配置
  243. const popupRuleConfig = config.popupRuleConfig;
  244. if (popupRuleConfig != undefined) {
  245. this.popupRuleConfig = popupRuleConfig;
  246. }
  247. // console.log("[loadConfig] popupRuleConfig:", this.popupRuleConfig);
  248. // 加载通知弹窗配置
  249. const popupMessageConfig = config.popupMessageConfig;
  250. if (popupMessageConfig != undefined) {
  251. this.popupMessageConfig = popupMessageConfig;
  252. }
  253. // console.log("[loadConfig] popupMessageConfig:", this.popupMessageConfig);
  254. // 加载弹窗数据
  255. const popupDataList = config.popupDataList;
  256. // console.log("[loadConfig] popupDataList:", popupDataList);
  257. if (popupDataList != undefined && popupDataList.length > 0) {
  258. for (var i = 0; i < popupDataList.length; i++) {
  259. // console.log("[loadConfig] popupDataList", i, popupDataList[i]);
  260. if (popupDataList[i] == 'default') {
  261. for (var j = 0; j < defaultPopUpDataList.length; j++) {
  262. this.popupDataList.push(defaultPopUpDataList[j]);
  263. }
  264. } else {
  265. this.popupDataList.push(popupDataList[i]);
  266. }
  267. }
  268. } else {
  269. this.popupDataList = defaultPopUpDataList;
  270. console.log("[loadConfig] popupDataList 加载默认列表");
  271. }
  272. // console.log("[loadConfig] popupDataList:", this.popupDataList);
  273. },
  274. // 获取倒计时
  275. getCountdown() {
  276. // console.log(this.endSecond)
  277. if (this.endSecond > 0) {
  278. const now = Date.now() / 1000;
  279. const dif = this.endSecond - now;
  280. // const dif = 3600*24 - 60;
  281. if (dif > 0) {
  282. this.countdown = '距结束 ' + tools.convertSecondsToDHM(dif);
  283. } else {
  284. this.countdown = "活动已结束";
  285. }
  286. // this.countdown = tools.convertSecondsToHMS(dif);
  287. } else {
  288. this.countdown = "距结束 --天--小时";
  289. }
  290. },
  291. fmtMcTime(timestamp) {
  292. return tools.fmtMcTime(timestamp);
  293. },
  294. // 获取活动时间
  295. getActtime() {
  296. this.acttime = tools.getActtime(this.beginSecond, this.endSecond);
  297. },
  298. getTeamName(teamType, teamIndex) {
  299. return teamName[teamType][teamIndex];
  300. },
  301. getCardConfigQuery() {
  302. uni.request({
  303. url: apiCardConfigQuery,
  304. header: {
  305. "Content-Type": "application/x-www-form-urlencoded",
  306. "token": this.token,
  307. },
  308. method: "POST",
  309. data: {
  310. ecId: this.ecId,
  311. pageName: this.pageName
  312. },
  313. success: (res) => {
  314. // console.log("getCardConfigQuery", res)
  315. const data = res.data.data;
  316. // console.log("configJson", data.configJson);
  317. const config = data.configJson != "" ? JSON.parse(data.configJson) : "";
  318. // console.log("configJson", data.configJson);
  319. /* const config = {
  320. "css": `
  321. .top{
  322. width: 100%;
  323. height: 170px;
  324. padding-top: 36px;
  325. justify-content: space-between;
  326. background-image: url("static/backgroud/top_bg_aoti3.png");
  327. background-repeat: no-repeat;
  328. background-position: center;
  329. background-size: cover;
  330. }
  331. `,
  332. "tabActiveColor": "#ff870d",
  333. "popupDataList": [{
  334. "type": 1,
  335. "data": {
  336. "title": "小飞龙定向赛",
  337. "img": "/static/logo/xfl.png",
  338. "content": "济南奥体中心“一场三馆”包括体育场、体育馆、网球馆和游泳馆,呈现出“东荷西柳”的总体布局。 体育场以济南的“市树”柳树为母题,将垂柳柔美飘逸的形态固化为建筑语言。"
  339. }
  340. },
  341. "default"
  342. ]
  343. }; */
  344. this.loadConfig(config);
  345. this.getUnReadMessageQuery();
  346. this.matchRsDetailQuery();
  347. setTimeout(this.dealFirstEnter, 500);
  348. },
  349. fail: (err) => {
  350. console.log("getCardConfigQuery err", err)
  351. },
  352. });
  353. },
  354. // 卡片对应活动或赛事详情查询
  355. // getCardDetailQuery() {
  356. // uni.request({
  357. // url: apiCardDetailQuery,
  358. // header: {
  359. // "Content-Type": "application/x-www-form-urlencoded",
  360. // "token": this.token,
  361. // },
  362. // method: "POST",
  363. // data: {
  364. // ecId: this.ecId
  365. // },
  366. // success: (res) => {
  367. // // console.log("getCardDetailQuery", res)
  368. // const data = res.data.data;
  369. // this.mcType = data.mcType;
  370. // this.mcId = data.mcId;
  371. // this.mcName = data.mcName;
  372. // this.beginSecond = data.beginSecond;
  373. // this.endSecond = data.endSecond;
  374. // this.coiName = data.coiName;
  375. // this.teamNum = data.teamNum;
  376. // this.mcState = tools.checkMcState(this.beginSecond, this.endSecond);
  377. // this.getCountdown();
  378. // this.getActtime();
  379. // this.getCardRankDetailQuery();
  380. // this.clear();
  381. // this.interval = setInterval(this.getCountdown, 60000);
  382. // },
  383. // fail: (err) => {
  384. // console.log("getCardDetailQuery err", err)
  385. // },
  386. // });
  387. // },
  388. // 卡片对应线上赛多个活动查询
  389. matchRsDetailQuery() {
  390. uni.request({
  391. url: apiMatchRsDetailQuery,
  392. header: {
  393. "Content-Type": "application/x-www-form-urlencoded",
  394. "token": this.token,
  395. },
  396. method: "POST",
  397. data: {
  398. ecId: this.ecId
  399. },
  400. success: (res) => {
  401. // console.log("matchRsDetailQuery", res);
  402. if (checkResCode(res)) {
  403. const data = res.data.data;
  404. this.mcType = data.mcType;
  405. this.mcId = data.mcId;
  406. this.mcName = data.mcName;
  407. this.beginSecond = data.beginSecond;
  408. this.endSecond = data.endSecond;
  409. this.nickName = data.nickName;
  410. // this.totalNum = data.totalNum;
  411. // this.totalDistanct = data.totalDistanct;
  412. // this.totalDistanctRankNum = data.totalDistanctRankNum;
  413. // this.totalCp = data.totalCp;
  414. // this.totalCpRankNum = data.totalCpRankNum;
  415. // this.totalSysPoint = data.totalSysPoint;
  416. // this.totalSysPointRankNum = data.totalSysPointRankNum;
  417. // this.fastPace = data.fastPace;
  418. // this.fastPaceRankNum = data.fastPaceRankNum;
  419. // this.ocaRs = data.ocaRs;
  420. this.mcState = tools.checkMcState(this.beginSecond, this.endSecond);
  421. this.getCountdown();
  422. this.getActtime();
  423. this.getCardRankDetailQuery();
  424. this.clear();
  425. this.interval = setInterval(this.getCountdown, 60000);
  426. }
  427. },
  428. fail: (err) => {
  429. console.log("matchRsDetailQuery err", err)
  430. },
  431. });
  432. },
  433. // 排名查询
  434. getCardRankDetailQuery() {
  435. uni.request({
  436. url: apiCardRankDetailQuery,
  437. header: {
  438. "Content-Type": "application/x-www-form-urlencoded",
  439. "token": this.token,
  440. },
  441. method: "POST",
  442. data: {
  443. mcIdListStr: this.mcId,
  444. mcType: this.mcType,
  445. dispArrStr: this.dispArrStr
  446. },
  447. success: (res) => {
  448. // console.log("getCardRankDetailQuery", res);
  449. const rankdata = res.data.data;
  450. this.rankList.totalDistanceRs = rankdata.totalDistanceRs;
  451. this.rankList.totalCpRs = rankdata.totalCpRs;
  452. this.rankList.totalSysPointRs = rankdata.totalSysPointRs;
  453. this.rankList.fastPaceRs = rankdata.fastPaceRs;
  454. },
  455. fail: (err) => {
  456. console.log("getCardRankDetailQuery err", err)
  457. },
  458. });
  459. },
  460. // 卡片用户当前排名查询
  461. // getUserCurrentRankNumQuery() {
  462. // uni.request({
  463. // url: apiUserCurrentRankNumQuery,
  464. // header: {
  465. // "Content-Type": "application/x-www-form-urlencoded",
  466. // "token": this.token,
  467. // },
  468. // method: "POST",
  469. // data: {
  470. // ecId: this.ecId
  471. // },
  472. // success: (res) => {
  473. // // console.log("getUserCurrentRankNumQuery", res)
  474. // if (res.data.code == 0) {
  475. // const data = res.data.data;
  476. // const rankNum = data.rankNum;
  477. // this.dealNotice(rankNum);
  478. // }
  479. // },
  480. // fail: (err) => {
  481. // console.log("getUserCurrentRankNumQuery err", err)
  482. // },
  483. // });
  484. // },
  485. // 是否允许重新分组(报名)
  486. isAllowMcSignUp() {
  487. uni.request({
  488. url: apiIsAllowMcSignUp,
  489. header: {
  490. "Content-Type": "application/x-www-form-urlencoded",
  491. "token": this.token,
  492. },
  493. method: "POST",
  494. data: {
  495. ecId: this.ecId
  496. },
  497. success: (res) => {
  498. // console.log("isAllowMcSignUp", res)
  499. if (res.data.code == 0) {
  500. const data = res.data.data;
  501. this.allowMcSignUp = data.allowSignUp;
  502. }
  503. },
  504. fail: (err) => {
  505. console.log("isAllowMcSignUp err", err)
  506. },
  507. });
  508. },
  509. // 用户是否已经报名卡片对应赛事查询
  510. getUserJoinCardQuery() {
  511. uni.request({
  512. url: apiUserJoinCardQuery,
  513. header: {
  514. "Content-Type": "application/x-www-form-urlencoded",
  515. "token": this.token
  516. },
  517. method: "POST",
  518. data: {
  519. ecId: this.ecId
  520. },
  521. success: (res) => {
  522. // console.log("getUserJoinCardQuery", res)
  523. const code = res.data.code;
  524. const data = res.data.data;
  525. if (code == 0) {
  526. this.isJoin = data.isJoin;
  527. if (this.isJoin) { // 已报名
  528. this.btnStartGameText = "我要比赛";
  529. } else { // 未报名
  530. this.btnStartGameText = "我要报名";
  531. }
  532. }
  533. },
  534. fail: (err) => {
  535. console.log("getUserJoinCardQuery err", err)
  536. },
  537. });
  538. },
  539. // 未读消息列表查询
  540. getUnReadMessageQuery() {
  541. uni.request({
  542. url: apiUnReadMessageQuery,
  543. header: {
  544. "Content-Type": "application/x-www-form-urlencoded",
  545. "token": this.token,
  546. },
  547. method: "POST",
  548. data: {
  549. relationType: 2, // 类型 1 成就 2 卡片
  550. relationId: this.ecId
  551. },
  552. success: (res) => {
  553. // console.log("getUnReadMessageQuery", res);
  554. if (checkResCode(res)) {
  555. const unReadMessageRs = res.data.data;
  556. this.popupMessageList.length = 0;
  557. this.mqIdListStr = "";
  558. for (var i = 0; i < unReadMessageRs.length; i++) {
  559. let popupData = {
  560. type: 6, // 6: 通知
  561. data: {}
  562. };
  563. this.messageKey += "-" + unReadMessageRs[i].mqId;
  564. popupData.data.mqType = unReadMessageRs[i].mqType;
  565. popupData.data.title = unReadMessageRs[i].mqTitle;
  566. popupData.data.message = unReadMessageRs[i].mqMessage;
  567. this.popupMessageList.push(popupData);
  568. // this.mqIdListStr += this.unReadMessageRs[i].mqId;
  569. // if (i < this.unReadMessageRs.length - 1) {
  570. // this.mqIdListStr += ",";
  571. // }
  572. }
  573. if (this.popupMessageList.length > 0) {
  574. const messageValue = uni.getStorageSync(this.messageKey);
  575. console.log("messageValue:", messageValue);
  576. if (!messageValue) {
  577. this.$refs.mypopupMessage.popupOpen();
  578. // uni.setStorageSync(this.messageKey, true);
  579. }
  580. }
  581. }
  582. },
  583. fail: (err) => {
  584. console.log("getUnReadMessageQuery err", err);
  585. },
  586. });
  587. },
  588. onNoMoreRemindersClick() {
  589. this.$refs.mypopupMessage.popupClose();
  590. uni.setStorageSync(this.messageKey, true);
  591. },
  592. // 标记消息已读
  593. readMessage() {
  594. uni.request({
  595. url: apiReadMessage,
  596. header: {
  597. "Content-Type": "application/x-www-form-urlencoded",
  598. "token": this.token,
  599. },
  600. method: "POST",
  601. data: {
  602. "mqIdListStr": this.mqIdListStr
  603. },
  604. success: (res) => {
  605. // console.log("readMessage", res);
  606. },
  607. fail: (err) => {
  608. console.log("readMessage err", err);
  609. },
  610. });
  611. },
  612. btnBack() {
  613. // window.history.back();
  614. // uni.navigateTo({
  615. // url: "/pages/bm/style2/rankOverview?" + this.queryString
  616. // });
  617. const url = `action://to_home/`;
  618. tools.appAction(url);
  619. },
  620. btnStartGame() {
  621. if (this.isJoin) { // 已报名
  622. const url = "/pages/bm/style2/rankOverview?" + this.queryString;
  623. tools.appAction(url, "uni.navigateTo");
  624. } else { // 未报名
  625. const url = "/pages/bm/style2/signup?" + this.queryString;
  626. tools.appAction(url, "uni.navigateTo");
  627. }
  628. },
  629. btnInfo() {
  630. // console.log(this.$refs.mypopup);
  631. this.$refs.mypopup.popupOpen();
  632. },
  633. btnMessage() {
  634. // console.log(this.$refs.mypopup);
  635. this.$refs.mypopupMessage.popupOpen();
  636. },
  637. onClickTabItem(e) {
  638. if (this.tabCurrent != e.currentIndex) {
  639. this.tabCurrent = e.currentIndex;
  640. }
  641. }
  642. }
  643. }
  644. </script>
  645. <style scoped>
  646. .content {
  647. width: 100vw;
  648. height: 100vh;
  649. }
  650. .top-default {
  651. width: 100%;
  652. height: 170px;
  653. padding-top: 36px;
  654. justify-content: space-between;
  655. background-image: url("/static/backgroud/top_bg_aoti3.png");
  656. background-repeat: no-repeat;
  657. background-position: center;
  658. background-size: cover;
  659. }
  660. .topbar-color-default {
  661. color: #5b9100;
  662. }
  663. .topbtm {
  664. width: 100%;
  665. margin-bottom: 5px;
  666. justify-content: space-evenly;
  667. }
  668. .topbtm-name {
  669. padding: 3px 12px;
  670. background-color: #9fda39;
  671. border-radius: 5px;
  672. text-align: center;
  673. font-weight: 500;
  674. color: #497400;
  675. font-size: 14px;
  676. }
  677. .cal {
  678. width: 46rpx;
  679. height: 46rpx;
  680. margin-right: 20rpx;
  681. }
  682. .main {
  683. width: 100%;
  684. /* height: 70vh; */
  685. flex-grow: 1;
  686. justify-content: space-around;
  687. /* justify-content: space-between; */
  688. }
  689. .main-tab {
  690. width: 90%;
  691. margin-top: 20rpx;
  692. }
  693. .tab-view {
  694. width: 100%;
  695. /* height: 69vh; */
  696. flex-grow: 1;
  697. }
  698. .btnBack {
  699. width: 70%;
  700. /* height: 6vh; */
  701. height: 80rpx;
  702. /* margin-bottom: 1vh; */
  703. margin-bottom: 20rpx;
  704. /* font-weight: bold; */
  705. color: white;
  706. font-size: 32rpx;
  707. line-height: 80rpx;
  708. border-radius: 27px;
  709. background-color: #81cd00;
  710. }
  711. </style>