rankList.vue 21 KB

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