rankList.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  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 } 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 {
  266. this.popupDataList.push(popupDataList[i]);
  267. }
  268. }
  269. } else {
  270. this.popupDataList = defaultPopUpDataList;
  271. console.log("[loadConfig] popupDataList 加载默认列表");
  272. }
  273. // console.log("[loadConfig] popupDataList:", this.popupDataList);
  274. this.pageReady = true;
  275. },
  276. // 获取倒计时
  277. getCountdown() {
  278. // console.log(this.endSecond)
  279. if (this.endSecond > 0) {
  280. const now = Date.now() / 1000;
  281. const dif = this.endSecond - now;
  282. // const dif = 3600*24 - 60;
  283. if (dif > 0) {
  284. this.countdown = '距结束 ' + tools.convertSecondsToDHM(dif);
  285. } else {
  286. this.countdown = "活动已结束";
  287. }
  288. // this.countdown = tools.convertSecondsToHMS(dif);
  289. } else {
  290. this.countdown = "距结束 --天--小时";
  291. }
  292. },
  293. fmtMcTime(timestamp) {
  294. return tools.fmtMcTime(timestamp);
  295. },
  296. // 获取活动时间
  297. getActtime() {
  298. this.acttime = tools.getActtime(this.beginSecond, this.endSecond);
  299. },
  300. getTeamName(teamType, teamIndex) {
  301. return teamName[teamType][teamIndex];
  302. },
  303. getCardConfigQuery() {
  304. uni.request({
  305. url: apiCardConfigQuery,
  306. header: {
  307. "Content-Type": "application/x-www-form-urlencoded",
  308. "token": this.token,
  309. },
  310. method: "POST",
  311. data: {
  312. ecId: this.ecId,
  313. pageName: this.pageName
  314. },
  315. success: (res) => {
  316. // console.log("getCardConfigQuery", res)
  317. const data = res.data.data;
  318. // console.log("configJson", data.configJson);
  319. const config = data.configJson != "" ? JSON.parse(data.configJson) : "";
  320. // console.log("configJson", data.configJson);
  321. /* const config = {
  322. "css": `
  323. .top{
  324. width: 100%;
  325. height: 170px;
  326. padding-top: 36px;
  327. justify-content: space-between;
  328. background-image: url("static/backgroud/top_bg_aoti3.png");
  329. background-repeat: no-repeat;
  330. background-position: center;
  331. background-size: cover;
  332. }
  333. `,
  334. "tabActiveColor": "#ff870d",
  335. "popupDataList": [{
  336. "type": 1,
  337. "data": {
  338. "title": "小飞龙定向赛",
  339. "img": "/static/logo/xfl.png",
  340. "content": "济南奥体中心“一场三馆”包括体育场、体育馆、网球馆和游泳馆,呈现出“东荷西柳”的总体布局。 体育场以济南的“市树”柳树为母题,将垂柳柔美飘逸的形态固化为建筑语言。"
  341. }
  342. },
  343. "default"
  344. ]
  345. }; */
  346. this.loadConfig(config);
  347. this.getUnReadMessageQuery();
  348. this.matchRsDetailQuery();
  349. setTimeout(this.dealFirstEnter, 500);
  350. },
  351. fail: (err) => {
  352. console.log("getCardConfigQuery err", err)
  353. },
  354. });
  355. },
  356. // 卡片对应活动或赛事详情查询
  357. // getCardDetailQuery() {
  358. // uni.request({
  359. // url: apiCardDetailQuery,
  360. // header: {
  361. // "Content-Type": "application/x-www-form-urlencoded",
  362. // "token": this.token,
  363. // },
  364. // method: "POST",
  365. // data: {
  366. // ecId: this.ecId
  367. // },
  368. // success: (res) => {
  369. // // console.log("getCardDetailQuery", res)
  370. // const data = res.data.data;
  371. // this.mcType = data.mcType;
  372. // this.mcId = data.mcId;
  373. // this.mcName = data.mcName;
  374. // this.beginSecond = data.beginSecond;
  375. // this.endSecond = data.endSecond;
  376. // this.coiName = data.coiName;
  377. // this.teamNum = data.teamNum;
  378. // this.mcState = tools.checkMcState(this.beginSecond, this.endSecond);
  379. // this.getCountdown();
  380. // this.getActtime();
  381. // this.getCardRankDetailQuery();
  382. // this.clear();
  383. // this.interval = setInterval(this.getCountdown, 60000);
  384. // },
  385. // fail: (err) => {
  386. // console.log("getCardDetailQuery err", err)
  387. // },
  388. // });
  389. // },
  390. // 卡片对应线上赛多个活动查询
  391. matchRsDetailQuery() {
  392. uni.request({
  393. url: apiMatchRsDetailQuery,
  394. header: {
  395. "Content-Type": "application/x-www-form-urlencoded",
  396. "token": this.token,
  397. },
  398. method: "POST",
  399. data: {
  400. ecId: this.ecId
  401. },
  402. success: (res) => {
  403. // console.log("matchRsDetailQuery", res);
  404. if (checkResCode(res)) {
  405. const data = res.data.data;
  406. this.mcType = data.mcType;
  407. this.mcId = data.mcId;
  408. this.mcName = data.mcName;
  409. this.beginSecond = data.beginSecond;
  410. this.endSecond = data.endSecond;
  411. this.nickName = data.nickName;
  412. // this.totalNum = data.totalNum;
  413. // this.totalDistanct = data.totalDistanct;
  414. // this.totalDistanctRankNum = data.totalDistanctRankNum;
  415. // this.totalCp = data.totalCp;
  416. // this.totalCpRankNum = data.totalCpRankNum;
  417. // this.totalSysPoint = data.totalSysPoint;
  418. // this.totalSysPointRankNum = data.totalSysPointRankNum;
  419. // this.fastPace = data.fastPace;
  420. // this.fastPaceRankNum = data.fastPaceRankNum;
  421. // this.ocaRs = data.ocaRs;
  422. this.mcState = tools.checkMcState(this.beginSecond, this.endSecond);
  423. this.getCountdown();
  424. this.getActtime();
  425. this.getCardRankDetailQuery();
  426. this.clear();
  427. this.interval = setInterval(this.getCountdown, 60000);
  428. }
  429. },
  430. fail: (err) => {
  431. console.log("matchRsDetailQuery err", err)
  432. },
  433. });
  434. },
  435. // 排名查询
  436. getCardRankDetailQuery() {
  437. uni.request({
  438. url: apiCardRankDetailQuery,
  439. header: {
  440. "Content-Type": "application/x-www-form-urlencoded",
  441. "token": this.token,
  442. },
  443. method: "POST",
  444. data: {
  445. mcIdListStr: this.mcId,
  446. mcType: this.mcType,
  447. dispArrStr: this.dispArrStr
  448. },
  449. success: (res) => {
  450. // console.log("getCardRankDetailQuery", res);
  451. const rankdata = res.data.data;
  452. this.rankList.totalDistanceRs = rankdata.totalDistanceRs;
  453. this.rankList.totalCpRs = rankdata.totalCpRs;
  454. this.rankList.totalSysPointRs = rankdata.totalSysPointRs;
  455. this.rankList.fastPaceRs = rankdata.fastPaceRs;
  456. },
  457. fail: (err) => {
  458. console.log("getCardRankDetailQuery err", err)
  459. },
  460. });
  461. },
  462. // 卡片用户当前排名查询
  463. // getUserCurrentRankNumQuery() {
  464. // uni.request({
  465. // url: apiUserCurrentRankNumQuery,
  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("getUserCurrentRankNumQuery", res)
  476. // if (res.data.code == 0) {
  477. // const data = res.data.data;
  478. // const rankNum = data.rankNum;
  479. // this.dealNotice(rankNum);
  480. // }
  481. // },
  482. // fail: (err) => {
  483. // console.log("getUserCurrentRankNumQuery err", err)
  484. // },
  485. // });
  486. // },
  487. // 是否允许重新分组(报名)
  488. isAllowMcSignUp() {
  489. uni.request({
  490. url: apiIsAllowMcSignUp,
  491. header: {
  492. "Content-Type": "application/x-www-form-urlencoded",
  493. "token": this.token,
  494. },
  495. method: "POST",
  496. data: {
  497. ecId: this.ecId
  498. },
  499. success: (res) => {
  500. // console.log("isAllowMcSignUp", res)
  501. if (res.data.code == 0) {
  502. const data = res.data.data;
  503. this.allowMcSignUp = data.allowSignUp;
  504. }
  505. },
  506. fail: (err) => {
  507. console.log("isAllowMcSignUp err", err)
  508. },
  509. });
  510. },
  511. // 用户是否已经报名卡片对应赛事查询
  512. getUserJoinCardQuery() {
  513. uni.request({
  514. url: apiUserJoinCardQuery,
  515. header: {
  516. "Content-Type": "application/x-www-form-urlencoded",
  517. "token": this.token
  518. },
  519. method: "POST",
  520. data: {
  521. ecId: this.ecId
  522. },
  523. success: (res) => {
  524. // console.log("getUserJoinCardQuery", res)
  525. const code = res.data.code;
  526. const data = res.data.data;
  527. if (code == 0) {
  528. this.isJoin = data.isJoin;
  529. if (this.isJoin) { // 已报名
  530. this.btnStartGameText = "我要比赛";
  531. } else { // 未报名
  532. this.btnStartGameText = "我要报名";
  533. }
  534. }
  535. },
  536. fail: (err) => {
  537. console.log("getUserJoinCardQuery err", err)
  538. },
  539. });
  540. },
  541. // 未读消息列表查询
  542. getUnReadMessageQuery() {
  543. uni.request({
  544. url: apiUnReadMessageQuery,
  545. header: {
  546. "Content-Type": "application/x-www-form-urlencoded",
  547. "token": this.token,
  548. },
  549. method: "POST",
  550. data: {
  551. relationType: 2, // 类型 1 成就 2 卡片
  552. relationId: this.ecId
  553. },
  554. success: (res) => {
  555. // console.log("getUnReadMessageQuery", res);
  556. if (checkResCode(res)) {
  557. const unReadMessageRs = res.data.data;
  558. this.popupMessageList.length = 0;
  559. this.mqIdListStr = "";
  560. for (var i = 0; i < unReadMessageRs.length; i++) {
  561. let popupData = {
  562. type: 6, // 6: 通知
  563. data: {}
  564. };
  565. this.messageKey += "-" + unReadMessageRs[i].mqId;
  566. popupData.data.mqType = unReadMessageRs[i].mqType;
  567. popupData.data.title = unReadMessageRs[i].mqTitle;
  568. popupData.data.message = unReadMessageRs[i].mqMessage;
  569. this.popupMessageList.push(popupData);
  570. // this.mqIdListStr += this.unReadMessageRs[i].mqId;
  571. // if (i < this.unReadMessageRs.length - 1) {
  572. // this.mqIdListStr += ",";
  573. // }
  574. }
  575. if (this.popupMessageList.length > 0) {
  576. const messageValue = uni.getStorageSync(this.messageKey);
  577. console.log("messageValue:", messageValue);
  578. if (!messageValue) {
  579. this.$refs.mypopupMessage.popupOpen();
  580. // uni.setStorageSync(this.messageKey, true);
  581. }
  582. }
  583. }
  584. },
  585. fail: (err) => {
  586. console.log("getUnReadMessageQuery err", err);
  587. },
  588. });
  589. },
  590. onNoMoreRemindersClick() {
  591. this.$refs.mypopupMessage.popupClose();
  592. uni.setStorageSync(this.messageKey, true);
  593. },
  594. // 标记消息已读
  595. readMessage() {
  596. uni.request({
  597. url: apiReadMessage,
  598. header: {
  599. "Content-Type": "application/x-www-form-urlencoded",
  600. "token": this.token,
  601. },
  602. method: "POST",
  603. data: {
  604. "mqIdListStr": this.mqIdListStr
  605. },
  606. success: (res) => {
  607. // console.log("readMessage", res);
  608. },
  609. fail: (err) => {
  610. console.log("readMessage err", err);
  611. },
  612. });
  613. },
  614. btnBack() {
  615. // window.history.back();
  616. // uni.navigateTo({
  617. // url: "/pages/bm/style2/rankOverview?" + this.queryString
  618. // });
  619. const url = `action://to_home/`;
  620. tools.appAction(url);
  621. },
  622. btnStartGame() {
  623. if (this.isJoin) { // 已报名
  624. const url = "/pages/bm/style2/rankOverview?" + this.queryString;
  625. tools.appAction(url, "uni.navigateTo");
  626. } else { // 未报名
  627. const url = "/pages/bm/style2/signup?" + this.queryString;
  628. tools.appAction(url, "uni.navigateTo");
  629. }
  630. },
  631. btnInfo() {
  632. // console.log(this.$refs.mypopup);
  633. this.$refs.mypopup.popupOpen();
  634. },
  635. btnMessage() {
  636. // console.log(this.$refs.mypopup);
  637. this.$refs.mypopupMessage.popupOpen();
  638. },
  639. onClickTabItem(e) {
  640. if (this.tabCurrent != e.currentIndex) {
  641. this.tabCurrent = e.currentIndex;
  642. }
  643. }
  644. }
  645. }
  646. </script>
  647. <style scoped>
  648. .content {
  649. width: 100vw;
  650. height: 100vh;
  651. }
  652. .top-default {
  653. width: 100%;
  654. height: 170px;
  655. padding-top: 36px;
  656. justify-content: space-between;
  657. background-image: url("/static/backgroud/top_bg_aoti3.png");
  658. background-repeat: no-repeat;
  659. background-position: center;
  660. background-size: cover;
  661. }
  662. .topbar-color-default {
  663. color: #5b9100;
  664. }
  665. .topbtm {
  666. width: 100%;
  667. margin-bottom: 5px;
  668. justify-content: space-evenly;
  669. }
  670. .topbtm-name {
  671. padding: 3px 12px;
  672. background-color: #9fda39;
  673. border-radius: 5px;
  674. text-align: center;
  675. font-weight: 500;
  676. color: #497400;
  677. font-size: 14px;
  678. }
  679. .cal {
  680. width: 46rpx;
  681. height: 46rpx;
  682. margin-right: 20rpx;
  683. }
  684. .main {
  685. width: 100%;
  686. /* height: 70vh; */
  687. flex-grow: 1;
  688. justify-content: space-around;
  689. /* justify-content: space-between; */
  690. }
  691. .main-tab {
  692. width: 90%;
  693. margin-top: 20rpx;
  694. }
  695. .tab-view {
  696. width: 100%;
  697. /* height: 69vh; */
  698. flex-grow: 1;
  699. }
  700. .btnBack {
  701. width: 70%;
  702. /* height: 6vh; */
  703. height: 80rpx;
  704. /* margin-bottom: 1vh; */
  705. margin-bottom: 20rpx;
  706. /* font-weight: bold; */
  707. color: white;
  708. font-size: 32rpx;
  709. line-height: 80rpx;
  710. border-radius: 27px;
  711. background-color: #81cd00;
  712. }
  713. </style>