rankList.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239
  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="tcview uni-row uni-jcsb">
  14. <view class="tcbox uni-column uni-jcc">
  15. <text class="tcbox-label">赛事总里程</text>
  16. <text class="tcbox-value">{{fmtDistanct(all_totalDistance)}} 千米</text>
  17. </view>
  18. <view class="tcbox uni-column uni-jcc">
  19. <text class="tcbox-label">{{configParam.labelRightAnswerNum}}</text>
  20. <text class="tcbox-value">{{all_totalAnswerNum}} 次</text>
  21. </view>
  22. </view>
  23. </view>
  24. <!-- <view class="topcontent uni-column uni-jcsa">
  25. <view class="logo"></view>
  26. <view class="tcbar uni-row uni-jcsb">
  27. <text class="tcbar-text">赛事总里程:{{fmtDistanct(all_totalDistance)}} 千米</text>
  28. <text class="tcbar-text">{{configParam.labelRightAnswerNum}}:{{all_totalAnswerNum}} 次</text>
  29. </view>
  30. </view> -->
  31. <view class="topbtm uni-row">
  32. <view class="topbtm-egg" @click="btnMyEgg">我的奖券</view>
  33. <text class="topbtm-name">{{nickName}}</text>
  34. <view class="topbtm-egg" @click="btnExchg">兑奖地址</view>
  35. </view>
  36. </view>
  37. <view class="main uni-column">
  38. <my-tab ref="tab1" :tabItems="tab1Items" :type="1" @onTabClick="onTab1Click"
  39. @onSelectChange="onSelectChange"></my-tab>
  40. <my-tab ref="tab2" :tabItems="tab2Items" :tabItemsMark="tab2ItemsMark" :type="0"
  41. @onTabClick="onTab2Click" :fontSize="12"></my-tab>
  42. <view class="tab-view uni-column">
  43. <!-- 团体成绩列表 -->
  44. <template v-if="tab1Current==0" v-for="(item, index) in rank1List" :key="index">
  45. <my-ranklist v-show="tab2Current === index" :rankRs="rankList[item]"
  46. :rank-type="rankTypeList[index]"></my-ranklist>
  47. </template>
  48. <!-- 个人成绩列表 -->
  49. <template v-if="tab1Current==1" v-for="(item, index) in rank2List" :key="index">
  50. <my-ranklist v-show="tab2Current === index" :rankRs="rankList[item]"
  51. :rank-type="rankTypeList[index]"></my-ranklist>
  52. </template>
  53. </view>
  54. <button class="btnBack" @click="btnStartGame">我要比赛</button>
  55. <!-- <button class="btnBack" @click="btnBack">返回</button> -->
  56. </view>
  57. <my-popup ref="mypopup" :config="popupRuleConfig" :dataList="popupDataList" :acttime="acttime"></my-popup>
  58. <my-popup ref="mypopupExchg" :config="popupExchgConfig" :dataList="popupExchgList"></my-popup>
  59. <my-popup ref="mypopupMessage" :dataList="popupMessageList"></my-popup>
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. import tools from '/common/tools';
  65. import {
  66. teamName,
  67. defaultPopUpDataList
  68. } from '/common/define';
  69. import {
  70. token,
  71. apiMatchRsDetailQuery,
  72. apiCardRankDetailQuery,
  73. apiCardConfigQuery,
  74. apiUserCurrentRankNumQuery,
  75. apiIsAllowMcSignUp,
  76. apiMapListQuery,
  77. apiCompStatisticQuery,
  78. apiUnReadMessageQuery,
  79. apiReadMessage,
  80. checkResCode
  81. } from '/common/api';
  82. export default {
  83. data() {
  84. return {
  85. pageName: "rankList",
  86. firstEnterKey: 'firstEnter-bm-style4',
  87. rankKey: "rank-bm-style4",
  88. mapKey: "rank-bm-style4-map",
  89. messageKey: "message-bm-style4",
  90. queryObj: {},
  91. queryString: "",
  92. token: "",
  93. ovtype: "",
  94. ecId: 0, // 卡片id
  95. mcId: 0, // 赛事id
  96. mcType: 0, // 赛事类型 1 普通活动 2 线下赛 3 线上赛
  97. mcName: "", // 赛事名称
  98. acttime: "", // 活动时间
  99. beginSecond: null, // 活动或赛事开始时间戳,单位秒
  100. endSecond: null, // 活动或赛事结束时间戳,单位秒
  101. ocaId: 0, // 关联id,带入到App活动详情页面
  102. nickName: "", // 昵称
  103. mapList: [], // 卡片对应地图列表详情
  104. all_totalDistance: 0, // 赛事所有人累计里程,单位米
  105. all_totalRightAnswerNum: 0, // 赛事所有人正确答题数(校园文化输出)
  106. all_totalAnswerNum: 0, // 赛事所有人答题数(校园文化输出)
  107. all_totalCp: 0, // 赛事中所有人打点数
  108. all_totalSysPoint: 0, // 赛事中所有人百味豆
  109. mcState: 0, // 赛事/活动状态 0: 未开始 1: 进行中 2: 已结束
  110. allowMcSignUp: false, // 是否允许重新分组
  111. countdown: "", // 倒计时
  112. rankList: { // 排名列表
  113. // totalDistanceRs: [],
  114. // totalCpRs: [],
  115. // totalSysPointRs: [],
  116. // fastPaceRs: []
  117. },
  118. interval: null,
  119. teamType: 0, // 队伍类型
  120. // dispArrStr: "totalDistance,totalCp,totalSysPoint,fastPace",
  121. dispArrStr: "teamCp,teamDistance,teamRightAnswerPer,teamPace,teamSpeed,regionCp,regionDistance,regionRightAnswerPer,regionPace,regionSpeed", // 要显示的集合范围
  122. tab1Current: 0,
  123. tab2Current: 0,
  124. tab1Items: ["团体"],
  125. // tab1Items: ["团体", {
  126. // selectValue: 1,
  127. // data: [
  128. // {text: "个人(中心校区)", value: 1},
  129. // {text: "个人(千佛山校区南区)", value: 2},
  130. // {text: "个人(兴隆校区)", value: 3}
  131. // ]}
  132. // ],
  133. // tab2Items: ["打点数", "总里程", "百味豆", "配速"],
  134. tab2Items: ["总积分", "总里程", "校园文化", "最快配速", "单场用时"],
  135. tab2ItemsMark: [{
  136. textColor: "#ff6203",
  137. icon: "static/common/award.png"
  138. }],
  139. tabActiveColor: "#81cd00",
  140. // 成绩类型列表
  141. rankTypeList: ["totalScore", "totalDistance", "rightAnswerPer", "fastPace", "fastPace"],
  142. // 团体成绩列表
  143. rank1List: ["teamCpRs", "teamDistanceRs", "teamRightAnswerPerRs", "teamPaceRs", "teamSpeedRs"],
  144. // 个人成绩列表
  145. rank2List: ["regionCpRs", "regionDistanceRs", "regionRightAnswerPerRs", "regionPaceRs", "regionSpeedRs"],
  146. cssTop: "",
  147. cssTopbarColor: "",
  148. configParam: {
  149. labelRightAnswerNum: "文化输出"
  150. },
  151. // selectedMapId: 0, // 用户选择的地图ID
  152. popupRuleConfig: {}, // 规则弹窗配置
  153. popupExchgConfig: {}, // 兑换地址弹窗配置
  154. popupDataList: [],
  155. popupExchgList: [],
  156. popupMessageList: [],
  157. // mqIdListStr: "", // 已读消息id列表 逗号分隔
  158. }
  159. },
  160. computed: {},
  161. onLoad(query) { // 类型非必填,可自动推导
  162. // console.log(query);
  163. this.queryObj = query;
  164. this.queryString = tools.objectToQueryString(this.queryObj);
  165. // console.log(queryString);
  166. this.token = query["token"] ?? token;
  167. this.ecId = query["id"] ?? 0;
  168. this.ovtype = query["ovtype"] ?? "";
  169. this.firstEnterKey += "-" + this.ecId;
  170. console.log("firstEnterKey:", this.firstEnterKey);
  171. this.rankKey += "-" + this.ecId;
  172. console.log("rankKey:", this.rankKey);
  173. this.mapKey += "-" + this.ecId;
  174. console.log("mapKey:", this.mapKey);
  175. this.messageKey += "-" + this.ecId;
  176. console.log("messageKey:", this.messageKey);
  177. tools.removeCssCode();
  178. const mapValue = uni.getStorageSync(this.mapKey);
  179. if (mapValue) {
  180. console.log("mapValue:", mapValue);
  181. // this.selectedMapId = mapValue;
  182. this.ocaId = mapValue;
  183. }
  184. this.getCardConfigQuery();
  185. },
  186. // 页面初次渲染完成,此时组件已挂载完成,DOM 树($el)已可用
  187. onReady() {
  188. // this.dealFirstEnter();
  189. },
  190. onUnload() {
  191. this.clear();
  192. },
  193. methods: {
  194. dealNotice(rank) {
  195. // console.log('[dealFirstEnter]');
  196. let that = this;
  197. uni.getStorage({
  198. key: that.rankKey,
  199. success: (res) => {
  200. console.log('[getStorage]', that.rankKey, res.data);
  201. const oldRank = res.data;
  202. if (oldRank != rank) {
  203. // that.notice = true;
  204. that.setRankValue(rank);
  205. }
  206. },
  207. fail: (e) => {
  208. console.log('[getStorage] fail', that.rankKey, e);
  209. // that.notice = false;
  210. that.setRankValue(rank);
  211. },
  212. })
  213. },
  214. setRankValue(data) {
  215. let that = this;
  216. uni.setStorage({
  217. key: that.rankKey,
  218. data: data,
  219. success: () => {
  220. console.log('[setStorage] success', that.rankKey, data);
  221. },
  222. fail: (e) => {
  223. console.log('[setStorage] fail', that.rankKey, e);
  224. },
  225. })
  226. },
  227. dealFirstEnter() {
  228. // console.log('[dealFirstEnter]');
  229. let that = this;
  230. uni.getStorage({
  231. key: that.firstEnterKey,
  232. success: (res) => {
  233. console.log('[getStorage]', that.firstEnterKey, res.data);
  234. },
  235. fail: (e) => {
  236. console.log('[getStorage] fail', that.firstEnterKey, e);
  237. that.btnInfo();
  238. that.setFirstEnterValue(true);
  239. },
  240. })
  241. },
  242. setFirstEnterValue(data) {
  243. let that = this;
  244. uni.setStorage({
  245. key: that.firstEnterKey,
  246. data: data,
  247. success: () => {
  248. console.log('[setStorage] success', that.firstEnterKey, data);
  249. },
  250. fail: (e) => {
  251. console.log('[setStorage] fail', that.firstEnterKey, e);
  252. },
  253. })
  254. },
  255. clear() {
  256. if (this.interval != null) {
  257. clearInterval(this.interval);
  258. this.interval = null;
  259. }
  260. },
  261. loadConfig(config) {
  262. // console.log("config", config);
  263. // 加载CSS样式
  264. const css = config.css;
  265. if (css != undefined && css.length > 0) {
  266. tools.loadCssCode(css);
  267. if (css.indexOf(".top{") >= 0) {
  268. this.cssTop = "top";
  269. }
  270. if (css.indexOf(".topbar-color{") >= 0) {
  271. this.cssTopbarColor = "topbar-color";
  272. }
  273. }
  274. if (this.cssTop == "") {
  275. this.cssTop = "top-default";
  276. }
  277. if (this.cssTopbarColor == "") {
  278. this.cssTopbarColor = "topbar-color-default";
  279. }
  280. console.log("[loadConfig] cssTop:", this.cssTop);
  281. console.log("[loadConfig] cssTopbarColor:", this.cssTopbarColor);
  282. const tabActiveColor = config.tabActiveColor;
  283. if (tabActiveColor != undefined && tabActiveColor.length > 0) {
  284. this.tabActiveColor = tabActiveColor;
  285. }
  286. // 加载规则弹窗配置
  287. const popupRuleConfig = config.popupRuleConfig;
  288. if (popupRuleConfig != undefined) {
  289. this.popupRuleConfig = popupRuleConfig;
  290. }
  291. // console.log("[loadConfig] popupRuleConfig:", this.popupRuleConfig);
  292. // 加载兑换地址弹窗配置
  293. const popupExchgConfig = config.popupExchgConfig;
  294. if (popupExchgConfig != undefined) {
  295. this.popupExchgConfig = popupExchgConfig;
  296. }
  297. // console.log("[loadConfig] popupExchgConfig:", this.popupExchgConfig);
  298. // 加载弹窗数据
  299. const popupDataList = config.popupDataList;
  300. // console.log("[loadConfig] popupDataList:", popupDataList);
  301. if (popupDataList != undefined && popupDataList.length > 0) {
  302. for (var i = 0; i < popupDataList.length; i++) {
  303. // console.log("[loadConfig] popupDataList", i, popupDataList[i]);
  304. if (popupDataList[i] == 'default') {
  305. for (var j = 0; j < defaultPopUpDataList.length; j++) {
  306. this.popupDataList.push(defaultPopUpDataList[j]);
  307. }
  308. } else {
  309. this.popupDataList.push(popupDataList[i]);
  310. }
  311. }
  312. } else {
  313. this.popupDataList = defaultPopUpDataList;
  314. console.log("[loadConfig] popupDataList 加载默认列表");
  315. }
  316. // console.log("[loadConfig] popupDataList:", this.popupDataList);
  317. // 加载弹窗(兑换地点)数据
  318. const popupExchgList = config.popupExchgList;
  319. if (popupExchgList != undefined && popupExchgList.length > 0) {
  320. for (var i = 0; i < popupExchgList.length; i++) {
  321. // console.log("[loadConfig] popupExchgList", i, popupExchgList[i]);
  322. this.popupExchgList.push(popupExchgList[i]);
  323. }
  324. }
  325. // console.log("[loadConfig] popupExchgList:", this.popupExchgList);
  326. // 加载页面参数
  327. const param = config.param;
  328. if (param != undefined) {
  329. if (param.labelRightAnswerNum != undefined && param.labelRightAnswerNum.length > 0) {
  330. this.configParam.labelRightAnswerNum = param.labelRightAnswerNum;
  331. }
  332. }
  333. // console.log("[loadConfig] param:", this.configParam);
  334. },
  335. // 获取倒计时
  336. getCountdown() {
  337. // console.log(this.endSecond)
  338. if (this.endSecond > 0) {
  339. const now = Date.now() / 1000;
  340. const dif = this.endSecond - now;
  341. // const dif = 3600*24 - 60;
  342. if (dif > 0) {
  343. this.countdown = '距结束 ' + tools.convertSecondsToDHM(dif);
  344. } else {
  345. this.countdown = "活动已结束";
  346. }
  347. // this.countdown = tools.convertSecondsToHMS(dif);
  348. } else {
  349. this.countdown = "距结束 --天--小时";
  350. }
  351. },
  352. // 格式化 距离
  353. fmtDistanct(val) {
  354. return Math.round(val * 100 / 1000) / 100;
  355. /* if (val < 10000)
  356. return Math.round(val * 10 / 1000) / 10;
  357. else
  358. return Math.round(val / 1000); */
  359. },
  360. fmtMcTime(timestamp) {
  361. return tools.fmtMcTime(timestamp);
  362. },
  363. // 获取活动时间
  364. getActtime() {
  365. this.acttime = tools.getActtime(this.beginSecond, this.endSecond);
  366. },
  367. getTeamName(teamType, teamIndex) {
  368. return teamName[teamType][teamIndex];
  369. },
  370. getCardConfigQuery() {
  371. uni.request({
  372. url: apiCardConfigQuery,
  373. header: {
  374. "Content-Type": "application/x-www-form-urlencoded",
  375. "token": this.token,
  376. },
  377. method: "POST",
  378. data: {
  379. ecId: this.ecId,
  380. pageName: this.pageName
  381. },
  382. success: (res) => {
  383. // console.log("getCardConfigQuery", res)
  384. const data = res.data.data;
  385. // console.log("configJson", data.configJson);
  386. const config = data.configJson != "" ? JSON.parse(data.configJson) : "";
  387. // console.log("configJson", data.configJson);
  388. /* const config = {
  389. "css": `
  390. .top{
  391. width: 100%;
  392. height: 170px;
  393. padding-top: 36px;
  394. justify-content: space-between;
  395. background-image: url('static/backgroud/top_bg_sddx.png');
  396. background-repeat: no-repeat;
  397. background-position-x: center;
  398. background-position-y: bottom;
  399. background-size: cover;
  400. }
  401. .logo{
  402. background-image: url('static/logo/sddx.png');
  403. }
  404. .tcbar{
  405. display: flex !important;
  406. }
  407. .topbar-color{
  408. color: #ffffff;
  409. }
  410. .btnBack{
  411. background-color: #a43a07 !important;
  412. }
  413. .tab-active{
  414. background-color: #a43a07 !important;
  415. }
  416. .swiper-item-button {
  417. background-color: #a43a07 !important;
  418. }
  419. .uni-swiper-dot-active {
  420. background: #a43a07 !important;
  421. }
  422. `,
  423. "tabActiveColor": "#a43a07",
  424. "popupRuleConfig": {
  425. "height": "500px"
  426. },
  427. "popupDataList": [
  428. {
  429. "type": 1,
  430. "data": {
  431. "title": "山大24级新生校园定向赛",
  432. "img": "/static/logo/sddx.png",
  433. "content": "  开学季来袭!山大24级新生校园定向赛燃情启幕!探索校园每一个角落,挑战智慧与体能,全校师生共同开启新学期活力篇章!等你来挑战!"
  434. }
  435. },
  436. {
  437. "type": 7,
  438. "data": {
  439. "topLogo": {
  440. "src": "/static/logo/sddx.png",
  441. "width": "80px",
  442. "height": "80px"
  443. },
  444. "bottomLogo": {
  445. "src": "/static/logo/inzone.png",
  446. "width": "150px",
  447. "height": "30px"
  448. },
  449. "title": "活动流程",
  450. "content": "<br>① 起点打点 → ② 依次打点 → ③ 接受挑战 <br><br>④ 终点打点 → ⑤ 查看成绩 → ⑥ 赢取奖励",
  451. "imageList": []
  452. }
  453. },
  454. {
  455. "type": 7,
  456. "data": {
  457. "topLogo": {
  458. "src": "/static/logo/sddx.png",
  459. "width": "80px",
  460. "height": "80px"
  461. },
  462. "bottomLogo": {
  463. "src": "/static/logo/inzone.png",
  464. "width": "150px",
  465. "height": "30px"
  466. },
  467. "title": "赛事规则",
  468. "content": "<p style='margin-bottom:12px;'>① 选择所在校区,参赛时间自由、路线随机</p> <p style='margin-bottom:12px;'>② 准确填报院系,共筑个人与院系荣耀</p> <p style='margin-bottom:12px;'>③ 打点1次1积分,途经点正确答题1积分,多次完赛,点数累加</p> <p style='margin-bottom:12px;'>④ 正常完赛累计积分,未完赛积分不计入</p>",
  469. "imageList": []
  470. }
  471. },
  472. {
  473. "type": 7,
  474. "data": {
  475. "topLogo": {
  476. "src": "/static/logo/sddx.png",
  477. "width": "80px",
  478. "height": "80px"
  479. },
  480. "bottomLogo": {
  481. "src": "/static/logo/inzone.png",
  482. "width": "150px",
  483. "height": "30px"
  484. },
  485. "title": "赛事奖励1",
  486. "content": "团队奖:<br>院系累计积分前8名; <text style='color:red;'>奖励</text>:团队奖杯 <br><br>个人奖:<br>各校区累计积分前10名;<text style='color:red;'>奖励</text>:荣誉证书完赛者均可获得参赛证书。<br> <text style='color:#A6A6A6;'>(赛事结束后体育委员会自APP颁发)</text>",
  487. "imageList": []
  488. }
  489. },
  490. {
  491. "type": 7,
  492. "data": {
  493. "topLogo": {
  494. "src": "/static/logo/sddx.png",
  495. "width": "80px",
  496. "height": "80px"
  497. },
  498. "bottomLogo": {
  499. "src": "/static/logo/inzone.png",
  500. "width": "150px",
  501. "height": "30px"
  502. },
  503. "title": "赛事奖励2",
  504. "content": "<p style='margin-bottom:12px;'>外部奖励:<br>各校区前10名获银座集团价值<text style='color:red;'>200元</text>进阶宠爱大礼。</p> <p style='margin-bottom:12px;'>完赛一次,可获银座价值<text style='color:red;'>50元</text>新生宠爱盲盒。<text style='color:#A6A6A6;'>(数量有限,发完为止)</text></p>每获25积分,可获银座<text style='color:red;'>100减10</text>优惠券1张。封顶5张,可与店内优惠叠加使用。<br><text style='color:#A6A6A6;'>(部分商品、特殊特例商品除外)</text>",
  505. "imageList": []
  506. }
  507. },
  508. {
  509. "type": 7,
  510. "data": {
  511. "title": "安全提示",
  512. "content": "<br><text style='color:#FFBA99; font-size: 20px; margin-right: 5px;'>●</text> 避免聚集,注意安全<br><br> <text style='color:#FFBA99; font-size: 20px; margin-right: 5px;'>●</text> 评估自身健康,适时参与<br><br> <text style='color:#FFBA99; font-size: 20px; margin-right: 5px;'>●</text> 注意交通与场地安全",
  513. "imageList": [{
  514. "src": "/static/backgroud/shanda.png",
  515. "width": "300px",
  516. "height": "150px"
  517. }]
  518. }
  519. },
  520. {
  521. "type": 2,
  522. "data": {
  523. "title": "基本图例",
  524. "img": "/static/common/jbtl.png"
  525. }
  526. },
  527. {
  528. "type": 2,
  529. "data": {
  530. "title": "基本标识",
  531. "img": "/static/common/jbbs2.png"
  532. }
  533. },
  534. {
  535. "type": 7,
  536. "data": {
  537. "topLogo": {
  538. "src": "/static/logo/sddx.png",
  539. "width": "80px",
  540. "height": "80px"
  541. },
  542. "bottomLogo": {
  543. "src": "/static/logo/inzone.png",
  544. "width": "150px",
  545. "height": "30px"
  546. },
  547. "title": "山大定向赛咨询群",
  548. "content": "",
  549. "imageList": [{
  550. "src": "/static/common/qrcode_sddxszxq.png",
  551. "width": "116px",
  552. "height": "116px"
  553. }],
  554. "memo": "<view style='display:block; text-align:center;'>赛事规程、流程、奖励咨询 <br><view style='color:#808080; font-size:12px'>(7*24小时解答)</view></view>"
  555. }
  556. },
  557. {
  558. "type": 8,
  559. "data": {
  560. "title": "兑换地点",
  561. "topImg": {
  562. "src": "/static/logo/inzone2.png",
  563. "width": "72px",
  564. "height": "72px"
  565. },
  566. "topMemo": "<view style='color:#E60012;font-size:14px;'>品质消费引领者 &nbsp; &nbsp; 美好生活推荐官</view>",
  567. "bottomMemo": "<view style='display: flex; align-items: center; justify-content: center; margin-top: 20px; color: #E67300; font-weight: 500; font-size: 15px; text-decoration-line: underline;'><image src='static/common/bulb.png' style='width: 22px; height: 26px; margin-right: 6px;'></image>点击查看《优惠券使用说明》</view>",
  568. "bottomMemoUrl": "https://oss-mbh5.colormaprun.com/page/explanation/inzone.html",
  569. "pointList": [
  570. {
  571. "map": "中 心 校 区",
  572. "name": "银座燕山店",
  573. "longitude": 117.075174,
  574. "latitude": 36.654108
  575. },
  576. {
  577. "map": "洪家楼校区",
  578. "name": "银座洪楼店",
  579. "longitude": 117.062653,
  580. "latitude": 36.684249
  581. },
  582. {
  583. "map": "兴隆山校区",
  584. "name": "银座七里山店",
  585. "longitude": 117.004617,
  586. "latitude": 36.613655
  587. },
  588. {
  589. "map": "趵突泉校区",
  590. "name": "银座泉城广场店",
  591. "longitude": 117.023766,
  592. "latitude": 36.661532
  593. },
  594. {
  595. "map": "千佛山校区",
  596. "name": "银座玉函店",
  597. "longitude": 117.014735,
  598. "latitude": 36.647098
  599. },
  600. {
  601. "map": "软件园校区",
  602. "name": "银座高新店",
  603. "longitude": 117.122241,
  604. "latitude": 36.682175
  605. }
  606. ]
  607. }
  608. }
  609. ],
  610. "popupExchgConfig": {
  611. "height": "500px"
  612. },
  613. "popupExchgList": [
  614. {
  615. "type": 8,
  616. "data": {
  617. "title": "兑换地点",
  618. "topImg": {
  619. "src": "/static/logo/inzone2.png",
  620. "width": "72px",
  621. "height": "72px"
  622. },
  623. "topMemo": "<view style='color:#E60012;font-size:14px;'>品质消费引领者 &nbsp; &nbsp; 美好生活推荐官</view>",
  624. "bottomMemo": "<view style='display: flex; align-items: center; justify-content: center; margin-top: 20px; color: #E67300; font-weight: 500; font-size: 15px; text-decoration-line: underline;'><image src='static/common/bulb.png' style='width: 22px; height: 26px; margin-right: 6px;'></image>点击查看《优惠券使用说明》</view>",
  625. "bottomMemoUrl": "https://oss-mbh5.colormaprun.com/page/explanation/inzone.html",
  626. "pointList": [
  627. {
  628. "map": "中 心 校 区",
  629. "name": "银座燕山店",
  630. "longitude": 117.075174,
  631. "latitude": 36.654108
  632. },
  633. {
  634. "map": "洪家楼校区",
  635. "name": "银座洪楼店",
  636. "longitude": 117.062653,
  637. "latitude": 36.684249
  638. },
  639. {
  640. "map": "兴隆山校区",
  641. "name": "银座七里山店",
  642. "longitude": 117.004617,
  643. "latitude": 36.613655
  644. },
  645. {
  646. "map": "趵突泉校区",
  647. "name": "银座泉城广场店",
  648. "longitude": 117.023766,
  649. "latitude": 36.661532
  650. },
  651. {
  652. "map": "千佛山校区",
  653. "name": "银座玉函店",
  654. "longitude": 117.014735,
  655. "latitude": 36.647098
  656. },
  657. {
  658. "map": "软件园校区",
  659. "name": "银座高新店",
  660. "longitude": 117.122241,
  661. "latitude": 36.682175
  662. }
  663. ]
  664. }
  665. },
  666. ],
  667. "param": {
  668. "labelRightAnswerNum": "文化输出"
  669. }
  670. }; */
  671. this.loadConfig(config);
  672. this.getUnReadMessageQuery();
  673. this.matchRsDetailQuery();
  674. setTimeout(this.dealFirstEnter, 500);
  675. },
  676. fail: (err) => {
  677. console.log("getCardConfigQuery err", err)
  678. },
  679. });
  680. },
  681. // 卡片对应活动或赛事详情查询
  682. // getCardDetailQuery() {
  683. // uni.request({
  684. // url: apiCardDetailQuery,
  685. // header: {
  686. // "Content-Type": "application/x-www-form-urlencoded",
  687. // "token": this.token,
  688. // },
  689. // method: "POST",
  690. // data: {
  691. // ecId: this.ecId
  692. // },
  693. // success: (res) => {
  694. // // console.log("getCardDetailQuery", res)
  695. // const data = res.data.data;
  696. // this.mcType = data.mcType;
  697. // this.mcId = data.mcId;
  698. // this.mcName = data.mcName;
  699. // this.beginSecond = data.beginSecond;
  700. // this.endSecond = data.endSecond;
  701. // this.coiName = data.coiName;
  702. // this.teamNum = data.teamNum;
  703. // this.mcState = tools.checkMcState(this.beginSecond, this.endSecond);
  704. // this.getCountdown();
  705. // this.getActtime();
  706. // this.getCardRankDetailQuery();
  707. // this.clear();
  708. // this.interval = setInterval(this.getCountdown, 60000);
  709. // },
  710. // fail: (err) => {
  711. // console.log("getCardDetailQuery err", err)
  712. // },
  713. // });
  714. // },
  715. // 卡片对应线上赛多个活动查询
  716. matchRsDetailQuery() {
  717. uni.request({
  718. url: apiMatchRsDetailQuery,
  719. header: {
  720. "Content-Type": "application/x-www-form-urlencoded",
  721. "token": this.token,
  722. },
  723. method: "POST",
  724. data: {
  725. ecId: this.ecId
  726. },
  727. success: (res) => {
  728. // console.log("matchRsDetailQuery", res);
  729. if (checkResCode(res)) {
  730. const data = res.data.data;
  731. this.mcType = data.mcType;
  732. this.mcId = data.mcId;
  733. this.mcName = data.mcName;
  734. this.beginSecond = data.beginSecond;
  735. this.endSecond = data.endSecond;
  736. this.nickName = data.nickName;
  737. // this.totalNum = data.totalNum;
  738. // this.totalDistanct = data.totalDistanct;
  739. // this.totalDistanctRankNum = data.totalDistanctRankNum;
  740. // this.totalCp = data.totalCp;
  741. // this.totalCpRankNum = data.totalCpRankNum;
  742. // this.totalSysPoint = data.totalSysPoint;
  743. // this.totalSysPointRankNum = data.totalSysPointRankNum;
  744. // this.fastPace = data.fastPace;
  745. // this.fastPaceRankNum = data.fastPaceRankNum;
  746. // this.ocaRs = data.ocaRs;
  747. this.mcState = tools.checkMcState(this.beginSecond, this.endSecond);
  748. this.getCountdown();
  749. this.getActtime();
  750. this.mapListQuery();
  751. this.compStatisticQuery();
  752. // this.getCardRankDetailQuery();
  753. this.clear();
  754. this.interval = setInterval(this.getCountdown, 60000);
  755. }
  756. },
  757. fail: (err) => {
  758. console.log("matchRsDetailQuery err", err)
  759. },
  760. });
  761. },
  762. // 卡片对应地图列表详情查询
  763. mapListQuery() {
  764. uni.request({
  765. url: apiMapListQuery,
  766. header: {
  767. "Content-Type": "application/x-www-form-urlencoded",
  768. "token": this.token,
  769. },
  770. method: "POST",
  771. data: {
  772. mcId: this.mcId
  773. },
  774. success: (res) => {
  775. // console.log("mapListQuery", res);
  776. if (res.data.code == 0) {
  777. const data = res.data.data;
  778. this.mapList = data;
  779. let mapItems = {
  780. // selectValue: this.selectedMapId,
  781. selectValue: this.ocaId,
  782. data: []
  783. };
  784. for (var i = 0; i < data.length; i++) {
  785. if (mapItems.selectValue == 0 && i == 0) {
  786. mapItems.selectValue = data[i].ocaId;
  787. // this.selectedMapId = data[i].ocaId;
  788. this.ocaId = data[i].ocaId;
  789. }
  790. let map = {};
  791. map.text = "个人(" + data[i].mapName + ")";
  792. map.value = data[i].ocaId;
  793. mapItems.data.push(map);
  794. }
  795. this.tab1Items.push(mapItems);
  796. this.getCardRankDetailQuery();
  797. }
  798. },
  799. fail: (err) => {
  800. console.log("mapListQuery err", err);
  801. },
  802. });
  803. },
  804. // 赛事总成绩统计查询
  805. compStatisticQuery() {
  806. uni.request({
  807. url: apiCompStatisticQuery,
  808. header: {
  809. "Content-Type": "application/x-www-form-urlencoded",
  810. "token": this.token,
  811. },
  812. method: "POST",
  813. data: {
  814. mcId: this.mcId
  815. },
  816. success: (res) => {
  817. // console.log("compStatisticQuery", res);
  818. if (res.data.code == 0) {
  819. const data = res.data.data;
  820. this.all_totalDistance = data.totalDistance;
  821. this.all_totalRightAnswerNum = data.totalRightAnswerNum;
  822. this.all_totalAnswerNum = data.totalAnswerNum;
  823. this.all_totalCp = data.totalCp;
  824. this.all_totalSysPoint = data.totalSysPoint;
  825. }
  826. },
  827. fail: (err) => {
  828. console.log("compStatisticQuery err", err);
  829. },
  830. });
  831. },
  832. // 排名查询
  833. getCardRankDetailQuery() {
  834. uni.request({
  835. url: apiCardRankDetailQuery,
  836. header: {
  837. "Content-Type": "application/x-www-form-urlencoded",
  838. "token": this.token,
  839. },
  840. method: "POST",
  841. data: {
  842. mcIdListStr: this.mcId,
  843. mcType: this.mcType,
  844. ocaId: this.ocaId,
  845. dispArrStr: this.dispArrStr
  846. },
  847. success: (res) => {
  848. // console.log("getCardRankDetailQuery", res);
  849. const rankdata = res.data.data;
  850. // this.rankList.totalDistanceRs = rankdata.totalDistanceRs;
  851. // this.rankList.totalCpRs = rankdata.totalCpRs;
  852. // this.rankList.totalSysPointRs = rankdata.totalSysPointRs;
  853. // this.rankList.fastPaceRs = rankdata.fastPaceRs;
  854. this.rankList = rankdata;
  855. },
  856. fail: (err) => {
  857. console.log("getCardRankDetailQuery err", err)
  858. },
  859. });
  860. },
  861. // 卡片用户当前排名查询
  862. // getUserCurrentRankNumQuery() {
  863. // uni.request({
  864. // url: apiUserCurrentRankNumQuery,
  865. // header: {
  866. // "Content-Type": "application/x-www-form-urlencoded",
  867. // "token": this.token,
  868. // },
  869. // method: "POST",
  870. // data: {
  871. // ecId: this.ecId
  872. // },
  873. // success: (res) => {
  874. // // console.log("getUserCurrentRankNumQuery", res)
  875. // if (res.data.code == 0) {
  876. // const data = res.data.data;
  877. // const rankNum = data.rankNum;
  878. // this.dealNotice(rankNum);
  879. // }
  880. // },
  881. // fail: (err) => {
  882. // console.log("getUserCurrentRankNumQuery err", err)
  883. // },
  884. // });
  885. // },
  886. // 是否允许重新分组(报名)
  887. isAllowMcSignUp() {
  888. uni.request({
  889. url: apiIsAllowMcSignUp,
  890. header: {
  891. "Content-Type": "application/x-www-form-urlencoded",
  892. "token": this.token,
  893. },
  894. method: "POST",
  895. data: {
  896. ecId: this.ecId
  897. },
  898. success: (res) => {
  899. // console.log("isAllowMcSignUp", res)
  900. if (res.data.code == 0) {
  901. const data = res.data.data;
  902. this.allowMcSignUp = data.allowSignUp;
  903. }
  904. },
  905. fail: (err) => {
  906. console.log("isAllowMcSignUp err", err)
  907. },
  908. });
  909. },
  910. // 未读消息列表查询
  911. getUnReadMessageQuery() {
  912. uni.request({
  913. url: apiUnReadMessageQuery,
  914. header: {
  915. "Content-Type": "application/x-www-form-urlencoded",
  916. "token": this.token,
  917. },
  918. method: "POST",
  919. data: {
  920. relationType: 2, // 类型 1 成就 2 卡片
  921. relationId: this.ecId
  922. },
  923. success: (res) => {
  924. // console.log("getUnReadMessageQuery", res);
  925. if (checkResCode(res)) {
  926. const unReadMessageRs = res.data.data;
  927. this.popupMessageList.length = 0;
  928. this.mqIdListStr = "";
  929. for (var i = 0; i < unReadMessageRs.length; i++) {
  930. let popupData = {
  931. type: 6, // 6: 通知
  932. data: {}
  933. };
  934. this.messageKey += "-" + unReadMessageRs[i].mqId;
  935. popupData.data.mqType = unReadMessageRs[i].mqType;
  936. popupData.data.title = unReadMessageRs[i].mqTitle;
  937. popupData.data.message = unReadMessageRs[i].mqMessage;
  938. this.popupMessageList.push(popupData);
  939. // this.mqIdListStr += this.unReadMessageRs[i].mqId;
  940. // if (i < this.unReadMessageRs.length - 1) {
  941. // this.mqIdListStr += ",";
  942. // }
  943. }
  944. if (this.popupMessageList.length > 0) {
  945. const messageValue = uni.getStorageSync(this.messageKey);
  946. console.log("messageValue:", messageValue);
  947. if (!messageValue) {
  948. this.$refs.mypopupMessage.popupOpen();
  949. uni.setStorageSync(this.messageKey, true);
  950. }
  951. }
  952. }
  953. },
  954. fail: (err) => {
  955. console.log("getUnReadMessageQuery err", err);
  956. },
  957. });
  958. },
  959. // 标记消息已读
  960. readMessage() {
  961. uni.request({
  962. url: apiReadMessage,
  963. header: {
  964. "Content-Type": "application/x-www-form-urlencoded",
  965. "token": this.token,
  966. },
  967. method: "POST",
  968. data: {
  969. "mqIdListStr": this.mqIdListStr
  970. },
  971. success: (res) => {
  972. // console.log("readMessage", res);
  973. },
  974. fail: (err) => {
  975. console.log("readMessage err", err);
  976. },
  977. });
  978. },
  979. btnBack() {
  980. // window.history.back();
  981. /* uni.navigateTo({
  982. url: "/pages/bm/style4/rankOverview?" + this.queryString
  983. }); */
  984. const url = `action://to_home/`;
  985. tools.appAction(url);
  986. },
  987. btnStartGame() {
  988. // uni.navigateTo({
  989. // url: "/pages/bm/style4/rankOverview?" + this.queryString
  990. // });
  991. const url = "/pages/bm/style4/rankOverview?" + this.queryString;
  992. tools.appAction(url, "uni.navigateTo");
  993. },
  994. btnInfo() {
  995. // console.log(this.$refs.mypopup);
  996. this.$refs.mypopup.popupOpen();
  997. },
  998. btnMessage() {
  999. // console.log(this.$refs.mypopup);
  1000. this.$refs.mypopupMessage.popupOpen();
  1001. },
  1002. btnMyEgg() {
  1003. // uni.navigateTo({
  1004. // url: "/pages/achievement/index2?tabCurrent=2&" + this.queryString
  1005. // });
  1006. const url = "/pages/achievement/index2?tabCurrent=2&" + this.queryString;
  1007. tools.appAction(url, "uni.navigateTo");
  1008. },
  1009. btnExchg() {
  1010. this.$refs.mypopupExchg.popupOpen();
  1011. },
  1012. onTab1Click(val) {
  1013. // console.log("onTab1Click: ", val);
  1014. this.tab1Current = val;
  1015. },
  1016. onTab2Click(val) {
  1017. // console.log("onTab2Click: ", val);
  1018. this.tab2Current = val;
  1019. },
  1020. onSelectChange(val) {
  1021. // console.log("onSelectChange: ", val);
  1022. this.ocaId = val.value;
  1023. this.getCardRankDetailQuery();
  1024. uni.setStorageSync(this.mapKey, this.ocaId);
  1025. },
  1026. }
  1027. }
  1028. </script>
  1029. <style scoped>
  1030. .content {
  1031. width: 100vw;
  1032. height: 100vh;
  1033. }
  1034. .top-default {
  1035. width: 100%;
  1036. height: 170px;
  1037. padding-top: 36px;
  1038. justify-content: space-between;
  1039. background-image: url('static/backgroud/top_bg_sddx.png');
  1040. background-repeat: no-repeat;
  1041. background-position: center;
  1042. background-size: cover;
  1043. }
  1044. .topcontent {
  1045. width: 90%;
  1046. /* height: 90%; */
  1047. /* margin-bottom: 20px; */
  1048. }
  1049. .logo {
  1050. width: 80px;
  1051. height: 80px;
  1052. margin-top: 10px;
  1053. margin-bottom: 10px;
  1054. /* background-image: url('/static/logo/sddx.png'); */
  1055. background-repeat: no-repeat;
  1056. background-position-x: center;
  1057. background-position-y: center;
  1058. background-size: contain;
  1059. }
  1060. .tcview {
  1061. width: 90%;
  1062. /* height: 100px; */
  1063. }
  1064. .tcbox {
  1065. width: 121px;
  1066. height: 63px;
  1067. opacity: 1;
  1068. border-radius: 6px;
  1069. background: #9A300E;
  1070. border: 1px solid #D3A254;
  1071. }
  1072. .tcbox-label {
  1073. font-size: 12px;
  1074. font-weight: 500;
  1075. line-height: 23px;
  1076. color: #f3d809;
  1077. }
  1078. .tcbox-value {
  1079. font-size: 16px;
  1080. font-weight: 500;
  1081. line-height: 26px;
  1082. color: #f3d809;
  1083. }
  1084. .tcbar {
  1085. display: none;
  1086. width: 92%;
  1087. padding: 6px 12px;
  1088. background: #9a300e;
  1089. border-radius: 6px;
  1090. }
  1091. .tcbar-text {
  1092. font-family: Source Han Sans CN;
  1093. font-weight: 500;
  1094. color: #f3d809;
  1095. font-size: 13px;
  1096. }
  1097. .mcName {
  1098. font-size: 40rpx;
  1099. font-weight: 550;
  1100. }
  1101. .topbtm {
  1102. width: 100%;
  1103. margin-bottom: 5px;
  1104. justify-content: space-around;
  1105. }
  1106. .topbtm-name {
  1107. padding: 3px 12px;
  1108. background-color: #9A300E;
  1109. border: 1px solid #D3A254;
  1110. border-radius: 6px;
  1111. text-align: center;
  1112. font-weight: 500;
  1113. color: #ffffff;
  1114. font-size: 14px;
  1115. }
  1116. .topbtm-egg {
  1117. width: 60px;
  1118. padding: 3px 12px;
  1119. background-color: #9A300E;
  1120. border: 1px solid #D3A254;
  1121. border-radius: 6px;
  1122. text-align: center;
  1123. color: #ffffff;
  1124. font-size: 14px;
  1125. }
  1126. .topbtm-null {
  1127. width: 60px;
  1128. padding: 3px 12px;
  1129. }
  1130. .cal {
  1131. width: 46rpx;
  1132. height: 46rpx;
  1133. margin-right: 20rpx;
  1134. }
  1135. .main {
  1136. width: 100%;
  1137. /* height: 70vh; */
  1138. flex-grow: 1;
  1139. justify-content: space-around;
  1140. /* justify-content: space-between; */
  1141. }
  1142. /* /deep/ .tab-active {
  1143. background-color: #a43a07 !important;
  1144. } */
  1145. .main-tab {
  1146. width: 90%;
  1147. margin-top: 20rpx;
  1148. }
  1149. .tab-view {
  1150. width: 100%;
  1151. /* height: 69vh; */
  1152. flex-grow: 1;
  1153. }
  1154. .btnBack {
  1155. width: 70%;
  1156. height: 80rpx;
  1157. margin-bottom: 20rpx;
  1158. /* font-weight: bold; */
  1159. color: white;
  1160. font-size: 32rpx;
  1161. line-height: 80rpx;
  1162. border-radius: 27px;
  1163. background-color: #2e85ec;
  1164. }
  1165. /* .swiper-item-button {
  1166. background-color: #ff870e !important;
  1167. }
  1168. .uni-swiper-dot-active {
  1169. background: #ff870e !important;
  1170. } */
  1171. </style>